{"version":3,"sources":["jsdelivr-header.js","/npm/rekordbox-parser@0.1.2/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,IAAI,gBAAmB,MAAQ,KAAK,iBAAoB,SAAU,GAC9D,OAAQ,GAAO,EAAI,WAAc,EAAM,CAAE,QAAW,EACxD,EACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,UAAY,QAAQ,aAAe,QAAQ,cAAgB,QAAQ,SAAW,QAAQ,eAAY,EAC1G,MAAM,gBAAkB,QAAQ,iBAM1B,mBAAqB,gBAAgB,QAAQ,uBACnD,QAAQ,cAAgB,mBAAmB,QAE3C,MAAM,kBAAoB,gBAAgB,QAAQ,sBAKlD,SAAS,SAAS,GACd,OAAO,IAAI,kBAAkB,QAAQ,IAAI,gBAAgB,aAAa,GAC1E,CAKA,SAAS,UAAU,GACf,OAAO,IAAI,mBAAmB,QAAQ,IAAI,gBAAgB,aAAa,GAC3E,CAMA,SAAU,UAAU,GAChB,MAAM,UAAE,EAAS,SAAE,GAAa,EAChC,IAAI,EAAU,EACd,EAAG,CACC,MAAM,EAAO,EAAQ,KAKrB,GAFA,EAAU,EAAK,UAEV,EAAK,WACN,SAEJ,MAAM,EAAO,EAAK,UACb,KAAK,GAAU,EAAM,OACrB,OACA,QAAQ,GAAQ,EAAI,UACzB,IAAK,MAAM,KAAO,QACR,EAAI,IAElB,OAAS,EAAQ,OAAS,EAAS,MACvC,CAvCA,QAAQ,aAAe,kBAAkB,QAOzC,QAAQ,SAAW,SAOnB,QAAQ,UAAY,UA0BpB,QAAQ,UAAY","file":"/npm/rekordbox-parser@0.1.2/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/rekordbox-parser@0.1.2/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tableRows = exports.RekordboxPdb = exports.RekordboxAnlz = exports.parsePdb = exports.parseAnlz = void 0;\nconst kaitai_struct_1 = require(\"kaitai-struct\");\n// eslint-ingore @typescript-eslint/ban-ts-comment\n// NOTE: These files are built using `yarn build-parsers`. The update script\n// will fetch the kaitai ksy files from crate-digger\n//\n// @ts-expect-error\nconst RekordboxAnlz_js_1 = __importDefault(require(\"./RekordboxAnlz.js\"));\nexports.RekordboxAnlz = RekordboxAnlz_js_1.default;\n// @ts-expect-error\nconst RekordboxPdb_js_1 = __importDefault(require(\"./RekordboxPdb.js\"));\nexports.RekordboxPdb = RekordboxPdb_js_1.default;\n/**\n * Parse a Rekordbox PDB database file\n */\nfunction parsePdb(data) {\n    return new RekordboxPdb_js_1.default(new kaitai_struct_1.KaitaiStream(data));\n}\nexports.parsePdb = parsePdb;\n/**\n * Parse a Rekordbox PDB database file\n */\nfunction parseAnlz(data) {\n    return new RekordboxAnlz_js_1.default(new kaitai_struct_1.KaitaiStream(data));\n}\nexports.parseAnlz = parseAnlz;\n/**\n * Utility generator that pages through a table and yields every present row.\n * This flattens the concept of rowGroups and refs.\n */\nfunction* tableRows(table) {\n    const { firstPage, lastPage } = table;\n    let pageRef = firstPage;\n    do {\n        const page = pageRef.body;\n        // Adjust our page ref for the next iteration. We do this early in our loop\n        // so we can break without having to remember to update for the next iter.\n        pageRef = page.nextPage;\n        // Ignore non-data pages. Not sure what these are for?\n        if (!page.isDataPage) {\n            continue;\n        }\n        const rows = page.rowGroups\n            .map((group) => group.rows)\n            .flat()\n            .filter((row) => row.present);\n        for (const row of rows) {\n            yield row.body;\n        }\n    } while (pageRef.index <= lastPage.index);\n}\nexports.tableRows = tableRows;\n"]}