@heycys/gallery 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/THIRD-PARTY-NOTICES.md +3253 -0
- package/assets/writing-preferences.md +107 -0
- package/bin/gallery.mjs +10 -0
- package/browser/editor/components/bookmark/icons.mjs +6 -0
- package/browser/editor/components/bookmark/index.mjs +80 -0
- package/browser/editor/components/bookmark/page.mjs +147 -0
- package/browser/editor/components/builders.mjs +19 -0
- package/browser/editor/components/callout/index.mjs +39 -0
- package/browser/editor/components/callout/page.mjs +13 -0
- package/browser/editor/components/code/index.mjs +327 -0
- package/browser/editor/components/code/page.mjs +561 -0
- package/browser/editor/components/colors.mjs +50 -0
- package/browser/editor/components/columns/index.mjs +104 -0
- package/browser/editor/components/columns/page.mjs +297 -0
- package/browser/editor/components/details/index.mjs +72 -0
- package/browser/editor/components/details/page.mjs +86 -0
- package/browser/editor/components/dialog/index.mjs +83 -0
- package/browser/editor/components/dialog/page.mjs +219 -0
- package/browser/editor/components/divider/index.mjs +48 -0
- package/browser/editor/components/embed/icons.mjs +11 -0
- package/browser/editor/components/embed/index.mjs +123 -0
- package/browser/editor/components/embed/page.mjs +309 -0
- package/browser/editor/components/figure/index.mjs +87 -0
- package/browser/editor/components/figure/page.mjs +33 -0
- package/browser/editor/components/file/icons.mjs +14 -0
- package/browser/editor/components/file/index.mjs +77 -0
- package/browser/editor/components/file/page.mjs +114 -0
- package/browser/editor/components/flowchart/add.mjs +123 -0
- package/browser/editor/components/flowchart/index.mjs +246 -0
- package/browser/editor/components/flowchart/page.mjs +453 -0
- package/browser/editor/components/heading/index.mjs +51 -0
- package/browser/editor/components/highlight/index.mjs +79 -0
- package/browser/editor/components/icon/index.mjs +57 -0
- package/browser/editor/components/icon/page.mjs +286 -0
- package/browser/editor/components/icons.mjs +45 -0
- package/browser/editor/components/image/crop.mjs +189 -0
- package/browser/editor/components/image/index.mjs +104 -0
- package/browser/editor/components/image/page.mjs +385 -0
- package/browser/editor/components/image/viewer.mjs +213 -0
- package/browser/editor/components/installed/index.mjs +133 -0
- package/browser/editor/components/installed/page.mjs +422 -0
- package/browser/editor/components/installed/served.mjs +35 -0
- package/browser/editor/components/kit.mjs +64 -0
- package/browser/editor/components/list/index.mjs +194 -0
- package/browser/editor/components/list/join.mjs +68 -0
- package/browser/editor/components/list/numbers.mjs +107 -0
- package/browser/editor/components/list/page.mjs +632 -0
- package/browser/editor/components/math/index.mjs +88 -0
- package/browser/editor/components/math/page.mjs +236 -0
- package/browser/editor/components/math/tex-logo.mjs +6 -0
- package/browser/editor/components/media/icons.mjs +19 -0
- package/browser/editor/components/media/page.mjs +162 -0
- package/browser/editor/components/media/parts.mjs +60 -0
- package/browser/editor/components/media/size.mjs +20 -0
- package/browser/editor/components/media/toolbar.mjs +37 -0
- package/browser/editor/components/media/write.mjs +7 -0
- package/browser/editor/components/pages.mjs +46 -0
- package/browser/editor/components/paragraph/index.mjs +43 -0
- package/browser/editor/components/paragraph/page.mjs +52 -0
- package/browser/editor/components/placeholder-bar.mjs +17 -0
- package/browser/editor/components/placeholder.mjs +128 -0
- package/browser/editor/components/quote/index.mjs +33 -0
- package/browser/editor/components/registry.mjs +833 -0
- package/browser/editor/components/rows.mjs +16 -0
- package/browser/editor/components/section/index.mjs +41 -0
- package/browser/editor/components/section/page.mjs +141 -0
- package/browser/editor/components/sheets/index.mjs +137 -0
- package/browser/editor/components/sheets/page.mjs +227 -0
- package/browser/editor/components/sheets/pills.mjs +226 -0
- package/browser/editor/components/table/grid.mjs +73 -0
- package/browser/editor/components/table/index.mjs +306 -0
- package/browser/editor/components/table/page.mjs +672 -0
- package/browser/editor/components/table/slots.mjs +41 -0
- package/browser/editor/components/widget/index.mjs +50 -0
- package/browser/editor/page/annotate/anchors.mjs +229 -0
- package/browser/editor/page/annotate/card.mjs +102 -0
- package/browser/editor/page/annotate/index.mjs +1629 -0
- package/browser/editor/page/at-menu/index.mjs +317 -0
- package/browser/editor/page/autosave.mjs +977 -0
- package/browser/editor/page/beside.mjs +21 -0
- package/browser/editor/page/block-info.mjs +63 -0
- package/browser/editor/page/block-menu/colors.mjs +82 -0
- package/browser/editor/page/block-menu/index.mjs +215 -0
- package/browser/editor/page/blocks.mjs +246 -0
- package/browser/editor/page/caret.mjs +679 -0
- package/browser/editor/page/chip-fills.mjs +126 -0
- package/browser/editor/page/clipboard/import/colors.mjs +192 -0
- package/browser/editor/page/clipboard/import/html.mjs +792 -0
- package/browser/editor/page/clipboard/import/inline.mjs +232 -0
- package/browser/editor/page/clipboard/import/languages.mjs +42 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
- package/browser/editor/page/clipboard/import/math.mjs +100 -0
- package/browser/editor/page/clipboard/import/office.mjs +245 -0
- package/browser/editor/page/clipboard/import/read.mjs +120 -0
- package/browser/editor/page/clipboard/import/rich.mjs +29 -0
- package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
- package/browser/editor/page/clipboard/index.mjs +797 -0
- package/browser/editor/page/clipboard/own/blocks.mjs +202 -0
- package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
- package/browser/editor/page/clipboard/own/describe.mjs +115 -0
- package/browser/editor/page/clipboard/own/export.mjs +167 -0
- package/browser/editor/page/clipboard/own/ids.mjs +39 -0
- package/browser/editor/page/clipboard/own/index.mjs +13 -0
- package/browser/editor/page/clipboard/own/rules.mjs +44 -0
- package/browser/editor/page/clipboard/own/selection.mjs +159 -0
- package/browser/editor/page/clipboard/own/writers.mjs +326 -0
- package/browser/editor/page/columns/index.mjs +360 -0
- package/browser/editor/page/commit.mjs +1798 -0
- package/browser/editor/page/conflicts.mjs +269 -0
- package/browser/editor/page/convert.mjs +830 -0
- package/browser/editor/page/core.mjs +1655 -0
- package/browser/editor/page/drag/drop.mjs +307 -0
- package/browser/editor/page/drag/index.mjs +335 -0
- package/browser/editor/page/drag/preview.mjs +121 -0
- package/browser/editor/page/edge-scroll.mjs +50 -0
- package/browser/editor/page/editor.mjs +1725 -0
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +278 -0
- package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
- package/browser/editor/page/emoji-picker/grid.mjs +79 -0
- package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
- package/browser/editor/page/emoji-picker/icons.mjs +32 -0
- package/browser/editor/page/emoji-picker/index.mjs +164 -0
- package/browser/editor/page/emoji-picker/styles.mjs +2 -0
- package/browser/editor/page/emoji-picker/support.mjs +202 -0
- package/browser/editor/page/emoji-picker/upload.mjs +235 -0
- package/browser/editor/page/export-report.mjs +23 -0
- package/browser/editor/page/fills.mjs +60 -0
- package/browser/editor/page/find/index.mjs +107 -0
- package/browser/editor/page/flags.mjs +70 -0
- package/browser/editor/page/format-bar/bar.mjs +448 -0
- package/browser/editor/page/format-bar/brush.mjs +77 -0
- package/browser/editor/page/format-bar/colors.mjs +46 -0
- package/browser/editor/page/format-bar/index.mjs +404 -0
- package/browser/editor/page/formula/index.mjs +236 -0
- package/browser/editor/page/formula/panel.mjs +336 -0
- package/browser/editor/page/formula/symbols.mjs +156 -0
- package/browser/editor/page/frame.mjs +74 -0
- package/browser/editor/page/frames.mjs +196 -0
- package/browser/editor/page/geometry.mjs +400 -0
- package/browser/editor/page/gesture.mjs +45 -0
- package/browser/editor/page/handle/index.mjs +639 -0
- package/browser/editor/page/handle-sizes.mjs +14 -0
- package/browser/editor/page/hints/index.mjs +84 -0
- package/browser/editor/page/history.mjs +401 -0
- package/browser/editor/page/insert/index.mjs +243 -0
- package/browser/editor/page/kept.mjs +38 -0
- package/browser/editor/page/links/address.mjs +40 -0
- package/browser/editor/page/links/index.mjs +866 -0
- package/browser/editor/page/links/pages.mjs +131 -0
- package/browser/editor/page/links/views.mjs +369 -0
- package/browser/editor/page/look.mjs +65 -0
- package/browser/editor/page/made.mjs +24 -0
- package/browser/editor/page/margin.mjs +352 -0
- package/browser/editor/page/markdown/index.mjs +88 -0
- package/browser/editor/page/markdown/rules.mjs +33 -0
- package/browser/editor/page/marks.mjs +377 -0
- package/browser/editor/page/media-menu/index.mjs +158 -0
- package/browser/editor/page/menu.mjs +500 -0
- package/browser/editor/page/merge.mjs +100 -0
- package/browser/editor/page/notices.mjs +142 -0
- package/browser/editor/page/offered.mjs +32 -0
- package/browser/editor/page/outline/folds.mjs +52 -0
- package/browser/editor/page/outline/index.mjs +697 -0
- package/browser/editor/page/outline/list.mjs +172 -0
- package/browser/editor/page/outline/read.mjs +201 -0
- package/browser/editor/page/outline/strip.mjs +281 -0
- package/browser/editor/page/outline/tree.mjs +248 -0
- package/browser/editor/page/overlay-layer.mjs +227 -0
- package/browser/editor/page/overlays.mjs +205 -0
- package/browser/editor/page/own.mjs +28 -0
- package/browser/editor/page/pads.mjs +71 -0
- package/browser/editor/page/page-objects.mjs +105 -0
- package/browser/editor/page/panel.mjs +64 -0
- package/browser/editor/page/placement.mjs +58 -0
- package/browser/editor/page/post.mjs +41 -0
- package/browser/editor/page/present-links.mjs +50 -0
- package/browser/editor/page/quiet.mjs +48 -0
- package/browser/editor/page/resize/index.mjs +327 -0
- package/browser/editor/page/select-all/index.mjs +262 -0
- package/browser/editor/page/selection/delete.mjs +59 -0
- package/browser/editor/page/selection/index.mjs +157 -0
- package/browser/editor/page/selection/marquee.mjs +174 -0
- package/browser/editor/page/session.mjs +117 -0
- package/browser/editor/page/slash-menu/index.mjs +291 -0
- package/browser/editor/page/storage.mjs +48 -0
- package/browser/editor/page/sync-state.mjs +267 -0
- package/browser/editor/page/table/aligns.mjs +29 -0
- package/browser/editor/page/table/cell-bar.mjs +138 -0
- package/browser/editor/page/table/cells.mjs +527 -0
- package/browser/editor/page/table/icons.mjs +40 -0
- package/browser/editor/page/table/index.mjs +985 -0
- package/browser/editor/page/table/lists.mjs +187 -0
- package/browser/editor/page/table/widths.mjs +308 -0
- package/browser/editor/page/tex.mjs +32 -0
- package/browser/editor/page/text-select/index.mjs +656 -0
- package/browser/editor/page/tooltip.mjs +98 -0
- package/browser/editor/page/type-grid.mjs +82 -0
- package/browser/editor/page/typing/code-edges.mjs +228 -0
- package/browser/editor/page/typing/index.mjs +276 -0
- package/browser/editor/page/typing/leave.mjs +68 -0
- package/browser/editor/page/ui.mjs +160 -0
- package/browser/shared/annotations.mjs +571 -0
- package/browser/shared/code-folds.mjs +10 -0
- package/browser/shared/code-languages.mjs +70 -0
- package/browser/shared/code-lines.mjs +30 -0
- package/browser/shared/colors.mjs +28 -0
- package/browser/shared/component-catalog.mjs +559 -0
- package/browser/shared/components/bookmark.mjs +26 -0
- package/browser/shared/components/callout.mjs +7 -0
- package/browser/shared/components/chart.mjs +20 -0
- package/browser/shared/components/code.mjs +37 -0
- package/browser/shared/components/columns.mjs +16 -0
- package/browser/shared/components/details.mjs +15 -0
- package/browser/shared/components/dialog.mjs +28 -0
- package/browser/shared/components/diff.mjs +18 -0
- package/browser/shared/components/divider.mjs +6 -0
- package/browser/shared/components/embed.mjs +25 -0
- package/browser/shared/components/figure.mjs +14 -0
- package/browser/shared/components/file.mjs +23 -0
- package/browser/shared/components/heading.mjs +6 -0
- package/browser/shared/components/highlight.mjs +9 -0
- package/browser/shared/components/icon.mjs +18 -0
- package/browser/shared/components/image.mjs +39 -0
- package/browser/shared/components/index.mjs +342 -0
- package/browser/shared/components/installed.mjs +162 -0
- package/browser/shared/components/list.mjs +146 -0
- package/browser/shared/components/math.mjs +49 -0
- package/browser/shared/components/mention.mjs +33 -0
- package/browser/shared/components/page.mjs +37 -0
- package/browser/shared/components/paragraph.mjs +9 -0
- package/browser/shared/components/quote.mjs +6 -0
- package/browser/shared/components/section.mjs +8 -0
- package/browser/shared/components/sheets.mjs +80 -0
- package/browser/shared/components/state.mjs +20 -0
- package/browser/shared/components/table.mjs +49 -0
- package/browser/shared/components/text.mjs +14 -0
- package/browser/shared/components/widget.mjs +10 -0
- package/browser/shared/copy-ids.mjs +72 -0
- package/browser/shared/css-references.mjs +110 -0
- package/browser/shared/emoji/custom.mjs +91 -0
- package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
- package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
- package/browser/shared/emoji/data/README.md +26 -0
- package/browser/shared/emoji/data/categories.json +1 -0
- package/browser/shared/emoji/data/icons.json +1 -0
- package/browser/shared/emoji/data/keywords-en.json +1 -0
- package/browser/shared/emoji/data/keywords-zh.json +1 -0
- package/browser/shared/emoji/data/names.json +1 -0
- package/browser/shared/emoji/data/positions.json +1 -0
- package/browser/shared/emoji/data/twemoji-index.json +1 -0
- package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
- package/browser/shared/emoji/data.mjs +196 -0
- package/browser/shared/emoji/emoji.mjs +37 -0
- package/browser/shared/emoji/glyphs.mjs +134 -0
- package/browser/shared/emoji/icon-value.mjs +90 -0
- package/browser/shared/escape.mjs +20 -0
- package/browser/shared/export-wrap.mjs +89 -0
- package/browser/shared/files.mjs +33 -0
- package/browser/shared/html-tree.mjs +53 -0
- package/browser/shared/http.mjs +22 -0
- package/browser/shared/i18n/en.mjs +1164 -0
- package/browser/shared/i18n/index.mjs +132 -0
- package/browser/shared/ids.mjs +24 -0
- package/browser/shared/import-types.mjs +23 -0
- package/browser/shared/inline-spacing.mjs +97 -0
- package/browser/shared/layers.mjs +42 -0
- package/browser/shared/media.mjs +162 -0
- package/browser/shared/new-names.mjs +64 -0
- package/browser/shared/number-reading.mjs +92 -0
- package/browser/shared/old-names.mjs +143 -0
- package/browser/shared/page-address.mjs +140 -0
- package/browser/shared/page-links.mjs +86 -0
- package/browser/shared/paths.mjs +73 -0
- package/browser/shared/preferences.mjs +110 -0
- package/browser/shared/preview-server.mjs +247 -0
- package/browser/shared/qa-levels.mjs +93 -0
- package/browser/shared/reading-place.mjs +91 -0
- package/browser/shared/renamed-storage.mjs +220 -0
- package/browser/shared/reports.mjs +46 -0
- package/browser/shared/search.mjs +85 -0
- package/browser/shared/session.mjs +76 -0
- package/browser/shared/table-chart.mjs +113 -0
- package/browser/shared/table-hides.mjs +120 -0
- package/browser/shared/table-slots.mjs +75 -0
- package/browser/shared/words.mjs +23 -0
- package/browser/shared/workspace.mjs +535 -0
- package/browser/shared/writing-preferences.mjs +68 -0
- package/browser/shared/zoom.mjs +57 -0
- package/dist/chunk-2B5E4CDJ.mjs +2 -0
- package/dist/chunk-2PBALTR3.mjs +57 -0
- package/dist/chunk-342HXE3Q.mjs +2 -0
- package/dist/chunk-3LA3EMDE.mjs +15 -0
- package/dist/chunk-43B75J5T.mjs +2 -0
- package/dist/chunk-4K5KC6V2.mjs +2 -0
- package/dist/chunk-5FRMCDPY.mjs +16 -0
- package/dist/chunk-5L7RYZCL.mjs +2 -0
- package/dist/chunk-5LEK2CBS.mjs +2 -0
- package/dist/chunk-5OFN5AHC.mjs +2 -0
- package/dist/chunk-5SIYS5HN.mjs +2 -0
- package/dist/chunk-5TEK3RAD.mjs +2 -0
- package/dist/chunk-6CYG3Z4V.mjs +2 -0
- package/dist/chunk-6U2SLSDN.mjs +3 -0
- package/dist/chunk-742D2WWJ.mjs +19 -0
- package/dist/chunk-7GHT2UCA.mjs +15 -0
- package/dist/chunk-7QQBR7PB.mjs +2 -0
- package/dist/chunk-A55HN5OK.mjs +2 -0
- package/dist/chunk-ACOPDCNB.mjs +2 -0
- package/dist/chunk-AGDILNWB.mjs +2 -0
- package/dist/chunk-ATCJYAR4.mjs +2 -0
- package/dist/chunk-B3VTYBYR.mjs +960 -0
- package/dist/chunk-C564NU2H.mjs +77 -0
- package/dist/chunk-C7HWOBIF.mjs +2 -0
- package/dist/chunk-DB4WKGYF.mjs +7 -0
- package/dist/chunk-E7VYDG2X.mjs +2 -0
- package/dist/chunk-EUX7IC5J.mjs +48 -0
- package/dist/chunk-EVJ3BX3M.mjs +2 -0
- package/dist/chunk-EZY3WC6Z.mjs +15 -0
- package/dist/chunk-FQGQH4KM.mjs +2 -0
- package/dist/chunk-G7TOXONE.mjs +6 -0
- package/dist/chunk-GPF4YWWB.mjs +9 -0
- package/dist/chunk-GRAXKKG4.mjs +2 -0
- package/dist/chunk-GYQV7Y4J.mjs +120 -0
- package/dist/chunk-HMHK3EQ6.mjs +2 -0
- package/dist/chunk-HQQMJCQJ.mjs +10 -0
- package/dist/chunk-HYMEEXKN.mjs +4 -0
- package/dist/chunk-IERUOGC3.mjs +6 -0
- package/dist/chunk-ITNLYXXV.mjs +3 -0
- package/dist/chunk-L4DVONOG.mjs +2 -0
- package/dist/chunk-LAE5NQ4B.mjs +2 -0
- package/dist/chunk-LC7YNQFG.mjs +2 -0
- package/dist/chunk-LHTFLRB6.mjs +4 -0
- package/dist/chunk-LKX55H76.mjs +2 -0
- package/dist/chunk-MAFIGVXY.mjs +2 -0
- package/dist/chunk-NFIBI4IP.mjs +26 -0
- package/dist/chunk-NSKUTQ5J.mjs +5 -0
- package/dist/chunk-O52JMOCZ.mjs +2 -0
- package/dist/chunk-P2CAZPDP.mjs +3 -0
- package/dist/chunk-QAIHRH3I.mjs +13 -0
- package/dist/chunk-QMQUXTU4.mjs +12 -0
- package/dist/chunk-QR6A54KJ.mjs +3 -0
- package/dist/chunk-QVWVFC5K.mjs +6 -0
- package/dist/chunk-QYKCJ7FG.mjs +8 -0
- package/dist/chunk-QZY6Q64C.mjs +2 -0
- package/dist/chunk-TDQP3DKQ.mjs +10 -0
- package/dist/chunk-TMYZB6AV.mjs +2 -0
- package/dist/chunk-TX6JH7TR.mjs +2 -0
- package/dist/chunk-U3SSPL4K.mjs +8 -0
- package/dist/chunk-UH4SIXTR.mjs +2 -0
- package/dist/chunk-UNUEWH4S.mjs +2 -0
- package/dist/chunk-UXUK4PMC.mjs +27 -0
- package/dist/chunk-V4CPWKMZ.mjs +2 -0
- package/dist/chunk-V6XZ4VIR.mjs +2 -0
- package/dist/chunk-VACRB2NE.mjs +3 -0
- package/dist/chunk-W63L7367.mjs +7 -0
- package/dist/chunk-W7CXPCRV.mjs +6 -0
- package/dist/chunk-W7XHE4CT.mjs +2 -0
- package/dist/chunk-XINNG4F2.mjs +4 -0
- package/dist/chunk-Y34NR5JL.mjs +2 -0
- package/dist/chunk-YEY3RSFQ.mjs +2 -0
- package/dist/chunk-YL2DPWVS.mjs +4 -0
- package/dist/chunk-YXAUQPVK.mjs +8 -0
- package/dist/chunk-YZ5Z6H4W.mjs +4 -0
- package/dist/chunk-Z52HTUW7.mjs +4 -0
- package/dist/chunk-ZBIM6ARY.mjs +216 -0
- package/dist/cli.mjs +2 -0
- package/dist/server.mjs +2 -0
- package/dist/worker.mjs +5 -0
- package/kit/charts.js +355 -0
- package/kit/code.js +164 -0
- package/kit/dialogs.js +157 -0
- package/kit/math.js +1988 -0
- package/kit/report.css +2821 -0
- package/kit/runtime.js +1707 -0
- package/kit/sheets.js +123 -0
- package/kit/state.js +217 -0
- package/kit/tables.js +1449 -0
- package/kit/tokens.js +29 -0
- package/kit/ui.js +561 -0
- package/package.json +41 -4
- package/release.json +25 -0
- package/sdk/column-widths.d.ts +56 -0
- package/sdk/doc-charts.d.ts +82 -0
- package/sdk/doc-code.d.ts +28 -0
- package/sdk/doc-dialogs.d.ts +4 -0
- package/sdk/doc-kit.d.ts +141 -0
- package/sdk/doc-math.d.ts +3 -0
- package/sdk/doc-sheets.d.ts +15 -0
- package/sdk/doc-state.d.ts +41 -0
- package/sdk/doc-tables.d.ts +24 -0
- package/sdk/doc-tokens.d.ts +22 -0
- package/sdk/index.d.ts +30 -0
- package/skill/SKILL.md +138 -0
- package/skill/agents/openai.yaml +5 -0
- package/skill/references/building-components.md +327 -0
- package/skill/references/example-report.html +356 -0
- package/skill/references/writing-html.md +187 -0
- package/skill/sdk/column-widths.d.ts +56 -0
- package/skill/sdk/doc-charts.d.ts +82 -0
- package/skill/sdk/doc-code.d.ts +28 -0
- package/skill/sdk/doc-dialogs.d.ts +4 -0
- package/skill/sdk/doc-kit.d.ts +141 -0
- package/skill/sdk/doc-math.d.ts +3 -0
- package/skill/sdk/doc-sheets.d.ts +15 -0
- package/skill/sdk/doc-state.d.ts +41 -0
- package/skill/sdk/doc-tables.d.ts +24 -0
- package/skill/sdk/doc-tokens.d.ts +22 -0
- package/skill/sdk/index.d.ts +30 -0
- package/starter/doc.html +21 -0
- package/starter/doc.json +5 -0
- package/vendor/d3.v7.9.0.min.js +2 -0
- package/vendor/katex/auto-render.min.js +1 -0
- package/vendor/katex/contrib/mhchem.min.js +1 -0
- package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/vendor/katex/katex.min.css +1 -0
- package/vendor/katex/katex.min.js +1 -0
- package/vendor/pdfjs/LICENSE +177 -0
- package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
- package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
- package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/vendor/types/@types/d3/LICENSE +21 -0
- package/vendor/types/@types/d3/index.d.ts +39 -0
- package/vendor/types/@types/d3/package.json +81 -0
- package/vendor/types/@types/d3-array/LICENSE +21 -0
- package/vendor/types/@types/d3-array/index.d.ts +1118 -0
- package/vendor/types/@types/d3-array/package.json +56 -0
- package/vendor/types/@types/d3-axis/LICENSE +21 -0
- package/vendor/types/@types/d3-axis/index.d.ts +293 -0
- package/vendor/types/@types/d3-axis/package.json +47 -0
- package/vendor/types/@types/d3-brush/LICENSE +21 -0
- package/vendor/types/@types/d3-brush/index.d.ts +255 -0
- package/vendor/types/@types/d3-brush/package.json +42 -0
- package/vendor/types/@types/d3-chord/LICENSE +21 -0
- package/vendor/types/@types/d3-chord/index.d.ts +471 -0
- package/vendor/types/@types/d3-chord/package.json +40 -0
- package/vendor/types/@types/d3-color/LICENSE +21 -0
- package/vendor/types/@types/d3-color/index.d.ts +669 -0
- package/vendor/types/@types/d3-color/package.json +55 -0
- package/vendor/types/@types/d3-contour/LICENSE +21 -0
- package/vendor/types/@types/d3-contour/index.d.ts +222 -0
- package/vendor/types/@types/d3-contour/package.json +38 -0
- package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
- package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
- package/vendor/types/@types/d3-delaunay/package.json +30 -0
- package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
- package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
- package/vendor/types/@types/d3-dispatch/package.json +51 -0
- package/vendor/types/@types/d3-drag/LICENSE +21 -0
- package/vendor/types/@types/d3-drag/index.d.ts +395 -0
- package/vendor/types/@types/d3-drag/package.json +42 -0
- package/vendor/types/@types/d3-dsv/LICENSE +21 -0
- package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
- package/vendor/types/@types/d3-dsv/package.json +45 -0
- package/vendor/types/@types/d3-ease/LICENSE +21 -0
- package/vendor/types/@types/d3-ease/index.d.ts +316 -0
- package/vendor/types/@types/d3-ease/package.json +40 -0
- package/vendor/types/@types/d3-fetch/LICENSE +21 -0
- package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
- package/vendor/types/@types/d3-fetch/package.json +37 -0
- package/vendor/types/@types/d3-force/LICENSE +21 -0
- package/vendor/types/@types/d3-force/index.d.ts +899 -0
- package/vendor/types/@types/d3-force/package.json +45 -0
- package/vendor/types/@types/d3-format/LICENSE +21 -0
- package/vendor/types/@types/d3-format/index.d.ts +337 -0
- package/vendor/types/@types/d3-format/package.json +45 -0
- package/vendor/types/@types/d3-geo/LICENSE +21 -0
- package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
- package/vendor/types/@types/d3-geo/package.json +48 -0
- package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
- package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
- package/vendor/types/@types/d3-hierarchy/package.json +50 -0
- package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
- package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
- package/vendor/types/@types/d3-interpolate/package.json +47 -0
- package/vendor/types/@types/d3-path/LICENSE +21 -0
- package/vendor/types/@types/d3-path/index.d.ts +108 -0
- package/vendor/types/@types/d3-path/package.json +41 -0
- package/vendor/types/@types/d3-polygon/LICENSE +21 -0
- package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
- package/vendor/types/@types/d3-polygon/package.json +40 -0
- package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
- package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
- package/vendor/types/@types/d3-quadtree/package.json +45 -0
- package/vendor/types/@types/d3-random/LICENSE +21 -0
- package/vendor/types/@types/d3-random/index.d.ts +313 -0
- package/vendor/types/@types/d3-random/package.json +41 -0
- package/vendor/types/@types/d3-scale/LICENSE +21 -0
- package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
- package/vendor/types/@types/d3-scale/package.json +53 -0
- package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
- package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
- package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
- package/vendor/types/@types/d3-selection/LICENSE +21 -0
- package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
- package/vendor/types/@types/d3-selection/package.json +56 -0
- package/vendor/types/@types/d3-shape/LICENSE +21 -0
- package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
- package/vendor/types/@types/d3-shape/package.json +53 -0
- package/vendor/types/@types/d3-time/LICENSE +21 -0
- package/vendor/types/@types/d3-time/index.d.ts +697 -0
- package/vendor/types/@types/d3-time/package.json +46 -0
- package/vendor/types/@types/d3-time-format/LICENSE +21 -0
- package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
- package/vendor/types/@types/d3-time-format/package.json +40 -0
- package/vendor/types/@types/d3-timer/LICENSE +21 -0
- package/vendor/types/@types/d3-timer/index.d.ts +68 -0
- package/vendor/types/@types/d3-timer/package.json +45 -0
- package/vendor/types/@types/d3-transition/LICENSE +21 -0
- package/vendor/types/@types/d3-transition/index.d.ts +664 -0
- package/vendor/types/@types/d3-transition/package.json +47 -0
- package/vendor/types/@types/d3-zoom/LICENSE +21 -0
- package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
- package/vendor/types/@types/d3-zoom/package.json +48 -0
- package/vendor/types/@types/geojson/LICENSE +21 -0
- package/vendor/types/@types/geojson/index.d.ts +202 -0
- package/vendor/types/@types/geojson/package.json +46 -0
- package/vendor/typescript/LICENSE.txt +55 -0
- package/vendor/typescript/lib.decorators.d.ts +384 -0
- package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
- package/vendor/typescript/lib.dom.d.ts +39429 -0
- package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
- package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
- package/vendor/typescript/lib.es2015.core.d.ts +597 -0
- package/vendor/typescript/lib.es2015.d.ts +28 -0
- package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
- package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
- package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
- package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
- package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
- package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
- package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
- package/vendor/typescript/lib.es2016.d.ts +21 -0
- package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
- package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
- package/vendor/typescript/lib.es2017.d.ts +26 -0
- package/vendor/typescript/lib.es2017.date.d.ts +31 -0
- package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
- package/vendor/typescript/lib.es2017.object.d.ts +49 -0
- package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
- package/vendor/typescript/lib.es2017.string.d.ts +45 -0
- package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
- package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
- package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
- package/vendor/typescript/lib.es2018.d.ts +24 -0
- package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
- package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
- package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
- package/vendor/typescript/lib.es2019.array.d.ts +79 -0
- package/vendor/typescript/lib.es2019.d.ts +24 -0
- package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
- package/vendor/typescript/lib.es2019.object.d.ts +33 -0
- package/vendor/typescript/lib.es2019.string.d.ts +37 -0
- package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
- package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
- package/vendor/typescript/lib.es2020.d.ts +27 -0
- package/vendor/typescript/lib.es2020.date.d.ts +42 -0
- package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
- package/vendor/typescript/lib.es2020.number.d.ts +28 -0
- package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
- package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
- package/vendor/typescript/lib.es2020.string.d.ts +44 -0
- package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/vendor/typescript/lib.es2021.d.ts +23 -0
- package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
- package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
- package/vendor/typescript/lib.es2021.string.d.ts +33 -0
- package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
- package/vendor/typescript/lib.es2022.array.d.ts +121 -0
- package/vendor/typescript/lib.es2022.d.ts +25 -0
- package/vendor/typescript/lib.es2022.error.d.ts +75 -0
- package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
- package/vendor/typescript/lib.es2022.object.d.ts +26 -0
- package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
- package/vendor/typescript/lib.es2022.string.d.ts +25 -0
- package/vendor/typescript/lib.es5.d.ts +4601 -0
- package/vendor/typescript/package.json +4 -0
- package/vendor/typescript/typescript.js +446 -0
- package/web/assets/index-B6Ai3wsa.js +13 -0
- package/web/assets/index-SYPC3EZy.css +1 -0
- package/web/index.html +14 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-NSKUTQ5J.mjs";import"./chunk-5L7RYZCL.mjs";export{b as UsageError,e as asksHelp,g as checkSlug,f as commandArguments,j as documentArguments,i as documentNamed,h as inTrashSaid,a as isOption,k as scriptArguments,d as usageFailureText,c as usageOf};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a as w}from"./chunk-TX6JH7TR.mjs";import{c as N}from"./chunk-ZBIM6ARY.mjs";import{a as k,b as d,f as O}from"./chunk-NSKUTQ5J.mjs";import{i as S}from"./chunk-HQQMJCQJ.mjs";import{c as u,g as x,o as A,p as C,r as b}from"./chunk-W63L7367.mjs";import $ from"node:fs";import v from"node:path";import{blocksHidden as D}from"../browser/editor/components/registry.mjs";import{PACKAGE_ID as K}from"../browser/shared/components/installed.mjs";import{DEVICE_NAMES as R,layoutOf as F,PACKAGE_MANIFEST as U,shallowPackages as T}from"../browser/shared/workspace.mjs";var W=(e,t,o)=>`{
|
|
3
|
+
"id": "${e}",
|
|
4
|
+
"apiVersion": 1,
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"name": { "zh": "${t}", "en": "${t}" },
|
|
7
|
+
"description": { "zh": "\u4E00\u4E2A\u53EF\u4EE5\u53CD\u590D\u4F7F\u7528\u7684\u5757", "en": "A block to use again" },
|
|
8
|
+
"words": "${t}",
|
|
9
|
+
"parts": {
|
|
10
|
+
"title": { "at": ":scope > h3", "edit": "text" },
|
|
11
|
+
"text": { "at": ":scope > p", "edit": "text", "optional": true }
|
|
12
|
+
},${o?`
|
|
13
|
+
"runtime": { "generated": [".component-drawn"] },`:""}
|
|
14
|
+
"markdown": "parts"
|
|
15
|
+
}
|
|
16
|
+
`,P=(e,t,o)=>`<div data-doc-component="${e}">
|
|
17
|
+
<h3>${t}</h3>
|
|
18
|
+
<p>${o}</p>
|
|
19
|
+
</div>
|
|
20
|
+
`,G=e=>`/* Every selector starts at the instance, so that nothing here reaches the rest of the page. */
|
|
21
|
+
[data-doc-component="${e}"] { padding: 12px 16px; border: 1px solid var(--doc-border); border-radius: 8px; }
|
|
22
|
+
[data-doc-component="${e}"] > h3 { margin-top: 0; }
|
|
23
|
+
`,M=(e,t,o)=>`# ${t}
|
|
24
|
+
|
|
25
|
+
What this block is for, and when a document uses it rather than a block of Gallery's own.
|
|
26
|
+
|
|
27
|
+
## How to write it
|
|
28
|
+
|
|
29
|
+
Write the element as example.html does: \`gallery component show ${e}\` prints it. Each part, and what goes in it:
|
|
30
|
+
|
|
31
|
+
- the title, its \`h3\`: required.
|
|
32
|
+
- the text, its \`p\`: optional.
|
|
33
|
+
|
|
34
|
+
## How it looks
|
|
35
|
+
|
|
36
|
+
What a reader sees of it, and what it shows while it is empty.
|
|
37
|
+
${o?`
|
|
38
|
+
## Its script
|
|
39
|
+
|
|
40
|
+
kit.js runs with the rights of a document's own script. What it draws, it draws in what the manifest's \`runtime\` names.
|
|
41
|
+
`:""}`,_=e=>`// Starts each instance from what the file says, and draws in a node the manifest's runtime names:
|
|
42
|
+
// the kit takes that off an instance before it starts one again, as an undo may put one back.
|
|
43
|
+
DocKit.component({
|
|
44
|
+
id: "${e}",
|
|
45
|
+
on: ["source"],
|
|
46
|
+
mount(host, context) {
|
|
47
|
+
const drawn = document.createElement("div");
|
|
48
|
+
drawn.className = "component-drawn";
|
|
49
|
+
host.append(drawn);
|
|
50
|
+
const draw = () => { drawn.textContent = context.part("title")?.textContent ?? ""; };
|
|
51
|
+
draw();
|
|
52
|
+
return { update: draw };
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
`;function I(e,{script:t=!1}={}){let o=e.split("/")[1];return{"component.json":W(e,o,t),"template.html":P(e,"\u6807\u9898","\u5199\u5728\u8FD9\u91CC\u3002"),"example.html":P(e,"\u4E00\u4E2A\u4F8B\u5B50","\u8FD9\u91CC\u5199\u8FD9\u4E2A\u5757\u5728\u4E00\u4EFD\u6587\u6863\u91CC\u7684\u6837\u5B50\u3002"),"writing.md":M(e,o,t),"style.css":G(e),...t?{"kit.js":_(e)}:{}}}var j="local";function B(e){let t=e.includes("/")?e:`${j}/${e}`;if(!K.test(t))throw new d(`Not a component's id: ${e} (<scope>/<name>, each in lowercase letters, digits and hyphens; a <name> alone is ${j}/<name>).`);let o=t.split("/").find(n=>R.has(n));if(o)throw new d(`Not a component's id: ${e} (Windows keeps ${o} for a device).`);return t}var V=(e,t)=>v.join(F(e).components,...t.split("/")),H=({name:e,file:t})=>`${w(t)} is one level too shallow, and no catalog reads it: a package is components/<scope>/<name>/, so move it to components/${j}/${e}/`;function Y(e,t){let o=T(e).find(({name:n})=>n===t.split("/")[1]);return o?H(o):`No component ${t} in ${w(F(e).components)}: gallery component list says which there are.`}function q(e,t,{script:o}){let n=V(e,t);if($.existsSync(n)||u(e).problems.has(t)){let s=!$.existsSync(v.join(n,U));console.error(s?`A folder is there with no component.json: ${w(n)}: move it, or give this component another name.`:`Component already exists: ${w(n)}: gallery component show ${t} says what it is; give a new one another name.`),process.exit(1)}let a=I(t,{script:o});try{$.mkdirSync(n,{recursive:!0});for(let[s,r]of Object.entries(a).reverse())$.writeFileSync(v.join(n,s),r)}catch(s){if(!s.code)throw s;console.error(`Cannot write ${w(n)} (${s.code}).`),process.exit(1)}console.log(`Created ${w(n)}: ${Object.keys(a).join(", ")}`),console.log(`Next: say in component.json what it is (its name, description and parts), write template.html, what "/" puts in a document, and example.html, an instance as a writer would fill it, then writing.md and style.css${o?" and kit.js":""} (references/building-components.md has every field and the rules), and run gallery component check ${t}, which passes as it stands now.`)}var g=({zh:e,en:t})=>e===t?e:`${e} / ${t}`;function z(e){if(C(e))return null;let t=A(e);return t?x("en",t):"it has no template.html"}var J={disabled:"disabled: its instances show as they stand, no script and no style",hidden:"hidden: the menus do not offer it, and the instances there go on running"};function L(e){let t=u(e),o=b(t),n=o.filter(({reason:i})=>i),a=o.filter(({reason:i})=>!i),s=a.filter(({state:i})=>i==="normal"),r=T(e),c=D(t.settings.hidden),p=()=>{c.length&&console.log(`Hidden by the user, not to write unless asked for: ${c.join(", ")}`)};if(console.log(`\u5DE5\u4F5C\u533A\uFF1A${w(e)}`),a.length+n.length+r.length===0){console.log("No component packages yet. A document is written with Gallery's blocks and whole blocks; gallery component new <id> starts a package when the user wants a block to use again."),p();return}console.log(s.length?`${s.length} component${s.length===1?"":"s"} to write with (gallery component show <id> says how):`:"No component to write with now.");for(let{id:i,name:l,version:m,description:y}of s){console.log(`${i} ${g(l)}`),console.log(` \u7248\u672C\uFF1A${m}\uFF08available\uFF09`),console.log(` \u8BF4\u660E\uFF1A${g(y)}`);let E=z(t.packages.get(i));E&&console.log(` \u6A21\u677F\uFF1Athe menus cannot insert it, and a document can still write it: ${E}`)}let h=a.filter(({state:i})=>i!=="normal");h.length+n.length+r.length>0&&console.log("Not to write with now:");for(let{id:i,name:l,version:m,state:y}of h)console.log(`${i} ${g(l)} ${m} ${J[y]}`);for(let{id:i,reason:l,version:m}of n)console.log(`${i}${m?` ${m}`:""} does not load: ${l.en}`);for(let i of r)console.log(H(i));p()}var Q=(e,{at:t,edit:o,optional:n,min:a,max:s})=>{let r=[n?"optional":"",a!==void 0?`at least ${a}`:"",s!==void 0?`at most ${s}`:""].filter(Boolean);return` ${e} ${t} ${o}${r.length?` (${r.join(", ")})`:""}`};function X(e,t){let o=u(e),n=o.problems.get(t),a=o.packages.get(t)??(n?.off?n:void 0);if(!a){let h=n?.problem;console.error(h?`${t} does not load: ${x("en",h)}`:Y(e,t)),process.exit(1)}let{state:s}=b(o).find(h=>h.id===t);console.log(`${t} ${g(a.name)}`),console.log(` \u7248\u672C\uFF1A${a.version}\uFF08${s==="normal"?"available":s}\uFF09`),console.log(` \u8BF4\u660E\uFF1A${g(a.description)}`),console.log(` ${w(a.folder)}`);let r=Object.entries(a.parts);console.log(r.length?"Parts (edit text: the user types there; none, or data: the component's):":"No parts.");for(let[h,i]of r)console.log(Q(h,i));let c=S(a,"writing.md")?.trimEnd();console.log(c?`How to write it (writing.md):
|
|
56
|
+
${c}`:"How to write it: the package has no writing.md.");let p=S(a,"example.html")?.trimEnd();console.log(p?`The example (example.html):
|
|
57
|
+
${p}`:"The example: the package has no example.html."),console.log("In a document: write the element as the example does, straight in the page or a section, with no data-block-id, which the export gives it.")}var f={new:(e,t,o)=>q(e,t,{script:o}),list:L,show:X,check:async(e,t)=>(await import("./chunk-YL2DPWVS.mjs")).checkCommand(e,t),try:async(e,t)=>(await import("./chunk-GPF4YWWB.mjs")).tryCommand(e,t)},Z=["--press","--drag","--to","--key"];function ee(e){let t=e.indexOf("--"),o=(t===-1?e:e.slice(0,t)).findIndex(s=>s==="--key"||s.startsWith("--key="));if(o===-1)return{argv:e,key:null};let n=o+(e[o].includes("=")?1:2),a=e[n];if(a===void 0||n===t||k(a))throw new d("--key takes a selector and a key: --key <selector> <key> (Enter, Space, ArrowRight, a letter, Shift+Tab).");return{argv:e.filter((s,r)=>r!==n),key:a}}async function we(e,{workspace:t}){try{return await te(e,t)}catch(o){throw o instanceof d&&e.find(n=>!k(n))==="try"&&(o.synopsis=N),o}}async function te(e,t){let{argv:o,key:n}=ee(e),{positional:a,options:s,values:r}=O({options:["--script","--keep"],values:Z,argv:o}),[c,p,...h]=a,i=Object.keys(f).join(", ");if(!c)throw new d(`Say what to do: ${i}.`);if(!Object.hasOwn(f,c))throw new d(`No such component command: ${c} (${i}).`);let l=f[c];if(s.has("--script")&&l!==f.new)throw new d(`--script goes with new, not ${c}.`);let m=[...r.keys(),...s.has("--keep")?["--keep"]:[]];if(l===f.try)return l(t,{named:a.slice(1),values:r,key:n,keep:s.has("--keep")});if(m.length)throw new d(`${m[0]} goes with try, not ${c}.`);if(l===f.list){if(p!==void 0)throw new d(`gallery component ${c} takes nothing else.`);return l(t)}if(p===void 0||h.length>0)throw new d(`gallery component ${c} takes one id.`);return l(t,B(p),s.has("--script"))}export{B as a,V as b,H as c,Y as d,ee as e,we as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import t from"node:path";import{exportsDirectory as e}from"../browser/shared/paths.mjs";var r="\u4EA4\u7ED9\u7528\u6237\uFF08\u79BB\u7EBF\u6587\u4EF6\uFF09\uFF1A",i=o=>t.join(e,`${o}.html`),m=o=>`${r}${i(o)}`;export{r as a,i as b,m as c};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a as Ee}from"./chunk-TX6JH7TR.mjs";import{a as Se,b as Ne,c as Oe,d as Ae,e as Le,f as Me}from"./chunk-LC7YNQFG.mjs";import{c as Te}from"./chunk-ITNLYXXV.mjs";import{o as ve}from"./chunk-QMQUXTU4.mjs";import{a as de}from"./chunk-HYMEEXKN.mjs";import{b as je}from"./chunk-5FRMCDPY.mjs";import{l as xe}from"./chunk-W63L7367.mjs";import A from"node:fs/promises";import De from"node:os";import E from"node:path";import{pathToFileURL as Ie}from"node:url";import{instancesOf as Fe}from"../browser/shared/components/index.mjs";import{FALLBACK as Ke,INSTANCE as pe}from"../browser/shared/components/installed.mjs";import{layoutOf as Ye,PACKAGE_MANIFEST as ze}from"../browser/shared/workspace.mjs";var Xe="in a browser, under the export's policy",X="component-check",Q=[360,736,1024],he=["light","dark"],Qe=[1024,360],Pe=1e4,Ze=6e4,we=3e4,_e=2e3,et=3e3,tt=60,nt=2,at=8,ot=we/2,st=/^(?:wasm-)?eval$/,it=new Set(["TargetCloseError","ConnectionClosedError"]),ue=e=>String(e?.message??e).split(`
|
|
3
|
+
`)[0],rt=(e,n)=>`<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${e}</title></head><body><main class="doc-page" data-doc-id="${e}">${n}
|
|
4
|
+
</main></body></html>
|
|
5
|
+
`,lt=({example:e,template:n})=>`<p>example.html</p>${e}
|
|
6
|
+
<hr><p>template.html</p>${n}`,He=(e,n)=>Fe(de(e),n).map(({sourceCodeLocation:{startLine:s,startOffset:i,endOffset:t}})=>({line:s,markup:e.slice(i,t)}));async function ct(e,n){let s=E.join(n,"components",...e.id.split("/"));for(let i of[ze,"template.html",...e.files]){let t=xe(e,i);if(!t)continue;let o=await A.readFile(t);await A.mkdir(E.dirname(E.join(s,i)),{recursive:!0}),await A.writeFile(E.join(s,i),i==="kit.js"?`${o}
|
|
7
|
+
//# sourceURL=kit.js
|
|
8
|
+
`:o)}}async function dt(e,{example:n,template:s},i){await ct(e,i);let t=E.join(i,X);await A.mkdir(t);let o=`${n}
|
|
9
|
+
`,p=je(rt(X,lt({example:n,template:s}))).text;await A.writeFile(E.join(t,"doc.html"),p),await A.writeFile(E.join(t,"doc.json"),JSON.stringify({title:X,description:X,type:"component"}));let u=await(await ve({directory:i}))(X),l=E.join(i,"export.html");await A.writeFile(l,u);let f=o.split(`
|
|
10
|
+
`).length-1,g=He(p,e).map(({line:c})=>c>f?{file:"template.html",line:c-f}:{file:"example.html",line:c});return{html:u,file:l,places:g,source:p}}async function ht({match:e,instance:n,fallback:s,parts:i,at:t,source:o,still:p,step:h,times:u,typed:l,typing:f}){let g=()=>[...document.querySelectorAll(e)].filter(a=>!a.parentElement.closest(n)),c=a=>new Promise(r=>setTimeout(r,a)),d=()=>new Promise(a=>{requestAnimationFrame(a),setTimeout(a,100)}),b=async a=>{await d(),await d();let r=a.outerHTML;for(let k=0,T=Date.now()+p;k<3;){if(Date.now()>T)return null;await c(h);let v=a.outerHTML;k=v===r?k+1:0,r=v}return r},w=a=>{let r=document.createElement("template");return r.innerHTML=a,r.content.firstElementChild},y=a=>`<${a.localName}${a.classList.length?` class="${a.getAttribute("class")}"`:""}>`,m=a=>a.nodeType===1?y(a):`the words "${a.data.trim().slice(0,40)}"`,$=a=>[...a.childNodes].filter(r=>r.nodeType===1||r.nodeType===3&&r.data.trim()),L=(a,r)=>["style","class"].includes(r)&&!a.getAttribute(r)?.trim()?null:a.getAttribute(r),P=(a,r)=>{for(let v of new Set([...a.getAttributeNames(),...r.getAttributeNames()]))if(L(a,v)!==L(r,v))return`${v} on ${y(r)}, ${JSON.stringify(L(a,v))} then ${JSON.stringify(L(r,v))}`;let[k,T]=[$(a),$(r)];for(let v=0;v<Math.max(k.length,T.length);v++){let[S,I]=[k[v],T[v]];if(!S||!I)return`${y(r)} ${S?`without ${m(S)}`:`with ${m(I)} more`}`;if(S.nodeType!==I.nodeType||S.localName!==I.localName||S.nodeType===3&&S.data.trim()!==I.data.trim())return`in ${y(r)}, ${m(S)} then ${m(I)}`;let _=S.nodeType===1?P(S,I):null;if(_)return _}return null},R=a=>{let r=new Map;for(let k of a)r.set(y(k),(r.get(y(k))??0)+1);return r},fe=()=>[...document.querySelectorAll("*")].filter(a=>!a.closest(n)),me=a=>[...a.at(-1).keys()].filter(r=>a.length>2&&a.every((k,T)=>T===0||(k.get(r)??0)>(a[T-1].get(r)??0))),ne=(a,r=()=>!0)=>Object.entries(i).filter(([,{edit:k}])=>r(k)).flatMap(([k,T])=>[...a.querySelectorAll(T.at)].map(v=>({name:k,node:v}))),Y=a=>ne(a,r=>r==="text"),U=a=>Object.entries(i).filter(([,{edit:r}])=>r==="data").map(([r,k])=>({name:r,node:a.querySelector(k.at)})).filter(({node:r})=>r),C=[],V=g()[t];if(!V)return[{kind:"gone"}];if(V.hasAttribute(s))return[{kind:"fallback"}];let ae=await b(V);if(ae===null)return[{kind:"moving"}];let Z=w(o),oe=Y(Z);Y(V).forEach(({name:a,node:r},k)=>{oe[k]&&oe[k].node.innerHTML!==r.innerHTML&&C.push({kind:"redrawn",part:a,how:`the file says ${JSON.stringify(oe[k].node.textContent.trim())}, the page ${JSON.stringify(r.textContent.trim())}`})});let ee=DocKit.dehydrate(V.cloneNode(!0)),se=P(Z,ee);if(se){let a=ne(ee),r=ne(Z).find(({node:k},T)=>a[T]&&P(k,a[T].node))?.name;C.push({kind:"left",what:se,...r?{part:r}:{}})}let qe=U(ee);for(let[a,{name:r,node:k}]of U(Z).entries())!se&&qe[a]?.node.innerHTML!==k.innerHTML&&C.push({kind:"data",part:r});let J=[],ie=new MutationObserver(a=>J.push(...a));ie.observe(document.documentElement,{subtree:!0,childList:!0,characterData:!0});let ge=new Set,ke=a=>{J.push(...ie.takeRecords());for(let{name:r,node:k}of a)(!k.isConnected||J.some(({target:T})=>k.contains(T)))&&ge.add(r);J.length=0},re=[ae],le=[R(fe())],ye=a=>{re.push(a),le.push(R(fe()))},x=ee,ce=Y(x);J.length=0,V.replaceWith(x);let H=await b(x);if(ke(ce),H!==null){ye(H);for(let a=0;a<u&&H!==null;a++){let r=x.cloneNode(!0);ce=Y(r),J.length=0,x.replaceWith(r),x=r,H=await b(x),ke(ce),H!==null&&ye(H)}}ie.disconnect(),H===null&&C.push({kind:"moving"});for(let a of ge)C.push({kind:"redrawn",part:a,how:"a mount changes it"});let be=re.map(a=>R(w(a).querySelectorAll("*"))),$e=me(be);for(let a of $e)C.push({kind:"piles",what:a,counts:be.map(r=>r.get(a)??0)});for(let a of me(le))C.push({kind:"piles",what:a,outside:!0,counts:le.map(r=>r.get(a)??0)});if(!$e.length){let a=re.slice(1).map(r=>P(w(ae),w(r))).find(Boolean);a&&C.push({kind:"changed",what:a})}let te=H===null?[]:Y(x).filter(({node:a})=>a.textContent.trim()),Ge=[...new Set([...new Map(te.map(a=>[a.name,a])).values(),...te])].slice(0,l),Ue=Date.now()+f;for(let{node:a}of Ge){if(Date.now()>Ue)break;let r=document.createTreeWalker(a,NodeFilter.SHOW_TEXT).nextNode(),k=r.data;r.data=`${k}\u2026`;let T=te.map(({node:S})=>S.textContent);await b(x);let v=te.find(({node:S},I)=>!S.isConnected||S.textContent!==T[I]);if(v){C.push({kind:"redrawn",part:v.name,how:"a change of its words does not stand"});break}r.data=k,await b(x)}return H!==null&&U(x).length>0&&C.push(...await Ve()),C;async function Ve(){let a=[],r=null,k=!1,T="as it hears that it can write (the editable signal)",v=[],S=_=>{if(_.target!==x)return;let{parts:F,run:z}=_.detail,M=F.map(({part:j})=>j.innerHTML),K=F.map(({part:j})=>j.cloneNode(!0)),q=z(Object.fromEntries(F.map(({name:j},O)=>[j,K[O]]))),W=F.find(({part:j},O)=>j.innerHTML!==M[O]),B=F.find(({part:j},O)=>K[O].cloneNode(!1).outerHTML!==j.cloneNode(!1).outerHTML);if(W&&F.forEach(({part:j},O)=>{j.innerHTML=M[O]}),!k){let j=W??B??F.find((O,D)=>K[D].innerHTML!==M[D]);j&&!v.some(O=>O.when===T)?v.push({kind:"unasked",part:j.name,when:T}):q&&!j&&_.preventDefault();return}W?r??=`it writes the part ${W.name} on the page, not the draft context.edit hands it, so the editor refuses the edit`:q&&B&&(r??=`it changes the part ${B.name}'s own tag or attributes, which are the file's: a change writes what a part holds, so the editor refuses the edit`),!(W||!q||B)&&(F.forEach(({part:j},O)=>{a.push({part:j,before:M[O]}),j.replaceChildren(...K[O].childNodes)}),_.preventDefault())};document.addEventListener("doc-component-edit",S);try{return[...await I(),...v]}finally{document.removeEventListener("doc-component-edit",S)}async function I(){dispatchEvent(new Event("doc-editable")),await b(x),T="as it mounts";let _=x.cloneNode(!0);x.replaceWith(_),x=_;let F=await b(x);T="as it hears its part changed (the source signal)";let z=DocKit.dehydrate(x.cloneNode(!0)),M=[];k=!0;try{if(!DocKit.example(x))return[{kind:"no-example"}]}catch(D){return[{kind:"example",what:`it throws: ${D?.message??D}`}]}finally{k=!1}let K=await b(x),q=DocKit.dehydrate(x.cloneNode(!0)),W=Object.fromEntries(U(q).map(({name:D,node:G},Je)=>[D,G.innerHTML,U(z)[Je]?.node.innerHTML]).filter(([,D,G])=>D!==G));r?M.push({kind:"example",what:r}):a.length===0?M.push({kind:"example",what:"context.edit was not taken: it was not called, or it answered false, and the console says why"}):Object.keys(W).length===0?M.push({kind:"example",what:"it changes nothing a part holds"}):M.push({kind:"wrote",parts:W});for(let D of[z,q])for(let{node:G}of U(D))G.textContent="";let B=P(z,q);B&&M.push({kind:"example",what:`it changes what is no data part: ${B}`});for(let{part:D,before:G}of a.reverse())D.innerHTML=G;let j=await b(x),O=F!==null&&j!==null?P(w(F),w(j)):null;return K===null||j===null?M.push({kind:"moving"}):O&&!B&&M.push({kind:"undo",what:O}),M}}}var pt=e=>e.map(({name:n,removed:s,added:i,lines:t})=>`${n} (-${s} +${i} of its ${t} line${t===1?"":"s"})`).join(" and "),ut="a write changes the lines it means and no others, a row moved with the blank before it, JSON written back by jsonIn and laid out in template.html and example.html as jsonIn writes it (building-components.md, Two examples)";function wt({kind:e,what:n,part:s,how:i,when:t,counts:o,outside:p,parts:h,back:u,line:l},f,{script:g}){let c=b=>({...f,what:b}),d=b=>({...f,what:b,note:!0});switch(e){case"wrote":return{...f,told:!0,what:`its example wrote ${pt(h)}; the server took it${u?"; put back as an undo does, it shows what it showed":""}`};case"laid":return d(`its example's write lays the part ${s} out anew (${i}): ${ut}`);case"drops":return{...d(`${n} listens for dragover and not for dragenter: a drop goes where both are cancelled, and the move that enters it asks dragenter alone, so that a release then (on a card's words, its padding) drops nothing: cancel dragenter as dragover is cancelled (preventDefault)`),file:"kit.js",line:l};case"gone":return c("the page does not hold this instance");case"fallback":return c(g?"its component failed or never started: the instance shows what it holds, read-only":"the instance shows as one of no package");case"moving":return d("what it shows never holds still (an animation?), so its mounts could not be compared");case"redrawn":return c(`the component redraws its text part ${s}: ${i}. A text part is the file's, what the user types in: read it, and draw in what is the component's`);case"left":return c(`dehydrate does not leave it as the file has it, so a copy of the view would hold what the kit made of it: ${n}. ${s?`That stands in its part ${s}, which is the file's: read a part, and draw in what is the component's`:"Name what it draws in the manifest's runtime, or take it off in dehydrate"}`);case"data":return c(`a mount changes its data part ${s}, so that a page would write what the component left there, with nothing edited: read a data part, and change it by context.edit alone`);case"no-example":return d("it has a data part and its component offers no example of an edit, so nothing has tried the way back to the file: give DocKit.component an example(host, context) that makes a small context.edit");case"example":return c(`its example: ${n}`);case"refused":return c("what its example wrote cannot go in the file: a script, a handler, an address of code, data-block-id or data-ge-*, what does not read back as itself, or what is no JSON in a script of data");case"undo":return c(`with what its example wrote put back, as an undo does, it does not show what it showed: ${n}: draw from the part, and on the source signal`);case"unasked":return c(`it writes its data part ${s} with no reader's gesture, ${t}, once the page takes edits: a page would write it each time it opened. Call context.edit on a gesture alone, a press, a drop or a key, and draw what the part holds as it is`);case"piles":return c(p?`${n} piles up outside the instance on each put-back (${o.join(", then ")} of them), so an undo adds another: a component draws in its instance, and what it has to put elsewhere it takes away again in destroy`:`${n} piles up on each put-back (${o.join(", then ")} of them): it is declared in neither the manifest's runtime nor dehydrate, so an undo adds another`);default:return c(`a mount does not give the same DOM again: ${n}`)}}var ft=e=>[...new Map(e.toReversed().map(n=>[`${n.finding.kind}|${n.finding.part??""}|${["piles","example"].includes(n.finding.kind)?n.finding.what:""}|${n.finding.when??""}|${n.finding.line??""}`,n])).values()].toReversed(),mt=4e6;function We(e,n,s=(i,t)=>i===t){let[i,t]=[e.split(`
|
|
11
|
+
`),n.split(`
|
|
12
|
+
`)],o=0;for(;o<i.length&&o<t.length&&s(i[o],t[o]);)o++;let p=0;for(;p<i.length-o&&p<t.length-o&&s(i[i.length-1-p],t[t.length-1-p]);)p++;let[h,u]=[i.slice(o,i.length-p),t.slice(o,t.length-p)];if(h.length===0&&u.length===0)return[];if(h.length*u.length>mt)return[{removed:h,added:u}];let l=Array.from({length:h.length+1},()=>new Uint32Array(u.length+1));for(let c=h.length-1;c>=0;c--)for(let d=u.length-1;d>=0;d--)l[c][d]=s(h[c],u[d])?l[c+1][d+1]+1:Math.max(l[c+1][d],l[c][d+1]);let f=[],g=null;for(let c=0,d=0;c<h.length||d<u.length;)c<h.length&&d<u.length&&s(h[c],u[d])?(g=null,c++,d++):(g||f.push(g={removed:[],added:[]}),d<u.length&&(c===h.length||l[c][d+1]>=l[c+1][d])?g.added.push(u[d++]):g.removed.push(h[c++]));return f}function gt(e,n){let s=t=>t.filter(o=>o.trim()).length,i=We(e,n);return{removed:i.reduce((t,o)=>t+s(o.removed),0),added:i.reduce((t,o)=>t+s(o.added),0),lines:s(e.split(`
|
|
13
|
+
`))}}function Re(e,n){let s=0,i=0;for(let[t,o]of e.entries())if(t>0&&s>0&&s<n&&i++,s+=o.replace(/\s+/g,"").length,s>=n)break;return i}function kt(e,n){let s=i=>i.filter(t=>!t.trim()).length;for(let{removed:i,added:t}of We(e,n,(o,p)=>o.trim()===p.trim())){if(s(t)>s(i))return"a line left blank";let[o,p]=[i.join("").replace(/\s+/g,""),t.join("").replace(/\s+/g,"")],h=0;for(;h<o.length&&h<p.length&&o[h]===p[h];)h++;let u=0;for(;u<o.length-h&&u<p.length-h&&o[o.length-1-u]===p[p.length-1-u];)u++;for(let[l,f,g]of[[h,i,t],[u,i.toReversed(),t.toReversed()]]){let[c,d]=[Re(f,l)+1,Re(g,l)+1];if(c!==d)return`${c} line${c===1?"":"s"} became ${d}`}}return null}function yt(e,{source:n,found:s,at:i,findings:t}){let o=Te(n,Fe(de(n),s)[i],e.parts,new Map([[s.id,s]]));if(!o)return[{kind:"refused"}];let p=Object.keys(e.parts),h=o.map(({start:l,end:f,text:g},c)=>({name:p[c],before:n.slice(l,f),after:g}));return[{kind:"wrote",back:!t.some(({kind:l})=>l==="undo"||l==="moving"),parts:h.map(({name:l,before:f,after:g})=>({name:l,...gt(f,g)}))},...h.flatMap(({name:l,before:f,after:g})=>{let c=kt(f,g);return c?[{kind:"laid",part:l,how:c}]:[]})]}var bt=2e3;function $t({match:e,instance:n,at:s,most:i}){let t=[...document.querySelectorAll(e)].filter(o=>!o.parentElement.closest(n))[s];return t?[window,document,t,...t.querySelectorAll("*")].slice(0,i):[]}function xt(e){return e.map((n,s)=>s<2?{parent:s-1,named:""}:{parent:s===2?1:e.indexOf(n.parentElement),named:`<${n.localName}${n.classList.length?` class="${n.getAttribute("class")}"`:""}>`})}function vt(){let e=new DragEvent("dragenter",{bubbles:!0,cancelable:!0,composed:!0,dataTransfer:new DataTransfer});return this.dispatchEvent(e),e.defaultPrevented}async function jt(e,{match:n,at:s}){let i=new Map,t=({scriptId:o,url:p})=>i.set(o,p);e.on("Debugger.scriptParsed",t);try{await e.send("Debugger.enable"),await e.send("Debugger.setSkipAllPauses",{skip:!0});let{result:o}=await e.send("Runtime.evaluate",{expression:`(${$t})(${JSON.stringify({match:n,instance:pe,at:s,most:bt})})`,objectGroup:"drops"}),{result:p}=await e.send("Runtime.callFunctionOn",{objectId:o.objectId,functionDeclaration:String(xt),arguments:[{objectId:o.objectId}],returnByValue:!0}),{result:h}=await e.send("Runtime.getProperties",{objectId:o.objectId,ownProperties:!0}),u=h.filter(({name:c,value:d})=>/^\d+$/.test(c)&&d?.objectId).sort((c,d)=>Number(c.name)-Number(d.name)),l=[];for(let{value:c}of u)l.push((await e.send("DOMDebugger.getEventListeners",{objectId:c.objectId})).listeners);let f=(c,d)=>l[c]?.some(b=>b.type===d),g=[];for(let c=2;c<l.length;c++){let d=l[c].find(w=>w.type==="dragover"&&i.get(w.scriptId)==="kit.js");if(!d)continue;let b=!1;for(let w=c;w>=2&&!b;w=p.value[w].parent)b=f(w,"dragenter");if(!b&&(f(0,"dragenter")||f(1,"dragenter"))){let{result:w}=await e.send("Runtime.callFunctionOn",{objectId:u[c].value.objectId,functionDeclaration:String(vt),returnByValue:!0});b=w.value===!0}b||g.push({kind:"drops",what:p.value[c].named,line:d.lineNumber+1})}return g}finally{e.off("Debugger.scriptParsed",t),await e.send("Runtime.releaseObjectGroup",{objectGroup:"drops"}).catch(()=>{}),await e.send("Debugger.disable").catch(()=>{})}}function Tt(e,n){let s={errors:new Map,notes:new Set,failed:new Set,dialogs:new Set,windows:0,opened:[],asked:1,pending:[]},i=t=>{let[o]=t.split(`
|
|
14
|
+
`);s.errors.has(o)||s.errors.set(o,Number(/\bkit\.js:(\d+)/.exec(t)?.[1])||null)};return e.on("pageerror",t=>i(t.stack??t.message)),e.on("console",t=>{let o=t.type();!["error","warn","warning"].includes(o)||!Oe(t,n,["kit.js"])||s.pending.push(Promise.all(t.args().map(p=>p.evaluate(h=>h instanceof Error?h.stack:String(h)).catch(()=>""))).then(p=>{let h=p.join(" ")||t.text();o==="error"?i(h):s.notes.add(h.split(`
|
|
15
|
+
`)[0])}))}),e.on("requestfailed",t=>{t.frame()===e.mainFrame()&&!t.isNavigationRequest()&&s.failed.add(t.url())}),e.on("request",t=>{t.isNavigationRequest()&&t.frame()===e.mainFrame()&&s.opened.push(t.url())}),s}async function Et(e,n){let s=await e.createCDPSession();return await s.send("Page.enable"),s.on("Page.javascriptDialogOpening",({type:i})=>{n.add(i),s.send("Page.handleJavaScriptDialog",{accept:!1}).catch(()=>{})}),s}function N(e,n,s=we){let i=0,t=()=>Object.assign(new Error(n),{stuck:!0,doing:n}),o=new Promise((h,u)=>{i=setTimeout(()=>u(t()),s)}),p=e.catch(h=>{throw it.has(h.name)?t():Object.assign(h,{doing:n})});return Promise.race([p,o]).finally(()=>clearTimeout(i))}var Be=e=>new Promise(n=>{if(!e.connected)return n(!0);e.once("disconnected",()=>n(!0)),setTimeout(()=>n(!1),_e)});function St({match:e,instance:n}){let{clientWidth:s,scrollWidth:i}=document.documentElement;if(i<=s+1)return null;let t=[...document.querySelectorAll(e)].filter(o=>!o.parentElement.closest(n));return{wide:i,at:t.findIndex(o=>[o,...o.querySelectorAll("*")].some(p=>p.getBoundingClientRect().right>s+1))}}var Ce=16,Nt="#8f8f8f";async function Ot(e,n,s){let i=await Promise.all(n.map(async t=>`data:image/png;base64,${(await A.readFile(t)).toString("base64")}`));await e.setViewport({width:Q.reduce((t,o)=>t+o,0)+Ce*(Q.length-1),height:900}),await e.setContent(`<!doctype html><body style="margin: 0; display: flex; align-items: flex-start; gap: ${Ce}px; background: ${Nt}">${i.map((t,o)=>`<img src="${t}" width="${Q[o]}" alt="" style="display: block">`).join("")}</body>`,{waitUntil:"load"}),await e.screenshot({path:s,fullPage:!0})}async function At(e,{file:n,html:s,source:i,places:t,found:o,out:p,loading:h}){let u=await e.createBrowserContext(),l=await u.newPage(),f=Ie(n).href,g=Tt(l,f),c=await Et(l,g.dialogs);u.on("targetcreated",w=>{w.type()==="page"&&(g.windows+=1,w.page().then(y=>y?.close()).then(()=>l.bringToFront()).catch(()=>{}))});let d={heard:g,blocked:[],late:[],taken:[],overviews:[],edited:[],asExport:[],answers:[],wide:[],stuck:null,stopped:null,gone:null},b=async w=>d.late.push(...await N(Me(l,{timeout:Pe}),w,3*Pe+we));await Ae(l),await l.setViewport({width:736,height:900}),await l.emulateMediaFeatures([{name:"prefers-color-scheme",value:"light"}]);try{await N(l.goto(f,{waitUntil:"load",timeout:0}),"the page opened",h),await b("the page opened");for(let m of he){await N(l.emulateMediaFeatures([{name:"prefers-color-scheme",value:m}]),`the ${m} theme came`);for(let $ of Q){if(await N(l.setViewport({width:$,height:900}),`the window went to ${$}px`),await b(`it was drawn at ${$}px`),m===he[0]){let P=await N(l.evaluate(St,{match:o.match,instance:pe}),`it was measured at ${$}px`);P&&d.wide.push({width:$,...P})}let L=E.join(p,`${$}-${m}.png`);await N(l.screenshot({path:L,fullPage:!0}),`it was pictured at ${$}px`),d.taken.push(L)}}await N(l.emulateMediaFeatures([{name:"prefers-color-scheme",value:"light"}]),"the light theme came"),await N(l.setViewport({width:736,height:900}),"the window went to 736px");let w=He(s,o),y=o.files.includes("kit.js")&&Object.values(o.parts).some(({edit:m})=>m==="data");for(let m=0;m<w.length;m++){let $=await N(l.evaluate(ht,{match:o.match,instance:pe,fallback:Ke,parts:o.parts,at:m,source:w[m].markup,still:et,step:tt,times:nt,typed:at,typing:ot}),"an instance was put back"),L=$.find(({kind:R})=>R==="wrote"),P=[...$.filter(R=>R!==L),...L?yt(L,{source:i,found:o,at:m,findings:$}):[]];y&&!$.some(({kind:R})=>R==="gone"||R==="fallback")&&P.push(...await N(jt(c,{match:o.match,at:m}),"the page was asked what an instance listens to")),d.answers.push(...P.map(R=>({finding:R,place:t[m]})))}d.blocked=await N(l.evaluate(()=>globalThis.__qaViolations),"the page was asked what it blocked"),g.asked+=1,await N(l.goto(f,{waitUntil:"load",timeout:0}),"the page opened again",h),await b("the page opened again"),await N(l.evaluate(()=>dispatchEvent(new Event("doc-editable"))),"the page was told it takes edits"),await b("it was drawn as the editing page draws it");for(let m of Qe){await N(l.setViewport({width:m,height:900}),`the window went to ${m}px`),await b(`it was drawn at ${m}px as the editing page draws it`);let $=E.join(p,`edit-${m}-light.png`);await N(l.screenshot({path:$,fullPage:!0}),`it was pictured at ${m}px as the editing page draws it`),d.edited.push($),(await A.readFile($)).equals(await A.readFile(E.join(p,`${m}-light.png`)))&&d.asExport.push($)}d.blocked.push(...await N(l.evaluate(()=>globalThis.__qaViolations),"the page was asked what it blocked"));for(let m of he){let $=E.join(p,`overview-${m}.png`);await N(Ot(l,Q.map(L=>E.join(p,`${L}-${m}.png`)),$),`the ${m} pictures were put side by side`),d.overviews.push($)}}catch(w){if(w.syscall)throw w;await Be(e)?d.gone=w.doing??"the page answered":w.stuck?d.stuck=w.doing:d.stopped=ue(w)}return await Promise.race([Promise.all(g.pending),new Promise(w=>setTimeout(w,_e).unref())]),d}var Lt=(e,n)=>e.startsWith(n)?e.slice(n.length):e;function Mt(e,n,s){let i=new Map;for(let{url:t,directive:o,source:p,line:h}of e){if(st.test(t)){let l=!p&&h>0;i.set(`${t}|${p}|${h}`,{file:l?"kit.js":"the page",...l?{line:h}:{},what:"the export's policy blocks code made from words (eval, new Function, a string given to setTimeout): an export runs none"});continue}let u=/^[a-z][a-z0-9+.-]*$/.test(t)?n.filter(l=>l.startsWith(`${t}:`)):[];for(let l of u.length?u:[t])i.set(`${l}|${o}`,{file:"the page",what:`the export's policy blocks ${Lt(l,s)||"something"} (${o}): ${o==="img-src"?"a picture of an instance is a data: address, or a file its style names":"an export holds all it needs"}`})}return[...i.values()]}function Dt({heard:e,blocked:n,late:s,answers:i,wide:t,stuck:o,stopped:p},{places:h,script:u,folder:l}){let f=ft(i).map(({finding:y,place:m})=>wt(y,m,{script:u})),g=[...e.failed],c=g.filter(y=>!n.some(m=>m.url&&y.startsWith(m.url))),d=e.opened.length>e.asked?"it loads itself again (location.reload(), a new location.href), so a reader's page would not stay":o?`it stopped answering while waiting until ${o}${u?": a script that never ends, or a component that changes what it hears (a text part, on its source signal)":""}`:p&&`the look at it stopped: ${p}`,b=t.map(({width:y,wide:m})=>`${m}px wide in a ${y}px window`).join(", "),w=h[t.find(({at:y})=>y>=0)?.at]??{file:"the page"};return{problems:[...[...e.errors].map(([y,m])=>({file:m?"kit.js":"the page",line:m,what:`the console says ${y}`})),...Mt(n,g,l),...c.map(y=>({file:"the page",what:`it could not load ${y.slice(0,120)}`})),...[...e.dialogs].map(y=>({file:"the page",what:`it opens a dialog (${y}), which stops a reader's page until it is answered: show what it says in the instance`})),...e.windows?[{file:"the page",what:"it opens a window, which takes a reader away from the page: show it in the instance, or link to it"}]:[],...d?[{file:"the page",what:d}]:[],...t.length?[{...w,what:`the page is ${b}: a reader scrolls the whole page sideways, and gallery qa fails it: let it fit the window (max-width: 100%), or put what is wider in a frame of its own that scrolls`}]:[],...f.filter(({note:y,told:m})=>!y&&!m)],notes:[...[...e.notes].map(y=>({file:"the page",what:`the console says ${y}`})),...f.filter(({note:y})=>y),...s.map(y=>({file:"the page",what:`waited for ${y}`}))],told:f.filter(({told:y})=>y)}}async function Jt(e,n,{example:s,template:i},{find:t=Se,start:o=Le,loading:p=Ze}={}){let h=Xe,u=null,l=null;try{u=await A.mkdtemp(E.join(De.tmpdir(),"gallery-component-check-"));let f=await dt(n,{example:s,template:i},u),g=t();if(!g)return{title:h,unverified:"no Chrome, Edge or Chromium found (GALLERY_BROWSER=<its executable> picks one)"};try{l=await o({executablePath:g,args:Ne()})}catch(w){return{title:h,unverified:`the browser ${g} did not start, twice, each time with a fresh profile (${ue(w)}; GALLERY_BROWSER=<its executable> picks another)`}}let c=E.join(Ye(e).qa,"components",...n.id.split("/"));await A.rm(c,{recursive:!0,force:!0}),await A.mkdir(c,{recursive:!0});let d=await At(l.browser,{...f,found:n,out:c,loading:p}),b=Dt(d,{places:f.places,script:n.files.includes("kit.js"),folder:Ie(`${u}${E.sep}`).href});return d.gone?{title:h,...b,unverified:`the browser went while waiting until ${d.gone}, so it says nothing of the package`}:{title:h,...b,...d.taken.length?{pictures:{folder:c,overviews:d.overviews.map(w=>E.basename(w)),each:d.taken.map(w=>E.basename(w)),edited:d.edited.map(w=>E.basename(w)),asExport:d.asExport.map(w=>E.basename(w))}}:{}}}catch(f){return f.reason==="check"?{title:h,problems:f.failures.map(g=>({file:"the export",what:g}))}:f.syscall?{title:h,unverified:`cannot write ${Ee(f.syscall==="mkdtemp"?De.tmpdir():f.path)} (${f.code})`}:l&&await Be(l.browser)?{title:h,unverified:"the browser went before the page opened"}:{title:h,problems:[{file:"the page",what:`the look at it stopped: ${ue(f)}`}]}}finally{await l?.close(),u&&await A.rm(u,{recursive:!0,force:!0,maxRetries:5,retryDelay:200}).catch(()=>{})}}export{Xe as a,Ze as b,et as c,tt as d,ue as e,rt as f,pt as g,ut as h,gt as i,kt as j,Et as k,N as l,Be as m,Jt as n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a}from"./chunk-UH4SIXTR.mjs";import"./chunk-5L7RYZCL.mjs";export{a as _keyDefinitions};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a as e,b as i,c as r,e as p}from"./chunk-QAIHRH3I.mjs";import"./chunk-5L7RYZCL.mjs";var f=(o,t,m)=>p(o,t,m,r);export{e as Parser,f as applyExtends,i as hideBin};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a as Ge}from"./chunk-E7VYDG2X.mjs";import{A as Ut,C as Ue,F as zt,H as ze,K as qe,L as Je,M as Ve,N as qt,c as at,d as Ke,l as Pt,m as We,t as He,u as gt,w as Pe}from"./chunk-NFIBI4IP.mjs";import{b as ht,e as Ys}from"./chunk-A55HN5OK.mjs";Ys();import tn from"node:path";import{attr as w,curlyQuoted as en}from"../browser/shared/html-tree.mjs";import{FOLDED_LINES as Xe,LINE_START as Ze,NOWRAP as Jt,lineStart as sn,validFolded as nn}from"../browser/shared/code-lines.mjs";import{COLORS as on}from"../browser/shared/colors.mjs";import{FLOWS as an,isInstance as it,matchesNode as $t}from"../browser/shared/components/index.mjs";import{HEADED as ft}from"../browser/shared/components/dialog.mjs";import{pageLanguage as cn}from"../browser/shared/components/page.mjs";import{SHEETS_LABEL as Qe,shortSheets as rn}from"../browser/shared/components/sheets.mjs";import{iconValueOf as ln}from"../browser/shared/emoji/icon-value.mjs";import{escapeText as pt}from"../browser/shared/escape.mjs";import{COLUMN_GAP as fn,READING_WIDTH as St,SPAN as Ye,SPAN_SIZE as dt}from"../browser/shared/media.mjs";import{kitNamespace as ls}from"../browser/shared/old-names.mjs";import{CHART_DATA as fs,CHART_SOURCE as tt,nextChartKey as dn}from"../browser/shared/table-chart.mjs";import{BLOCK_COLORS as se}from"../browser/editor/components/colors.mjs";import{DETAILS as un,DIALOG as Xt,PAGE as mn,SECTION as hn,SHEETS as gn}from"../browser/editor/components/kit.mjs";import{DIALOG_TRIGGER as pn}from"../browser/editor/components/dialog/index.mjs";import{CHECKED as ne,FLOW as ut,TODO as Zt}from"../browser/editor/components/list/index.mjs";import{texSource as Nn}from"../browser/editor/components/math/index.mjs";import{BOX_CLASSES as On,HOSTS as $n,UNIT_KINDS as wn}from"../browser/editor/components/registry.mjs";import{HEADER_LOOK as ts}from"../browser/editor/components/table/index.mjs";import{backgroundColor as bn,parseColor as kn,textColor as Ln}from"../browser/editor/page/clipboard/import/colors.mjs";var oe=new Set(["script","style","template","textarea","noscript","code","svg","math","select","option","button","iframe","video","audio","canvas","object","picture"]),It=["doc-figure","doc-code","doc-diff","doc-math-inline","doc-math-block","doc-link-mention","doc-sheet-tabs","doc-state-fields","doc-filter-row","doc-image","doc-file","doc-bookmark","doc-embed","doc-icon","doc-title","doc-table-meta"],ae=new Set(["p","h1","h2","h3","h4","h5","h6","li","td","th","dt","dd","blockquote","figcaption","caption","summary"]),xt=new Set(["main","section","div","article","aside","blockquote","li","details","dialog"]),yn=new Set(on.map(({name:s})=>s)),C=s=>(w(s,"class")??"").split(/\s+/).filter(Boolean),es=s=>C(s).every(n=>se.includes(n)),vn=se.filter(s=>s.startsWith("doc-highlight-")),ct=s=>C(s).some(n=>!ls(n)),D=s=>s.nodeName==="#text",At=/^[\s\u200b-\u200d\u2060\ufeff]*$/,J=s=>D(s)&&At.test(s.value),L=s=>(s.childNodes??[]).filter(n=>n.tagName),Z=s=>(s.attrs??[]).map(n=>n.name),K=(s,n)=>Z(s).every(d=>n.includes(d)),Cn=[hn.match,un.match,Xt.match,gn.match,"table.doc-table"].join(", ");function ds(s){let n=C(s);return n.some(d=>It.includes(d))||Ke(s)||$t(s,Cn)||On.some(([d])=>n.includes(d))||wn.some(d=>d.class&&n.includes(d.class)&&(!d.tag||[d.tag].flat().includes(s.tagName)))}var Sn=s=>{for(let n=s.parentNode;n?.tagName&&n.tagName!=="main";n=n.parentNode)if(n.tagName==="figure")return!0;return!1},us=new Set(["thead","tbody","tfoot","tr","colgroup","col"]),ie=s=>ct(s)&&s.tagName!=="figure"&&!ae.has(s.tagName)&&!us.has(s.tagName)&&!ds(s),ms=new Set([...at].filter(s=>!["header","main","dialog","form","fieldset","caption","dd","dt","figcaption","summary","li","td","th",...us].includes(s))),xn=/\\\(([\s\S]*?)\\\)/g,Nt=s=>Nn(s)&&/\S/.test(s);function Tn(s,n=!0){let d=n?s:/^\s*(?:\\\[[\s\S]*?\\\]|\$\$[\s\S]*?\$\$)/.exec(s)?.[0]??"";return/[<>]/.test(d)&&Nt(d.replace(/</g,"\\lt ").replace(/>/g,"\\gt "))}var Qt=new Set(["br","wbr","img","input"]),hs=new Set([...at,"script","style","template","noscript","link","meta"]),gs=new Set(["input","select","textarea","button","label","option"]),En=new Set([...at,"hgroup","search","center","dir","listing","xmp","plaintext"]),Yt=s=>L(s).some(n=>En.has(n.tagName)||Yt(n)),ps=new Set(["main","section","div","article","aside","blockquote"]),In=an.join(", "),An=s=>ps.has(s.tagName)&&!ct(s)&&(C(s).length===0||$t(s,In)),et=s=>D(s)?!At.test(s.value):(s.childNodes??[]).some(et),Ns=s=>s.childNodes.some(n=>D(n)&&!At.test(n.value))&&L(s).some(n=>at.has(n.tagName)),_n=/^[ \t\n\r\f]*/;function Vt(s){let n=[],d=[];for(let u of s)u.tagName&&hs.has(u.tagName)?(n.push(d),d=[]):d.push(u);n.push(d);let p=u=>!u.tagName&&!et(u),N=u=>(D(u)||u.tagName&&!gs.has(u.tagName))&&et(u);return n.map(u=>{let O=u.findIndex(h=>!p(h));return O<0?[]:u.slice(O,u.findLastIndex(h=>!p(h))+1)}).filter(u=>u.some(N))}function jn(s){let n=[],d=p=>{for(let N of p.childNodes??[])N.tagName==="style"?n.push(N.childNodes.map(u=>u.value??"").join("")):N.tagName&&N.tagName!=="template"&&d(N)};return d(s),n.flatMap(p=>[...p.replace(/\/\*[\s\S]*?(?:\*\/|$)/g," ").matchAll(/([^{};]*)\{/g)].map(([,N])=>N))}var Bn=(s,{tags:n=[],classes:d=[]})=>{let p=[...n.map(u=>`(?<![\\w.#-])${u}`),...d.map(u=>`\\.${u}`)],N=p.length?new RegExp(`(?:${p.join("|")})(?![\\w-])`,"i"):null;return!!N&&s.some(u=>N.test(u))};function Mn(s){let n=[],d=p=>{for(let N of p.childNodes??[])N.tagName==="script"?n.push(N.childNodes.map(u=>u.value??"").join("")):N.tagName&&N.tagName!=="template"&&d(N)};return d(s),n.join(`
|
|
3
|
+
`)}var ce=["contains-task-list","task-list-item"],re=["task-list-item"],Os=["task-list-item-checkbox"],le=(s,n)=>C(s).every(d=>n.includes(d));function $s(s){let n=s.childNodes.find(d=>!J(d));return n?.tagName==="input"&&K(n,["type","checked","disabled","class"])&&w(n,"type")?.toLowerCase()==="checkbox"&&le(n,Os)&&n.sourceCodeLocation?.startTag?n:null}var ws=s=>s.tagName==="li"&&le(s,re)&&w(s,ne)===void 0&&s.sourceCodeLocation?.startTag&&$s(s),Rn=s=>s.tagName==="ul"&&le(s,ce)&&L(s).length>0&&s.childNodes.every(n=>n.tagName==="li"||J(n))&&L(s).every(ws),Dn={classes:[...new Set([...ce,...re,...Os])]},Fn=/checkbox|task-list/i,te=s=>s.tagName==="ol"&&(w(s,"data-doc-chart")==="flow"||w(s,"data-flow")!==void 0&&w(s,"data-doc-chart")===void 0),Gn=s=>s?.tagName==="ol"&&!ct(s)&&(C(s).includes(ut)||te(s)),Kn=s=>s.tagName==="li"&&Gn(s.parentNode),Et="doc-icon",Wn=s=>s.some(n=>n.tagName==="strong"||n.tagName==="b")&&s.every(n=>n.tagName==="strong"||n.tagName==="b"||D(n)&&At.test(n.value)||n.nodeName==="#comment"),Hn=/^(?:inherit|unset|currentcolor|none)$/i,Pn=/^(?:inherit|initial|unset|revert|revert-layer|transparent|none)$/i,z=s=>s.replace(/\s+/g," ").trim(),ss=/^\s*--doc-(?:table-height|span)\s*:/i;function ee(s){let n=s.replace(/\/\*[\s\S]*?(?:\*\/|$)/g," "),d=[],p="",N=0,u=0;for(let O=0;O<=n.length;O++){let h=n[O];p?h==="\\"?O++:h===p&&(p=""):h==='"'||h==="'"?p=h:h==="("?N++:h===")"?N=Math.max(0,N-1):(h===";"&&N===0||O===n.length)&&(d.push(n.slice(u,O)),u=O+1)}return d.filter(O=>O.trim())}function bs(s){let n=new Map;for(let l of ee(s)){let $=l.indexOf(":"),i=z($<0?l:l.slice(0,$)).toLowerCase();n.set(i==="background-color"?"background":i,$<0?"":z(l.slice($+1).replace(/!\s*important\s*$/i,"")))}let d=[],p=[],N,u,O=new Set,h=(l,$,i)=>{if((l==="color"?Hn:Pn).test($))return;let f=kn($);if(!f||f.a===0&&l==="color"){d.push(l);return}if(f.a===0)return;let g=i($,{nearest:!0})?.replace(/_background$/,"");if(!g||!yn.has(g)){p.push(`${l} ${$} left out: the ${l==="color"?"text's":"page's"} own is the nearest`);return}return i($)?.replace(/_background$/,"")!==g&&p.push(`${l} ${$} written as the kit's ${g}${l==="color"?"":" highlight"}`),g};for(let[l,$]of n)l==="color"?N=h(l,$,Ln):l==="background"?u=h(l,$,bn):l==="font-weight"&&/^(?:bold|bolder|[6-9]\d\d)$/i.test($)?O.add("strong"):l==="font-style"&&/^(?:italic|oblique)\b/i.test($)?O.add("em"):(l==="text-decoration"||l==="text-decoration-line")&&/^(?:(?:underline|line-through|solid)\s*)+$/i.test($)&&/underline|line-through/i.test($)?(/underline/i.test($)&&O.add("u"),/line-through/i.test($)&&O.add("s")):d.push(l);if(d.length)return{foreign:[...new Set(d)]};let y=[];N&&y.push([`<span class="doc-text-${N}">`,"</span>"]),u&&y.push([`<span class="doc-highlight-${u}">`,"</span>"]);for(let l of["strong","em","u","s"])O.has(l)&&y.push([`<${l}>`,`</${l}>`]);return{open:y.map(([l])=>l).join(""),close:y.map(([,l])=>l).reverse().join(""),notes:p}}var ns=/^(?:language|lang)-([\w#+.-]+)$/,Un=new Set(["data-language","data-lang","data-block-id"]),zn=[{name:Ze,names:[Ze,"data-start"],value:s=>sn(s)?.toString()??null,says:"the number of its first line is a whole number from 1"},{name:"data-line-numbers",names:["data-line-numbers"],value:s=>/^\s*(?:true|false)\s*$/i.test(s)?s.trim().toLowerCase():null,says:"false hides its line numbers, true shows them"},{name:Xe,names:[Xe],value:s=>nn(z(s))?z(s):null,says:"its folded lines are their numbers from 1, spaces between"}],os="data-title",as="data-wrap",qn=s=>L(s).length===1&&L(s)[0].tagName==="code"&&s.childNodes.every(n=>n.tagName||J(n))?L(s)[0]:null,Jn=new Set(["a","abbr","b","bdi","bdo","cite","code","data","del","dfn","em","font","i","ins","kbd","mark","q","s","samp","small","span","strike","strong","sub","sup","time","tt","u","var","br","wbr"]),Vn=new Set(["code","kbd","samp","tt","var"]);function ks(s){for(let n of s.childNodes){if(D(n))continue;if(!n.tagName)return"a comment in its <figcaption>";if(["img","picture","svg"].includes(n.tagName))return"a picture in its <figcaption>";if(!Jn.has(n.tagName))return`a <${n.tagName}> in its <figcaption>`;if(!n.sourceCodeLocation?.startTag||!(n.sourceCodeLocation.endTag||Qt.has(n.tagName)))return`a <${n.tagName}> not closed in its <figcaption>`;let d=ks(n);if(d)return d}return""}function is(s){let n=L(s),d=n.filter(y=>y.tagName==="pre"),p=n.filter(y=>y.tagName==="figcaption");if(!d.length)return null;let[N]=d,[u=null]=p,O=s.childNodes.find(y=>!y.tagName&&!J(y)),h=d.length>1||p.length>1||n.length>d.length+p.length?"more than the pre and one <figcaption> in its <figure>":O?D(O)?"words in its <figure> outside its caption":"a comment in its <figure>":u?Z(u).length?`its <figcaption> has an attribute of its own (${Z(u).join(", ")})`:u.sourceCodeLocation?.endTag?ks(u):"its <figcaption> is not closed in the file":"";return h?{pre:N,caption:u,why:h}:{pre:N,caption:u}}function Tt(s){let n=(s.attrs??[]).filter(({value:p})=>p.trim()),d=s.tagName==="abbr";return n.map(p=>`${p.name} ${JSON.stringify(z(p.value))} dropped: ${d&&p.name==="title"?"write the full name in the text":"write it in the text if the reader needs it"}`)}var q=s=>s.replace(/&/g,"&").replace(/"/g,""");function Xn(s){let n=new Set,d=p=>{for(let N of p.childNodes??[])if(N.tagName){for(let u of[tt,fs])w(N,u)!==void 0&&n.add(w(N,u));d(N.tagName==="template"?N.content:N)}};return d(s),n}function Zn(s){let n=new Map,d=p=>{for(let N of p.childNodes??[]){if(!N.tagName)continue;let u=w(N,"id");u!==void 0&&n.set(u,(n.get(u)??0)+1),d(N.tagName==="template"?N.content:N)}};return d(s),n}var Qn=/^[A-Za-z][\w-]{0,63}$/;function Yn(s){let n=Ge(s),d=ht(n,{sourceCodeLocationInfo:!0}),p=jt(d);if(!p)return{text:n,changes:[]};let N=[],u=[],O=t=>n.slice(0,t).split(`
|
|
4
|
+
`).length,h=(t,e,o=[],a={})=>{let c=O(t.sourceCodeLocation.startOffset);o.length||u.push({line:c,rule:e,...a});for(let r of o)u.push({line:c,rule:e,note:r,...a})},y=0,l=(t,e,o,{opens:a=null,closes:c=null,move:r=null,leaves:m=!1}={})=>N.push({start:t,end:e,text:o,order:y++,opens:a,closes:c,move:r,leaves:m}),$=(t,e,o,a)=>{l(t,t,o,{opens:e}),l(e,e,a,{closes:t})},i=t=>t.sourceCodeLocation?.startTag,f=t=>t.sourceCodeLocation?.endTag,g=(t,e,{drop:o=[]}={})=>{let a=C(t).filter(m=>!o.includes(m)),c=[...a,...e.filter(m=>!a.includes(m))],r=t.sourceCodeLocation.attrs?.class;if(c.join(" ")!==C(t).join(" "))if(r&&c.length)l(r.startOffset,r.endOffset,`class="${q(c.join(" "))}"`);else if(r)S(t,"class");else{let m=i(t).startOffset+1+t.tagName.length;l(m,m,` class="${q(c.join(" "))}"`)}},S=(t,e)=>{let o=t.sourceCodeLocation.attrs[e],a=o.startOffset;for(;/[ \t\n\r\f]/.test(n[a-1]??"");)a--;l(a,o.endOffset,"")},M=(t,e,{classes:o=[],drop:a=[]}={})=>{let c=t.sourceCodeLocation,r=Object.entries(c.attrs??{}).filter(([v])=>v!=="class"&&!a.includes(v)).map(([,v])=>` ${n.slice(v.startOffset,v.endOffset)}`).join(""),m=[...o,...C(t).filter(v=>!o.includes(v))];return`<${e}${m.length?` class="${q(m.join(" "))}"`:""}${r}>`},_,F=t=>Bn(_??=jn(d),t),Q,rt=t=>t.test(Q??=Mn(d)),W=(t,e,o)=>{l(i(t).startOffset,i(t).endOffset,e),f(t)&&l(f(t).startOffset,f(t).endOffset,o)},Bt=t=>W(t,"",""),H=t=>!!(i(t)&&(f(t)||t.tagName==="img")),de,ue=t=>{let e=w(t,"id");if(t.tagName!=="dialog"||!K(t,["id"])||!Qn.test(e??"")||!H(t))return!1;let o=L(t);return!(o.length?ms.has(o[0].tagName)&&H(o[0]):t.childNodes.some(c=>!J(c)&&c.nodeName!=="#comment"))||o.some(c=>c.tagName==="form")?!1:(de??=Zn(d),de.get(e)===1)},xs=t=>{let e=L(t)[0];return!$t(e,Xt.short)||Z(e).length?null:t.childNodes.slice(0,t.childNodes.indexOf(e)).every(J)?e:null},me=t=>t.tagName==="dialog"&&(C(t).includes("doc-dialog")||ue(t)),he=(t,e=[])=>{for(let o of t.childNodes??[])o===p||it(o)||(me(o)&&H(o)?e.push(o):he(o,e));return e},Mt=f(p)?he(d):[],ge,Ts=t=>(ge??=new Set((function e(o,a=[]){for(let c of o.childNodes??[])!c.tagName||it(c)||(me(c)&&a.push(w(c,"id")),e(c,a));return a})({childNodes:[p,...Mt]})),/^#./.test(t??"")&&ge.has(t.slice(1))),Es=t=>{let[e,...o]=L(t);if(!e||o.length||!C(e).includes("doc-dialog-panel"))return null;let[a,c,...r]=L(e);if(r.length||!a||!c||!C(a).includes(ft.header)||!C(c).includes("doc-dialog-content"))return null;let m=x=>x.childNodes.some(A=>!A.tagName&&!J(A)&&A.nodeName!=="#comment");if(m(e)||m(a)||!H(a)||!i(c))return null;let v=L(a),k=v.filter(x=>C(x).includes(ft.title)),E=v.filter(x=>!k.includes(x)),I=x=>(C(x).includes(ft.close)||w(x,ft.closeAttribute)!==void 0)&&H(x);return k.length!==1||!H(k[0])||E.length>1||!E.every(I)?null:{header:a,title:k[0],close:E[0]??null,content:c}},mt,pe=(t,e=[])=>{for(let o of t.childNodes??[])if(o.tagName){for(let{name:a,value:c}of o.attrs)a!=="id"&&a!=="class"&&e.push(c);(o.tagName==="script"||o.tagName==="style")&&e.push(o.childNodes.map(a=>a.value??"").join("")),pe(o,e)}return e},Is=(t,e)=>{mt??=pe(d).join(`
|
|
5
|
+
`);let o=0;for(let a=mt.indexOf(t);a>=0;a=mt.indexOf(t,a+t.length))!/[\w-]/.test(mt[a-1]??"")&&!/[\w-]/.test(mt[a+t.length]??"")&&o++;return o>(e?1:0)};function As(t){let e=Es(t);if(!e)return;let{header:o,title:a,close:c,content:r}=e,m=w(a,"id"),v=!!m&&w(t,"aria-labelledby")?.trim()===m;v&&S(t,"aria-labelledby"),l(i(o).startOffset,i(o).endOffset,n.slice(i(r).startOffset,i(r).endOffset));let k=i(a).startOffset+1;l(k,k+a.tagName.length,"h3"),g(a,[],{drop:[ft.title]}),m!==void 0&&!(m&&Is(m,v))&&S(a,"id"),l(f(a).startOffset,f(a).endOffset,"</h3>"),c&&l(c.sourceCodeLocation.startOffset,c.sourceCodeLocation.endOffset,""),l(f(o).startOffset,f(o).endOffset,""),l(i(r).startOffset,i(r).endOffset,"")}let Ne=t=>{for(let e of t.childNodes??[])it(e)||(e.tagName&&$t(e,Xt.match)&&As(e),Ne(e))},Rt=new Set;function Oe(t){let e=t.tagName;if(!H(t))return!1;let o=[];if(e==="mark"&&K(t,[]))W(t,'<span class="doc-highlight-yellow">',"</span>");else if((e==="del"||e==="strike")&&K(t,["cite","datetime"]))W(t,"<s>","</s>"),o=Tt(t);else if(e==="ins"&&K(t,["cite","datetime"]))W(t,"<u>","</u>"),o=Tt(t);else{if(["kbd","samp","tt","var"].includes(e)&&K(t,[]))return W(t,"<code>","</code>"),Rt.add(t),h(t,e),!0;if(e==="a"&&K(t,["href"])&&Ts(w(t,"href")))return g(t,[pn]),h(t,"dialog link"),!1;if(e==="small"&&K(t,[]))W(t,'<span class="doc-text-gray">',"</span>");else if(e==="q"&&K(t,["cite"]))W(t,"\u201C","\u201D"),o=Tt(t);else if(["abbr","cite","dfn","time","bdi","data"].includes(e)&&K(t,["title","datetime","value"]))Bt(t),o=Tt(t);else if(e==="span"&&K(t,[])||e==="font"&&K(t,["color"])&&!w(t,"color")?.trim())Bt(t);else if(e==="span"&&K(t,["style"])||e==="font"&&K(t,["color"])){let a=bs(e==="span"?w(t,"style")??"":`color: ${w(t,"color")}`);if(a.foreign)return!1;W(t,a.open,a.close),o=a.notes}else return!1}return Rt.add(t),h(t,e,o),!1}function _s(t){let{startOffset:e,endOffset:o}=t.sourceCodeLocation,a=n.slice(e,o);for(let c of a.matchAll(xn))$(e+c.index,e+c.index+c[0].length,'<span class="doc-math-inline">',"</span>"),u.push({line:O(e+c.index),rule:"formula"})}let $e=t=>L(t).every(e=>Rt.has(e)?$e(e):Ue(e));function js(t,e){let o=Ut(e);if(!o||t.tagName!==$n[o].takes||!H(e)||!H(t)||Z(t).length>0||!e.childNodes.every(r=>r===t||J(r))||!$e(t))return;let a=n.slice(i(e).endOffset,i(t).startOffset)+n.slice(f(t).endOffset,f(e).startOffset);l(i(e).endOffset,i(t).endOffset,""),l(f(t).startOffset,f(e).startOffset,"");let c=a.split(`
|
|
6
|
+
`).length-1;c>0&&l(f(e).endOffset,f(e).endOffset,lt.repeat(c)),h(e,o)}let Dt=new Set,we=new Set;function wt(t,e=()=>!1){for(let o of Vt(t)){if(!o.every(k=>k.tagName?i(k)&&(f(k)||Qt.has(k.tagName))&&!Yt(k):k.sourceCodeLocation))continue;let a=o[0].sourceCodeLocation.startOffset,c=o.at(-1).sourceCodeLocation.endOffset,r=n.slice(a,c),m=a+_n.exec(r)[0].length,v=c-/[ \t\n\r\f]*$/.exec(r)[0].length;if(o.every(D)&&Nt(n.slice(m,v)))$(m,v,'<div class="doc-math-block">',"</div>"),u.push({line:O(m),rule:"display formula"}),o.forEach(k=>we.add(k));else if(e(o)){let k=Wn(o);$(m,v,k?"<p>":"<p><strong>",k?"</p>":"</strong></p>"),u.push({line:O(m),rule:"step title",...ke(o[0].parentNode)}),o.forEach(E=>Dt.add(E))}else $(m,v,"<p>","</p>"),u.push({line:O(m),rule:"loose words"}),o.forEach(k=>Dt.add(k))}}let Bs=t=>t[0].parentNode.childNodes.slice(0,t[0].parentNode.childNodes.indexOf(t[0])).every(e=>!e.tagName||C(e).includes(Et)),be=new Set,ke=t=>be.has(t.parentNode)?{}:(be.add(t.parentNode),{note:"a step's own words written as its title, the first block of its node: <li><p><strong>\u2026</strong></p> then its content (a paragraph, a list\u2026)</li>"}),Ms=t=>{if(wt(t.childNodes,Bs),t.childNodes.filter(c=>c.tagName&&!C(c).includes(Et)).length>0||Vt(t.childNodes).length>0||!i(t)||!f(t))return;let a=t.childNodes.filter(c=>c.tagName).at(-1)?.sourceCodeLocation?.endOffset??i(t).endOffset;l(a,a,"<p></p>"),u.push({line:O(a),rule:"step title",...ke(t)})},Ft,Le=()=>{Ft??=Xn(d);let t=dn(Ft);return Ft.add(t),t},Rs=(t,e)=>`<div data-doc-chart="${q(w(t,"data-doc-chart"))}" ${fs}="${q(e)}"></div>`,lt=n.includes(`\r
|
|
7
|
+
`)?`\r
|
|
8
|
+
`:`
|
|
9
|
+
`,ye=t=>/^[ \t]*/.exec(n.slice(n.lastIndexOf(`
|
|
10
|
+
`,t-1)+1))[0];function ve(t,e,o,a=null){let c=Ce(t),r=c?gt(n,c.sourceCodeLocation.startOffset,c.sourceCodeLocation.endOffset):null,m=!!r&&(r.start!==c.sourceCodeLocation.startOffset||r.end!==c.sourceCodeLocation.endOffset),v=c?{from:i(c).endOffset,to:f(c).startOffset}:null,k=A=>`<figure class="doc-figure">${A?`<h3>${A}</h3>`:""}${Rs(t,o)}</figure>`,E=A=>v?A:A(""),I=m?`${lt}${ye(i(e).startOffset)}`:"",x=!!(a??f(e));if(x){let A=a?f(t).endOffset:f(e).endOffset;l(A,A,E(G=>`${a??""}${I}${k(G)}`),{closes:i(e).startOffset,move:v}),u.push({line:O(A),rule:"chart",key:o})}else l(i(e).startOffset,i(e).startOffset,E(A=>`${k(A)}${I}`),{opens:i(e).endOffset,move:v}),u.push({line:O(i(e).startOffset),rule:"chart",key:o});return r&&l(r.start,r.end,""),x&&!!a}let[Ds]=ts,Ce=t=>{let e=t.childNodes.find(o=>!J(o));return e?.tagName!=="caption"||!H(e)||Z(e).length>0||!et(e)||!e.childNodes.every(o=>D(o)||o.tagName&&!hs.has(o.tagName)&&!gs.has(o.tagName)&&!Yt(o))||e.childNodes.every(D)&&Nt(n.slice(i(e).endOffset,f(e).startOffset))||F({tags:["caption"]})?null:e},Fs=t=>{let e=w(t,"rowspan");return e===void 0||/^\s*\d+\s*$/.test(e)&&Number(e)===1};function Gs(t){let e=L(t).filter(m=>["thead","tbody","tfoot"].includes(m.tagName)),o=e.flatMap(m=>L(m)).flatMap(m=>L(m)).filter(m=>m.tagName==="th"&&i(m)),a=!F({tags:["th","thead"]});if(a)for(let m of o)g(m,se.some(v=>C(m).includes(v))?[Ds]:ts);let c=a||!o.length?[]:["its th as written (no header look, no thead): the document's own <style> styles th"],r=m=>m.length>0&&m.every(v=>v.tagName==="tr"&&H(v));for(let m of e){let v=L(m);if(m.tagName!=="tbody"||!r(v))continue;let[k,...E]=v,I=a&&e.length===1&&E.length>0&&L(k).length>0&&L(k).every(G=>G.tagName==="th"&&Fs(G)),x=i(m);if(x){if(!I||!f(m))continue;l(x.startOffset,x.endOffset,"<thead>"),l(k.sourceCodeLocation.endOffset,k.sourceCodeLocation.endOffset,`</thead>${n.slice(x.startOffset,x.endOffset)}`),h(k,"header row");continue}I&&($(k.sourceCodeLocation.startOffset,k.sourceCodeLocation.endOffset,"<thead>","</thead>"),h(k,"header row"));let A=I?E:v;$(A[0].sourceCodeLocation.startOffset,A.at(-1).sourceCodeLocation.endOffset,"<tbody>","</tbody>")}return c}let Gt,Ks=()=>{Gt??=(function e(o,a=new Set){for(let c of o.childNodes??[])c.tagName&&(w(c,"data-doc-sheets")!==void 0&&a.add(w(c,"data-doc-sheets")),e(c.tagName==="template"?c.content:c,a));return a})(d);let t=1;for(;Gt.has(`tabs-${t}`);)t++;return Gt.add(`tabs-${t}`),`tabs-${t}`},Se=new Set,Ws=t=>{let e=[],o=c=>c.childNodes.map(r=>D(r)?r.sourceCodeLocation?n.slice(r.sourceCodeLocation.startOffset,r.sourceCodeLocation.endOffset):r.value:r.tagName?(i(r)&&e.push(z(n.slice(i(r).startOffset,i(r).endOffset))),r.tagName==="br"?" ":o(r)):"").join(""),a=c=>c.childNodes.map(r=>D(r)?r.value:r.tagName==="br"?" ":r.tagName?a(r):"").join("");return{raw:z(o(t)),plain:z(a(t)),left:[...new Set(e)]}},Hs=(t,e,o)=>{let a=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,48).replace(/-+$/,"")||`tab-${e+1}`,c=a;for(let r=2;o.has(c);r++)c=`${a}-${r}`;return o.add(c),c};function Ps(t,e){let o=cn(n),a=Qe[o]??Qe.zh,c=w(t,"data-doc-sheets")?.trim()?null:Ks(),r=new Set,m=[],v=e.map(({section:E,heading:I},x)=>{let{raw:A,plain:G,left:Y}=Ws(I),st=Hs(G,x,r);Z(I).length&&m.push(`${Z(I).join(", ")} of the heading "${G}" left out: a tab is its name alone`);for(let nt of Y)m.push(`${nt} in the heading "${G}" left out: a tab's name is plain text`);W(E,`<div data-doc-sheet="${st}">`,"</div>"),Se.add(I);let{startOffset:V,endOffset:X}=I.sourceCodeLocation,U=gt(n,V,X);return l(U.start,U.end,lt.repeat(n.slice(U.start,U.end).split(`
|
|
11
|
+
`).length-1)),Pe({sheet:st,title:A})}),k=M(t,t.tagName,{classes:["doc-sheet-shell"],drop:c?["data-doc-sheets"]:[]});c&&(k=k.replace(/>$/,` data-doc-sheets="${c}">`)),w(t,"aria-label")===void 0&&(k=k.replace(/>$/,` aria-label="${a}">`)),l(i(t).startOffset,i(t).endOffset,`${k}<div class="doc-sheet-tabs" aria-label="${a}">${v.join("")}</div>`),h(t,"sheets",m)}let Us=t=>{let e=L(t)[0];return L(t).length===1&&e.tagName==="a"&&C(e).join(" ")==="doc-bookmark"&&K(e,["class","href","title","target","rel"])&&!!w(e,"href")?.trim()&&H(e)&&e.childNodes.every(D)&&t.childNodes.every(o=>o===e||J(o))};function zs(t){let e=L(t)[0],o=w(e,"href").trim(),a=z(w(e,"title")??""),c=o;try{c=new URL(o).hostname||o}catch{}let r=[],m=w(e,"target");m!==void 0&&m.trim()!=="_blank"&&r.push(`target ${JSON.stringify(z(m))} left out: a bookmark opens its page in a new tab`);let v=w(e,"rel");v!==void 0&&v.split(/\s+/).some(I=>I&&!["noopener","noreferrer"].includes(I.toLowerCase()))&&r.push(`rel ${JSON.stringify(z(v))} left out: a bookmark's link is rel="noopener noreferrer"`),l(i(t).startOffset,i(t).endOffset,M(t,"figure",{classes:["doc-bookmark"]}));let k=et(e)?"":pt(c);l(i(e).startOffset,i(e).endOffset,`<a class="doc-bookmark-card" href="${q(o)}" target="_blank" rel="noopener noreferrer"><span class="doc-bookmark-text"><span class="doc-bookmark-title">${k}`);let E=a?`<span class="doc-bookmark-description">${pt(a)}</span>`:"";l(f(e).startOffset,f(e).endOffset,`</span>${E}<span class="doc-bookmark-url"><span class="doc-bookmark-href">${pt(o)}</span></span></span></a>`),l(f(t).startOffset,f(t).endOffset,"<figcaption></figcaption></figure>"),h(t,"bookmark",r)}let qs=t=>{let e=t?.parentNode;if(!t?.tagName||!C(t).includes("doc-column")||!e?.tagName||!C(e).includes("doc-columns"))return null;let o=r=>Number(/--doc-column-ratio\s*:\s*(\d*\.?\d+)/i.exec(w(r,"style")??"")?.[1]??1)||1,a=L(e).filter(r=>C(r).includes("doc-column")),c=a.reduce((r,m)=>r+o(m),0);return(St-fn*(a.length-1))/St*(o(t)/c)},Kt=(t,e,o)=>{let a=w(t,"width"),c=/^\s*(\d+(?:\.\d+)?)\s*(px|%)?\s*$/i.exec(a??""),r=(e?w(e,"style")??"":"").trim().replace(/;\s*$/,""),m=t.sourceCodeLocation.attrs?.width;if(!c||!m||/--doc-span\s*:/i.test(r))return null;let v=c[2]==="%",k=v?qs(o):null,E=v?Number(c[1])/100*(k??1):Number(c[1])/St,I=Math.round(Math.min(dt.max,Math.max(dt.min,E))*1e3)/1e3,x=m.startOffset;for(;/[ \t\n\r\f]/.test(n[x-1]??"");)x--;l(x,m.endOffset,"");let A=E<dt.min||E>dt.max?`, within ${dt.min} to ${dt.max}`:"",G=v?k===null?"a share of the width it stands in":`a share of the width it stands in, its column ${Math.round(k*1e3)/1e3} of the reading width`:`${Number(c[1])}px of the ${St}px reading width`;return{attribute:` style="${q(`${r?`${r}; `:""}${Ye}: ${I}`)}"`,note:`width="${a}" written as ${Ye}: ${I} on its figure (${G}${A}; at most the width it stands in)`}},Wt=(t,e)=>{let o=t?M(t,"figure",{classes:["doc-image"],drop:e?.attribute?["style"]:[]}):'<figure class="doc-image">';return e?.attribute?`${o.slice(0,-1)}${e.attribute}>`:o},Js=t=>L(t).filter(e=>e.tagName==="img").length===1&&L(t).every(e=>e.tagName==="img"||e.tagName==="figcaption")&&t.childNodes.every(e=>e.tagName||J(e)),Vs=t=>L(t).length===1&&L(t)[0].tagName==="img"&&t.childNodes.every(e=>e.tagName||J(e)),Xs=t=>t.childNodes.length>0&&t.childNodes.every(D)&&Nt(n.slice(i(t).endOffset,f(t).startOffset)),xe=new Set,Te=()=>F(Dn)||rt(Fn),Ee=t=>Rn(t)&&!Te();function Ie(t,e=null,o=null,a=[]){let c=qn(t),r=[t,c].filter(Boolean),m=[e,...r].filter(Boolean),v=r.flatMap(C).map(b=>ns.exec(b)?.[1]).find(Boolean)??m.map(b=>w(b,"data-language")??w(b,"data-lang")).find(Boolean),k=b=>m.find(T=>T.sourceCodeLocation.attrs?.[b]),E=(b,T)=>{let B=b?.sourceCodeLocation.attrs[T];return B?` ${n.slice(B.startOffset,B.endOffset)}`:""},I=k("id"),x=[...a],A=new Map(m.map(b=>[b,new Set])),G=b=>b.flatMap(T=>m.filter(B=>w(B,T)!==void 0).map(B=>(A.get(B).add(T),{element:B,name:T,value:w(B,T)}))),Y=(b,T)=>x.push(`${b.name} ${JSON.stringify(z(b.value))} left out (its <${b.element.tagName}>'s): ${T}`),st=zn.flatMap(({name:b,names:T,value:B,says:P})=>{let ot=G(T),R=ot.find(j=>B(j.value)!==null);for(let j of ot)j!==R&&Y(j,B(j.value)===null?P:`the block takes its <${R.element.tagName}>'s ${R.name}`);return R?[` ${b}="${q(B(R.value))}"`]:[]}),V=G([as]),X=V.find(b=>/^\s*(?:true|false)\s*$/i.test(b.value));for(let b of V)b!==X&&Y(b,X?`the block takes its <${X.element.tagName}>'s ${as}`:"false keeps its long lines on one line (they scroll), true wraps them");let U=X?X.value.trim().toLowerCase()==="false":r.some(b=>C(b).includes(Jt)),nt=r.flatMap(C).find(b=>vn.includes(b)),je=G([os]),Lt=o?null:je[0],Be=Lt?pt(z(Lt.value)):"";for(let b of je)b!==Lt&&Y(b,o?"its caption is its title":`the block takes its <${Lt.element.tagName}>'s ${os}`);let Me=b=>Object.keys(b.sourceCodeLocation.attrs??{}).filter(T=>T!=="class"&&!Un.has(T)&&!(T==="id"&&b===I)&&!A.get(b).has(T)),Re=b=>{let T=C(b).filter(j=>!ns.test(j)&&j!==Jt&&j!==nt),B=Me(b),ot=(b.attrs.find(j=>j.name==="style")?.value??"").split(";").map(j=>j.trim()).filter(Boolean).every(j=>/^--doc-code-height\s*:/i.test(j)),R=[...T.length?[`class ${JSON.stringify(T.join(" "))}`]:[],...B.filter(j=>!(j==="style"&&ot))];return R.length&&x.push(`${R.join(", ")} kept on its <${b.tagName}>`),`<${b.tagName}${T.length?` class="${q(T.join(" "))}"`:""}${B.map(j=>E(b,j)).join("")}>`},Ht=e?Me(e):[],De=`<div class="doc-code${U?` ${Jt}`:""}${nt?` ${nt}`:""}"${E(I,"id")}${E(k("data-block-id"),"data-block-id")}${v?` data-language="${q(v.toLowerCase())}"`:""}${st.join("")}${Ht.map(b=>E(e,b)).join("")}>`;Ht.length&&x.push(`${Ht.join(", ")} kept on the block (its <figure>'s)`);let Fe=Re(t),yt=b=>c?`${b}${Fe}`:`${b}${Fe}<code>`,vt=c&&H(c)?"</pre>":"</code></pre>",Ct=b=>`<div class="doc-code-title">${b}</div>`;if(!e)W(t,yt(`${De}${Ct(Be)}`),`${vt}</div>`);else if(W(e,De,"</div>"),!o)W(t,yt(Ct(Be)),vt);else{let{startOffset:b,endOffset:T}=o.sourceCodeLocation,B={from:i(o).endOffset,to:f(o).startOffset},P=R=>R.replace(/[ \t\n\r\f]+/g," ").trim(),ot=(R,j)=>n.slice(R,j).split(`
|
|
12
|
+
`).length-1;if(b<t.sourceCodeLocation.startOffset)l(b,T,R=>`${Ct(P(R))}${lt.repeat(ot(b,T))}`,{move:B}),W(t,yt(""),vt);else{let R=gt(n,b,T),j=ot(R.start,R.end),Zs=j?`${lt.repeat(j)}${ye(i(t).startOffset)}`:"";l(i(t).startOffset,i(t).endOffset,Qs=>yt(`${Ct(P(Qs))}${Zs}`),{move:B}),l(R.start,R.end,""),f(t)&&l(f(t).startOffset,f(t).endOffset,vt)}}if(c&&Z(c).length&&l(i(c).startOffset,i(c).endOffset,Re(c)),o){let b=new Set,T=B=>{for(let P of L(B))(!Vn.has(P.tagName)||Z(P).length)&&b.add(z(n.slice(i(P).startOffset,i(P).endOffset))),Qt.has(P.tagName)?l(i(P).startOffset,i(P).endOffset,P.tagName==="br"?" ":""):(Bt(P),T(P))};T(o);for(let B of b)x.push(`${B} in its caption left out: a code block's title is plain text`)}h(e??t,"code",x)}function Ae(t,e){let o=t.tagName;if(!H(t))return!1;if((o==="p"||o==="div"&&C(t).length===0)&&Xs(t))return W(t,M(t,"div",{classes:["doc-math-block"]}),"</div>"),h(t,"display formula"),!0;if(o==="figure"&&C(t).length===0&&Js(t)){let r=Kt(L(t).find(m=>m.tagName==="img"),t,e);return l(i(t).startOffset,i(t).endOffset,Wt(t,r)),L(t).some(m=>m.tagName==="figcaption")||l(f(t).startOffset,f(t).startOffset,"<figcaption></figcaption>"),h(t,"figure",r?[r.note]:[]),!0}if(o==="img"&&xt.has(e?.tagName)){let r=Kt(t,null,e);return $(i(t).startOffset,i(t).endOffset,Wt(null,r),"<figcaption></figcaption></figure>"),h(t,"picture",r?[r.note]:[]),!0}if(o==="p"&&xt.has(e?.tagName)&&Us(t))return zs(t),!0;if(w(t,"data-doc-sheets")!==void 0){let r=rn(t)?.tabs;return r&&Ps(t,r),!1}if(o==="p"&&Vs(t)){let r=Kt(L(t)[0],t,e);return W(t,Wt(t,r),"<figcaption></figcaption></figure>"),h(t,"picture",r?[r.note]:[]),!0}let a=o==="figure"&&C(t).length===0?is(t):null;if(a&&!a.why&&H(a.pre))return Ie(a.pre,t,a.caption),!0;if(o==="pre"&&!C(e??{}).includes("doc-code")){let m=e?.tagName==="figure"&&C(e).length===0&&L(e).some(k=>k.tagName==="figcaption")?is(e):null,v=m?.pre===t?m.why:"";return Ie(t,null,null,v?[`its <figure>'s caption stays a caption beside it: ${v}; a <figure> holding the pre and one <figcaption> of words alone makes them its title`]:[]),!0}if(o==="figure")return!xt.has(e?.tagName)||Sn(t)?!0:(g(t,["doc-figure"]),h(t,"figure"),ct(t));let c=o==="table"&&C(e??{}).includes("doc-table-wrap");if(o==="table"&&w(t,"data-doc-chart")!==void 0&&!xt.has((c?e.parentNode:e)?.tagName))return!1;if(o==="table"&&w(t,"data-doc-chart")!==void 0&&c&&i(e)){let r=w(e,tt)??Le();if(ve(t,e,r),w(e,tt)===void 0){let m=i(e).endOffset-1;l(m,m,` ${tt}="${q(r)}"`)}return l(i(t).startOffset,i(t).endOffset,M(t,"table",{drop:["data-doc-chart"]})),!1}if(o==="table"&&(!ct(t)||ds(t))&&!C(e??{}).includes("doc-table-wrap")){let r=t.sourceCodeLocation.attrs?.["data-block-id"],m=w(t,"data-doc-chart")!==void 0,k=(w(t,tt)?.trim()||null)??(m?Le():null),E=w(t,"style"),I=E===void 0?[]:ee(E).filter(U=>ss.test(U)),x=I.length?ee(E).filter(U=>!ss.test(U)):[],A=U=>` style="${q(U.map(nt=>nt.trim()).join("; "))}"`,G=`<div class="doc-table-wrap"${r?` ${n.slice(r.startOffset,r.endOffset)}`:""}${k?` ${tt}="${q(k)}"`:""}${I.length?A(I):""}>`,Y=M(t,"table",{classes:["doc-table"],drop:["data-block-id",...w(t,tt)!==void 0?[tt]:[],...m?["data-doc-chart"]:[],...I.length?["style"]:[]]}),st=x.length?`${Y.slice(0,-1)}${A(x)}>`:Y,V=m?null:Ce(t),X=!1;if(m&&(X=ve(t,t,k,"</div>")),V){let U=n.slice(i(t).endOffset,V.sourceCodeLocation.startOffset);l(i(t).startOffset,i(V).endOffset,'<p class="doc-note">'),l(f(V).startOffset,f(V).endOffset,`</p>${U}${G}${st}`),h(V,"caption")}else l(i(t).startOffset,i(t).startOffset,G,{opens:f(t).endOffset}),l(i(t).startOffset,i(t).endOffset,st);return X||l(f(t).endOffset,f(t).endOffset,"</div>",{closes:i(t).startOffset}),h(t,"table",Gs(t)),!1}if(o==="details"&&es(t)){let r=L(t)[0]?.tagName==="summary"?L(t)[0]:null;return!r||!H(r)||(l(i(t).startOffset,i(t).endOffset,M(t,"details",{classes:["doc-details"]})),L(r).some(m=>C(m).includes("doc-details-summary-label"))||$(i(r).endOffset,f(r).startOffset,'<span class="doc-details-summary-label">',"</span>"),$(f(r).endOffset,f(t).startOffset,'<div class="doc-details-content">',"</div>"),wt(t.childNodes.slice(t.childNodes.indexOf(r)+1)),h(t,"details")),!1}if(o==="dialog"&&ue(t)){let r=xs(t);return l(i(t).startOffset,i(t).endOffset,M(t,"dialog",{classes:["doc-dialog"]})),$(i(t).endOffset,f(t).startOffset,'<div class="doc-dialog-panel"><div class="doc-dialog-content">',"</div></div>"),r&&W(r,"<h3>","</h3>"),wt(t.childNodes.slice(r?t.childNodes.indexOf(r)+1:0)),h(t,"dialog"),!1}if(o==="aside"&&es(t)&&!F({tags:["aside"]}))return g(t,["doc-panel"]),xe.add(t),h(t,"aside"),!1;if(o==="ul"&&Ee(t)){g(t,[Zt],{drop:ce});for(let r of L(t))_e(r);return h(t,"task list"),!1}if(te(t)&&!ct(t))return l(i(t).startOffset,i(t).endOffset,M(t,"ol",{classes:[ut],drop:["data-doc-chart","data-flow"]})),h(t,"flowchart"),!1;if(o==="ul"&&C(t).includes(Zt)&&!ct(t)){let r=L(t).filter(ws);if(r.length&&!Te()){for(let m of r)_e(m);h(t,"task list")}return!1}return!1}function _e(t){let e=$s(t);if(g(t,[],{drop:re}),w(e,"checked")!==void 0){let c=i(t).startOffset+1+t.tagName.length;l(c,c,` ${ne}`)}let{startOffset:o,endOffset:a}=e.sourceCodeLocation;l(o,a+(n[a]===" "?1:0),"")}function bt(t,e=null,o=!1){An(t)&&(Ns(t)||xe.has(t)&&Vt(t.childNodes).length>0)?wt(t.childNodes):Kn(t)&&i(t)&&Ms(t);for(let a of t.childNodes??[]){if(D(a)){a.sourceCodeLocation&&a.value.includes("\\(")&&!we.has(a)&&_s(a);continue}if(!(!a.tagName||oe.has(a.tagName)||Se.has(a)||it(a))&&!(w(a,"data-doc-chart")!==void 0&&a.tagName!=="table"&&!te(a)||w(a,"contenteditable")!==void 0)&&!C(a).some(c=>It.includes(c))){if(a.tagName==="pre"){Ae(a,t);continue}if(!(ie(a)&&!Ee(a))){if(Dt.has(a)){Oe(a)||bt(a,a,!0);continue}Ae(a,t)||o&&Oe(a)||(bt(a,a,o||ae.has(a.tagName)),js(a,t))}}}}bt(p,p),bt({childNodes:Mt}),n.includes(ft.header)&&Ne(d);for(let t of Mt){let{startOffset:e,endOffset:o}=t.sourceCodeLocation,a=gt(n,e,o),c=f(p).startOffset,r=a.end>o?He(n,c):null;l(c,c,m=>r===null?m:`${m}${lt}${r}`,{move:{from:e,to:o}}),l(a.start,a.end,"",{leaves:!0}),h(t,"card outside main")}if(!N.length)return{text:n,changes:[]};let kt=N;for(let t of N.filter(e=>e.move)){let{from:e,to:o}=t.move,a=kt.filter(c=>!c.move&&!c.leaves&&c.start>=e&&c.end<=o);kt=kt.filter(c=>!a.includes(c)),t.text=t.text(cs(n.slice(e,o),a,e)),t.move=null}return{text:cs(n,kt),changes:u.sort((t,e)=>t.line-e.line)}}function cs(s,n,d=0){let p=h=>h.closes!==null?0:h.opens!==null?2:1,N=(h,y)=>p(h)-p(y)||(h.closes!==null?y.closes-h.closes||y.order-h.order:0)||(h.opens!==null?y.opens-h.opens:0)||h.order-y.order,u=[...n].sort((h,y)=>y.start-h.start||y.end-h.end||(h.start===h.end?N(y,h):y.order-h.order)),O=s;for(let{start:h,end:y,text:l}of u)O=O.slice(0,h-d)+l+O.slice(y-d);return O}function Ls(s,{finish:n=d=>d}={}){let{text:d,changes:p}=Yn(s);return{text:p.length?n(d):d,changes:p}}function jo(s,{finish:n,next:d,metadata:p=null}={}){let N=qt(s);if(N.length)return{text:s,changes:[],added:0,given:[],repeated:N,title:null,icon:null};let u=Ls(s,{finish:n}),{text:O,added:h,given:y}=qe(u.text,d),l=to(O,p);return{...l,changes:u.changes,added:h,given:Ve(l.text,y),repeated:N}}function Bo(s){return qt(s).length?[]:Je(Ls(s).text)}function to(s,n=null){let d=ht(s,{sourceCodeLocationInfo:!0}),p=jt(d),N=p&&Ot(p,l=>$t(l,mn.title)),u=N?.sourceCodeLocation?.endTag?Pt(s.slice(N.sourceCodeLocation.startTag.endOffset,N.sourceCodeLocation.endTag.startOffset)):"",O=s,h=null;if(u){let l=Ot(d,S=>S.tagName==="head"),i=(l&&Ot(l,S=>S.tagName==="title"))?.sourceCodeLocation,f=typeof n?.title=="string"?n.title:null,g=!1;if(i?.startTag&&i.endTag){let S=Pt(s.slice(i.startTag.endOffset,i.endTag.startOffset));if(!(f&&f!==u&&f.includes(u)?S.split(f).join("\0").includes(u):S.includes(u))){let _=f&&f!==u&&We(s,{from:f,to:u})||{start:i.startTag.endOffset,end:i.endTag.startOffset,text:pt(u)};O=s.slice(0,_.start)+_.text+s.slice(_.end),g=!0}}(g||f!==null&&f!==u)&&(h={from:f,to:u,page:g})}let y=null;if(p&&n&&typeof n=="object"){let l=ze(s),$=l.units.find(g=>g.kind==="icon"&&l.boxes[g.box]?.kind==="header"),i=$?ln(s.slice($.start,$.end)):null,f=n.icon??null;$?i!==null&&i!==f&&(y={from:f,to:i}):y=f===null?null:{from:f,to:f,missing:!0}}return{text:O,title:h,icon:y}}function Mo(s,n,{dryRun:d=!1,pending:p=!1,reread:N=!d&&!p}={}){let u=new Map;for(let{rule:y,line:l}of n)u.set(y,[...new Set([...u.get(y)??[],l])]);let O=[...u].map(([y,l])=>`${y} (line${l.length>1?"s":""} ${l.join(", ")})`).join(", "),h=tn.resolve(s);return[p?`natural ${h}: ${O} not rewritten yet: the export rewrites them in this file as the kit's markup (nothing to fix)`:`natural ${h}: ${O}${d?" would be":""} rewritten in this file as the kit's markup (nothing to fix)`,...n.filter(y=>y.note).map(({line:y,rule:l,note:$})=>` line ${y}, ${l}: ${$}`),...N?[" re-read the file before editing it"]:[]]}var rs="strong, em, b, i, u, s, code, a, sub, sup and br, the kit's colors (doc-text-*, doc-highlight-*) and formulas",fe=`write a to-do list as ul.${Zt} \u203A li, li[${ne}] for a checked item (a GFM task list, every item starting with its box, is made one unless the document's own style or script uses GFM's classes or the boxes)`,ys=s=>C(s).every(ls),vs=s=>L(s).flatMap(n=>[...n.tagName==="span"&&!(K(n,["class"])&&ys(n))?[n]:[],...vs(n)]),Cs=s=>L(s).some(n=>n.tagName==="img"||Cs(n)),Ss=s=>L(s).some(n=>n.tagName==="svg"||n.tagName==="canvas"||Ss(n)),_t=s=>L(s).some(n=>n.tagName==="input"&&w(n,"type")?.toLowerCase()==="checkbox"||_t(n)),eo=(s,n)=>{if(s==="tag:img")return"a picture amid the words: give it a paragraph of its own";if(s==="tag:span"){let d=vs(n).filter(p=>K(p,["style","class"])&&w(p,"style")!==void 0&&ys(p)).map(p=>bs(w(p,"style")).foreign).find(Boolean);return d?`a span with a style the kit has no format for (${d.join(", ")}): left as written`:`a <span> with a class or attribute of the document's own (the preview edits ${rs})`}return s==="tag:input"&&_t(n)?`a checkbox amid the words: ${fe}`:s.startsWith("tag:")&&at.has(s.slice(4))?`a block (<${s.slice(4)}>) amid the words: give the words a paragraph of their own`:s.startsWith("tag:")?`<${s.slice(4)}> amid the words (the preview edits ${rs})`:s==="comment"?"an HTML comment amid the words":s==="markup"?"an element not closed in the file (the parser closed it)":s==="mention"?'a page block written another way: the preview edits only <a class="doc-link-mention" href="../<slug>/doc.html"><span class="doc-link-mention-icon"></span>title</a>, its title plain words, no other attribute':s==="link"?"a javascript: or data: link":s},so=new Set([...ps,"details"]);function Ro(s){let n=ht(s,{sourceCodeLocationInfo:!0}),d=jt(n);if(!d)return[];let p=$=>s.slice(0,$).split(`
|
|
13
|
+
`).length,N=new Map,u=[],O=$=>{so.has($.tagName)&&$.sourceCodeLocation?.startTag&&Ns($)&&u.push({line:p($.sourceCodeLocation.startOffset),text:`<${$.tagName}>: words straight in it, outside any paragraph: give them a <p> (the preview cannot reach them, nor move its blocks one by one)`})},h=$=>{for(let i of L($)){let f=i.sourceCodeLocation?.startTag;f&&N.set(f.endOffset-1,i),h(i)}},y=$=>{for(let i of $.childNodes??[]){if(!i.tagName||oe.has(i.tagName))continue;if(it(i)){h(i);continue}if(w(i,"data-doc-chart")!==void 0||C(i).some(S=>It.includes(S))||ie(i))continue;let f=i.sourceCodeLocation?.startTag;f&&N.set(f.endOffset-1,i);let g=i.sourceCodeLocation?.endTag;if(ae.has(i.tagName)&&f&&i.childNodes.some(S=>D(S)&&/\\\[|\$\$/.test(S.value))&&!(g&&i.childNodes.every(D)&&Nt(s.slice(f.endOffset,g.startOffset)))){let S=Tn(s.slice(f.endOffset,g?g.startOffset:i.sourceCodeLocation.endOffset),!!g);u.push({line:p(f.startOffset),text:S?`<${i.tagName}>: the formula holds a bare < or >: write \\lt / \\gt (or < / >)`:`<${i.tagName}>: a display formula (\\[\u2026\\] or $$\u2026$$) amid the words: give it a paragraph of its own`})}i.tagName==="caption"&&f&&(et(i)||L(i).length>0)&&u.push({line:p(f.startOffset),text:'<caption>: the preview cannot edit a table caption; write the line above the table as <p class="doc-note">'}),O(i),y(i)}};O(d),y(d);let l=new Set;for(let{at:$,reason:i}of zt(s).locks){let f=N.get($);if(!f)continue;let g=i==="tag:input"&&f.tagName==="li"&&_t(f)&&f.parentNode?.sourceCodeLocation?.startTag?f.parentNode:null;g&&l.has(g)||(g&&l.add(g),g?u.push({line:p(g.sourceCodeLocation.startOffset),text:`<${g.tagName}>: checkboxes in its items: ${fe}`}):u.push({line:p(f.sourceCodeLocation.startOffset),text:`<${f.tagName}>: ${eo(i,f)}`}))}return u.sort(($,i)=>$.line-i.line).map(({line:$,text:i})=>`line ${$}: ${i}`)}function Do(s){let n=ht(s,{sourceCodeLocationInfo:!0}),d=jt(n);if(!d)return[];let p=f=>s.slice(0,f).split(`
|
|
14
|
+
`).length,N=[],u=[],O=f=>{for(let g of f.childNodes??[])g.tagName==="style"?u.push((g.childNodes??[]).map(S=>S.value??"").join("")):O(g)};O(n);let h=u.join(`
|
|
15
|
+
`).replace(/\/\*[\s\S]*?\*\//g,""),y=f=>new RegExp(`\\.${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`).test(h),l=f=>{for(let g of L(f).filter(S=>S.tagName==="colgroup"&&w(S,"data-doc-columns")===void 0)){let S=[g,...L(g)].filter(_=>w(_,"width")!==void 0||/(?:^|;)\s*(?:min-|max-)?width\s*:/i.test(w(_,"style")??"")),M=(g.sourceCodeLocation?g:L(g)[0])?.sourceCodeLocation;S.length&&M&&N.push({line:p(M.startOffset),text:`<${g.sourceCodeLocation?"colgroup":"col"}> widths: the kit sizes columns itself; a merged table uses yours`})}},$=f=>{for(let g of f.childNodes??[]){if(!g.tagName||oe.has(g.tagName)||it(g)||w(g,"data-doc-chart")!==void 0||C(g).some(_=>It.includes(_)))continue;if(ie(g)){let _=g.sourceCodeLocation,F=en(s,g).some(({name:Q})=>Q==="class");if(ms.has(g.tagName)&&_?.startTag&&!F&&(et(g)||Cs(g))&&!Ss(g)&&!C(g).some(y)){let Q=(g.tagName==="ul"||g.tagName==="ol")&&_t(g)?`; for its checkboxes, ${fe}`:"";N.push({line:p(_.startOffset),text:`<${g.tagName} class="${w(g,"class").trim()}"> is a whole block (\u6574\u4F53\u5757): the reader moves it whole and edits its words in place; right for a layout of yours that is no figure (a figure, a diagram or a timeline, goes in <figure class="doc-figure">); drop its class only if its contents were meant as ordinary blocks${Q}`})}continue}g.tagName==="table"&&l(g);let S=Ut(g)?L(g).filter(_=>at.has(_.tagName)):[];S.length>0&&g.sourceCodeLocation&&N.push({line:p(g.sourceCodeLocation.startOffset),text:`<${g.tagName} class="${w(g,"class").trim()}"> holds ${[...new Set(S.map(_=>`<${_.tagName}>`))].join(", ")}: it is one text block, its words straight in it (<br> starts a line) or in one plain <p>, and blocks set apart on a fill go in an <aside>`});let M=g.tagName==="ol"&&C(g).includes(ut)?L(g).find(_=>_.tagName!=="li"&&_.sourceCodeLocation):null;if(M&&N.push({line:p(M.sourceCodeLocation.startOffset),text:`<ol class="${ut}"> holds a <${M.tagName}> outside its items: a flowchart's steps are its <li>s (what one holds after its words, a paragraph or a list, is that step's content)`}),g.tagName==="ol"&&C(g).includes(ut))for(let _ of L(g).filter(F=>F.tagName==="li")){let F=L(_).find(rt=>!C(rt).includes(Et)),Q=F?_.childNodes.slice(0,_.childNodes.indexOf(F)):[];F&&F.tagName!=="p"&&F.sourceCodeLocation&&!Q.some(rt=>!C(rt).includes(Et)&&et(rt))&&N.push({line:p(F.sourceCodeLocation.startOffset),text:`a step of <ol class="${ut}"> begins with a <${F.tagName}>: a step's first block is its title, a paragraph (<p><strong>\u2026</strong></p>), the blocks after it its content`})}$(g)}};return $(d),i(d,(f,g)=>N.push({line:f,text:`a ${no[g]} in the text: the page shows it as a break or an empty line, not as a character (a tool that decodes \\u2028 or \\u2029 escapes writes one); write the break the text means (<br>, a new paragraph, a new line in code) or take it out`})),N.sort((f,g)=>f.line-g.line).map(({line:f,text:g})=>`line ${f}: ${g}`);function i(f,g){for(let S of f.childNodes??[])if(!(S.tagName==="script"||S.tagName==="style"||it(S))){if(D(S)&&S.sourceCodeLocation&&/[\u2028\u2029]/.test(S.value)){let{startOffset:M,endOffset:_}=S.sourceCodeLocation,Q=s.slice(M,_).search(/[\u2028\u2029]/);g(p(M+Math.max(Q,0)),S.value.match(/[\u2028\u2029]/)[0])}i(S,g)}}}function Fo(s){let n=O=>s.slice(0,O).split(`
|
|
16
|
+
`).length,d=O=>D(O)?O.value:(O.childNodes??[]).map(d).join(""),p=O=>d(O).replace(/\s+/g," ").trim(),N=O=>L(O).find(h=>/^h[1-6]$/.test(h.tagName)),u=[];for(let O of zt(s).units){if(O.keep?.reason!=="script"||!O.keep.own)continue;let h=O.node.parentNode;for(;h&&h.tagName!=="section";)h=h.parentNode;let y=O.tag==="section"&&N(O.node)?` ${p(N(O.node))}`:"",l=h?.tagName&&N(h)?` in ${p(N(h))}`:"";u.push({line:n(O.elStart),text:`<${O.tag}>${y}${l} kept by the script: ${O.keep.names.join(", ")} (the reader cannot delete or convert it; rename any of these the script does not select it by)`})}return u.sort((O,h)=>O.line-h.line).map(({line:O,text:h})=>`line ${O}: ${h}`)}var no={"\u2028":"line separator (U+2028)","\u2029":"paragraph separator (U+2029)"};function jt(s){return Ot(s,n=>n.tagName==="main")}function Ot(s,n){if(s.tagName&&n(s))return s;for(let d of s.childNodes??[]){let p=Ot(d,n);if(p)return p}return null}export{Yn as a,Ls as b,jo as c,Bo as d,to as e,Mo as f,Ro as g,Do as h,Fo as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
var h=Object.create;var f=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b,c)=>()=>{if(c)throw c[0];try{return a&&(b=a(a=0)),b}catch(d){throw c=[d],d}};var o=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}},p=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,d)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of j(b))!l.call(a,e)&&e!==c&&f(a,e,{get:()=>b[e],enumerable:!(d=i(b,e))||d.enumerable});return a};var q=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a)),r=a=>g(f({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a}from"./chunk-GYQV7Y4J.mjs";import"./chunk-7GHT2UCA.mjs";import"./chunk-UNUEWH4S.mjs";import"./chunk-G7TOXONE.mjs";import"./chunk-LC7YNQFG.mjs";import"./chunk-6U2SLSDN.mjs";import"./chunk-W7CXPCRV.mjs";import"./chunk-LAE5NQ4B.mjs";import"./chunk-P2CAZPDP.mjs";import"./chunk-ITNLYXXV.mjs";import"./chunk-QMQUXTU4.mjs";import"./chunk-HQQMJCQJ.mjs";import"./chunk-QYKCJ7FG.mjs";import"./chunk-YZ5Z6H4W.mjs";import"./chunk-VACRB2NE.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-TDQP3DKQ.mjs";import"./chunk-5FRMCDPY.mjs";import"./chunk-E7VYDG2X.mjs";import"./chunk-NFIBI4IP.mjs";import"./chunk-W63L7367.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{a as startProductionServer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a as k}from"./chunk-V4CPWKMZ.mjs";import{b as B,c as I}from"./chunk-342HXE3Q.mjs";import{a as y,b,c as v,d as l,e as x,f as S,g as $}from"./chunk-XINNG4F2.mjs";import"./chunk-7GHT2UCA.mjs";import"./chunk-G7TOXONE.mjs";import{k as h}from"./chunk-6U2SLSDN.mjs";import"./chunk-P2CAZPDP.mjs";import"./chunk-ITNLYXXV.mjs";import{j as u}from"./chunk-NSKUTQ5J.mjs";import{j as c,p as m,s as d,t as w,u as g}from"./chunk-QMQUXTU4.mjs";import"./chunk-HQQMJCQJ.mjs";import"./chunk-QYKCJ7FG.mjs";import"./chunk-YZ5Z6H4W.mjs";import"./chunk-VACRB2NE.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-TDQP3DKQ.mjs";import"./chunk-5FRMCDPY.mjs";import"./chunk-E7VYDG2X.mjs";import"./chunk-NFIBI4IP.mjs";import"./chunk-W63L7367.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";async function C(L){let{slugs:o,options:M}=await u({options:["--allow-failures"],argv:L});o.length===0&&(console.error(k()),process.exit(1));let N=await h(o),s=await c(o,{prepare:l({say:!1})}),t=await y(o.filter(e=>!s.has(e)));await b(o.filter(e=>s.has(e)||t.failures.has(e))),await S(o),await $(o);let p=o.filter(e=>!s.has(e)&&!t.failures.has(e)),{built:a,exported:i,failures:n}=p.length>0?await m(p,{prepare:l({say:!1})}):{built:[],exported:[],failures:new Map};for(let[e,r]of[...s,...t.failures])n.set(e,r);await w(n,{exportNote:!0}),await N.keep(i.map(({slug:e})=>e));let R=new Map(a.map(({report:e,removed:r})=>[e.slug,r]));for(let{slug:e,bytes:r,sha256:D}of i){let f=R.get(e),j=f.length>0?`; shared scripts and styles left out (unused): ${f.join(", ")}`:"";console.log(`Exported ${B(e)} (${r.toLocaleString("en-US")} bytes, sha256 ${D})${j}`)}d(a.map(({report:e})=>e)),x(a.map(({report:e})=>e));for(let e of t.lines)console.log(e);t.written.length>0&&console.log(v(t.written));for(let{slug:e}of i)console.log(I(e));g(n,{above:!0,allow:M.has("--allow-failures")})}export{C as run};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{b as l,g as a,h as c}from"./chunk-YXAUQPVK.mjs";import{b as s,f as t,i}from"./chunk-NSKUTQ5J.mjs";import"./chunk-5L7RYZCL.mjs";import{reportsDirectory as w}from"../browser/shared/paths.mjs";async function h(m){let{positional:o,options:p}=t({options:["--no-browser"],argv:m});if(o.length>1)throw new s("Name one document at most.");let{slug:e=null,block:u=null}=o.length?await i(o[0]):{};console.log(`\u5DE5\u4F5C\u533A\uFF1A${w}`);let n=await a({slug:e,baseline:e!==null});n.ok||(console.error(n.message),process.exit(1));let r=await c(e,n,u);for(let g of r)console.log(g);console.log(await l(r,p))}export{h as run};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n,t as o,u as p,v as q}from"./chunk-QMQUXTU4.mjs";import"./chunk-HQQMJCQJ.mjs";import"./chunk-QYKCJ7FG.mjs";import"./chunk-YZ5Z6H4W.mjs";import"./chunk-VACRB2NE.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-E7VYDG2X.mjs";import"./chunk-W63L7367.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{h as buildReports,d as checkReports,f as checkSelectedReports,b as exportFailures,k as exportReports,p as failureSummary,e as handInBlockers,l as notesByKind,m as notesOf,j as offlineReports,o as printFailures,c as quickFailures,a as repeatedIdFailures,q as reportFailures,n as reportNotes,i as withExportPolicy,g as writeSharedAssets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-2PBALTR3.mjs";import"./chunk-TX6JH7TR.mjs";import"./chunk-ZBIM6ARY.mjs";import"./chunk-NSKUTQ5J.mjs";import"./chunk-HQQMJCQJ.mjs";import"./chunk-QYKCJ7FG.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-W63L7367.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{e as keyOf,d as missingSaid,b as packageFolder,a as packageNamed,f as run,c as shallowSaid};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{g as M}from"./chunk-HQQMJCQJ.mjs";import{a as O}from"./chunk-HYMEEXKN.mjs";import{b as E}from"./chunk-5FRMCDPY.mjs";import{F as I,K as S}from"./chunk-NFIBI4IP.mjs";import d from"node:fs/promises";import b from"node:path";import{isInstance as T}from"../browser/shared/components/index.mjs";import{ATTRIBUTE as _}from"../browser/shared/components/installed.mjs";import{exportSourceOf as q}from"../browser/shared/export-wrap.mjs";import{sha256 as w}from"../browser/shared/files.mjs";import{attr as g,hasClass as y}from"../browser/shared/html-tree.mjs";import{editStateDirectory as F,exportsDirectory as z,qaDirectory as G,reportsDirectory as H}from"../browser/shared/paths.mjs";import{documentDirectory as K,documentFiles as Q}from"../browser/shared/workspace.mjs";function V(t,e=null){return t.tagName==="figure"&&y(t,"doc-figure")||t.tagName==="div"&&(y(t,"doc-code")||y(t,"doc-diff"))||e===D||T(t)||y(t,"doc-flow")||y(t,"doc-sheet-shell")||g(t,"data-doc-sheets")!==void 0?0:t.tagName==="figure"||y(t,"doc-columns")?1:y(t,"doc-table-wrap")?2:3}function X(t){let e=new Map,n=new Map;for(let i of I(t).units)i.blockId&&!n.has(i.blockId)&&n.set(i.blockId,i.kind);let a=new Map,r=new Map,o=new Map,f=i=>!!i.tagName&&g(i,"data-block-id")!==void 0,u=(i,c)=>{if(i.nodeName==="#text")return i.value;if(!i.tagName||i.tagName==="template")return"";let s=g(i,"data-doc-chart-data")?.trim();s&&a.get(c).push(s);let l=g(i,"data-doc-chart-source")?.trim();l&&!r.has(l)&&r.set(l,c);let h=i.attrs.map(({name:k,value:N})=>`${k}="${N}"`).sort().join(" ");return`<${i.tagName} ${h}>${(i.childNodes??[]).map(k=>f(k)?"":u(k,c)).join("")}</${i.tagName}>`},m=(i,c)=>{for(let s of i.childNodes??[]){if(!s.tagName||s.tagName==="template")continue;let l=g(s,"data-block-id"),h=c;if(l!==void 0&&!e.has(l)){let k=[s.tagName,...(g(s,"class")??"").split(/\s+/).filter(Boolean).slice(0,1)].join("."),N=o.get(c)??0;o.set(c,N+1),a.set(l,[]);let v=V(s,n.get(l)),x=s.sourceCodeLocation,U=x?(x.endOffset??x.startTag?.endOffset??x.startOffset)-x.startOffset:0,B=u(s,l).replace(R," ");e.set(l,{hash:w(B).slice(0,16),bare:w(B.replace(`data-block-id="${l}"`,"")).slice(0,16),rank:v,card:v<3,whole:n.get(l)===D,figure:n.get(l)===tt,tag:k,parent:c,at:N,size:U,package:T(s)?g(s,_)??null:null}),h=l}m(s,h)}};m(O(t),null);let p=new Map([...e].map(([i,{hash:c,bare:s}])=>[i,{hash:c,bare:s}]));for(let[i,c]of a){let s=c.map(l=>p.get(r.get(l))).filter(Boolean);s.length&&(e.get(i).hash=w([p.get(i).hash,...s.map(({hash:l})=>l)].join("|")).slice(0,16),e.get(i).bare=w([p.get(i).bare,...s.map(({bare:l})=>l)].join("|")).slice(0,16))}return e}function Y(t){let e=[],n=a=>{for(let r of a.childNodes??[])if(!(!r.tagName||r.tagName==="template"||g(r,"data-block-id")!==void 0))if(r.tagName==="script"||r.tagName==="style"){let o=r.attrs.map(({name:f,value:u})=>`${f}="${u}"`).sort().join(" ");e.push(`<${r.tagName} ${o}>${(r.childNodes??[]).map(f=>f.value??"").join("")}`.replace(R," "))}else n(r)};return n(O(t)),e.length?w(e.join("|")).slice(0,16):""}var Z=t=>Object.fromEntries(M(t).map(({id:e,stamp:n})=>[e,n])),D="block",tt="figure",R=/[ \t\n\f\r]+/g,et=["export","preview"];function st(t){if(t==null)return null;try{let{blocks:e,places:n,moved:a,unseen:r,from:o,time:f,idless:u,page:m,packages:p}=JSON.parse(t)??{};if(!e||typeof e!="object"||Array.isArray(e))return null;let i=n&&typeof n=="object"&&!Array.isArray(n)?n:{},c=s=>Array.isArray(s)?s.filter(l=>typeof l=="string"):[];return{blocks:Object.fromEntries(Object.entries(e).filter(([,s])=>typeof s=="string")),places:Object.fromEntries(Object.entries(i).filter(([,s])=>Array.isArray(s)&&s.length===2&&(s[0]===null||typeof s[0]=="string")&&Number.isInteger(s[1]))),moved:c(a),unseen:c(r),...et.includes(o)?{from:o,time:Number.isFinite(f)?f:null}:{},...c(u).length?{idless:c(u)}:{},...typeof m=="string"?{page:m}:{},...p&&typeof p=="object"&&!Array.isArray(p)?{packages:Object.fromEntries(Object.entries(p).filter(([,s])=>typeof s=="string"))}:{}}}catch{return null}}var $="ge-idless-";function nt(t,{from:e,time:n}){let a=0,{text:r}=S(E(t).text,()=>`${$}${a++}`),o=Z(r),f={blocks:{},places:{},moved:[],unseen:[],from:e,time:n,page:Y(r),...Object.keys(o).length?{packages:o}:{}},u=[];for(let[m,{hash:p,bare:i,card:c,parent:s,at:l}]of X(r)){if(m.startsWith($)){u.push(i);continue}f.blocks[m]=p,s?.startsWith($)||(f.places[m]=[s,l]),c&&f.unseen.push(m)}return u.length?{...f,idless:u}:f}function yt(t,e){if(!e?.idless?.length)return e;let n=new Map;for(let o of e.idless)n.set(o,(n.get(o)??0)+1);let a={...e,blocks:{...e.blocks},unseen:[...e.unseen]};for(let[o,{hash:f,bare:u,card:m}]of t)Object.hasOwn(e.blocks,o)||!n.get(u)||(n.set(u,n.get(u)-1),a.blocks[o]=f,m&&a.unseen.push(o));let r=[...n].flatMap(([o,f])=>Array(f).fill(o));return r.length?a.idless=r:delete a.idless,a}var at=/<[^>]*\sdata-doc-placeholder\b/,j=t=>b.join(G,t),L=t=>b.join(j(t),"blocks.json"),P=t=>b.join(j(t),"exported.html");async function W(t){return st(await d.readFile(L(t),"utf8").catch(()=>null))!==null}async function C(t,e,n){let a=async c=>d.readFile(c).then(s=>({bytes:s,file:c}),()=>null),r=await a(P(t)),o=[r];if(e){let c=e.slice(0,16),s=b.join(F,"history",t),l=await d.readdir(s).catch(()=>[]);o.push(...await Promise.all(l.filter(h=>h.endsWith(`-${c}.html`)).map(h=>a(b.join(s,h))))),o.push(await a(b.join(F,"snapshots",`${c}.html`)))}let f=r?(await d.stat(r.file).catch(()=>null))?.mtimeMs??null:null,m=!(r&&e&&n!==null&&f!==null&&f>n&&w(r.bytes)!==e)&&e&&o.find(c=>c&&w(c.bytes)===e),p=m||r;if(!p)return null;let i=m&&n!==null?n:p===r?f??n:(await d.stat(p.file).catch(()=>null))?.mtimeMs??n;return{text:p.bytes.toString("utf8"),time:i??null}}async function A(t){let e=b.join(z,`${t}.html`),[n,a]=await Promise.all([d.readFile(e,"utf8").catch(()=>null),d.stat(e).catch(()=>null)]);return n===null||!a?null:{said:q(n),time:a.mtimeMs}}async function J(t,e,n){if(at.test(e))return!1;let a=nt(e,n);return!Object.keys(a.blocks).length&&!a.idless?!1:(await d.mkdir(j(t),{recursive:!0}),await d.writeFile(L(t),`${JSON.stringify(a)}
|
|
3
|
+
`),!0)}async function bt(t){let e=new Map(await Promise.all(t.map(async a=>[a,await A(a).catch(()=>null)])));return{keep:async(a,r=null)=>{for(let o of a)try{if(!await W(o)){let m=e.get(o),p=await C(o,m?.said??null,m?.time??null);p&&await J(o,p.text,{from:"export",time:p.time})}let[f,u]=await Promise.all([d.readFile(Q(K(o,H)).html),r?{said:r.get(o)??null}:A(o)]);u?.said&&w(f)===u.said&&(await d.mkdir(j(o),{recursive:!0}),await d.writeFile(P(o),f))}catch{}}}}async function kt(t,e){try{if(await W(t))return!1;let n=await A(t),a=await C(t,n?.said??null,n?.time??null);return await J(t,a?.text??e,a?{from:"export",time:a.time}:{from:"preview",time:Date.now()})}catch{return!1}}export{V as a,X as b,Y as c,Z as d,et as e,st as f,nt as g,yt as h,W as i,C as j,bt as k,kt as l};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import st from"node:child_process";import{EventEmitter as Jt}from"node:events";import{accessSync as Zt}from"node:fs";import it from"node:os";import Qt from"node:readline";import pe from"node:path";import{execSync as he}from"node:child_process";import de from"node:os";import I from"node:path";import{createHash as vt}from"node:crypto";import{createWriteStream as yt,unlinkSync as gt}from"node:fs";import*as Me from"node:http";import*as Be from"node:https";import{URL as Ct,urlToHttpOptions as Rt}from"node:url";async function Oe(t){return await new Promise(e=>{X(t,"HEAD",r=>{r.resume(),e(r.statusCode===200)},!1).then(r=>{r.on("error",()=>{e(!1)})}).catch(()=>{e(!1)})})}async function X(t,e,r,o=!0){let a;try{let{ProxyAgent:c}=await import("proxy-agent");a=new c}catch{}let i={protocol:t.protocol,hostname:t.hostname,port:t.port,path:t.pathname+t.search,method:e,headers:o?{Connection:"keep-alive"}:void 0,auth:Rt(t).auth,agent:a},n=c=>{c.statusCode&&c.statusCode>=300&&c.statusCode<400&&c.headers.location?(X(new Ct(c.headers.location),e,r),c.resume()):r(c)},l=i.protocol==="https:"?Be.request(i,n):Me.request(i,n);return l.end(),l}var ne=class{#e=vt("sha256");update(e){this.#e.update(e)}verify(e,r,o){let a=this.#e.digest("hex");if(a!==o.toLowerCase()){try{gt(r)}catch{}throw new Error(`Integrity check failed for downloaded browser archive.
|
|
3
|
+
URL: ${e}
|
|
4
|
+
Expected: ${o.toLowerCase()}
|
|
5
|
+
Actual: ${a}`)}}};function le(t,e,r,o){return new Promise(async(a,i)=>{let n=0,l=0,c=o?new ne:null;try{(await X(t,"GET",f=>{if(f.statusCode!==200){let E=new Error(`Download failed: server returned code ${f.statusCode}. URL: ${t}`);f.resume(),i(E);return}let p=yt(e);p.on("close",()=>{if(c&&o)try{c.verify(t,e,o)}catch(E){i(E);return}return a()}),p.on("error",E=>i(E)),l=parseInt(f.headers["content-length"],10),f.on("data",E=>{n+=E.length,c?.update(E),r&&r(n,l)}),f.pipe(p)})).on("error",f=>i(f))}catch(d){i(d)}})}async function O(t){let e=await ce(t);try{return JSON.parse(e)}catch{throw new Error("Could not parse JSON from "+t.toString())}}function ce(t){return new Promise(async(e,r)=>{try{(await X(t,"GET",a=>{let i="";if(a.statusCode&&a.statusCode>=400)return r(new Error(`Got status code ${a.statusCode}`));a.on("data",n=>{i+=n}),a.on("end",()=>{try{return e(String(i))}catch{return r(new Error(`Failed to read text response from ${t}`))}})},!1)).on("error",a=>{r(a)})}catch(o){r(o)}})}var u;(function(t){t.CHROME="chrome",t.CHROMEHEADLESSSHELL="chrome-headless-shell",t.CHROMIUM="chromium",t.FIREFOX="firefox",t.CHROMEDRIVER="chromedriver"})(u||(u={}));var s;(function(t){t.LINUX="linux",t.LINUX_ARM="linux_arm",t.MAC="mac",t.MAC_ARM="mac_arm",t.WIN32="win32",t.WIN64="win64"})(s||(s={}));var h;(function(t){t.CANARY="canary",t.NIGHTLY="nightly",t.BETA="beta",t.DEV="dev",t.DEVEDITION="devedition",t.STABLE="stable",t.ESR="esr",t.LATEST="latest"})(h||(h={}));var m;(function(t){t.STABLE="stable",t.DEV="dev",t.CANARY="canary",t.BETA="beta"})(m||(m={}));function ue(t){if(Object.values(m).includes(t))return t;throw new Error(`Invalid Chrome channel: ${t}`)}function F(t,e){switch(t){case s.LINUX_ARM:return e&&g(e,"153.0.8001.0")<0?"linux64":"linux-arm64";case s.LINUX:return"linux64";case s.MAC_ARM:return"mac-arm64";case s.MAC:return"mac-x64";case s.WIN32:return"win32";case s.WIN64:return"win64"}}function Ue(t,e,r="https://storage.googleapis.com/chrome-for-testing-public"){return`${r}/${fe(t,e).join("/")}`}function fe(t,e){return[e,F(t,e),`chrome-${F(t,e)}.zip`]}function _e(t,e){switch(t){case s.MAC:case s.MAC_ARM:return I.join("chrome-"+F(t,e),"Google Chrome for Testing.app","Contents","MacOS","Google Chrome for Testing");case s.LINUX_ARM:case s.LINUX:return I.join("chrome-"+F(t,e),"chrome");case s.WIN32:case s.WIN64:return I.join("chrome-"+F(t,e),"chrome.exe")}}var me="https://googlechromelabs.github.io/chrome-for-testing";async function St(t){let e=await O(new URL(`${me}/last-known-good-versions.json`));for(let r of Object.keys(e.channels))e.channels[r.toLowerCase()]=e.channels[r],delete e.channels[r];return e.channels[t]}async function At(t){return(await O(new URL(`${me}/latest-versions-per-milestone.json`))).milestones[t]}async function $t(t){return(await O(new URL(`${me}/latest-patch-versions-per-build.json`))).builds[t]}async function x(t){if(Object.values(m).includes(t))return(await St(t)).version;if(t.match(/^\d+$/))return(await At(t))?.version;if(t.match(/^\d+\.\d+\.\d+$/))return(await $t(t))?.version}var He=["PROGRAMFILES","ProgramW6432","ProgramFiles(x86)","LOCALAPPDATA"];function Fe(t,e){if(e.size===0)throw new Error("Non of the common Windows Env variables were set");let r;switch(t){case m.STABLE:r="Google\\Chrome\\Application\\chrome.exe";break;case m.BETA:r="Google\\Chrome Beta\\Application\\chrome.exe";break;case m.CANARY:r="Google\\Chrome SxS\\Application\\chrome.exe";break;case m.DEV:r="Google\\Chrome Dev\\Application\\chrome.exe";break}return[...e.values()].map(o=>I.win32.join(o,r))}function Dt(t){try{let e=he(`cmd.exe /c echo %${t.toLocaleUpperCase()}%`,{stdio:["ignore","pipe","ignore"],encoding:"utf-8"}).trim();if(e)return e}catch{}}function Nt(t){if(!he("wslinfo --version",{stdio:["ignore","pipe","ignore"],encoding:"utf-8"}).trim())throw new Error("Not in WSL or unsupported version of WSL.");let r=new Set;for(let a of He){let i=Dt(a);i&&r.add(i)}return Fe(t,r).map(a=>he(`wslpath "${a}"`).toString().trim())}function Lt(t){let e=[];switch(t){case m.STABLE:e.push("/opt/google/chrome/chrome");break;case m.BETA:e.push("/opt/google/chrome-beta/chrome");break;case m.CANARY:e.push("/opt/google/chrome-canary/chrome");break;case m.DEV:e.push("/opt/google/chrome-unstable/chrome");break}try{let r=Nt(t);r&&e.push(...r)}catch{}return e}function ke(t,e){switch(t){case s.WIN64:case s.WIN32:let r=new Set(He.map(o=>process.env[o]).filter(o=>!!o));return r.add("C:\\Program Files"),r.add("C:\\Program Files (x86)"),r.add("D:\\Program Files"),r.add("D:\\Program Files (x86)"),Fe(e,r);case s.MAC_ARM:case s.MAC:switch(e){case m.STABLE:return["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"];case m.BETA:return["/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta"];case m.CANARY:return["/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"];case m.DEV:return["/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev"]}case s.LINUX_ARM:case s.LINUX:return Lt(e)}}function We(t,e){switch(t){case s.WIN64:case s.WIN32:switch(e){case m.STABLE:return I.join(Y(),"Google","Chrome","User Data");case m.BETA:return I.join(Y(),"Google","Chrome Beta","User Data");case m.CANARY:return I.join(Y(),"Google","Chrome SxS","User Data");case m.DEV:return I.join(Y(),"Google","Chrome Dev","User Data")}case s.MAC_ARM:case s.MAC:switch(e){case m.STABLE:return I.join(q(),"Chrome");case m.BETA:return I.join(q(),"Chrome Beta");case m.DEV:return I.join(q(),"Chrome Dev");case m.CANARY:return I.join(q(),"Chrome Canary")}case s.LINUX_ARM:case s.LINUX:switch(e){case m.STABLE:return I.join(z(),"google-chrome");case m.BETA:return I.join(z(),"google-chrome-beta");case m.CANARY:return I.join(z(),"google-chrome-canary");case m.DEV:return I.join(z(),"google-chrome-unstable")}}}function Y(){return process.env.LOCALAPPDATA||I.join(de.homedir(),"AppData","Local")}function z(){return process.env.CHROME_CONFIG_HOME||process.env.XDG_CONFIG_HOME||I.join(de.homedir(),".config")}function q(){return I.join(de.homedir(),"Library","Application Support","Google")}function g(t,e){let r=t.trim(),o=e.trim(),a=/^\d+(?:\.\d+){0,3}$/;if(!a.test(r))throw new Error(`Version ${t} is not a valid Chrome version`);if(!a.test(o))throw new Error(`Version ${e} is not a valid Chrome version`);let i=r.split(".").map(Number),n=o.split(".").map(Number);for(let l=0;l<4;l++){let c=i[l]??0,d=n[l]??0;if(c>d)return 1;if(c<d)return-1}return 0}function k(t,e){switch(t){case s.LINUX_ARM:return e&&g(e,"153.0.8001.0")<0?"linux64":"linux-arm64";case s.LINUX:return"linux64";case s.MAC_ARM:return"mac-arm64";case s.MAC:return"mac-x64";case s.WIN32:return"win32";case s.WIN64:return"win64"}}function Ge(t,e,r="https://storage.googleapis.com/chrome-for-testing-public"){return`${r}/${we(t,e).join("/")}`}function we(t,e){return[e,k(t,e),`chrome-headless-shell-${k(t,e)}.zip`]}function je(t,e){switch(t){case s.MAC:case s.MAC_ARM:return pe.join("chrome-headless-shell-"+k(t,e),"chrome-headless-shell");case s.LINUX_ARM:case s.LINUX:return pe.join("chrome-headless-shell-"+k(t,e),"chrome-headless-shell");case s.WIN32:case s.WIN64:return pe.join("chrome-headless-shell-"+k(t,e),"chrome-headless-shell.exe")}}import be from"node:path";function W(t,e){switch(t){case s.LINUX_ARM:return e&&g(e,"153.0.8001.0")<0?"linux64":"linux-arm64";case s.LINUX:return"linux64";case s.MAC_ARM:return"mac-arm64";case s.MAC:return"mac-x64";case s.WIN32:return"win32";case s.WIN64:return"win64"}}function Ve(t,e,r="https://storage.googleapis.com/chrome-for-testing-public"){return`${r}/${xe(t,e).join("/")}`}function xe(t,e){return[e,W(t,e),`chromedriver-${W(t,e)}.zip`]}function Xe(t,e){switch(t){case s.MAC:case s.MAC_ARM:return be.join("chromedriver-"+W(t,e),"chromedriver");case s.LINUX_ARM:case s.LINUX:return be.join("chromedriver-"+W(t,e),"chromedriver");case s.WIN32:case s.WIN64:return be.join("chromedriver-"+W(t,e),"chromedriver.exe")}}import Ee from"node:path";function Bt(t,e){switch(t){case s.LINUX_ARM:case s.LINUX:return"chrome-linux";case s.MAC_ARM:case s.MAC:return"chrome-mac";case s.WIN32:case s.WIN64:return parseInt(e,10)>591479?"chrome-win":"chrome-win32"}}function Ye(t){switch(t){case s.LINUX_ARM:case s.LINUX:return"Linux_x64";case s.MAC_ARM:return"Mac_Arm";case s.MAC:return"Mac";case s.WIN32:return"Win";case s.WIN64:return"Win_x64"}}function ze(t,e,r="https://storage.googleapis.com/chromium-browser-snapshots"){return`${r}/${Ie(t,e).join("/")}`}function Ie(t,e){return[Ye(t),e,`${Bt(t,e)}.zip`]}function qe(t,e){switch(t){case s.MAC:case s.MAC_ARM:return Ee.join("chrome-mac","Chromium.app","Contents","MacOS","Chromium");case s.LINUX_ARM:case s.LINUX:return Ee.join("chrome-linux","chrome");case s.WIN32:case s.WIN64:return Ee.join("chrome-win","chrome.exe")}}async function Ke(t){return await ce(new URL(`https://storage.googleapis.com/chromium-browser-snapshots/${Ye(t)}/LAST_CHANGE`))}function Je(t,e){return Number(t)-Number(e)}import G from"node:fs";import $ from"node:path";function ve(t){return Number(t.split(".").shift())>=135?"xz":"bz2"}function Ut(t,e){switch(t){case s.LINUX:return`firefox-${e}.en-US.linux-x86_64.tar.${ve(e)}`;case s.LINUX_ARM:return`firefox-${e}.en-US.linux-aarch64.tar.${ve(e)}`;case s.MAC_ARM:case s.MAC:return`firefox-${e}.en-US.mac.dmg`;case s.WIN32:case s.WIN64:return`firefox-${e}.en-US.${t}.zip`}}function _t(t,e){switch(t){case s.LINUX_ARM:case s.LINUX:return`firefox-${e}.tar.${ve(e)}`;case s.MAC_ARM:case s.MAC:return`Firefox ${e}.dmg`;case s.WIN32:case s.WIN64:return`Firefox Setup ${e}.exe`}}function Ht(t){switch(t){case s.LINUX:return"linux-x86_64";case s.LINUX_ARM:return"linux-aarch64";case s.MAC_ARM:case s.MAC:return"mac";case s.WIN32:case s.WIN64:return t}}function ye(t){for(let e of Object.values(w))if(t.startsWith(e+"_"))return t=t.substring(e.length+1),[e,t];return[w.NIGHTLY,t]}function Qe(t,e,r){let[o]=ye(e);switch(o){case w.NIGHTLY:r??="https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central";break;case w.DEVEDITION:r??="https://archive.mozilla.org/pub/devedition/releases";break;case w.BETA:case w.STABLE:case w.ESR:r??="https://archive.mozilla.org/pub/firefox/releases";break}return`${r}/${ge(t,e).join("/")}`}function ge(t,e){let[r,o]=ye(e);switch(r){case w.NIGHTLY:return[Ut(t,o)];case w.DEVEDITION:case w.BETA:case w.STABLE:case w.ESR:return[o,Ht(t),"en-US",_t(t,o)]}}function et(t,e){let[r]=ye(e);switch(r){case w.NIGHTLY:switch(t){case s.MAC_ARM:case s.MAC:return $.join("Firefox Nightly.app","Contents","MacOS","firefox");case s.LINUX_ARM:case s.LINUX:return $.join("firefox","firefox");case s.WIN32:case s.WIN64:return $.join("firefox","firefox.exe")}case w.BETA:case w.DEVEDITION:case w.ESR:case w.STABLE:switch(t){case s.MAC_ARM:case s.MAC:return $.join("Firefox.app","Contents","MacOS","firefox");case s.LINUX_ARM:case s.LINUX:return $.join("firefox","firefox");case s.WIN32:case s.WIN64:return $.join("core","firefox.exe")}}}var w;(function(t){t.STABLE="stable",t.ESR="esr",t.DEVEDITION="devedition",t.BETA="beta",t.NIGHTLY="nightly"})(w||(w={}));var Ft="https://product-details.mozilla.org/1.0";async function T(t=w.NIGHTLY){let e={[w.ESR]:"FIREFOX_ESR",[w.STABLE]:"LATEST_FIREFOX_VERSION",[w.DEVEDITION]:"FIREFOX_DEVEDITION",[w.BETA]:"FIREFOX_DEVEDITION",[w.NIGHTLY]:"FIREFOX_NIGHTLY"},o=(await O(new URL(`${Ft}/firefox_versions.json`)))[e[t]];if(!o)throw new Error(`Channel ${t} is not found.`);return t+"_"+o}async function tt(t){G.existsSync(t.path)||await G.promises.mkdir(t.path,{recursive:!0}),await Wt({preferences:{...kt(t.preferences),...t.preferences},path:t.path})}function kt(t){let e="dummy.test",r={"app.normandy.api_url":"","app.update.checkInstallTime":!1,"app.update.disabledForTesting":!0,"apz.content_response_timeout":6e4,"browser.contentblocking.features.standard":"-tp,tpPrivate,cookieBehavior0,-cryptoTP,-fp","browser.dom.window.dump.enabled":!0,"browser.newtabpage.activity-stream.feeds.system.topstories":!1,"browser.newtabpage.enabled":!1,"browser.pagethumbnails.capturing_disabled":!0,"browser.safebrowsing.blockedURIs.enabled":!1,"browser.safebrowsing.downloads.enabled":!1,"browser.safebrowsing.malware.enabled":!1,"browser.safebrowsing.phishing.enabled":!1,"browser.search.update":!1,"browser.sessionstore.resume_from_crash":!1,"browser.shell.checkDefaultBrowser":!1,"browser.startup.homepage":"about:blank","browser.startup.homepage_override.mstone":"ignore","browser.startup.page":0,"browser.tabs.disableBackgroundZombification":!1,"browser.tabs.warnOnCloseOtherTabs":!1,"browser.tabs.warnOnOpen":!1,"browser.translations.automaticallyPopup":!1,"browser.uitour.enabled":!1,"browser.urlbar.suggest.searches":!1,"browser.usedOnWindows10.introURL":"","browser.warnOnQuit":!1,"datareporting.healthreport.documentServerURI":`http://${e}/dummy/healthreport/`,"datareporting.healthreport.logging.consoleEnabled":!1,"datareporting.healthreport.service.enabled":!1,"datareporting.healthreport.service.firstRun":!1,"datareporting.healthreport.uploadEnabled":!1,"datareporting.policy.dataSubmissionEnabled":!1,"datareporting.policy.dataSubmissionPolicyBypassNotification":!0,"devtools.jsonview.enabled":!1,"dom.disable_open_during_load":!1,"dom.file.createInChild":!0,"dom.ipc.reportProcessHangs":!1,"dom.max_chrome_script_run_time":0,"dom.max_script_run_time":0,"extensions.autoDisableScopes":0,"extensions.enabledScopes":5,"extensions.getAddons.cache.enabled":!1,"extensions.installDistroAddons":!1,"extensions.update.enabled":!1,"extensions.update.notifyUser":!1,"extensions.webservice.discoverURL":`http://${e}/dummy/discoveryURL`,"focusmanager.testmode":!0,"general.useragent.updates.enabled":!1,"geo.provider.testing":!0,"geo.wifi.scan":!1,"hangmonitor.timeout":0,"javascript.options.showInConsole":!0,"media.gmp-manager.updateEnabled":!1,"media.sanity-test.disabled":!0,"network.cookie.sameSite.laxByDefault":!1,"network.http.prompt-temp-redirect":!1,"network.http.speculative-parallel-limit":0,"network.manage-offline-status":!1,"network.sntp.pools":e,"plugin.state.flash":0,"privacy.trackingprotection.enabled":!1,"remote.bidi.dismiss_file_pickers.enabled":!0,"screenshots.browser.component.enabled":!1,"security.certerrors.mitm.priming.enabled":!1,"security.fileuri.strict_origin_policy":!1,"security.notification_enable_delay":0,"services.settings.server":"data:,#remote-settings-dummy/v1","signon.autofillForms":!1,"signon.rememberSignons":!1,"startup.homepage_welcome_url":"about:blank","startup.homepage_welcome_url.additional":"","toolkit.cosmeticAnimations.enabled":!1,"toolkit.startup.max_resumed_crashes":-1};return Object.assign(r,t)}async function Ze(t){G.existsSync(t)&&await G.promises.copyFile(t,t+".puppeteer")}async function Wt(t){let e=$.join(t.path,"prefs.js"),r=$.join(t.path,"user.js"),o=Object.entries(t.preferences).map(([i,n])=>`user_pref(${JSON.stringify(i)}, ${JSON.stringify(n)});`),a=await Promise.allSettled([Ze(r).then(async()=>{await G.promises.writeFile(r,o.join(`
|
|
6
|
+
`))}),Ze(e)]);for(let i of a)if(i.status==="rejected")throw i.reason}function rt(t,e){return parseInt(t.replace(".",""),16)-parseInt(e.replace(".",""),16)}var K={[u.CHROMEDRIVER]:Ve,[u.CHROMEHEADLESSSHELL]:Ge,[u.CHROME]:Ue,[u.CHROMIUM]:ze,[u.FIREFOX]:Qe},wo={[u.CHROMEDRIVER]:xe,[u.CHROMEHEADLESSSHELL]:we,[u.CHROME]:fe,[u.CHROMIUM]:Ie,[u.FIREFOX]:ge},U={[u.CHROMEDRIVER]:Xe,[u.CHROMEHEADLESSSHELL]:je,[u.CHROME]:_e,[u.CHROMIUM]:qe,[u.FIREFOX]:et},jt={[u.CHROMEDRIVER]:g,[u.CHROMEHEADLESSSHELL]:g,[u.CHROME]:g,[u.CHROMIUM]:Je,[u.FIREFOX]:rt};async function Vt(t,e,r){switch(t){case u.FIREFOX:switch(r){case h.LATEST:return await T(w.NIGHTLY);case h.BETA:return await T(w.BETA);case h.NIGHTLY:return await T(w.NIGHTLY);case h.DEVEDITION:return await T(w.DEVEDITION);case h.STABLE:return await T(w.STABLE);case h.ESR:return await T(w.ESR);case h.CANARY:case h.DEV:throw new Error(`${r.toUpperCase()} is not available for Firefox`)}case u.CHROME:switch(r){case h.LATEST:return await x(m.CANARY);case h.BETA:return await x(m.BETA);case h.CANARY:return await x(m.CANARY);case h.DEV:return await x(m.DEV);case h.STABLE:return await x(m.STABLE);case h.NIGHTLY:case h.DEVEDITION:case h.ESR:throw new Error(`${r.toUpperCase()} is not available for Chrome`)}case u.CHROMEDRIVER:switch(r){case h.LATEST:case h.CANARY:return await x(m.CANARY);case h.BETA:return await x(m.BETA);case h.DEV:return await x(m.DEV);case h.STABLE:return await x(m.STABLE);case h.NIGHTLY:case h.DEVEDITION:case h.ESR:throw new Error(`${r.toUpperCase()} is not available for ChromeDriver`)}case u.CHROMEHEADLESSSHELL:switch(r){case h.LATEST:case h.CANARY:return await x(m.CANARY);case h.BETA:return await x(m.BETA);case h.DEV:return await x(m.DEV);case h.STABLE:return await x(m.STABLE);case h.NIGHTLY:case h.DEVEDITION:case h.ESR:throw new Error(`${r} is not available for chrome-headless-shell`)}case u.CHROMIUM:switch(r){case h.LATEST:return await Ke(e);case h.NIGHTLY:case h.CANARY:case h.DEV:case h.DEVEDITION:case h.BETA:case h.STABLE:case h.ESR:throw new Error(`${r} is not supported for Chromium. Use 'latest' instead.`)}}}async function Ce(t,e,r){let o=r;if(Object.values(h).includes(o))return await Vt(t,e,o);switch(t){case u.FIREFOX:return r;case u.CHROME:let a=await x(r);return a||r;case u.CHROMEDRIVER:let i=await x(r);return i||r;case u.CHROMEHEADLESSSHELL:let n=await x(r);return n||r;case u.CHROMIUM:return r}}async function Xt(t,e){switch(t){case u.FIREFOX:return await tt(e);case u.CHROME:case u.CHROMIUM:throw new Error(`Profile creation is not support for ${t} yet`)}}function Yt(t,e,r){switch(t){case u.CHROMEDRIVER:case u.CHROMEHEADLESSSHELL:case u.FIREFOX:case u.CHROMIUM:throw new Error(`Default user dir detection is not supported for ${t} yet.`);case u.CHROME:return We(e,r)}}function ot(t,e,r){switch(t){case u.CHROMEDRIVER:case u.CHROMEHEADLESSSHELL:case u.FIREFOX:case u.CHROMIUM:throw new Error(`System browser detection is not supported for ${t} yet.`);case u.CHROME:return ke(e,r)}}function Re(t){return jt[t]}import R from"node:fs";import at from"node:os";import D from"node:path";import{debuglog as zt}from"node:util";var b={cache:"puppeteer:browsers:cache",fileUtil:"puppeteer:browsers:fileUtil",install:"puppeteer:browsers:install",launcher:"puppeteer:browsers:launcher"},J=t=>{let e=zt(t);return e.enabled?e:void 0};import Se from"node:os";function y(){let t=Se.platform(),e=Se.arch();switch(t){case"darwin":return e==="arm64"?s.MAC_ARM:s.MAC;case"linux":return e==="arm64"?s.LINUX_ARM:s.LINUX;case"win32":return e==="x64"||e==="arm64"&&qt(Se.release())?s.WIN64:s.WIN32;default:return}}function qt(t){let e=t.split(".");if(e.length>2){let r=parseInt(e[0],10),o=parseInt(e[1],10),a=parseInt(e[2],10);return r>10||r===10&&o>0||r===10&&o===0&&a>=22e3}return!1}var _=class{browser;buildId;platform;executablePath;#e;constructor(e,r,o,a){this.#e=e,this.browser=r,this.buildId=o,this.platform=a,this.executablePath=e.computeExecutablePath({browser:r,buildId:o,platform:a})}get path(){return this.#e.installationDir(this.browser,this.platform,this.buildId)}readMetadata(){return this.#e.readMetadata(this.browser)}writeMetadata(e){this.#e.writeMetadata(this.browser,e)}},C=class{#e;#r;constructor(e,r){this.#e=e,this.#r=r?.(b.cache)}get rootDir(){return this.#e}browserRoot(e){return D.join(this.#e,e)}metadataFile(e){return D.join(this.browserRoot(e),".metadata")}readMetadata(e){let r=this.metadataFile(e);if(!R.existsSync(r))return{aliases:{}};let o=JSON.parse(R.readFileSync(r,"utf8"));if(typeof o!="object")throw new Error(".metadata is not an object");return o}writeMetadata(e,r){let o=this.metadataFile(e);R.mkdirSync(D.dirname(o),{recursive:!0}),R.writeFileSync(o,JSON.stringify(r,null,2))}readExecutablePath(e,r,o){let a=this.readMetadata(e),i=`${r}-${o}`;return a.executablePaths?.[i]??null}writeExecutablePath(e,r,o,a){let i=this.readMetadata(e);i.executablePaths||(i.executablePaths={});let n=`${r}-${o}`;i.executablePaths[n]=a,this.writeMetadata(e,i)}resolveAlias(e,r){let o=this.readMetadata(e);return r==="latest"?Object.values(o.aliases||{}).sort(Re(e)).at(-1):o.aliases[r]}installationDir(e,r,o){return D.join(this.browserRoot(e),`${r}-${o}`)}clear(){R.rmSync(this.#e,{force:!0,recursive:!0,maxRetries:10,retryDelay:500})}uninstall(e,r,o){let a=this.readMetadata(e);for(let n of Object.keys(a.aliases))a.aliases[n]===o&&delete a.aliases[n];let i=`${r}-${o}`;a.executablePaths?.[i]&&(delete a.executablePaths[i],this.writeMetadata(e,a)),R.rmSync(this.installationDir(e,r,o),{force:!0,recursive:!0,maxRetries:10,retryDelay:500})}getInstalledBrowsers(){return R.existsSync(this.#e)?R.readdirSync(this.#e).filter(o=>Object.values(u).includes(o)).flatMap(o=>R.readdirSync(this.browserRoot(o)).map(i=>{let n=Kt(D.join(this.browserRoot(o),i));return n?new _(this,o,n.buildId,n.platform):null}).filter(i=>i!==null)):[]}computeExecutablePath(e){if(e.platform??=y(),!e.platform)throw new Error(`Cannot download a binary for the provided platform: ${at.platform()} (${at.arch()})`);try{e.buildId=this.resolveAlias(e.browser,e.buildId)??e.buildId}catch{this.#r?.("could not read .metadata file for the browser")}let r=this.installationDir(e.browser,e.platform,e.buildId),o=this.readExecutablePath(e.browser,e.platform,e.buildId);return o?D.join(r,o):D.join(r,U[e.browser](e.platform,e.buildId))}};function Kt(t){let r=D.basename(t).split("-");if(r.length!==2)return;let[o,a]=r;if(!(!a||!o))return{platform:o,buildId:a}}function re(t){if(t.cacheDir===null){if(t.platform??=y(),t.platform===void 0)throw new Error("No platform specified. Couldn't auto-detect browser platform.");return U[t.browser](t.platform,t.buildId)}return new C(t.cacheDir).computeExecutablePath(t)}function Ae(t,e=!0){if(t.platform??=y(),!t.platform)throw new Error(`Cannot download a binary for the provided platform: ${it.platform()} (${it.arch()})`);let r=ot(t.browser,t.platform,t.channel);for(let o of r)try{return Zt(o),o}catch{}if(!e)return r[0];throw new Error(`Could not find Google Chrome executable for channel '${t.channel}' at:${r.map(o=>`
|
|
7
|
+
- ${o}`)}.`)}function $e(t){return new ee({...t,logger:t.logger??J})}var er=/^DevTools listening on (ws:\/\/.*)$/,tr=/^WebDriver BiDi listening on (ws:\/\/.*)$/,N=new Map,nt={exit:(...t)=>{N.get("exit")?.forEach(e=>e(...t))},SIGINT:(...t)=>{N.get("SIGINT")?.forEach(e=>e(...t))},SIGHUP:(...t)=>{N.get("SIGHUP")?.forEach(e=>e(...t))},SIGTERM:(...t)=>{N.get("SIGTERM")?.forEach(e=>e(...t))}};function Z(t,e){let r=N.get(t)||[];r.length===0&&process.on(t,nt[t]),r.push(e),N.set(t,r)}function Q(t,e){let r=N.get(t)||[],o=r.indexOf(e);o!==-1&&(r.splice(o,1),N.set(t,r),r.length===0&&process.off(t,nt[t]))}var ee=class{#e;#r;#o;#t;#s=!1;#a=!1;#i=async()=>{};#c;#n=[];#u=1e3;#h=new Jt;#d=()=>{this.kill()};#l;constructor(e){if(this.#e=e.executablePath,this.#r=e.args??[],this.#o=e.logger?.(b.launcher),this.#l=e.signal,this.#l?.aborted)throw new Error(this.#l.reason?this.#l.reason:"Launch aborted");this.#l?.addEventListener("abort",this.#d,{once:!0}),e.pipe??=!1,e.dumpio??=!1,e.handleSIGINT??=!0,e.handleSIGTERM??=!0,e.handleSIGHUP??=!0,e.detached??=process.platform!=="win32";let r=this.#p({pipe:e.pipe}),o=e.env||{};this.#o?.(`Launching ${this.#e} ${this.#r.join(" ")}`,{detached:e.detached,env:Object.keys(o).reduce((a,i)=>(i.toLowerCase().startsWith("puppeteer_")&&(a[i]=o[i]),a),{}),stdio:r}),this.#t=st.spawn(this.#e,this.#r,{detached:e.detached,windowsHide:!0,env:o,stdio:r}),this.#x(this.#t.stderr),this.#x(this.#t.stdout),this.#o?.(`Launched ${this.#t.pid}`),e.dumpio&&(this.#t.stderr?.pipe(process.stderr),this.#t.stdout?.pipe(process.stdout)),Z("exit",this.#b),e.handleSIGINT&&Z("SIGINT",this.#f),e.handleSIGTERM&&Z("SIGTERM",this.#f),e.handleSIGHUP&&Z("SIGHUP",this.#f),e.onExit&&(this.#i=e.onExit),this.#c=new Promise((a,i)=>{this.#t.once("exit",async()=>{this.#o?.(`Browser process ${this.#t.pid} onExit`),this.#w(),this.#s=!0;try{await this.#m()}catch(n){i(n);return}a()})})}async#m(){this.#a||(this.#a=!0,await this.#i())}get nodeProcess(){return this.#t}#p(e){return e.pipe?["pipe","pipe","pipe","pipe","pipe"]:["pipe","pipe","pipe"]}#w(){Q("exit",this.#b),Q("SIGINT",this.#f),Q("SIGTERM",this.#f),Q("SIGHUP",this.#f),this.#l?.removeEventListener("abort",this.#d)}#b=e=>{this.kill()};#f=e=>{switch(e){case"SIGINT":this.kill(),process.exit(130);case"SIGTERM":case"SIGHUP":this.close();break}};async close(){return await this.#m(),this.#s||this.kill(),await this.#c}hasClosed(){return this.#c}kill(){if(this.#o?.(`Trying to kill ${this.#t.pid}`),this.#t&&this.#t.pid&&or(this.#t.pid))try{if(this.#o?.(`Browser process ${this.#t.pid} exists`),process.platform==="win32")try{st.execSync(`taskkill /pid ${this.#t.pid} /T /F`)}catch(e){this.#o?.(`Killing ${this.#t.pid} using taskkill failed`,e),this.#t.kill()}else{let e=-this.#t.pid;try{process.kill(e,"SIGKILL")}catch(r){this.#o?.(`Killing ${this.#t.pid} using process.kill failed`,r),this.#t.kill("SIGKILL")}}}catch(e){throw new Error(`${rr}
|
|
8
|
+
Error cause: ${lt(e)?e.stack:e}`)}this.#w()}#x(e){let r=Qt.createInterface(e),o=()=>{r.off("line",a),r.off("close",i);try{r.close()}catch{}},a=n=>{if(n.trim()==="")return;this.#n.push(n);let l=this.#n.length-this.#u;l&&this.#n.splice(0,l),this.#h.emit("line",n)},i=()=>{o()};r.on("line",a),r.on("close",i)}getRecentLogs(){return[...this.#n]}waitForLineOutput(e,r=0){return new Promise((o,a)=>{let i=f=>{l(),a(new Error([`Failed to launch the browser process: ${f instanceof Error?` ${f.message}`:` Code: ${f}`}`,"","stderr:",this.getRecentLogs().join(`
|
|
9
|
+
`),"","TROUBLESHOOTING: https://pptr.dev/troubleshooting",""].join(`
|
|
10
|
+
`)))};this.#t.on("exit",i),this.#t.on("error",i);let n=r>0?setTimeout(c,r):void 0;this.#h.on("line",d);let l=()=>{clearTimeout(n),this.#h.off("line",d),this.#t.off("exit",i),this.#t.off("error",i)};function c(){l(),a(new te(`Timed out after ${r} ms while waiting for the WS endpoint URL to appear in stdout!`))}for(let f of this.#n)d(f);function d(f){let p=f.match(e);p&&(l(),o(p[1]))}})}},rr=`Puppeteer was unable to kill the process which ran the browser binary.
|
|
11
|
+
This means that, on future Puppeteer launches, Puppeteer might not be able to launch the browser.
|
|
12
|
+
Please check your open processes and ensure that the browser processes that Puppeteer launched have been killed.
|
|
13
|
+
If you think this is a bug, please report it on the Puppeteer issue tracker.`;function or(t){try{return process.kill(t,0)}catch(e){if(ar(e)&&e.code&&e.code==="ESRCH")return!1;throw e}}function lt(t){return typeof t=="object"&&t!==null&&"name"in t&&"message"in t}function ar(t){return lt(t)&&("errno"in t||"code"in t||"path"in t||"syscall"in t)}var te=class extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor)}};import gr from"node:assert";import{spawnSync as Ne}from"node:child_process";import{existsSync as A,readFileSync as Cr}from"node:fs";import{mkdir as mt,unlink as Rr}from"node:fs/promises";import L from"node:os";import H from"node:path";var S=class{#e;constructor(e){this.#e=e}supports(e){return!0}getDownloadUrl(e){return this.#r(e.browser,e.platform,e.buildId)}#r(e,r,o){return new URL(K[e](r,o,this.#e))}getExecutablePath(e){return U[e.browser](e.platform,e.buildId)}getName(){return"DefaultProvider"}};import{spawnSync as sr,spawn as ir,execFile as nr}from"node:child_process";import{constants as lr,createReadStream as cr,createWriteStream as ur}from"node:fs";import{mkdir as oe,readdir as hr,symlink as dr}from"node:fs/promises";import*as v from"node:path";import{Stream as fr,Writable as mr}from"node:stream";import{pipeline as ct}from"node:stream/promises";import{promisify as De}from"node:util";var M=De(nr);async function ht(t,e,r){if(v.isAbsolute(e)||(e=v.resolve(process.cwd(),e)),t.endsWith(".zip"))await oe(e,{recursive:!0}),await xr(t,e,r);else if(t.endsWith(".tar.bz2"))await ut(t,e,"bzip2",r);else if(t.endsWith(".dmg"))await oe(e),await br(t,e);else if(t.endsWith(".exe")){let o=sr(t,[`/ExtractDir=${e}`],{env:{__compat_layer:"RunAsInvoker"}});if(o.status!==0)throw new Error(`Failed to extract ${t} to ${e}: ${o.output}`)}else if(t.endsWith(".tar.xz"))await ut(t,e,"xz");else throw new Error(`Unsupported archive format: ${t}`)}function pr(t){let e=new fr.Transform({transform(r,o,a){t.stdin.write(r,o)?a():t.stdin.once("drain",a)},flush(r){t.stdout.destroyed?r():(t.stdin.end(),t.stdout.on("close",r))}});return t.stdin.on("error",r=>{"code"in r&&r.code==="EPIPE"?e.emit("end"):e.destroy(r)}),t.stdout.on("data",r=>e.push(r)).on("error",r=>e.destroy(r)),t.once("close",()=>e.end()),e}var wr={xz:"xz",bzip2:"bzip2"};async function ut(t,e,r,o){let{unpackTar:a}=await import("./chunk-QR6A54KJ.mjs");return await new Promise((i,n)=>{function l(f){return p=>{"code"in p&&p.code==="ENOENT"&&(p=new Error(`\`${f}\` utility is required to unpack this archive`,{cause:p})),n(p)}}let c=ir(wr[r],["-d"],{stdio:["pipe","pipe","inherit"]}).once("error",l(r)).once("exit",f=>{o?.(b.fileUtil)?.(`${r} exited, code=${f}`)}),d=a(e);d.once("error",l("tar")),d.once("finish",i),cr(t).pipe(pr(c)).pipe(d)})}async function br(t,e){let{stdout:r}=await M("hdiutil",["attach","-nobrowse","-noautoopen",t]),o=r.match(/\/Volumes\/(.*)/m);if(!o)throw new Error(`Could not find volume path in ${r}`);let a=o[0];try{let n=(await hr(a)).find(c=>typeof c=="string"&&c.endsWith(".app"));if(!n)throw new Error(`Cannot find app in ${a}`);let l=v.join(a,n);await M("cp",["-R",l,e])}finally{await M("hdiutil",["detach",a,"-quiet"])}}var j=class extends Error{};async function xr(t,e,r){for(let o of[Ir,Er])try{await o(t,e,r);return}catch(a){if(!(a instanceof j))throw a}throw new Error("Extraction failed: no zip archiver is available. Install `unzip` (or `tar.exe`/Powershell on Windows), or add the optional `yauzl` dependency.")}async function Er(t,e,r){let{default:o}=await import("yauzl").catch(()=>{throw new j("Extraction failed: The optional `yauzl` dependency is not installed.")}),a=De(o.open);try{let i=await a(t,{lazyEntries:!0});await new Promise((n,l)=>{i.on("error",l).on("end",n).on("entry",c=>{yr(i,c,e).then(()=>{i.readEntry()},l)}).readEntry()})}catch(i){throw new Error(`Extraction failed: ${t}`,{cause:i})}}async function Ir(t,e,r){try{if(process.platform==="win32"){let o=process.env.SystemRoot??process.env.SYSTEMROOT??"C:\\Windows";try{let a=`${o}\\System32\\tar.exe`;await M(a,["-xf",t,"-C",e]);return}catch(a){r?.(b.fileUtil)?.(`tar.exe extraction failed: ${a}`)}try{await M("powershell.exe",["-NoProfile","-NonInteractive","-Command","& { Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force }",t,e]);return}catch(a){r?.(b.fileUtil)?.(`powershell.exe extraction failed: ${a}`)}await M("pwsh.exe",["-NoProfile","-NonInteractive","-Command","& { Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force }",t,e])}else await M("unzip",["-o",t,"-d",e])}catch(o){throw o?.code==="ENOENT"?new j("Extraction failed: Required native binary ('tar.exe', 'powershell.exe', 'pwsh.exe' or 'unzip') was not found in the system PATH."):new Error(`Extraction failed: ${o?.stderr?.toString()||o?.message}`)}}function vr(t,e){let r=v.resolve(t),o=v.resolve(e);return o===r||o.startsWith(r+v.sep)}async function yr(t,e,r){let{S_IFMT:o,S_IFDIR:a,S_IFLNK:i}=lr,n=e.externalFileAttributes>>>16,l=(n&o)===a||e.fileName.endsWith("/")||e.versionMadeBy>>8===0&&e.externalFileAttributes===16,c=(n&o)===i,d=n===0?l?493:420:n&511,f=v.join(r,e.fileName);if(l){await oe(f,{recursive:!0,mode:d});return}await oe(v.dirname(f),{recursive:!0});let p=await De(t.openReadStream.bind(t))(e);if(c){let E=[];await ct(p,new mr({write(Te,Wr,It){Te instanceof Buffer&&E.push(Te),It()}}));let P=Buffer.concat(E).toString(),Et=v.resolve(v.dirname(f),P);if(!vr(r,Et))throw new Error(`Zip symlink "${e.fileName}" would point outside of the target directory.`);await dr(P,f);return}await ct(p,ur(f,{mode:d}))}var V=null,ae=class t{#e;#r=0;#o=0;#t=[];#s=!1;#a=0;#i=!1;constructor(e){this.#e=e}static createBarTicker(e,r,o=process.stderr){return(!V||V.#e!==o)&&(V=new t(o)),V.#n(e,r)}#c(){let e=this.#r++;return e>0&&this.#e.isTTY&&this.#e.write(`
|
|
14
|
+
`),e}#n(e,r){let o=this.#c();this.#t.push({title:e,total:r,downloaded:0,startTime:0,lastRendered:""});let a=!1;return i=>{let n=this.#t[o];n.startTime===0&&(n.startTime=Date.now()),n.downloaded+=i;let l=n.downloaded>=n.total;(l||Date.now()-this.#a>=100)&&this.#u(),l&&!a&&(a=!0,this.#l())}}#u(){this.#s||(this.#s=!0,queueMicrotask(()=>{this.#s=!1,this.#a=Date.now(),this.#d()}))}#h(e){let r=this.#t[e],o=Math.min(1,Math.max(0,r.downloaded/r.total)),a=Math.round(o*100),i=r.startTime>0?Date.now()-r.startTime:0,n=i>0?r.downloaded/i:0,l=n>0?(r.total-r.downloaded)/n/1e3:0,c=20,d=Math.round(c*o),f="=".repeat(d)+" ".repeat(c-d),p=o>=1?"unpacking":`${a}% ${l.toFixed(1)}s`;return`${r.title} [${f}] ${p} `}#d(){if(!this.#e.isTTY)return;let e=this.#r;if(e!==0){e>1&&this.#e.moveCursor(0,-(e-1));for(let r=0;r<e;r++){let o=this.#h(r);o!==this.#t[r].lastRendered&&(this.#e.cursorTo(0),this.#e.write(o),this.#e.clearLine(1),this.#t[r].lastRendered=o),r<e-1&&this.#e.moveCursor(0,1)}this.#e.cursorTo(0),this.#i&&(V=null,this.#e.write(`
|
|
15
|
+
`))}}#l(){this.#o++,this.#o>=this.#r&&this.#r>0&&(this.#i=!0)}};var pt=new Map;function se(t){pt.set(t,process.hrtime())}function ie(t,e){let r=process.hrtime(),o=pt.get(t);if(!o)return;let a=r[0]*1e3+r[1]/1e6-(o[0]*1e3+o[1]/1e6);e?.(b.install)?.(`Duration for ${t}: ${a}ms`)}var B=class extends Error{};async function Sr(t){if(!t.platform)throw new Error("Platform must be defined");let e=t.logger,o=new C(t.cacheDir,t.logger).browserRoot(t.browser),a=[...t.providers||[]];t.baseUrl&&a.push(new S(t.baseUrl)),(!t.baseUrl||t.forceFallbackForTesting)&&a.push(new S);let i={browser:t.browser,platform:t.platform,buildId:t.buildId,progressCallback:t.downloadProgressCallback==="default"?await wt(t.browser,t.buildIdAlias??t.buildId):t.downloadProgressCallback},n=[];for(let d of a)try{if(!await d.supports(i)){e?.(b.install)?.(`Provider ${d.getName()} does not support ${t.browser} on ${t.platform}`);continue}d instanceof S||(e?.(b.install)?.(`\u26A0\uFE0F Using custom downloader: ${d.getName()}`),e?.(b.install)?.("\u26A0\uFE0F Puppeteer does not guarantee compatibility with non-default providers")),e?.(b.install)?.(`Trying provider: ${d.getName()} for ${t.browser} ${t.buildId}`);let f=await d.getDownloadUrl(i);if(!f){e?.(b.install)?.(`Provider ${d.getName()} returned no URL for ${t.browser} ${t.buildId}`);continue}return e?.(b.install)?.(`Successfully got URL from ${d.getName()}: ${f}`),A(o)||await mt(o,{recursive:!0}),await Ar(f,t,d,e)}catch(f){e?.(b.install)?.(`Provider ${d.getName()} failed: ${f.message}`),n.push({providerName:d.getName(),error:f})}let l=n.map(d=>` - ${d.providerName}: ${d.error.message}`).join(`
|
|
16
|
+
`),c=`All providers failed for ${t.browser} ${t.buildId}:
|
|
17
|
+
${l}`;throw n.length>0&&n.every(d=>d.error instanceof B)?new B(c):new Error(c)}async function Le(t){if(t.platform??=y(),t.unpack??=!0,t.logger??=J,!t.platform)throw new Error(`Cannot download a binary for the provided platform: ${L.platform()} (${L.arch()})`);return t.providers??=[],await Sr(t)}async function dt(t,e){if(process.platform!=="linux"||t.platform!==s.LINUX&&t.platform!==s.LINUX_ARM)return;let r=H.join(H.dirname(t.executablePath),"deb.deps");if(!A(r)){e?.(b.install)?.(`deb.deps file was not found at ${r}`);return}let o=Cr(r,"utf-8").split(`
|
|
18
|
+
`).join(",");if(process.getuid?.()!==0)throw new Error("Installing system dependencies requires root privileges");let a=Ne("apt-get",["-v"]);if(a.status!==0)throw new Error("Failed to install system dependencies: apt-get does not seem to be available");if(e?.(b.install)?.(`Trying to install dependencies: ${o}`),a=Ne("apt-get",["satisfy","-y",o,"--no-install-recommends"]),a.status!==0)throw new Error(`Failed to install system dependencies: status=${a.status},error=${a.error},stdout=${a.stdout.toString("utf8")},stderr=${a.stderr.toString("utf8")}`);e?.(b.install)?.(`Installed system dependencies ${o}`)}async function Ar(t,e,r,o){if(!r)throw new Error("Provider is required for installation");if(e.platform??=y(),!e.platform)throw new Error(`Cannot download a binary for the provided platform: ${L.platform()} (${L.arch()})`);let a=e.downloadProgressCallback;a==="default"&&(a=await wt(e.browser,e.buildIdAlias??e.buildId));let i=decodeURIComponent(t.toString()).split("/").pop();gr(i,`A malformed download URL was found: ${t}.`);let n=new C(e.cacheDir,e.logger),l=n.browserRoot(e.browser),c=H.join(l,`${e.buildId}-${i}`);if(A(l)||await mt(l,{recursive:!0}),e.expectedHash&&o?.(b.install)?.(`Using provided checksum for ${i}: ${e.expectedHash}`),!e.unpack)return A(c)||(o?.(b.install)?.(`Downloading binary from ${t}`),se("download"),await le(t,c,a,e.expectedHash),ie("download",o)),c;let d=n.installationDir(e.browser,e.platform,e.buildId),f=await r.getExecutablePath({browser:e.browser,buildId:e.buildId,platform:e.platform});o?.(b.install)?.(`Using executable path from provider: ${f}`);let p=new _(n,e.browser,e.buildId,e.platform);r instanceof S||n.writeExecutablePath(e.browser,e.platform,e.buildId,f);try{if(A(d)){if(!A(p.executablePath))throw new B(`The browser folder (${d}) exists but the executable (${p.executablePath}) is missing. An earlier install of this build probably did not finish. Delete ${d} and install the browser again.`);return await ft(p,o),e.installDeps&&await dt(p,o),p}if(A(c))o?.(b.install)?.(`Using existing archive at ${c}`);else{o?.(b.install)?.(`Downloading binary from ${t}`);try{se("download"),await le(t,c,a,e.expectedHash)}finally{ie("download",o)}}o?.(b.install)?.(`Installing ${c} to ${d}`);try{se("extract"),await ht(c,d,e.logger)}finally{ie("extract",o)}if(e.buildIdAlias){let E=p.readMetadata();E.aliases[e.buildIdAlias]=e.buildId,p.writeMetadata(E)}return await ft(p,o),e.installDeps&&await dt(p,o),p}finally{A(c)&&await Rr(c)}}async function ft(t,e){if((t.platform===s.WIN32||t.platform===s.WIN64)&&t.browser===u.CHROME&&t.platform===y())try{se("permissions");let r=H.dirname(t.executablePath),o=H.join(r,"setup.exe");if(!A(o))return;Ne(H.join(r,"setup.exe"),["--configure-browser-in-directory="+r],{shell:!1})}finally{ie("permissions",e)}}async function $r(t){if(t.platform??=y(),!t.platform)throw new Error(`Cannot detect the browser platform for: ${L.platform()} (${L.arch()})`);new C(t.cacheDir).uninstall(t.browser,t.platform,t.buildId)}async function Dr(t){return new C(t.cacheDir).getInstalledBrowsers()}async function Nr(t){if(t.platform??=y(),!t.platform)throw new Error(`Cannot download a binary for the provided platform: ${L.platform()} (${L.arch()})`);let e=[...t.providers||[],new S(t.baseUrl)],r={browser:t.browser,platform:t.platform,buildId:t.buildId};for(let o of e){if(!await o.supports(r))continue;let a=await o.getDownloadUrl(r);if(a&&await Oe(a))return!0}return!1}function Lr(t,e,r,o){return new URL(K[t](e,r,o))}async function wt(t,e){let r,o=0;return(a,i)=>{r||(r=ae.createBarTicker(`Downloading ${t} ${e} - ${Pr(i)}`,i));let n=a-o;o=a,r(n)}}function Pr(t){let e=t/1e3/1e3;return`${Math.round(e*10)/10} MB`}import{spawn as Tr}from"node:child_process";import bt from"node:fs";import Mr from"node:os";import Br from"node:path";import{stdin as Or,stdout as Ur}from"node:process";import*as xt from"node:readline";function _r(t){return Object.values(u).includes(t)}function Hr(t){return Object.values(s).includes(t)}var Fr="3.2.3",Pe=class{#e;#r;#o;#t;#s;#a;#i;constructor(e,r){e||(e={}),typeof e=="string"&&(e={cachePath:e}),this.#e=e.cachePath??process.cwd(),this.#r=r,this.#o=e.scriptName??"@puppeteer/browsers",this.#t=e.version??Fr,this.#s=e.allowCachePathOverride??!0,this.#a=e.pinnedBrowsers,this.#i=e.prefixCommand}#c(e,r){return e.positional("browser",{description:"Which browser to install <browser>[@<buildId|latest>]. `latest` will try to find the latest available build. `buildId` is a browser-specific identifier such as a version or a revision.",type:"string",coerce:o=>{let a={name:this.#d(o),buildId:this.#l(o)};if(!_r(a.name))throw new Error(`Unsupported browser '${a.name}'`);return a},demandOption:r})}#n(e){return e.option("platform",{type:"string",desc:"Platform that the binary needs to be compatible with.",choices:Object.values(s),default:y(),coerce:r=>{if(!Hr(r))throw new Error(`Unsupported platform '${r}'`);return r},defaultDescription:"Auto-detected"})}#u(e,r=!1){return this.#s?e.option("path",{type:"string",desc:"Path to the root folder for the browser downloads and installation. If a relative path is provided, it will be resolved relative to the current working directory. The installation folder structure is compatible with the cache structure used by Puppeteer.",defaultDescription:"Current working directory",...r?{}:{default:process.cwd()},demandOption:r}):e}async run(e){let{default:r}=await import("./chunk-C564NU2H.mjs"),{hideBin:o}=await import("./chunk-4K5KC6V2.mjs"),a=r(o(e)),i=a.scriptName(this.#o).version(this.#t);this.#i?i=i.command(this.#i.cmd,this.#i.description,n=>this.#h(n)):i=this.#h(i),await i.demandCommand(1).help().wrap(Math.min(120,a.terminalWidth())).parseAsync()}#h(e){let r=this.#a?"pinned":"latest",o=this.#a?"[browser]":"<browser>";return e.command(`install ${o}`,"Download and install the specified browser. If successful, the command outputs the actual browser buildId that was installed and the absolute path to the browser executable (see --format).",a=>{this.#a&&a.example("$0 install","Install all pinned browsers"),a.example("$0 install chrome",`Install the ${r} available build of the Chrome browser.`).example("$0 install chrome@latest","Install the latest available build for the Chrome browser.").example("$0 install chrome@stable","Install the latest available build for the Chrome browser from the stable channel.").example("$0 install chrome@beta","Install the latest available build for the Chrome browser from the beta channel.").example("$0 install chrome@dev","Install the latest available build for the Chrome browser from the dev channel.").example("$0 install chrome@canary","Install the latest available build for the Chrome Canary browser.").example("$0 install chrome@115","Install the latest available build for Chrome 115.").example("$0 install chromedriver@canary","Install the latest available build for ChromeDriver Canary.").example("$0 install chromedriver@115","Install the latest available build for ChromeDriver 115.").example("$0 install chromedriver@115.0.5790","Install the latest available patch (115.0.5790.X) build for ChromeDriver.").example("$0 install chrome-headless-shell","Install the latest available chrome-headless-shell build.").example("$0 install chrome-headless-shell@beta","Install the latest available chrome-headless-shell build corresponding to the Beta channel.").example("$0 install chrome-headless-shell@118","Install the latest available chrome-headless-shell 118 build.").example("$0 install chromium@1083080","Install the revision 1083080 of the Chromium browser.").example("$0 install firefox","Install the latest nightly available build of the Firefox browser.").example("$0 install firefox@stable","Install the latest stable build of the Firefox browser.").example("$0 install firefox@beta","Install the latest beta build of the Firefox browser.").example("$0 install firefox@devedition","Install the latest devedition build of the Firefox browser.").example("$0 install firefox@esr","Install the latest ESR build of the Firefox browser.").example("$0 install firefox@nightly","Install the latest nightly build of the Firefox browser.").example("$0 install firefox@stable_111.0.1","Install a specific version of the Firefox browser.").example("$0 install firefox --platform mac","Install the latest Mac (Intel) build of the Firefox browser."),this.#s&&a.example("$0 install firefox --path /tmp/my-browser-cache","Install to the specified cache directory.");let i=this.#c(a,!this.#a),n=this.#n(i);return this.#u(n,!1).option("base-url",{type:"string",desc:"Base URL to download from"}).option("install-deps",{type:"boolean",desc:"Whether to attempt installing system dependencies (only supported on Linux, requires root privileges).",default:!1}).option("format",{type:"string",desc:"Format to use for the output. Supported placeholders: {{browser}}, {{buildId}}, {{path}}, {{platform}}",default:"{{browser}}@{{buildId}} {{path}}"})},async a=>{if(this.#a&&!a.browser){let i=await Promise.allSettled(Object.entries(this.#a).map(async([n,l])=>{l.skipDownload||await this.#p({...a,browser:{name:n,buildId:l.buildId}})}));for(let n of i)if(n.status==="rejected")throw n.reason}else await this.#p(a)}).command("launch <browser>","Launch the specified browser",a=>{a.example("$0 launch chrome@115.0.5790.170","Launch Chrome 115.0.5790.170").example("$0 launch firefox@112.0a1","Launch the Firefox browser identified by the milestone 112.0a1.").example("$0 launch chrome@115.0.5790.170 --detached","Launch the browser but detach the sub-processes.").example("$0 launch chrome@canary --system","Try to locate the Canary build of Chrome installed on the system and launch it.").example("$0 launch chrome@115.0.5790.170 -- --version","Launch Chrome 115.0.5790.170 and pass custom argument to the binary.");let i=a.parserConfiguration({"populate--":!0}),n=this.#c(i,!0),l=this.#n(n);return this.#u(l).option("detached",{type:"boolean",desc:"Detach the child process.",default:!1}).option("system",{type:"boolean",desc:"Search for a browser installed on the system instead of the cache folder.",default:!1}).option("dumpio",{type:"boolean",desc:"Forwards the browser's process stdout and stderr",default:!1})},async a=>{let i=a["--"]?.filter(l=>typeof l=="string");a.browser.buildId=this.#m(a.browser.buildId,a.browser.name);let n=a.system?Ae({browser:a.browser.name,channel:ue(a.browser.buildId),platform:a.platform}):re({browser:a.browser.name,buildId:a.browser.buildId,cacheDir:a.path??this.#e,platform:a.platform});$e({args:i,executablePath:n,dumpio:a.dumpio,detached:a.detached})}).command("clear",this.#s?"Removes all installed browsers from the specified cache directory":`Removes all installed browsers from ${this.#e}`,a=>this.#u(a,!0),async a=>{let i=a.path??this.#e,n=this.#r??xt.createInterface({input:Or,output:Ur});n.question(`Do you want to permanently and recursively delete the content of ${i} (yes/No)? `,l=>{if(n.close(),!["y","yes"].includes(l.toLowerCase().trim())){console.log("Cancelled.");return}new C(i).clear(),console.log(`${i} cleared.`)})}).command("list","List all installed browsers in the cache directory",a=>(a.example("$0 list","List all installed browsers in the cache directory"),this.#s&&a.example("$0 list --path /tmp/my-browser-cache","List browsers installed in the specified cache directory"),this.#u(a)),async a=>{let i=a.path??this.#e,l=new C(i).getInstalledBrowsers();for(let c of l)console.log(`${c.browser}@${c.buildId} (${c.platform}) ${c.executablePath}`)}).command("bisect <path>","(experimental) Bisect Chrome for Testing using the specified script. Downloads https://chromium.googlesource.com/chromium/src.git/+/main/tools/bisect-builds.py to ~/bisect-builds.py if needed.",a=>a.positional("path",{type:"string",description:"Path to a script or test name to bisect.",demandOption:!0}).option("good",{type:"string",alias:"g",demandOption:!0,desc:"Last known good version"}).option("bad",{type:"string",alias:"b",demandOption:!0,desc:"First known bad version"}).option("cft",{type:"boolean",desc:"Use -cft",default:!0}),async a=>{let n=a.path.endsWith(".mjs")||a.path.endsWith(".cjs")||a.path.endsWith(".js")?`PUPPETEER_EXECUTABLE_PATH=%p node ${a.path}`:`BINARY=%p npm run ${a.path}`,l=Br.join(Mr.homedir(),"bisect-builds.py");if(!bt.existsSync(l)){console.log("Downloading bisect-builds.py...");let f=await fetch("https://chromium.googlesource.com/chromium/src.git/+/main/tools/bisect-builds.py?format=TEXT");if(!f.ok)throw new Error(`Failed to download bisect-builds.py: ${f.statusText}`);let p=await f.text(),E=Buffer.from(p,"base64").toString("utf-8");bt.writeFileSync(l,E,{mode:493}),console.log(`Saved bisect-builds.py to ${l}`)}let c="python3",d=[l,"-g",a.good,"-b",a.bad,a.cft?"-cft":"-s","-v","--verify-range","--not-interactive","-c",n];await new Promise((f,p)=>{let E=Tr(c,d,{stdio:"inherit"});E.on("error",P=>{p(P)}),E.on("exit",P=>{P!==0?p(new Error(`Process exited with code ${P}`)):f()})})}).demandCommand(1).help()}#d(e){return e.split("@").shift()}#l(e){let r=e.split("@");return r.length===2?r[1]:this.#a?"pinned":"latest"}#m(e,r){if(e==="pinned"){let o=this.#a?.[r];if(!o||!o.buildId)throw new Error(`No pinned version found for ${r}`);return o.buildId}return e}async#p(e){if(!e.browser)throw new Error("No browser arg provided");if(!e.platform)throw new Error("Could not resolve the current platform");e.browser.buildId=this.#m(e.browser.buildId,e.browser.name);let r=e.browser.buildId;e.browser.buildId=await Ce(e.browser.name,e.platform,e.browser.buildId);try{await Le({browser:e.browser.name,buildId:e.browser.buildId,platform:e.platform,cacheDir:e.path??this.#e,downloadProgressCallback:"default",baseUrl:e.baseUrl,buildIdAlias:r!==e.browser.buildId?r:void 0,installDeps:e.installDeps})}catch(a){if(!(a instanceof B))throw a;let i=this.#i?`${this.#o} ${this.#i.cmd}`:this.#o;throw new Error(`${a.message}
|
|
19
|
+
You can also empty the whole browser cache with \`npx ${i} clear\` and then run \`npx ${i} install\` again.`,{cause:a})}let o=re({browser:e.browser.name,buildId:e.browser.buildId,cacheDir:e.path??this.#e,platform:e.platform});console.log(e.format.replace(/{{browser}}/g,e.browser.name).replace(/{{buildId}}/g,e.browser.buildId).replace(/{{path}}/g,o).replace(/{{platform}}/g,e.platform))}};function kr(t,e,r,o="zip"){return`${t}-${e}-${r}.${o}`}export{u as a,s as b,h as c,m as d,Ce as e,Xt as f,Yt as g,Re as h,y as i,_ as j,C as k,re as l,Ae as m,$e as n,er as o,tr as p,ee as q,te as r,S as s,Le as t,$r as u,Dr as v,Nr as w,Lr as x,Pe as y,kr as z};
|