// Copies the npm-managed JavaScript libraries into include/js/ so the tree // ships with prebuilt assets. Run `npm ci && npm run build:js` after any change // to the pinned versions in package.json. Local compatibility and security // fixes are applied to generated assets below, leaving npm sources unchanged. // screenfull ships ESM-only since v6, so its copy is rewritten below. // tablesorter is also rewritten below to drop jQuery-4-incompatible utility // calls ($.isFunction, $.trim, $.isArray, ...) that its latest release still ships. import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; import { dirname, resolve } from 'node:path'; import { pathToFileURL } from 'node:url'; export const assetMap = Object.freeze({ 'node_modules/jquery/dist/jquery.js': 'include/js/jquery.js', 'node_modules/htmx.org/dist/htmx.js': 'include/js/htmx.js', 'node_modules/d3/dist/d3.js': 'include/js/d3.js', 'node_modules/big.js/big.js': 'include/js/big.js', 'node_modules/lzjs/lzjs.js': 'include/js/lzjs.js', 'node_modules/screenfull/index.js': 'include/js/screenfull.js', 'node_modules/dompurify/dist/purify.js': 'include/js/purify.js', 'node_modules/dompurify/dist/purify.js.map': 'include/js/purify.js.map', 'node_modules/jquery-ui/dist/jquery-ui.js': 'include/js/jquery-ui.js', 'node_modules/jquery-ui-touch-punch/jquery.ui.touch-punch.js': 'include/js/jquery.ui.touch.punch.js', 'node_modules/chart.js/dist/chart.umd.js': 'include/js/Chart.js', 'node_modules/moment/min/moment.min.js': 'include/js/vendor/moment/moment.min.js', 'node_modules/moment/LICENSE': 'include/js/vendor/moment/LICENSE', 'node_modules/daterangepicker/daterangepicker.js': 'include/js/vendor/daterangepicker/daterangepicker.js', 'node_modules/hotkeys-js/dist/hotkeys-js.umd.cjs': 'include/js/vendor/hotkeys/hotkeys.js', 'node_modules/hotkeys-js/dist/hotkeys-js.min.js': 'include/js/vendor/hotkeys/hotkeys.min.js', 'node_modules/hotkeys-js/LICENSE': 'include/js/vendor/hotkeys/LICENSE', 'node_modules/mark.js/dist/jquery.mark.js': 'include/js/vendor/mark/jquery.mark.js', 'node_modules/jstree/dist/jstree.js': 'include/js/jstree.js', 'node_modules/billboard.js/dist/billboard.js': 'include/js/billboard.js', 'node_modules/pace-js/pace.js': 'include/js/pace.js', 'node_modules/select2/dist/js/select2.full.js': 'include/js/select2.js', 'node_modules/tablesorter/dist/js/jquery.tablesorter.js': 'include/js/jquery.tablesorter.js', 'node_modules/tablesorter/dist/js/jquery.tablesorter.widgets.js': 'include/js/jquery.tablesorter.widgets.js', 'node_modules/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js': 'include/js/jquery.tablesorter.pager.js', 'node_modules/jquery-validation/dist/jquery.validate.js': 'include/js/jquery.validate/jquery.validate.js', 'node_modules/jquery-validation/dist/jquery.validate.min.js': 'include/js/jquery.validate/jquery.validate.min.js', 'node_modules/jquery-validation/dist/additional-methods.js': 'include/js/jquery.validate/additional-methods.js', 'node_modules/jquery-validation/dist/additional-methods.min.js': 'include/js/jquery.validate/additional-methods.min.js', }); // screenfull 6+ dropped its UMD build and ships only `export default screenfull;`, // which throws "export declarations may only appear at top level of a module" // when loaded as a classic