@bendyline/gezel-service 1.0.7 → 1.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/dist/bin/gezeld.js +6253 -3616
- package/dist/handboek-content/whats-new/1.26224.md +1 -0
- package/dist/handboek-content/whats-new/1.26226.md +1 -0
- package/dist/handboek-content/whats-new/1.26231.md +1 -0
- package/dist/handboek-content/whats-new/1.26234.md +1 -0
- package/dist/handboek-content/whats-new/1.26237.md +1 -0
- package/dist/handboek-content/whats-new/1.26244.md +2 -1
- package/dist/handboek-content/whats-new/1.26247.md +88 -0
- package/dist/handboek-content/whats-new/whats-new-index.md +1 -0
- package/dist/index-store/static-index-worker.js +17 -1
- package/dist/index.d.ts +473 -209
- package/dist/index.js +6251 -3614
- package/dist/memory/embed-worker.js +58 -2
- package/dist/memory/image-embed-worker.js +8 -0
- package/dist/providers/llama-cpp/gguf-metadata-worker.js +2 -0
- package/dist/providers/mlx/python/gezel_mlx_server.py +18 -18
- package/dist/ui/assets/AmbientDashboardCard-Cf5fi_fY.js +1 -0
- package/dist/ui/assets/{AudioEngineSettings-BDrNIGGm.js → AudioEngineSettings-D3L7HOHe.js} +1 -1
- package/dist/ui/assets/{BenchmarksView-CHyujjs8.js → BenchmarksView-B68hrLCl.js} +1 -1
- package/dist/ui/assets/CatalogBrowser-DEM9t7Es.js +1 -0
- package/dist/ui/assets/{ChannelsSettings-Be_W1mr8.js → ChannelsSettings-DtK_k0Ul.js} +1 -1
- package/dist/ui/assets/ChatTimelineView-CQ4Sf4Ip.js +7 -0
- package/dist/ui/assets/ConfirmDialog-Dt1ed4Fh.js +1 -0
- package/dist/ui/assets/ConnectedAppsPanel-Cl8LEkrt.js +1 -0
- package/dist/ui/assets/CraftbookEditor-DEQRlQ2p.js +1 -0
- package/dist/ui/assets/{CraftbookScriptEditorView-DXIZYZT3.js → CraftbookScriptEditorView-DhXkkIdK.js} +1 -1
- package/dist/ui/assets/{CraftbookTabContent-Bm7t_b37.js → CraftbookTabContent-_oIdpQTG.js} +1 -1
- package/dist/ui/assets/{CraftbookToolsetSetup-DTEA-3K3.js → CraftbookToolsetSetup-BKg136L1.js} +1 -1
- package/dist/ui/assets/{CraftbooksView-C4X99TTe.js → CraftbooksView-Dm2zH-nW.js} +2 -2
- package/dist/ui/assets/{DiffpackReviewView-ClcNxtmF.js → DiffpackReviewView-EFLGJnwr.js} +1 -1
- package/dist/ui/assets/DocumentDetail-ClDRj2N-.js +1 -0
- package/dist/ui/assets/DocumentsView-ny9oieg2.js +1 -0
- package/dist/ui/assets/DropdownMenu-S4d9-3j3.js +1 -0
- package/dist/ui/assets/Ds4Settings-CeWlm5Vf.js +1 -0
- package/dist/ui/assets/EmbeddedChat-Hjrrgpao.js +1 -0
- package/dist/ui/assets/{FaceRecognitionCard-D3hdc7uU.js → FaceRecognitionCard-D7ufKqjI.js} +1 -1
- package/dist/ui/assets/FileMapView-DRjf59RH.js +1 -0
- package/dist/ui/assets/{FoldersSettings-BcNzl4vT.js → FoldersSettings-DDUhaFio.js} +1 -1
- package/dist/ui/assets/GezelDetail-Cph6pVGb.js +1 -0
- package/dist/ui/assets/{GezelJsonEditor-fOvYclu9.js → GezelJsonEditor-7vDGyBib.js} +1 -1
- package/dist/ui/assets/{GezellenView-BTzhHrxi.js → GezellenView-DQhcO1CP.js} +1 -1
- package/dist/ui/assets/{GildeUpdatesCard-Bq6XEpLP.js → GildeUpdatesCard-UKKNm_U8.js} +1 -1
- package/dist/ui/assets/{GithubSignInChip-CnlTCG8G.js → GithubSignInChip-DjM3qZsL.js} +1 -1
- package/dist/ui/assets/{HandboekMediaProvider-BfQW8_Nr.js → HandboekMediaProvider-DixaXTAH.js} +1 -1
- package/dist/ui/assets/HandboekView-BeNQqho9.js +1 -0
- package/dist/ui/assets/HistoryView-E2szGNGS.js +1 -0
- package/dist/ui/assets/{HomeView-CB_5TJIp.css → HomeView-CNeqCFPc.css} +1 -1
- package/dist/ui/assets/HomeView-CkiS3DXy.js +1 -0
- package/dist/ui/assets/{ImageEngineSettings-BpMfQy4f.js → ImageEngineSettings-BCKT7Gvi.js} +1 -1
- package/dist/ui/assets/{ImageRecognitionSettings-Ct-7-Oas.js → ImageRecognitionSettings-DD6syFez.js} +1 -1
- package/dist/ui/assets/IncompleteDownloads-BiPaaahS.js +1 -0
- package/dist/ui/assets/InstallProgressRow-DyKOI4MU.js +1 -0
- package/dist/ui/assets/KnowledgeCatalogsCard-B132vzRa.js +1 -0
- package/dist/ui/assets/KnowledgeView-CtPuIlN4.js +1 -0
- package/dist/ui/assets/LlamaCppSettings-D6zHcu4W.js +1 -0
- package/dist/ui/assets/{MarkdownField-D-0Zw7gM.js → MarkdownField-CK8K3fzj.js} +1 -1
- package/dist/ui/assets/MemoriesTree-DzjXzIrM.js +1 -0
- package/dist/ui/assets/{MicrophoneSettings-BIaFxyY_.js → MicrophoneSettings-1FH83SCq.js} +1 -1
- package/dist/ui/assets/MlxSettings-BYxUqFnJ.js +1 -0
- package/dist/ui/assets/ModelPicker-DoXPfQkQ.js +1 -0
- package/dist/ui/assets/{NewScriptDialog-D-gkY8TS.js → NewScriptDialog-C5X-7PMt.js} +1 -1
- package/dist/ui/assets/NewTaskDialog-Cyqtmigv.js +2 -0
- package/dist/ui/assets/{OllamaSettings-oIE2Mech.js → OllamaSettings-DkjmA-sB.js} +1 -1
- package/dist/ui/assets/ProjectChat-YEqUME6k.js +5 -0
- package/dist/ui/assets/{ProjectConnectionsTab-BZqp-oKI.js → ProjectConnectionsTab-dFCJpW93.js} +1 -1
- package/dist/ui/assets/ProjectGitStatusBar-CjZxG54t.js +1 -0
- package/dist/ui/assets/{ProjectGithubView-w8suLCsA.js → ProjectGithubView-CQ4-tmPx.js} +1 -1
- package/dist/ui/assets/{ProjectMailTab-DGo7eyB8.js → ProjectMailTab-NaScsZJf.js} +1 -1
- package/dist/ui/assets/ProjectOverviewView-ChjxbQas.js +1 -0
- package/dist/ui/assets/{ProjectTimeline-DRe3D9qY.js → ProjectTimeline-BZpdCisR.js} +1 -1
- package/dist/ui/assets/ProjectsView-J77ECk6V.js +7 -0
- package/dist/ui/assets/{RecommendedBadge-BKiDixnB.js → RecommendedBadge-D0m68PAu.js} +1 -1
- package/dist/ui/assets/{RemoteServersPanel-DGyl6-Rg.js → RemoteServersPanel-BdLOoORu.js} +1 -1
- package/dist/ui/assets/ScriptEditorTabs-BFvIiDFZ.js +2 -0
- package/dist/ui/assets/ScriptEditorView-B09rm1vz.js +5 -0
- package/dist/ui/assets/{ScriptsView-WQc28TmQ.js → ScriptsView-BvNAJXpo.js} +1 -1
- package/dist/ui/assets/{SecurityComplianceSettings-DsMEA4J3.js → SecurityComplianceSettings-DzGOnptO.js} +1 -1
- package/dist/ui/assets/SessionSwitcher-6okzcxT7.js +1 -0
- package/dist/ui/assets/SettingsView-Dur4dLhW.js +3 -0
- package/dist/ui/assets/SquisqIntegration-6v3yNOIP.js +2 -0
- package/dist/ui/assets/{StorageCleanupDialog-DHqwyMZZ.js → StorageCleanupDialog-OQlomMJD.js} +1 -1
- package/dist/ui/assets/{StorageUsageCard-CdT6SU51.js → StorageUsageCard-f6c6qTbM.js} +1 -1
- package/dist/ui/assets/Tabs-jE0Z5Tzd.js +1 -0
- package/dist/ui/assets/TaskTabContent-0w3kAUWR.js +1 -0
- package/dist/ui/assets/TasksView-BVMT4BAY.js +1 -0
- package/dist/ui/assets/{TerminalCodeEditor-77pBm6f3.js → TerminalCodeEditor-DO7zLKy-.js} +2 -2
- package/dist/ui/assets/ToolsetsEditor-Bb1wD5mV.js +8 -0
- package/dist/ui/assets/TransformToolbarButton-BWYkEB0d.js +5 -0
- package/dist/ui/assets/UnrecognizedModels-HtdMZUqK.js +1 -0
- package/dist/ui/assets/{VideoEngineSettings-DzMeINuv.js → VideoEngineSettings-Dq8Nw_tK.js} +1 -1
- package/dist/ui/assets/{WorkspaceIndexPane-DU4yd4Ai.js → WorkspaceIndexPane-fpDz4MwZ.js} +1 -1
- package/dist/ui/assets/{api-BX5xXiFs.js → api-BPraLwsh.js} +1 -1
- package/dist/ui/assets/chat-thread-memory-Be48zsyG.js +1 -0
- package/dist/ui/assets/chunk-6ECMNUIP-DDVjPyfK.js +15 -0
- package/dist/ui/assets/{chunk-6N2J7C2B-B5QIrD9m.js → chunk-6N2J7C2B-CsppiLVr.js} +1 -1
- package/dist/ui/assets/{chunk-A6N6IN3I-DXok09eC.js → chunk-A6N6IN3I-ofeM4l8g.js} +1 -1
- package/dist/ui/assets/chunk-B7GEAZBI-Divd2h1k.js +1 -0
- package/dist/ui/assets/chunk-DXYWKZ52-BXcAlClu.js +1 -0
- package/dist/ui/assets/chunk-FLR2ARKC-D7wrvQgT.js +2 -0
- package/dist/ui/assets/chunk-IIQYS2YH-DKZhWMpn.js +1 -0
- package/dist/ui/assets/{chunk-ILCJ3WFD-WRukZ7R1.js → chunk-ILCJ3WFD-CLZxw4Ge.js} +3 -3
- package/dist/ui/assets/chunk-OBADJV7C-CDVOcmYt.js +1 -0
- package/dist/ui/assets/chunk-Q77KNJIN-BIDRf0aP.js +6 -0
- package/dist/ui/assets/chunk-S5PCVMKU-Df5XzhSE.js +6 -0
- package/dist/ui/assets/chunk-UBFT2CDQ-FexGDigd.js +31 -0
- package/dist/ui/assets/{chunk-USU6HTKB-D5FmDzJU.js → chunk-USU6HTKB-B_p-YcDp.js} +1 -1
- package/dist/ui/assets/chunk-VKXOZTYP-BoVvWSBR.js +5 -0
- package/dist/ui/assets/{chunk-6RQOV3B3-CwvKotJw.js → chunk-VPWPEMZJ-DRKoa_j0.js} +1 -1
- package/dist/ui/assets/{chunk-WATAOG4Y-DXg2lov5.js → chunk-WATAOG4Y-C1EXVPmG.js} +1 -1
- package/dist/ui/assets/{container-B7jJtK5V.js → container-Ce94efbg.js} +1 -1
- package/dist/ui/assets/csv-62UGQMzZ.js +1 -0
- package/dist/ui/assets/data-B2kHjlc5.js +1 -0
- package/dist/ui/assets/dist-B9-VrAP8.js +2 -0
- package/dist/ui/assets/dist-BaHut5iX.js +2 -0
- package/dist/ui/assets/dist-BqGwkOe5.js +225 -0
- package/dist/ui/assets/dist-ZnIgkoEi.js +4 -0
- package/dist/ui/assets/{dist-BHl1ZAVG.js → dist-l6uUFZMV.js} +2 -2
- package/dist/ui/assets/dist-pLLFUPO-.js +1 -0
- package/dist/ui/assets/{doc-s6H7T0IO.js → doc-Dr5K49bx.js} +28 -28
- package/dist/ui/assets/document-companion-BQk2kS0F.js +1 -0
- package/dist/ui/assets/document-import-QoM9UxJr.js +1 -0
- package/dist/ui/assets/docx-sXa1Rf41.js +2 -0
- package/dist/ui/assets/{epub-B98SgHBz.js → epub-RopMP0ec.js} +4 -4
- package/dist/ui/assets/{export-options-Bu-tI6og.js → export-options-f7PKjEBb.js} +1 -1
- package/dist/ui/assets/extract-UTAOG7LV-4WDRw1o4.js +1 -0
- package/dist/ui/assets/file-browser-c2tf4MIb.js +5 -0
- package/dist/ui/assets/html-BGVOMhkv.js +253 -0
- package/dist/ui/assets/icons-DWaUNQbT.js +1 -0
- package/dist/ui/assets/images-JLBFCDD4-6JitW0hD.js +1 -0
- package/dist/ui/assets/index-B8NcxqcR.css +1 -0
- package/dist/ui/assets/index-C0DYtvfg.js +34 -0
- package/dist/ui/assets/index-J8TOMdvV.js +2 -0
- package/dist/ui/assets/{infer-kCLH1C8z.js → infer-LEGOsu64.js} +2 -2
- package/dist/ui/assets/ironcalc-BAi5gOlE.js +3 -0
- package/dist/ui/assets/layouts-2A7QNF6Y-CVwP7noP.js +1 -0
- package/dist/ui/assets/{mail-link-CI6YD6k2.js → mail-link-DXkmCd5b.js} +1 -1
- package/dist/ui/assets/markdown-baseline-9B52XlX2.js +1 -0
- package/dist/ui/assets/{markdown-Bi9b5f5Y.js → markdown-ryKA_OmY.js} +1 -1
- package/dist/ui/assets/materialize-A34OZGEU-xNNKzytx.js +1 -0
- package/dist/ui/assets/model-inventory-ykSm_IT5.js +1 -0
- package/dist/ui/assets/{model-quantization-BDzrELN_.js → model-quantization-CLO7XLoF.js} +1 -1
- package/dist/ui/assets/{monaco-base-BiVSa1J-.js → monaco-base-B1H1U1Sw.js} +1 -1
- package/dist/ui/assets/{monaco-setup-UeltVkg_.js → monaco-setup-DjhrGQui.js} +1 -1
- package/dist/ui/assets/{new-project-meta-0xhggGA_.js → new-project-meta-_f9sfcRX.js} +1 -1
- package/dist/ui/assets/outside-in-D73N1g_b.js +3 -0
- package/dist/ui/assets/{pdf-DgTjy3rN.js → pdf-BOjVDlCK.js} +3 -3
- package/dist/ui/assets/{pending-drafts-YVW6X55O.js → pending-drafts-B11MKQ9R.js} +1 -1
- package/dist/ui/assets/{poppetje-Ce-02Aqi.js → poppetje-DLB8uevw.js} +2 -2
- package/dist/ui/assets/pptx-BuxyNxQh.js +6 -0
- package/dist/ui/assets/primitives-CWrGZpPI.js +41 -0
- package/dist/ui/assets/run-export-ChaMXrKS.js +23 -0
- package/dist/ui/assets/squisq-formats-aAdypXoy.js +1 -0
- package/dist/ui/assets/standalone-source-q_Zzd1bd.js +11 -0
- package/dist/ui/assets/storage-D8pE2zg0.js +1 -0
- package/dist/ui/assets/styles-BhnF3s2q.css +1 -0
- package/dist/ui/assets/styles-CKVKwqoQ.js +550 -0
- package/dist/ui/assets/table-fcouR4db.js +1 -0
- package/dist/ui/assets/{terminal-monaco-setup-DNoK2tN4.js → terminal-monaco-setup-BAzrVzeR.js} +1 -1
- package/dist/ui/assets/{useCompactLayout-BarJPYcv.js → useCompactLayout-Dtolvzye.js} +0 -0
- package/dist/ui/assets/{useCopilotAvailability-BH1nLXQI.js → useCopilotAvailability-3xZvKgTF.js} +1 -1
- package/dist/ui/assets/{useDiffpacks-CK8W_OD_.js → useDiffpacks-Dsnr0wtX.js} +1 -1
- package/dist/ui/assets/{useGitSync-DWxX5-7K.js → useGitSync-BCTptQsp.js} +1 -1
- package/dist/ui/assets/{useShowWorkInProgressFeatures-DwwviLRO.js → useShowWorkInProgressFeatures-BhDNuQiU.js} +1 -1
- package/dist/ui/assets/{useTotalRamBytes-WoN_mi-V.js → useTotalRamBytes-DIx-_pf8.js} +1 -1
- package/dist/ui/assets/wasm-DdxEDD2H.js +1 -0
- package/dist/ui/assets/wasm_bg-DW9Xt_vt.wasm +0 -0
- package/dist/ui/assets/xlsx-DyBGuAO1.js +4 -0
- package/dist/ui/index.html +19 -18
- package/package.json +11 -11
- package/dist/ui/assets/AmbientDashboardCard-C1Ee-FKZ.js +0 -1
- package/dist/ui/assets/CatalogBrowser-Bz8ZtxPn.js +0 -1
- package/dist/ui/assets/ChatTimelineView-Do9EryEH.js +0 -7
- package/dist/ui/assets/ConfirmDialog-BHFs6vmJ.js +0 -1
- package/dist/ui/assets/ConnectedAppsPanel-BtMayq0R.js +0 -1
- package/dist/ui/assets/CraftbookEditor-D5jTzWwF.js +0 -1
- package/dist/ui/assets/DocumentDetail-CPU51d04.js +0 -1
- package/dist/ui/assets/DocumentsView-B6OyjvJ0.js +0 -1
- package/dist/ui/assets/DropdownMenu-D5fCzIrh.js +0 -1
- package/dist/ui/assets/Ds4Settings-CrUM_KGP.js +0 -1
- package/dist/ui/assets/EmbeddedChat-ue9ia-WY.js +0 -1
- package/dist/ui/assets/FileMapView-CxvfDLGA.js +0 -1
- package/dist/ui/assets/GezelDetail-DHuqBK55.js +0 -1
- package/dist/ui/assets/HandboekView-CPnnyj29.js +0 -1
- package/dist/ui/assets/HistoryView-B4VAfEMe.js +0 -1
- package/dist/ui/assets/HomeView-ccH60J6f.js +0 -1
- package/dist/ui/assets/KnowledgeCatalogsCard-Bi5Rx9Iz.js +0 -1
- package/dist/ui/assets/KnowledgeView-DAwjwLZo.js +0 -1
- package/dist/ui/assets/LlamaCppSettings-Ceyk9pDP.js +0 -1
- package/dist/ui/assets/MemoriesTree-BKZEPJpm.js +0 -1
- package/dist/ui/assets/MlxSettings-CG3wfuc3.js +0 -1
- package/dist/ui/assets/ModelPicker-CCBVjLMS.js +0 -1
- package/dist/ui/assets/NewPathDialog-D4jnNBfP.js +0 -1
- package/dist/ui/assets/NewTaskDialog-Ox9D612Z.js +0 -2
- package/dist/ui/assets/ProjectChat-DMwKnkW-.js +0 -5
- package/dist/ui/assets/ProjectGitStatusBar-C6bkCSby.js +0 -1
- package/dist/ui/assets/ProjectOverviewView-NNwXd_QQ.js +0 -1
- package/dist/ui/assets/ProjectsView-SBPgYOq8.js +0 -7
- package/dist/ui/assets/ScriptEditorTabs-paocQ6dj.js +0 -2
- package/dist/ui/assets/ScriptEditorView-N9zSLqqi.js +0 -5
- package/dist/ui/assets/SessionSwitcher-C8te7YSe.js +0 -1
- package/dist/ui/assets/SettingsView-Brl4JQkW.js +0 -3
- package/dist/ui/assets/Tabs-BAY1Q79B.js +0 -1
- package/dist/ui/assets/TaskTabContent-CNPJ4DQj.js +0 -1
- package/dist/ui/assets/TasksView-DuMjFS8S.js +0 -1
- package/dist/ui/assets/ToolsetsEditor-BdxHnIBj.js +0 -8
- package/dist/ui/assets/TransformToolbarButton-CVg5nz36.js +0 -5
- package/dist/ui/assets/UnrecognizedModels-Cw9Ku_bW.js +0 -1
- package/dist/ui/assets/chat-thread-memory-CZGcwgGo.js +0 -1
- package/dist/ui/assets/chunk-6ECMNUIP-C1kohb1U.js +0 -15
- package/dist/ui/assets/chunk-AONELFLA-Cv2nS9ga.js +0 -1
- package/dist/ui/assets/chunk-IIQYS2YH-Dxg6MAfT.js +0 -1
- package/dist/ui/assets/chunk-MIKKUKOD-XIkmalSN.js +0 -31
- package/dist/ui/assets/chunk-NNJLSQPW-DJA6camf.js +0 -5
- package/dist/ui/assets/chunk-S5PCVMKU-DbCZ5AUH.js +0 -6
- package/dist/ui/assets/csv-xmd1_Aqd.js +0 -4
- package/dist/ui/assets/dist-BPx-FyRH.js +0 -222
- package/dist/ui/assets/dist-Bvo52IGx.js +0 -1
- package/dist/ui/assets/dist-D5aoNQwk.js +0 -2
- package/dist/ui/assets/docx-Cj4A9MhC.js +0 -2
- package/dist/ui/assets/extract-UTAOG7LV-C4b7ycaL.js +0 -1
- package/dist/ui/assets/file-browser-80qWoVju.js +0 -5
- package/dist/ui/assets/html-C9TlzI57.js +0 -253
- package/dist/ui/assets/icons-C9dD-bDi.js +0 -1
- package/dist/ui/assets/images-ESPQKVTW-D7SgdVJ_.js +0 -1
- package/dist/ui/assets/index-D1m4Wx8V.css +0 -1
- package/dist/ui/assets/index-DXWR4qW1.js +0 -34
- package/dist/ui/assets/layouts-2A7QNF6Y-De2t-YXl.js +0 -1
- package/dist/ui/assets/markdown-baseline-HMqF2ChK.js +0 -1
- package/dist/ui/assets/outside-in-BFVUUcLa.js +0 -3
- package/dist/ui/assets/pptx-6ChgUEf4.js +0 -6
- package/dist/ui/assets/primitives-DEsn1shf.js +0 -41
- package/dist/ui/assets/run-export-BrYhHj1O.js +0 -23
- package/dist/ui/assets/standalone-source-D6mbpa3h.js +0 -11
- package/dist/ui/assets/storage-fn4FCEVK.js +0 -1
- package/dist/ui/assets/styles-C0EoNJbk.css +0 -1
- package/dist/ui/assets/styles-CKr_yrbn.js +0 -541
- package/dist/ui/assets/xlsx-DH7sTb3W.js +0 -4
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./doc-s6H7T0IO.js";import{l as t}from"./chunk-O7JILDEF-CqcO1qaI.js";import{O as n}from"./chunk-GAZKTT4R-BkP6-w3z.js";import{l as r}from"./markdown-Bi9b5f5Y.js";import"./schemas-JY4jmLbC.js";import"./chunk-7AWFHP5U-MiVVPFTx.js";import{a as i,n as a,t as o}from"./chunk-JU2RHXUB-ClblWDJZ.js";import{a as s,i as c,n as l,r as u,t as d}from"./chunk-A6N6IN3I-DXok09eC.js";import{B as f,E as p,F as m,H as h,I as g,J as _,L as ee,M as v,Q as y,R as te,U as ne,V as re,W as ie,a as ae,at as b,c as oe,et as se,i as ce,it as x,k as S,l as le,n as ue,nt as C,o as de,r as fe,rt as pe,s as me,tt as w,u as he,z as ge}from"./chunk-S5PCVMKU-DbCZ5AUH.js";import{t as _e}from"./chunk-ILCJ3WFD-WRukZ7R1.js";import{t as ve}from"./chunk-IIQYS2YH-Dxg6MAfT.js";import{a as ye,i as be,n as xe,r as Se}from"./chunk-USU6HTKB-D5FmDzJU.js";import{t as Ce}from"./chunk-AONELFLA-Cv2nS9ga.js";import{r as we}from"./chunk-BXWNU4T5-CFA9w1DZ.js";var Te={Heading1:1,Heading2:2,Heading3:3,Heading4:4,Heading5:5,Heading6:6,heading1:1,heading2:2,heading3:3,heading4:4,heading5:5,heading6:6,Title:1,Subtitle:2},Ee={1:`Heading1`,2:`Heading2`,3:`Heading3`,4:`Heading4`,5:`Heading5`,6:`Heading6`},De=new Set([`Quote`,`IntenseQuote`,`quote`,`BlockQuote`]),Oe=new Set([`Code`,`CodeBlock`,`HTMLCode`,`PlainText`]),ke=new Set([`CodeChar`,`HTMLCodeChar`,`VerbatimChar`]),Ae=new Set([`bullet`,`none`]),je=`Calibri`,Me=`Calibri Light`,T=22,E=`Consolas`,D=20,Ne={1:32,2:26,3:24,4:22,5:22,6:22},Pe=`0563C1`;function Fe(e){return Math.round(e*20)}async function Ie(e,n={}){n.signal?.throwIfAborted();let r=n.themeId===void 0?{...n,themeId:t(e.frontmatter)}:n,i=new Re(r,e),a=Le(e.children);i.setRelationshipSource(`document`);let o=A(a.body,i);i.setRelationshipSource(`header`);let s=A(a.header,i);i.setRelationshipSource(`footer`);let c=A(a.footer,i);return i.setRelationshipSource(`document`),st(o,s,c,i,r)}function Le(e){let t={body:[],header:[],footer:[]};for(let n of e)n.type===`containerDirective`&&n.name===`docx-header`?t.header.push(...n.children):n.type===`containerDirective`&&n.name===`docx-footer`?t.footer.push(...n.children):t.body.push(n);return t}var Re=class{constructor(t,r){this.relIds=new d,this.nextNumId=1,this.nextFootnoteId=1,this.relationships=[],this.relationshipSource=`document`,this.numberingDefs=[],this.footnotes=new Map,this.footnoteIdMap=new Map,this.images=[],this.hasLists=!1,this.hasFootnotes=!1,this.iconFamilies=new Set,this.nextDocPrId=1;let i,a,o,s,l,u;if(t.themeId){let d=e(r,t.themeId,t.themeRegistry);i=k(n(d.typography?.bodyFont,``)),a=k(n(d.typography?.titleFont,``)),o=c(d.colors?.primary),s=c(d.colors?.text),l=c(d.colors?.textMuted),u=c(d.colors?.background)}this.font=t.defaultFont??i??je,this.headingFont=a??this.font,this.fontSize=t.defaultFontSize?t.defaultFontSize*2:T,this.headingColor=o,this.bodyColor=s,this.mutedColor=l,this.backgroundColor=u,this.resolvedImages=t.images??new Map,this.allowRelativeHyperlinks=t.allowRelativeHyperlinks??!1,this.signal=t.signal}allocRelId(){return this.allocRelIdFor(this.relationshipSource)}allocRelIdFor(e){return this.relIds.alloc(O(e))}setRelationshipSource(e){this.relationshipSource=e}addHyperlink(e){let t=s(e,{allowRelative:this.allowRelativeHyperlinks});if(!t)return null;let n=this.allocRelId();return this.relationships.push({id:n,type:f,target:t,targetMode:`External`,source:this.relationshipSource}),n}addImage(e,t,n){let r=this.allocRelId(),i=this.nextDocPrId++,a=`word/media/${n}`;return this.images.push({relId:r,path:a,data:e,contentType:t}),this.relationships.push({id:r,type:re,target:`media/${n}`,source:this.relationshipSource}),{relId:r,docPrId:i}}allocNumbering(e){let t=this.nextNumId++;return this.numberingDefs.push({numId:t,ordered:e}),this.hasLists=!0,t}getFootnoteId(e){let t=this.footnoteIdMap.get(e);return t===void 0&&(t=this.nextFootnoteId++,this.footnoteIdMap.set(e,t),this.hasFootnotes=!0),t}};function O(e){return e===`header`?`word/header1.xml`:e===`footer`?`word/footer1.xml`:`word/document.xml`}function k(e){if(!e)return``;let t=new Set([`sans-serif`,`serif`,`monospace`,`system-ui`,`cursive`,`fantasy`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`inherit`,`initial`]);for(let n of e.split(`,`)){let e=n.trim().replace(/^["']|["']$/g,``);if(e&&!t.has(e.toLowerCase()))return e}return``}function A(e,t){let n=[];for(let r=0;r<e.length;r++){r&255||t.signal?.throwIfAborted();let i=e[r];n.push(j(i,t,0))}return n.join(``)}function j(e,t,n){switch(e.type){case`heading`:return ze(e,t);case`paragraph`:return Be(e,t);case`blockquote`:return Ve(e,t);case`list`:return He(e,t,n);case`code`:return We(e);case`table`:return Ge(e,t);case`thematicBreak`:return Je();case`htmlBlock`:return Ye(e);case`math`:return Xe(e);case`footnoteDefinition`:return Ze(e,t);case`containerDirective`:return A(e.children,t);default:return``}}function ze(e,t){let n=Ee[e.depth]??`Heading1`,r=N(e.children,t);return`<w:p><w:pPr><w:pStyle w:val="${n}"/></w:pPr>`+r+`</w:p>`}function Be(e,t){return`<w:p>${N(e.children,t,M(t))}</w:p>`}function M(e){return e.bodyColor?{color:e.bodyColor}:{}}function Ve(e,t){let n=[];for(let r of e.children)if(r.type===`paragraph`){let e=t.mutedColor?{color:t.mutedColor}:M(t),i=N(r.children,t,e);n.push(`<w:p><w:pPr><w:pStyle w:val="Quote"/><w:ind w:left="${Fe(36)}"/><w:pBdr><w:left w:val="single" w:sz="12" w:space="4" w:color="CCCCCC"/></w:pBdr></w:pPr>`+i+`</w:p>`)}else n.push(j(r,t,0));return n.join(``)}function He(e,t,n){let r=t.allocNumbering(e.ordered??!1),i=[];for(let a of e.children)i.push(Ue(a,t,r,n));return i.join(``)}function Ue(e,t,n,r){let i=[];for(let a of e.children)if(a.type===`paragraph`){let e=N(a.children,t,M(t));i.push(`<w:p><w:pPr><w:pStyle w:val="ListParagraph"/><w:numPr><w:ilvl w:val="${r}"/><w:numId w:val="${n}"/></w:numPr></w:pPr>`+e+`</w:p>`)}else a.type===`list`?i.push(He(a,t,r+1)):i.push(j(a,t,r));return i.join(``)}function We(e){let t=e.value.split(`
|
|
2
|
-
`),n=[];for(let e of t)n.push(`<w:p><w:pPr><w:pStyle w:val="Code"/><w:pBdr><w:top w:val="single" w:sz="4" w:space="1" w:color="CCCCCC"/><w:left w:val="single" w:sz="4" w:space="4" w:color="CCCCCC"/><w:bottom w:val="single" w:sz="4" w:space="1" w:color="CCCCCC"/><w:right w:val="single" w:sz="4" w:space="4" w:color="CCCCCC"/></w:pBdr><w:shd w:val="clear" w:color="auto" w:fill="F5F5F5"/></w:pPr><w:r><w:rPr><w:rFonts w:ascii="${E}" w:hAnsi="${E}"/><w:sz w:val="${D}"/></w:rPr><w:t xml:space="preserve">${o(e)}</w:t></w:r></w:p>`);return n.join(``)}function Ge(e,t){let n=[];for(let r=0;r<e.children.length;r++){let i=e.children[r];n.push(Ke(i,t,r===0,e.align))}return`<w:tbl><w:tblPr><w:tblStyle w:val="TableGrid"/><w:tblW w:w="0" w:type="auto"/><w:tblBorders><w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:left w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto"/></w:tblBorders></w:tblPr><w:tblGrid/>`+n.join(``)+`</w:tbl>`}function Ke(e,t,n,r){let i=[];for(let a=0;a<e.children.length;a++){let o=e.children[a],s=r?.[a]??null;i.push(qe(o,t,n,s))}return`<w:tr>${n?`<w:trPr><w:tblHeader/></w:trPr>`:``}${i.join(``)}</w:tr>`}function qe(e,t,n,r){let i=N(e.children,t,M(t)),a=n?`<w:rPr><w:b/></w:rPr>`:``,o=r?`<w:jc w:val="${{left:`left`,center:`center`,right:`right`}[r]}"/>`:``;return`<w:tc><w:p>${a||o?`<w:pPr>${o}</w:pPr>`:``}${i}</w:p></w:tc>`}function Je(){return`<w:p><w:pPr><w:pBdr><w:bottom w:val="single" w:sz="6" w:space="1" w:color="auto"/></w:pBdr></w:pPr></w:p>`}function Ye(e){let t=i(e.rawHtml);return t.trim()?`<w:p><w:r><w:t xml:space="preserve">${o(t)}</w:t></w:r></w:p>`:``}function Xe(e){return`<w:p><w:pPr><w:jc w:val="center"/></w:pPr><w:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/><w:i/></w:rPr><w:t xml:space="preserve">${o(e.value)}</w:t></w:r></w:p>`}function Ze(e,t){let n=t.getFootnoteId(e.identifier),r=[];for(let n of e.children)if(n.type===`paragraph`){let e=N(n.children,t,M(t));r.push(`<w:p>${e}</w:p>`)}let i=`<w:footnote w:id="${n}">`+(r.length>0?r.join(``):`<w:p/>`)+`</w:footnote>`;return t.footnotes.set(n,i),``}function Qe(e){return{run:(e,t)=>P(e,t),link:(t,n)=>tt(t,e,n),image:t=>it(t,e),icon:(t,n)=>et(t,n,e),lineBreak:()=>`<w:r><w:br/></w:r>`,footnoteRef:t=>ot(t,e)}}function N(e,t,n={}){return u(e,Qe(t),n)}function $e(e,t,n){return l(e,Qe(t),n)}function P(e,t){if(!e)return``;let n=[];return t.code&&n.push(`<w:rFonts w:ascii="${E}" w:hAnsi="${E}"/>`),t.bold&&n.push(`<w:b/>`),t.italic&&n.push(`<w:i/>`),t.strike&&n.push(`<w:strike/>`),t.color&&n.push(`<w:color w:val="${t.color}"/>`),t.code&&n.push(`<w:sz w:val="${D}"/>`),t.vertAlign&&n.push(`<w:vertAlign w:val="${t.vertAlign}"/>`),`<w:r>${n.length>0?`<w:rPr>${n.join(``)}</w:rPr>`:``}<w:t xml:space="preserve">${o(e)}</w:t></w:r>`}function et(e,t,n){let r=be(e.family,e.name);if(!r)return P(`{[${e.token}]}`,t);let i=xe(e.family);n.iconFamilies.add(e.family);let a=o(i.typeface),s=[`<w:rFonts w:ascii="${a}" w:hAnsi="${a}" w:eastAsia="${a}" w:cs="${a}"/>`];return t.strike&&s.push(`<w:strike/>`),t.color&&s.push(`<w:color w:val="${t.color}"/>`),`<w:r><w:rPr>${s.join(``)}</w:rPr><w:t xml:space="preserve">${o(r)}</w:t></w:r>`}function tt(e,t,n){let r=t.addHyperlink(e.url);return r?`<w:hyperlink r:id="${r}">${nt(e.children,t,n)}</w:hyperlink>`:N(e.children,t,n)}function nt(e,t,n){let r=[];for(let i of e)i.type===`text`?r.push(rt(i.value,n)):r.push($e(i,t,n));return r.join(``)}function rt(e,t){if(!e)return``;let n=[`<w:rStyle w:val="Hyperlink"/>`];return t.bold&&n.push(`<w:b/>`),t.italic&&n.push(`<w:i/>`),n.push(`<w:color w:val="${Pe}"/>`,`<w:u w:val="single"/>`),`<w:r><w:rPr>${n.join(``)}</w:rPr><w:t xml:space="preserve">${o(e)}</w:t></w:r>`}function it(e,t){let n=t.resolvedImages.get(e.url);if(!n)return P(`[Image: ${e.alt||e.url}]`,{italic:!0});let{data:r,contentType:i}=n,a=i.split(`/`)[1]?.replace(`jpeg`,`jpg`)||`png`,s=`image${t.images.length+1}.${a}`,{relId:c,docPrId:l}=t.addImage(r,i,s),u=at(r),d=914400,f=6*d,p,m;if(u){let e=u.width/96*d,t=u.height/96*d;if(e>f){let n=f/e;p=f,m=Math.round(t*n)}else p=Math.round(e),m=Math.round(t)}else p=5*d,m=3*d;let h=o(e.alt||s),g=`http://schemas.openxmlformats.org/drawingml/2006/main`,_=`http://schemas.openxmlformats.org/drawingml/2006/picture`;return`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${p}" cy="${m}"/><wp:docPr id="${l}" name="${h}"/><wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="${g}" noChangeAspect="1"/></wp:cNvGraphicFramePr><a:graphic xmlns:a="${g}"><a:graphicData uri="${_}"><pic:pic xmlns:pic="${_}"><pic:nvPicPr><pic:cNvPr id="0" name="${h}"/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${c}"/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${p}" cy="${m}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`}function at(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.length<24)return null;if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71)return{width:t[16]<<24|t[17]<<16|t[18]<<8|t[19],height:t[20]<<24|t[21]<<16|t[22]<<8|t[23]};if(t[0]===255&&t[1]===216){let e=2;for(;e<t.length-9&&t[e]===255;){let n=t[e+1];if(n===192||n===194){let n=t[e+5]<<8|t[e+6];return{width:t[e+7]<<8|t[e+8],height:n}}let r=t[e+2]<<8|t[e+3];e+=2+r}}return t[0]===71&&t[1]===73&&t[2]===70?{width:t[6]|t[7]<<8,height:t[8]|t[9]<<8}:null}function ot(e,t){return`<w:r><w:rPr><w:rStyle w:val="FootnoteReference"/><w:vertAlign w:val="superscript"/></w:rPr><w:footnoteReference w:id="${t.getFootnoteId(e.identifier)}"/></w:r>`}async function st(e,t,n,r,i){let a=_e(),o=Se(r.iconFamilies),s=t.trim().length>0,c=n.trim().length>0,l=r.allocRelIdFor(`document`),u=r.allocRelIdFor(`document`),d=r.allocRelIdFor(`document`),f=r.hasLists?r.allocRelIdFor(`document`):void 0,p=r.hasFootnotes?r.allocRelIdFor(`document`):void 0,v=s?r.allocRelIdFor(`document`):void 0,y=c?r.allocRelIdFor(`document`):void 0,re=ct(e,r.backgroundColor,v,y);a.addPart(`word/document.xml`,re,ue),s&&a.addPart(`word/header1.xml`,F(`header`,t),de),c&&a.addPart(`word/footer1.xml`,F(`footer`,n),ce);let b=lt(i,r);a.addPart(`word/styles.xml`,b,he);let se=dt(r.backgroundColor!==void 0);a.addPart(`word/settings.xml`,se,le);let x=ft(i,o);a.addPart(`word/fontTable.xml`,x,fe);for(let e=0;e<o.length;e++){let t=o[e],n=`${t.fileStem}.odttf`;a.addBinaryPart(`word/fonts/${n}`,ye(t),oe),a.addRelationship(`word/fontTable.xml`,{id:`rId${e+1}`,type:m,target:`fonts/${n}`})}if(r.hasLists){let e=pt(r);a.addPart(`word/numbering.xml`,e,me)}if(r.hasFootnotes){let e=mt(r);a.addPart(`word/footnotes.xml`,e,ae)}a.addRelationship(``,{id:`rId1`,type:ne,target:`word/document.xml`}),a.addRelationship(`word/document.xml`,{id:l,type:_,target:`styles.xml`}),a.addRelationship(`word/document.xml`,{id:u,type:ie,target:`settings.xml`}),a.addRelationship(`word/document.xml`,{id:d,type:g,target:`fontTable.xml`}),f&&a.addRelationship(`word/document.xml`,{id:f,type:h,target:`numbering.xml`}),p&&a.addRelationship(`word/document.xml`,{id:p,type:te,target:`footnotes.xml`}),v&&a.addRelationship(`word/document.xml`,{id:v,type:ge,target:`header1.xml`}),y&&a.addRelationship(`word/document.xml`,{id:y,type:ee,target:`footer1.xml`});for(let e of r.relationships)a.addRelationship(O(e.source),{id:e.id,type:e.type,target:e.target,...e.targetMode?{targetMode:e.targetMode}:{}});for(let e of r.images)a.addBinaryPart(e.path,e.data,e.contentType);return(i.title||i.author||i.description)&&a.setCoreProperties({title:i.title,creator:i.author,description:i.description,created:new Date().toISOString(),modified:new Date().toISOString()}),a.toArrayBuffer()}function ct(e,t,n,r){let i=t?`<w:background w:color="${t}"/>`:``,o=(n?`<w:headerReference w:type="default" r:id="${n}"/>`:``)+(r?`<w:footerReference w:type="default" r:id="${r}"/>`:``);return a()+`<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="${p}" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="${S}" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="${v}" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">`+i+`<w:body>`+e+`<w:sectPr>`+o+`<w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/><w:cols w:space="720"/></w:sectPr></w:body></w:document>`}function F(e,t){let n=e===`header`?`hdr`:`ftr`;return a()+`<w:${n} xmlns:w="${v}" xmlns:r="${S}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">`+t+`</w:${n}>`}function lt(e,t){let n=t.font,r=t.headingFont,i=t.bodyColor?`<w:color w:val="${t.bodyColor}"/>`:``,s=t.mutedColor??`404040`;return a()+`<w:styles xmlns:w="${v}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="${o(n)}" w:hAnsi="${o(n)}" w:eastAsia="${o(n)}" w:cs="${o(n)}"/>`+i+`<w:sz w:val="${T}"/><w:szCs w:val="${T}"/></w:rPr></w:rPrDefault><w:pPrDefault/></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/>`+(i?`<w:rPr>${i}</w:rPr>`:``)+`</w:style>`+ut(r,t.headingColor)+`<w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:pPr><w:ind w:left="720"/></w:pPr><w:rPr><w:i/><w:color w:val="${s}"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Code"><w:name w:val="Code"/><w:basedOn w:val="Normal"/><w:rPr><w:rFonts w:ascii="${E}" w:hAnsi="${E}"/><w:sz w:val="${D}"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:pPr><w:ind w:left="720"/></w:pPr></w:style><w:style w:type="character" w:styleId="Hyperlink"><w:name w:val="Hyperlink"/><w:rPr><w:color w:val="${Pe}"/><w:u w:val="single"/></w:rPr></w:style><w:style w:type="character" w:styleId="FootnoteReference"><w:name w:val="footnote reference"/><w:rPr><w:vertAlign w:val="superscript"/></w:rPr></w:style><w:style w:type="table" w:styleId="TableGrid"><w:name w:val="Table Grid"/><w:tblPr><w:tblBorders><w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:left w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/><w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto"/></w:tblBorders></w:tblPr></w:style></w:styles>`}function ut(e,t){let n=``;for(let r=1;r<=6;r++){let i=Ee[r],a=Ne[r]??22,s=t?`<w:color w:val="${t}"/>`:``;n+=`<w:style w:type="paragraph" w:styleId="${i}"><w:name w:val="heading ${r}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:outlineLvl w:val="${r-1}"/><w:spacing w:before="240" w:after="60"/></w:pPr><w:rPr><w:rFonts w:ascii="${o(e)}" w:hAnsi="${o(e)}"/><w:b/>`+s+`<w:sz w:val="${a}"/><w:szCs w:val="${a}"/></w:rPr></w:style>`}return n}function dt(e){return a()+`<w:settings xmlns:w="${v}">`+(e?`<w:displayBackgroundShape/>`:``)+`<w:defaultTabStop w:val="720"/><w:characterSpacingControl w:val="doNotCompress"/><w:compat><w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/><w:compatSetting w:name="overrideTableStyleFontSizeAndJustification" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/><w:compatSetting w:name="enableOpenTypeFeatures" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/><w:compatSetting w:name="doNotFlipMirrorIndents" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/><w:compatSetting w:name="differentiateMultirowTableHeaders" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/></w:compat></w:settings>`}function ft(e,t){let n=e.defaultFont??je,r=t.map((e,t)=>`<w:font w:name="${o(e.typeface)}"><w:charset w:val="00"/><w:family w:val="decorative"/><w:pitch w:val="variable"/><w:embedRegular r:id="rId${t+1}" w:fontKey="{${e.docxFontKey}}"/></w:font>`).join(``);return a()+`<w:fonts xmlns:w="${v}" xmlns:r="${S}"><w:font w:name="${o(n)}"><w:panose1 w:val="020F0502020204030204"/><w:charset w:val="00"/><w:family w:val="swiss"/><w:pitch w:val="variable"/></w:font><w:font w:name="${Me}"><w:panose1 w:val="020F0302020204030204"/><w:charset w:val="00"/><w:family w:val="swiss"/><w:pitch w:val="variable"/></w:font><w:font w:name="${E}"><w:charset w:val="00"/><w:family w:val="modern"/><w:pitch w:val="fixed"/></w:font>`+r+`</w:fonts>`}function pt(e){let t=[],n=[];for(let r of e.numberingDefs){let e=r.numId,i=[];for(let e=0;e<9;e++)if(r.ordered)i.push(`<w:lvl w:ilvl="${e}"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%${e+1}."/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${720*(e+1)}" w:hanging="360"/></w:pPr></w:lvl>`);else{let t=[`•`,`◦`,`▪`],n=t[e%t.length];i.push(`<w:lvl w:ilvl="${e}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${n}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${720*(e+1)}" w:hanging="360"/></w:pPr></w:lvl>`)}t.push(`<w:abstractNum w:abstractNumId="${e}">`+i.join(``)+`</w:abstractNum>`),n.push(`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${e}"/></w:num>`)}return a()+`<w:numbering xmlns:w="${v}">`+t.join(``)+n.join(``)+`</w:numbering>`}function mt(e){let t=[];t.push(`<w:footnote w:type="separator" w:id="-1"><w:p><w:r><w:separator/></w:r></w:p></w:footnote>`),t.push(`<w:footnote w:type="continuationSeparator" w:id="0"><w:p><w:r><w:continuationSeparator/></w:r></w:p></w:footnote>`);for(let[n,r]of e.footnotes)t.push(r);return a()+`<w:footnotes xmlns:w="${v}" xmlns:r="${S}">`+t.join(``)+`</w:footnotes>`}var I=`word/document.xml`;async function ht(e,t={}){let n=await pe(e,t),r=x(n,I,`DOCX`),i=await _t(n,t,r),a=await C(n,r);if(!a)throw Error(`Invalid DOCX package: main document part "${r}" could not be parsed.`);let o=Lt(a,`body`);if(!o)return{type:`document`,children:[]};let s={type:`document`,children:await L(o,i)};return we(s),s}async function gt(e,t={}){let n=await pe(e,t),i=x(n,I,`DOCX`),a=await _t(n,{...t,extractImages:!0},i),o=await C(n,i);if(!o)throw Error(`Invalid DOCX package: main document part "${i}" could not be parsed.`);let s=Lt(o,`body`);return s?ve(r({type:`document`,children:await L(s,a)}),a.extractedImages):ve(``,[])}async function _t(e,t,n=I){let r={headingStyles:new Map,quoteStyles:new Set,codeStyles:new Set,inlineCodeStyles:new Set,documentRels:new Map,numbering:new Map,footnotes:new Map,endnotes:new Map,currentPartPath:n,mainPartPath:n,pkg:e,options:t,extractedImages:new Map,imageCounter:0};for(let[e,t]of Object.entries(Te))r.headingStyles.set(e,t);for(let e of De)r.quoteStyles.add(e);for(let e of Oe)r.codeStyles.add(e);for(let e of ke)r.inlineCodeStyles.add(e);await vt(e,r);let i=await w(e,n);for(let e of i)r.documentRels.set(e.id,e);return await yt(e,r),await bt(e,r),await xt(e,r),r}async function vt(e,t){let n=await C(e,`word/styles.xml`);if(!n)return;let r=n.getElementsByTagNameNS(v,`style`),i=r.length>0?r:n.getElementsByTagName(`style`);for(let e=0;e<i.length;e++){let n=i[e],r=n.getAttributeNS(`http://schemas.openxmlformats.org/wordprocessingml/2006/main`,`styleId`)??n.getAttribute(`w:styleId`);if(!r)continue;let a=J(n,`name`),o=(a?.getAttributeNS(`http://schemas.openxmlformats.org/wordprocessingml/2006/main`,`val`)??a?.getAttribute(`w:val`)??``).match(/^heading\s+(\d+)$/i);if(o){let e=parseInt(o[1],10);e>=1&&e<=6&&t.headingStyles.set(r,e)}let s=J(n,`pPr`);if(s){let e=J(s,`outlineLvl`);if(e){let n=e.getAttributeNS(`http://schemas.openxmlformats.org/wordprocessingml/2006/main`,`val`)??e.getAttribute(`w:val`);if(n!==null){let e=parseInt(n,10)+1;e>=1&&e<=6&&t.headingStyles.set(r,e)}}}}}async function yt(e,t){let n=await C(e,`word/numbering.xml`);if(!n)return;let r=new Map,i=X(n,`abstractNum`);for(let e of i){let t=Z(e,`abstractNumId`);if(!t)continue;let n=new Map,i=Y(e,`lvl`);for(let e of i){let t=Z(e,`ilvl`);if(t===null)continue;let r=parseInt(t,10),i=J(e,`numFmt`),a=i?Z(i,`val`):null,o=a!==null&&!Ae.has(a);n.set(r,o)}r.set(t,n)}let a=X(n,`num`);for(let e of a){let n=Z(e,`numId`);if(!n)continue;let i=J(e,`abstractNumId`),a=i?Z(i,`val`):null;if(!a)continue;let o=r.get(a);o&&t.numbering.set(n,{levels:o})}}async function bt(e,t){let n=await C(e,`word/footnotes.xml`);if(!n)return;let r=X(n,`footnote`);for(let e of r){let n=Z(e,`id`),r=Z(e,`type`);!n||r===`separator`||r===`continuationSeparator`||t.footnotes.set(n,e)}}async function xt(e,t){let n=await C(e,`word/endnotes.xml`);if(!n)return;let r=X(n,`endnote`);for(let e of r){let n=Z(e,`id`),r=Z(e,`type`);!n||r===`separator`||r===`continuationSeparator`||t.endnotes.set(n,e)}}async function L(e,t){let n=await z(e,t),r=await R(e,t,`header`),i=await R(e,t,`footer`),a=await Ft(t);return[...n,...r,...i,...a]}async function R(e,t,n){let r=`/${n}`,i=`${n}Reference`,a=new Map;for(let t of X(e,i)){let e=t.getAttributeNS(`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,`id`)??t.getAttribute(`r:id`);e&&a.set(e,Z(t,`type`)??`default`)}let o=t.documentRels,s=t.currentPartPath,c=[];for(let e of o.values()){if(!e.type.endsWith(r))continue;let i=b(y(t.mainPartPath),e.target),l=await C(t.pkg,i);if(!l?.documentElement)continue;let u=await w(t.pkg,i);t.documentRels=new Map(u.map(e=>[e.id,e])),t.currentPartPath=i;try{let r=await z(l.documentElement,t);if(r.length===0)continue;c.push({type:`containerDirective`,name:`docx-${n}`,attributes:{type:a.get(e.id)??`default`,source:i},children:r})}finally{t.documentRels=o,t.currentPartPath=s}}return c}async function z(e,t){return B(Array.from(e.children),t)}async function B(e,t){let n=[],r=0;for(;r<e.length;){let i=e[r],a=i.localName;if(a===`p`){if(q(i)){let{node:i,consumed:a}=await At(e,r,t);n.push(i),r+=a;continue}let a=await St(i,t);a&&n.push(a),r++}else if(a===`tbl`){let e=await Mt(i,t);e&&n.push(e),r++}else if(a===`sdt`){let e=J(i,`sdtContent`);e&&n.push(...await B(Array.from(e.children),t)),r++}else if(a===`ins`||a===`moveTo`||a===`customXml`||a===`smartTag`||a===`fldSimple`)n.push(...await B(Array.from(i.children),t)),r++;else if(a===`AlternateContent`){let e=J(i,`Choice`)??J(i,`Fallback`);e&&n.push(...await B(Array.from(e.children),t)),r++}else r++}return n}async function St(e,t){let n=Rt(J(e,`pPr`));if(n&&t.headingStyles.has(n)){let r=t.headingStyles.get(n),i=await V(e,t);return i.length===0?null:{type:`heading`,depth:Math.min(Math.max(r,1),6),children:i}}if(n&&t.quoteStyles.has(n)){let n=await V(e,t);return n.length===0?null:{type:`blockquote`,children:[{type:`paragraph`,children:n}]}}if(n&&t.codeStyles.has(n))return{type:`code`,value:zt(e)};let r=await V(e,t);return r.length===0?null:{type:`paragraph`,children:r}}async function V(e,t){return Vt(await H(Array.from(e.children),t))}async function H(e,t){let n=[];for(let r of e){let e=r.localName;if(e===`r`){let e=await Ct(r,t);n.push(...e)}else if(e===`hyperlink`){let e=await Dt(r,t);e&&n.push(e)}else if(e===`sdt`){let e=J(r,`sdtContent`);e&&n.push(...await H(Array.from(e.children),t))}else if(e===`ins`||e===`moveTo`||e===`customXml`||e===`smartTag`||e===`fldSimple`)n.push(...await H(Array.from(r.children),t));else if(e===`AlternateContent`){let e=J(r,`Choice`)??J(r,`Fallback`);e&&n.push(...await H(Array.from(e.children),t))}else(e===`drawing`||e===`pict`)&&n.push(...await wt(r,t))}return n}async function Ct(e,t){let n=[],r=Et(J(e,`rPr`),t);for(let i of Array.from(e.children)){let e=i.localName;if(e===`t`){let e=i.textContent??``;if(!e)continue;if(r.code)n.push({type:`inlineCode`,value:e});else{let t={type:`text`,value:e};r.vertAlign&&(t=r.vertAlign===`superscript`?{type:`superscript`,children:[t]}:{type:`subscript`,children:[t]}),r.strike&&(t={type:`delete`,children:[t]}),r.italic&&(t={type:`emphasis`,children:[t]}),r.bold&&(t={type:`strong`,children:[t]}),n.push(t)}}else if(e===`br`||e===`cr`)n.push({type:`break`});else if(e===`tab`)n.push({type:`text`,value:` `});else if(e===`footnoteReference`){let e=Z(i,`id`);e&&e!==`0`&&e!==`-1`&&n.push({type:`footnoteReference`,identifier:`fn${e}`})}else if(e===`endnoteReference`){let e=Z(i,`id`);e&&e!==`0`&&e!==`-1`&&n.push({type:`footnoteReference`,identifier:`endnote${e}`})}else if(e===`drawing`||e===`pict`||e===`object`)n.push(...await wt(i,t));else if(e===`AlternateContent`){let e=J(i,`Choice`)??J(i,`Fallback`);e&&n.push(...await H(Array.from(e.children),t))}}return n}async function wt(e,t){let n=[],r=kt(e,`txbxContent`);for(let e of r)W(n,await U(e,t));let i=await Ot(e,t);return i&&n.push(i),r.length>0&&n.length>0&&(n[0]?.type!==`break`&&n.unshift({type:`break`}),n[n.length-1]?.type!==`break`&&n.push({type:`break`})),n}async function U(e,t){let n=[];for(let r of Array.from(e.children))if(r.localName===`p`)W(n,await V(r,t));else if(r.localName===`tbl`)W(n,await Tt(r,t));else if(r.localName===`sdt`){let e=J(r,`sdtContent`);e&&W(n,await U(e,t))}else if(r.localName===`ins`||r.localName===`moveTo`||r.localName===`customXml`||r.localName===`smartTag`||r.localName===`fldSimple`)W(n,await U(r,t));else if(r.localName===`AlternateContent`){let e=J(r,`Choice`)??J(r,`Fallback`);e&&W(n,await U(e,t))}else(r.localName===`r`||r.localName===`hyperlink`)&&W(n,await H([r],t));return $(n)}async function Tt(e,t){let n=[];for(let r of Y(e,`tr`))for(let e of Y(r,`tc`))W(n,await U(e,t));return $(n)}function W(e,t){t.length!==0&&(e.length>0&&e[e.length-1]?.type!==`break`&&e.push({type:`break`}),e.push(...t))}function Et(e,t){if(!e)return{bold:!1,italic:!1,strike:!1,code:!1,vertAlign:null};let n=Q(e,`b`)&&!G(J(e,`b`)),r=Q(e,`i`)&&!G(J(e,`i`)),i=Q(e,`strike`)&&!G(J(e,`strike`)),a=J(e,`rStyle`),o=a?Z(a,`val`):null,s=o?t.inlineCodeStyles.has(o):!1,c=J(e,`rFonts`),l=c?Z(c,`ascii`)??Z(c,`hAnsi`)??``:``,u=/consolas|courier|mono/i.test(l),d=J(e,`vertAlign`),f=d?Z(d,`val`):null;return{bold:n,italic:r,strike:i,code:s||u,vertAlign:f===`superscript`||f===`subscript`?f:null}}function G(e){let t=Z(e,`val`);return t===`0`||t===`false`}async function Dt(e,t){let n=e.getAttributeNS(`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,`id`)??e.getAttribute(`r:id`),r=``;if(n){let e=t.documentRels.get(n);e&&(r=e.target)}if(!r){let t=e.getAttributeNS(`http://schemas.openxmlformats.org/wordprocessingml/2006/main`,`anchor`)??e.getAttribute(`w:anchor`);t&&(r=`#${t}`)}let i=await H(Array.from(e.children),t);return i.length===0?null:{type:`link`,url:r,children:$(i)}}async function Ot(e,t){let n=K(e,`blip`),r=K(e,`imagedata`),i=n?n.getAttributeNS(`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,`embed`)??n.getAttribute(`r:embed`):r?.getAttributeNS(`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,`id`)??r?.getAttribute(`r:id`)??r?.getAttribute(`o:relid`);if(!i)return null;let a=t.documentRels.get(i);if(!a||a.targetMode===`External`)return null;let o=b(y(t.currentPartPath),a.target),s=await se(t.pkg,o);if(!s)return null;let c=o.lastIndexOf(`.`),l=c===-1?`.png`:o.slice(c).toLowerCase(),u=Ce(l);t.imageCounter++;let d=`images/image${t.imageCounter}${l}`;t.extractedImages.set(d,{data:s,mimeType:u});let f=K(e,`docPr`),p=K(e,`shape`);return{type:`image`,url:d,alt:f?.getAttribute(`descr`)||f?.getAttribute(`title`)||p?.getAttribute(`alt`)||p?.getAttribute(`title`)||`Image`}}function K(e,t){for(let n of Array.from(e.children)){if(n.localName===t)return n;let e=K(n,t);if(e)return e}return null}function kt(e,t){let n=[];for(let r of Array.from(e.children))r.localName===t&&n.push(r),n.push(...kt(r,t));return n}async function At(e,t,n){let r=q(e[t]),{numId:i}=r,a=n.numbering.get(i),o=a?.levels.get(0)??!1,s=[],c=0,l=t;for(;l<e.length;){let t=e[l];if(t.localName!==`p`)break;let o=q(t);if(!o||o.numId!==i)break;let u=await V(t,n);if(u.length>0){let t={type:`paragraph`,children:u};if(o.ilvl>r.ilvl){let t=await jt(e,l,n,r.ilvl);if(s.length>0){let e=s[s.length-1],n={type:`list`,ordered:a?.levels.get(o.ilvl)??!1,children:t.items};e.children.push(n)}else s.push(...t.items);l+=t.consumed,c+=t.consumed;continue}s.push({type:`listItem`,children:[t]})}l++,c++}return{node:{type:`list`,ordered:o,children:s},consumed:c}}async function jt(e,t,n,r){let i=[],a=0,o=t;for(;o<e.length;){let t=e[o];if(t.localName!==`p`)break;let s=q(t);if(!s||s.ilvl<=r)break;let c=await V(t,n);if(c.length>0){let e={type:`paragraph`,children:c};i.push({type:`listItem`,children:[e]})}o++,a++}return{items:i,consumed:a}}function q(e){let t=J(e,`pPr`);if(!t)return null;let n=J(t,`numPr`);if(!n)return null;let r=J(n,`ilvl`),i=J(n,`numId`),a=r?Z(r,`val`):null,o=i?Z(i,`val`):null;return!o||o===`0`?null:{numId:o,ilvl:a?parseInt(a,10):0}}async function Mt(e,t){let n=[],r=Y(e,`tr`);for(let e=0;e<r.length;e++){let i=await Nt(r[e],t,e===0);n.push(i)}return n.length===0?null:{type:`table`,children:n}}async function Nt(e,t,n){let r=[],i=Y(e,`tc`);for(let e of i){let i=await Pt(e,t,n);r.push(i)}return{type:`tableRow`,children:r}}async function Pt(e,t,n){return{type:`tableCell`,isHeader:n,children:$(await U(e,t))}}async function Ft(e){return[...await It(e,e.footnotes,`fn`,`word/footnotes.xml`),...await It(e,e.endnotes,`endnote`,`word/endnotes.xml`)]}async function It(e,t,n,r){let i=[],a=e.documentRels,o=e.currentPartPath,s=await w(e.pkg,r);e.documentRels=new Map(s.map(e=>[e.id,e])),e.currentPartPath=r;try{for(let[r,a]of t){let t=await z(a,e);t.length>0&&i.push({type:`footnoteDefinition`,identifier:`${n}${r}`,children:t})}}finally{e.documentRels=a,e.currentPartPath=o}return i}function J(e,t){for(let n of Array.from(e.children??[]))if(n.localName===t)return n;return null}function Y(e,t){let n=[];for(let r of Array.from(e.children))r.localName===t&&n.push(r);return n}function X(e,t){let n=`getElementsByTagNameNS`in e?e.getElementsByTagNameNS(v,t):null;if(n&&n.length>0)return Array.from(n);let r=e.getElementsByTagName(`w:${t}`);return r.length>0?Array.from(r):Array.from(e.getElementsByTagName(t))}function Lt(e,t){let n=X(e,t);return n.length>0?n[0]:null}function Z(e,t){return e.getAttributeNS(`http://schemas.openxmlformats.org/wordprocessingml/2006/main`,t)||e.getAttribute(`w:${t}`)||null}function Q(e,t){return J(e,t)!==null}function Rt(e){if(!e)return null;let t=J(e,`pStyle`);return t?Z(t,`val`):null}function zt(e){let t=[];function n(e){e.localName===`t`&&t.push(e.textContent??``);for(let t of Array.from(e.children))n(t)}return n(e),t.join(``)}function $(e){if(e.length<=1)return e;let t=[];for(let n of e){let e=t[t.length-1];n.type===`text`&&e?.type===`text`?e.value+=n.value:t.push(n)}return t}function Bt(e){return e.type===`emphasis`||e.type===`strong`||e.type===`delete`||e.type===`superscript`||e.type===`subscript`||e.type===`link`}function Vt(e){let t=[],n=[],r=()=>{let e=Ht(n);Ut(e),Wt(e),t.push(...$(e)),n=[]};for(let i of e)i.type===`break`?(r(),t.push(i)):n.push(i);return r(),t}function Ht(e){let t=[];for(let n of e){if(!Bt(n)){t.push(n);continue}let e=Ht(n.children),r=Ut(e),i=Wt(e);r&&t.push({type:`text`,value:r}),e.length>0&&t.push({...n,children:e}),i&&t.push({type:`text`,value:i})}return $(t)}function Ut(e){let t=e[0];if(t?.type!==`text`)return``;let n=/^[\t ]+/.exec(t.value);return n?(t.value=t.value.slice(n[0].length),t.value||e.shift(),n[0]):``}function Wt(e){let t=e[e.length-1];if(t?.type!==`text`)return``;let n=/[\t ]+$/.exec(t.value);return n?(t.value=t.value.slice(0,-n[0].length),t.value||e.pop(),n[0]):``}export{gt as docxToContainer,ht as docxToMarkdownDoc,Ie as markdownDocToDocx};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7AWFHP5U-MiVVPFTx.js";import"./chunk-S5PCVMKU-DbCZ5AUH.js";import{n as e}from"./chunk-WATAOG4Y-DXg2lov5.js";export{e as extractPptxTheme};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BINu2OK5.js","assets/preload-helper-Czpn1I53.js","assets/run-export-BrYhHj1O.js","assets/chunk-MIKKUKOD-XIkmalSN.js","assets/rolldown-runtime-aKtaBQYM.js","assets/chunk-O7JILDEF-CqcO1qaI.js","assets/chunk-4VOD55SX-BFSSw0c8.js","assets/markdown-Bi9b5f5Y.js","assets/export-options-Bu-tI6og.js","assets/api-BX5xXiFs.js","assets/dist-D5aoNQwk.js","assets/dist-BPx-FyRH.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-CEpd2cAX.js";import{t as r}from"./react-dom-OL4w_gzs.js";import{A as i,F as a,I as o,N as s,P as c,j as l,k as u}from"./primitives-DEsn1shf.js";import"./dist-BPx-FyRH.js";import{t as d}from"./api-BX5xXiFs.js";import{_ as f,d as p,g as m,n as h,r as g,t as _,v}from"./NewPathDialog-D4jnNBfP.js";import{i as y,n as b,o as x,r as S,t as C}from"./DropdownMenu-D5fCzIrh.js";import{t as w}from"./relative-time-B2kBaekd.js";import{t as T}from"./ConfirmDialog-BHFs6vmJ.js";import{t as E}from"./chunk-O7JILDEF-CqcO1qaI.js";import{v as D}from"./chunk-GAZKTT4R-BkP6-w3z.js";import{n as O}from"./chunk-MIKKUKOD-XIkmalSN.js";import"./markdown-Bi9b5f5Y.js";import"./schemas-JY4jmLbC.js";import{t as k}from"./preload-helper-Czpn1I53.js";import{b as A}from"./chunk-6ECMNUIP-C1kohb1U.js";import{a as j,i as M}from"./styles-CKr_yrbn.js";import{s as N}from"./chunk-AE3IUKMM-mZjzzO8Z.js";import{_ as P}from"./index-DXWR4qW1.js";import"./transform-CmAXy0Ck.js";import{a as ee,i as F,n as I,o as L,r as R,s as z,t as te}from"./export-options-Bu-tI6og.js";import{s as B,t as V,u as H}from"./outside-in-BFVUUcLa.js";var ne=[`replace`,`remove`,`insertAfter`],U=5;function re(e={}){let t=null,n=null,r=!1,i=new Set(e.initialWords??[]),a=async()=>{let t=await k(()=>import(`./dist-BINu2OK5.js`),__vite__mapDeps([0,1])),n=e.binary;if(n===void 0)if(e.wasmUrl){let r=typeof location<`u`?new URL(e.wasmUrl,location.href).toString():e.wasmUrl;n=t.createBinaryModuleFromUrl(r)}else n=(await k(async()=>{let{binary:e}=await import(`./_gezel-harper-binary-stub-BQjge3vR.js`);return{binary:e}},[])).binary;let r=t.Dialect[e.dialect??`American`],a={binary:n,dialect:r},o=typeof Worker<`u`?new t.WorkerLinter(a):new t.LocalLinter(a);return await o.setup(),i.size>0&&await o.importWords([...i]),{harper:t,linter:o}},o=()=>r?Promise.reject(Error(`ProofingProvider has been disposed`)):(t||=a().catch(e=>{throw t=null,e}),t),s=(e,t,n)=>{let r=e.span(),i=e.lint_kind();return{id:t,start:r.start,end:r.end,category:A(i),kind:i,message:e.message(),originalText:n.slice(r.start,r.end),suggestions:e.suggestions().map(e=>({text:e.get_replacement_text(),kind:ne[e.kind()]??`replace`}))}},c=0;return{hasAppDictionary:e.onDictionaryWord!=null,async setup(){await o()},async lint(e,t){let{linter:r}=await o(),i=t?.language??`plaintext`,a=await r.lint(e,{language:i});c+=1;let l=new Map,u=a.map((t,n)=>{let r=`${c}:${n}`,i=s(t,r,e);return l.set(r,{lint:t,start:i.start,end:i.end}),i});return n={source:e,language:i,byId:l},u},async ignoreFinding(e){let{linter:t}=await o(),r=n,i=r?.byId.get(e);if(!r||!i){console.warn(`squisq proofing: ignoreFinding called with a stale finding id`,e);return}let a=i.lint;for(let e=0;e<U&&a;e+=1)await t.ignoreLint(r.source,a),a=(await t.lint(r.source,{language:r.language})).find(e=>e.span().start===i.start&&e.span().end===i.end)},async addWord(t){let{linter:n}=await o();i.add(t),await n.importWords([...i]),e.onDictionaryWord?.(t)},async addWords(e){if(e.length===0)return;let{linter:t}=await o();for(let t of e)i.add(t);await t.importWords([...i])},async exportIgnored(){let{linter:e}=await o();return e.exportIgnoredLints()},async clearIgnored(){let{linter:e}=await o();await e.clearIgnoredLints()},async importIgnored(e){let{linter:t}=await o();await t.importIgnoredLints(e)},async setDialect(e){let{harper:t,linter:n}=await o();await n.setDialect(t.Dialect[e])},dispose(){if(r)return;r=!0,n=null;let e=t;t=null,e?.then(e=>e.linter.dispose()).catch(()=>{})}}}var W=e(t(),1),G=n(),ie=[`pdf`,`docx`,`pptx`,`html`,`md`],K={pdf:`PDF`,docx:`Word`,pptx:`PowerPoint`,html:`HTML`,md:`Markdown`},q=[{key:`plain`,label:`Plain`,hint:`A lightweight static HTML document.`},{key:`rendered`,label:`Rendered`,hint:`Renders via SquisqPlayer with themes and playback support.`}],ae=[{key:`single`,label:`Single file`,hint:`One .html file with images embedded as base64 data URIs.`},{key:`zip`,label:`ZIP archive`,hint:`A .zip with index.html plus separate image (and JS) files.`}];function oe({name:e,value:t,options:n,onChange:r}){return(0,G.jsx)(`fieldset`,{className:`gezel-export-choice-tray gz-tray`,"aria-label":e,children:n.map(n=>{let i=n.key===t;return(0,G.jsxs)(`label`,{className:`gz-key${i?` gz-key-active`:``}`,title:n.title,children:[(0,G.jsx)(`input`,{type:`radio`,className:`gezel-export-choice-radio`,name:e,value:n.key,checked:i,onChange:()=>r(n.key)}),n.label]},n.key)})})}function se({initial:e,exporting:t,error:n=null,onExport:r,onClose:d}){let[f,p]=(0,W.useState)(e.format),[m,h]=(0,W.useState)(e.themeId),[g,_]=(0,W.useState)(e.transformStyle),[v,y]=(0,W.useState)(e.pageSize),[b,x]=(0,W.useState)(e.htmlStyle),[S,C]=(0,W.useState)(e.htmlBundle),w=D(),T=N(),E=f===`docx`||f===`pdf`||f===`pptx`||f===`html`&&b===`rendered`,O=f===`pptx`,k=f===`pdf`,A=f===`html`,j=(0,W.useCallback)(e=>{e.preventDefault(),r({format:f,themeId:m,transformStyle:g,pageSize:v,htmlStyle:b,htmlBundle:S})},[f,m,g,v,b,S,r]);return(0,G.jsx)(a,{open:!0,onOpenChange:e=>!e&&d(),children:(0,G.jsxs)(c,{children:[(0,G.jsx)(s,{}),(0,G.jsx)(l,{className:`gezel-export-dialog`,children:(0,G.jsxs)(`form`,{onSubmit:j,children:[(0,G.jsxs)(`div`,{className:`gezel-export-dialog-header`,children:[(0,G.jsx)(o,{children:`Export document`}),(0,G.jsx)(i,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:`gezel-export-dialog-close`,"aria-label":`Close`,children:`×`})})]}),(0,G.jsxs)(`div`,{className:`gezel-export-dialog-body`,children:[(0,G.jsxs)(`div`,{className:`gezel-export-field`,children:[(0,G.jsx)(`span`,{className:`gezel-export-label`,children:`Format`}),(0,G.jsx)(oe,{name:`Format`,value:f,options:ie.map(e=>({key:e,label:K[e],title:R[e]})),onChange:p})]}),A&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`gezel-export-field`,children:[(0,G.jsx)(`span`,{className:`gezel-export-label`,children:`Style`}),(0,G.jsx)(oe,{name:`Style`,value:b,options:q,onChange:x}),(0,G.jsx)(`span`,{className:`gezel-export-hint`,children:q.find(e=>e.key===b)?.hint})]}),(0,G.jsxs)(`div`,{className:`gezel-export-field`,children:[(0,G.jsx)(`span`,{className:`gezel-export-label`,children:`Bundle`}),(0,G.jsx)(oe,{name:`Bundle`,value:S,options:ae,onChange:C}),(0,G.jsx)(`span`,{className:`gezel-export-hint`,children:ae.find(e=>e.key===S)?.hint})]})]}),E&&(0,G.jsxs)(`div`,{className:`gezel-export-field`,children:[(0,G.jsx)(`label`,{className:`gezel-export-label`,htmlFor:`gezel-export-theme`,children:`Theme`}),(0,G.jsx)(`select`,{id:`gezel-export-theme`,className:`gezel-export-select`,value:m,onChange:e=>h(e.target.value),children:w.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))}),(0,G.jsx)(`span`,{className:`gezel-export-hint`,children:w.find(e=>e.id===m)?.description})]}),O&&(0,G.jsxs)(`div`,{className:`gezel-export-field`,children:[(0,G.jsx)(`label`,{className:`gezel-export-label`,htmlFor:`gezel-export-transform`,children:`Transform`}),(0,G.jsx)(`select`,{id:`gezel-export-transform`,className:`gezel-export-select`,value:g,onChange:e=>_(e.target.value),children:T.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))}),(0,G.jsx)(`span`,{className:`gezel-export-hint`,children:T.find(e=>e.id===g)?.description})]}),k&&(0,G.jsxs)(`div`,{className:`gezel-export-field`,children:[(0,G.jsx)(`label`,{className:`gezel-export-label`,htmlFor:`gezel-export-pagesize`,children:`Page size`}),(0,G.jsxs)(`select`,{id:`gezel-export-pagesize`,className:`gezel-export-select`,value:v,onChange:e=>y(e.target.value),children:[(0,G.jsx)(`option`,{value:`letter`,children:`US Letter`}),(0,G.jsx)(`option`,{value:`a4`,children:`A4`})]})]}),n&&(0,G.jsx)(`p`,{className:`error small`,role:`alert`,children:n})]}),(0,G.jsxs)(u,{children:[(0,G.jsx)(i,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,disabled:t,children:`Cancel`})}),(0,G.jsx)(`button`,{type:`submit`,className:`primary`,disabled:t,children:t?`Exporting…`:`Export`})]})]})})]})})}function J(e){let t=e instanceof Error?e.message.trim():``;return t?`Export failed: ${t}`:`Export failed. The document was not exported.`}function ce(e){let t=I[e.format].toUpperCase().replace(`.`,``),n=e.format===`html`&&e.htmlBundle===`zip`?`ZIP`:t,r=[];if(e.format===`html`&&e.htmlStyle===`rendered`&&r.push(`rendered`),e.themeId!==`standard`&&(e.format!==`html`||e.htmlStyle===`rendered`)){let t=D().find(t=>t.id===e.themeId);t&&r.push(t.name)}if(e.format===`pptx`&&e.transformStyle){let t=N().find(t=>t.id===e.transformStyle);t&&r.push(t.name)}return r.length>0?`Export ${n} with ${r.join(` + `)}`:`Export ${n}`}function le({selectedFile:e,mediaContainer:t,mediaSource:n}){let{markdownSource:r}=M(),[i,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(null),[w,T]=(0,W.useState)(!1),[E,D]=(0,W.useState)(null),[O,A]=(0,W.useState)(()=>F()),j=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>j.current?.abort(),[]),(0,W.useEffect)(()=>{let e=!1;return L().then(t=>{e||A(t)}),()=>{e=!0}},[]);let N=(0,W.useCallback)(()=>{f(!1),D(null),m(!0)},[]),P=(0,W.useCallback)(()=>{w||(m(!1),D(null))},[w]),I=(0,W.useCallback)(async t=>{if(!e||!n)return;let i=new AbortController;j.current?.abort(),j.current=i,f(!1),g(t),v(null);try{let a=await d.exportDocumentMedia({markdown:r,selectedFile:e,format:t,source:n},i.signal);if(i.signal.aborted)return;z(a,`${(e.split(`/`).pop()??e).replace(/\.[^.]+$/,``)||`document`}.${t}`),g(null)}catch(e){if(i.signal.aborted)return;v(J(e))}finally{j.current===i&&(j.current=null)}},[r,n,e]),R=(0,W.useCallback)(()=>{j.current?.abort(),j.current=null,g(null),v(null)},[]),B=(0,W.useCallback)(async n=>{T(!0),D(null),A(n);try{await ee(n);let{runExport:i}=await k(async()=>{let{runExport:e}=await import(`./run-export-BrYhHj1O.js`);return{runExport:e}},__vite__mapDeps([2,3,4,5,6,7,1,8,9,10,11]));await i(r,e,n,t),m(!1)}catch(e){D(J(e))}finally{T(!1)}},[r,e,t]),V=(0,W.useCallback)(async()=>{if(O){f(!1),T(!0),D(null);try{let{runExport:n}=await k(async()=>{let{runExport:e}=await import(`./run-export-BrYhHj1O.js`);return{runExport:e}},__vite__mapDeps([2,3,4,5,6,7,1,8,9,10,11]));await n(r,e,O,t)}catch(e){D(J(e)),m(!0)}finally{T(!1)}}},[O,r,e,t]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(y,{open:i,onOpenChange:f,children:[(0,G.jsx)(x,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,className:`squisq-toolbar-button gezel-export-trigger`,"aria-label":`Export document`,title:`Export document`,disabled:w,children:[(0,G.jsx)(ue,{}),(0,G.jsx)(`span`,{children:`Export`})]})}),(0,G.jsx)(S,{children:(0,G.jsxs)(C,{className:`app-nav-menu gezel-export-menu`,sideOffset:4,align:`end`,children:[O&&(0,G.jsx)(b,{className:`app-nav-menu-item`,onSelect:()=>void V(),disabled:w,children:ce(O)}),(0,G.jsx)(b,{className:`app-nav-menu-item`,onSelect:N,children:`Export…`}),e&&n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`gezel-export-menu-divider`,role:`separator`,tabIndex:-1}),(0,G.jsx)(b,{className:`app-nav-menu-item`,onSelect:()=>void I(`mp4`),children:`Export video…`}),(0,G.jsx)(b,{className:`app-nav-menu-item`,onSelect:()=>void I(`gif`),children:`Export animated GIF…`})]})]})})]}),p&&(0,G.jsx)(se,{initial:O??te,exporting:w,error:E,onExport:e=>void B(e),onClose:P}),(h||_)&&(0,G.jsx)(a,{open:!0,onOpenChange:e=>!e&&R(),children:(0,G.jsxs)(c,{children:[(0,G.jsx)(s,{}),(0,G.jsxs)(l,{className:`gezel-export-loading-dialog`,children:[(0,G.jsx)(o,{children:h===`gif`?`Exporting animated GIF`:`Exporting video`}),(0,G.jsx)(`p`,{className:_?`error`:`muted`,role:_?`alert`:`status`,children:_??`Rendering with the ffmpeg installed on this computer. This can take a while…`}),(0,G.jsx)(u,{children:(0,G.jsx)(`button`,{type:`button`,onClick:R,children:_?`Close`:`Cancel`})})]})]})})]})}function ue(){return(0,G.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M8 10.5V1.75`}),(0,G.jsx)(`path`,{d:`M5.25 4.5 8 1.75l2.75 2.75`}),(0,G.jsx)(`path`,{d:`M4.25 6.75h-1a1.5 1.5 0 0 0-1.5 1.5v4.5a1.5 1.5 0 0 0 1.5 1.5h9.5a1.5 1.5 0 0 0 1.5-1.5v-4.5a1.5 1.5 0 0 0-1.5-1.5h-1`})]})}var de=e(r(),1),fe=class e{context;onChange;static create(t){let n=globalThis,r=n.AudioContext??n.webkitAudioContext;if(!r)return null;try{return new e(new r,t)}catch{return null}}chunks=[];pending=new Map;sources=new Set;bufferedDuration=0;playbackOffset=0;playbackStartedAt=0;playing=!1;complete=!1;disposed=!1;endTimer=null;constructor(e,t){this.context=e,this.onChange=t}prime(){this.context.resume().catch(()=>void 0)}async appendWav(e,t){if(this.disposed||e<this.chunks.length||this.pending.has(e))return this.snapshot();let n=await this.context.decodeAudioData(t.slice(0));if(this.disposed)return this.snapshot();for(this.pending.set(e,n);this.pending.has(this.chunks.length);){let e=this.chunks.length,t=this.pending.get(e);this.pending.delete(e);let n={index:e,start:this.bufferedDuration,buffer:t};this.chunks.push(n),this.bufferedDuration+=t.duration,this.playing&&this.scheduleChunk(n)}return this.refreshEndTimer(),this.emit(),this.snapshot()}async play(){if(this.disposed||this.bufferedDuration<=0)return!1;if(this.playing)return!0;if(this.playbackOffset>=this.bufferedDuration-.02){if(!this.complete)return this.emit(),!1;this.playbackOffset=0}await this.context.resume(),this.stopSources(),this.playing=!0,this.playbackStartedAt=this.context.currentTime+.025;for(let e of this.chunks)this.scheduleChunk(e);return this.refreshEndTimer(),this.emit(),!0}pause(){this.playing&&(this.playbackOffset=this.currentTime(),this.playing=!1,this.stopSources(),this.clearEndTimer(),this.emit())}seek(e){let t=this.playing;this.playbackOffset=Math.max(0,Math.min(this.bufferedDuration,e)),this.playing=!1,this.stopSources(),this.clearEndTimer(),t?this.play():this.emit()}finish(){this.complete=!0,this.refreshEndTimer(),this.emit()}snapshot(){let e=this.currentTime();return{currentTime:e,bufferedDuration:this.bufferedDuration,isPlaying:this.playing,waitingForAudio:!this.complete&&!this.playing&&this.bufferedDuration>0&&e>=this.bufferedDuration-.05,complete:this.complete}}dispose(){this.disposed||(this.disposed=!0,this.playing=!1,this.stopSources(),this.clearEndTimer(),this.context.close().catch(()=>void 0))}currentTime(){return this.playing?Math.min(this.bufferedDuration,this.playbackOffset+Math.max(0,this.context.currentTime-this.playbackStartedAt)):this.playbackOffset}scheduleChunk(e){let t=e.start+e.buffer.duration;if(!this.playing||t<=this.playbackOffset+.005)return;let n=Math.max(0,this.playbackOffset-e.start),r=this.playbackStartedAt+Math.max(0,e.start-this.playbackOffset);if(r<this.context.currentTime&&(n+=this.context.currentTime-r,r=this.context.currentTime),n>=e.buffer.duration-.005)return;let i=this.context.createBufferSource();i.buffer=e.buffer,i.connect(this.context.destination),i.addEventListener(`ended`,()=>this.sources.delete(i),{once:!0}),this.sources.add(i),i.start(r,n)}refreshEndTimer(){if(this.clearEndTimer(),!this.playing)return;let e=Math.max(20,(this.bufferedDuration-this.currentTime())*1e3+40);this.endTimer=setTimeout(()=>{if(this.playing){if(this.currentTime()<this.bufferedDuration-.05){this.refreshEndTimer();return}this.playbackOffset=this.bufferedDuration,this.playing=!1,this.stopSources(),this.clearEndTimer(),this.emit()}},e)}stopSources(){for(let e of this.sources)try{e.stop()}catch{}this.sources.clear()}clearEndTimer(){this.endTimer&&clearTimeout(this.endTimer),this.endTimer=null}emit(){this.disposed||this.onChange(this.snapshot())}};function pe(e){return e.replace(/\u00a0/g,` `).replace(/[ \t]+\n/g,`
|
|
3
|
-
`).replace(/\n{3,}/g,`
|
|
4
|
-
|
|
5
|
-
`).trim()}function me(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}function he(e){let t=new Uint8Array(e.byteLength);return t.set(e),t.buffer}function Y(e){let t=Number.isFinite(e)&&e>0?Math.floor(e):0;return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}function ge(e,t){return`${(e?.split(/[\\/]/).pop()?.replace(/\.[^.]+$/,``)||`document`).replace(/[^a-z0-9._-]+/gi,`-`).replace(/^-+|-+$/g,``)||`document`}-${t}-narration.wav`}function _e(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.style.display=`none`,document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),0)}function ve({fileName:e,projectId:t}){let{markdownDoc:n,markdownSource:r}=M(),i=(0,W.useRef)(null),a=(0,W.useRef)(null),o=(0,W.useRef)(null),s=(0,W.useRef)(null),c=(0,W.useRef)(null),l=(0,W.useRef)(null),u=(0,W.useRef)(null),f=(0,W.useRef)(0),p=(0,W.useRef)(0),m=(0,W.useRef)(0),h=(0,W.useRef)(0),g=(0,W.useRef)(!1),[_,v]=(0,W.useState)(`idle`),[y,b]=(0,W.useState)(`document`),[x,S]=(0,W.useState)(null),[C,w]=(0,W.useState)(!1),[T,D]=(0,W.useState)(0),[k,A]=(0,W.useState)(0),[N,P]=(0,W.useState)(null),[ee,F]=(0,W.useState)(0),[I,L]=(0,W.useState)(0),[R,z]=(0,W.useState)(!1),te=(0,W.useMemo)(()=>{try{return pe(E(n??O(r)))}catch{return pe(r)}},[n,r]),B=(0,W.useCallback)(()=>{l.current?.dispose(),l.current=null,a.current?.(),a.current=null;let e=i.current;e&&(e.pause(),e.removeAttribute(`src`)),i.current=null,o.current&&URL.revokeObjectURL(o.current),o.current=null,s.current=null},[]),V=(0,W.useCallback)(()=>{c.current?.abort(),c.current=null,B(),v(`idle`),S(null),w(!1),D(0),A(0),L(0),z(!1),P(null),u.current=null,g.current=!1},[B]);(0,W.useEffect)(()=>()=>{c.current?.abort(),B()},[B]),(0,W.useEffect)(()=>{if(_!==`creating`)return;let e=f.current||performance.now();F(0);let t=window.setInterval(()=>{F(Math.floor((performance.now()-e)/1e3))},1e3);return()=>window.clearInterval(t)},[_]),(0,W.useEffect)(()=>{if(_===`idle`||!l.current)return;let e=window.setInterval(()=>{let e=l.current?.snapshot();e&&(D(e.currentTime),L(e.bufferedDuration),w(e.isPlaying),z(e.waitingForAudio))},200);return()=>window.clearInterval(e)},[_]);let H=(0,W.useCallback)(async(e,n)=>{let r=pe(e);if(!r)return;c.current?.abort(),B();let _=fe.create(e=>{D(e.currentTime),L(e.bufferedDuration),w(e.isPlaying),z(e.waitingForAudio)});l.current=_,_?.prime();let y=new AbortController;c.current=y,f.current=performance.now(),p.current=0,m.current=0,h.current=0,u.current=null,g.current=!1,b(n),v(`creating`),S(null),w(!1),D(0),A(0),L(0),z(!1),P(null);try{let e=await d.synthesizeSpeechWithProgress({text:r,...t?{projectId:t}:{},inline:!0},{onProgress:e=>{u.current=e,P(e)},onChunk:async e=>{if(y.signal.aborted||l.current!==_||!_)return;let t=await _.appendWav(e.index,he(me(e.b64Wav))),n=performance.now(),r=u.current;if(p.current===0&&(p.current=n,m.current=t.bufferedDuration,h.current=r?.completedCharacters??0),t.isPlaying||g.current)return;let i=(n-p.current)/1e3,a=t.bufferedDuration-m.current,o=i>.25?a/i:0,s=(r?.completedCharacters??0)-h.current,c=i>.25?s/i:0,d=r&&c>0?(r.totalCharacters-r.completedCharacters)/c:1/0,f=t.bufferedDuration-t.currentTime;f>=4&&(o>=1.15||f>=d+3)&&await _.play()}},y.signal);if(y.signal.aborted)return;if(!e.b64Wav)throw Error(`The speech engine did not return playable audio.`);let n=new Blob([he(me(e.b64Wav))],{type:`audio/wav`});if(s.current=n,_&&_.snapshot().bufferedDuration>0){_.finish(),L(_.snapshot().bufferedDuration),A(e.meta?.durationSeconds??_.snapshot().bufferedDuration),v(`ready`),c.current=null,!_.snapshot().isPlaying&&!g.current&&await _.play();return}_?.dispose(),l.current===_&&(l.current=null);let f=URL.createObjectURL(n),b=new Audio(f),x=()=>{D(b.currentTime||0),Number.isFinite(b.duration)&&A(b.duration)},C=()=>w(!0),T=()=>w(!1),E=()=>w(!1),O=()=>{S(`The narration was created, but this device could not play it.`),v(`error`)};b.addEventListener(`loadedmetadata`,x),b.addEventListener(`durationchange`,x),b.addEventListener(`timeupdate`,x),b.addEventListener(`play`,C),b.addEventListener(`pause`,T),b.addEventListener(`ended`,E),b.addEventListener(`error`,O),a.current=()=>{b.removeEventListener(`loadedmetadata`,x),b.removeEventListener(`durationchange`,x),b.removeEventListener(`timeupdate`,x),b.removeEventListener(`play`,C),b.removeEventListener(`pause`,T),b.removeEventListener(`ended`,E),b.removeEventListener(`error`,O)},o.current=f,i.current=b,A(e.meta?.durationSeconds??0),v(`ready`),c.current=null,await b.play().catch(()=>void 0)}catch(e){if(y.signal.aborted){c.current===y&&v(`idle`);return}_?.dispose(),l.current===_&&(l.current=null),S(e instanceof Error?e.message:`Could not create the narration.`),v(`error`),c.current=null}},[t,B]);j((0,W.useMemo)(()=>[{id:`gezel.narrate-selection`,label:`Narrate selection`,group:`narration`,when:`selection`,disabled:_===`creating`,icon:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M4 9v6h4l5 4V5L8 9H4Zm12.5 3a4.5 4.5 0 0 0-2-3.74v7.48a4.5 4.5 0 0 0 2-3.74Z`})}),onSelect:({selectedText:e})=>H(e,`selection`)}],[H,_]));let ne=(0,W.useCallback)(()=>{let e=l.current;if(e){e.snapshot().isPlaying?(g.current=!0,e.pause()):(g.current=!1,e.play().catch(e=>{S(e instanceof Error?e.message:`Could not play the narration.`),v(`error`)}));return}let t=i.current;t&&(t.paused?(Number.isFinite(t.duration)&&t.currentTime>=t.duration&&(t.currentTime=0),t.play().catch(e=>{S(e instanceof Error?e.message:`Could not play the narration.`),v(`error`)})):t.pause())},[]),U=(0,W.useCallback)(e=>{let t=l.current;if(t){let n=t.snapshot();t.seek(n.currentTime+e);return}let n=i.current;if(!n)return;let r=Number.isFinite(n.duration)?n.duration:1/0;n.currentTime=Math.max(0,Math.min(r,n.currentTime+e)),D(n.currentTime)},[]),re=(0,W.useCallback)(e=>{let t=l.current;if(t){t.seek(e);return}let n=i.current;n&&(n.currentTime=e,D(e))},[]),ie=(0,W.useCallback)(()=>{let t=s.current;t&&_e(t,ge(e,y))},[e,y]),K=N?.phase===`encoding`?100:Math.min(100,Math.round((N?.completedCharacters??0)/(N?.totalCharacters||1)*100)),q=I>0?Math.min(K,T/I*K):0,ae=_===`idle`?null:(0,de.createPortal)((0,G.jsxs)(`aside`,{className:`document-narration-transport`,"aria-label":`Narration controls`,children:[_===`creating`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`document-narration-summary`,"aria-live":`polite`,children:[(0,G.jsx)(`strong`,{children:C?`Playing while creating…`:R&&!g.current?`Buffering narration…`:`Creating narration…`}),(0,G.jsx)(`span`,{children:I>0?`${Y(T)} played · ${Y(I)} buffered`:`${y===`document`?`Full document`:`Selected text`} · ${N?.phase===`loading`?`Preparing voice`:`Starting speech`} · ${Y(ee)} elapsed`})]}),I>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,className:`document-narration-control`,"aria-label":`Back 30 seconds`,title:`Back 30 seconds`,onClick:()=>U(-30),children:[`↶`,(0,G.jsx)(`small`,{children:`30`})]}),(0,G.jsx)(`button`,{type:`button`,className:`document-narration-control document-narration-play`,"aria-label":C?`Pause narration`:`Play buffered narration`,title:C?`Pause`:`Play buffered audio`,onClick:ne,children:C?`Ⅱ`:`▶`}),(0,G.jsxs)(`button`,{type:`button`,className:`document-narration-control`,"aria-label":`Forward 30 seconds`,title:`Forward within buffered audio`,onClick:()=>U(30),children:[`↷`,(0,G.jsx)(`small`,{children:`30`})]})]}),(0,G.jsxs)(`div`,{className:`document-narration-progress`,role:`progressbar`,"aria-label":`Creating narration`,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,"aria-valuenow":K,title:`${Y(I)} generated · ${K}% complete`,children:[(0,G.jsx)(`span`,{className:`document-narration-progress-buffered`,style:{width:`${K}%`}}),(0,G.jsx)(`span`,{className:`document-narration-progress-played`,style:{width:`${q}%`}})]}),(0,G.jsxs)(`span`,{className:`document-narration-progress-value`,children:[K,`% · `,Y(I)]}),(0,G.jsx)(`button`,{type:`button`,className:`document-narration-cancel`,onClick:V,children:`Cancel`})]}),_===`ready`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`document-narration-summary`,"aria-live":`polite`,children:[(0,G.jsx)(`strong`,{children:y===`document`?`Document narration`:`Selection narration`}),(0,G.jsx)(`span`,{children:C?`Playing`:`Paused`})]}),(0,G.jsxs)(`button`,{type:`button`,className:`document-narration-control`,"aria-label":`Back 30 seconds`,title:`Back 30 seconds`,onClick:()=>U(-30),children:[`↶`,(0,G.jsx)(`small`,{children:`30`})]}),(0,G.jsx)(`button`,{type:`button`,className:`document-narration-control document-narration-play`,"aria-label":C?`Pause narration`:`Play narration`,title:C?`Pause`:`Play`,onClick:ne,children:C?`Ⅱ`:`▶`}),(0,G.jsxs)(`button`,{type:`button`,className:`document-narration-control`,"aria-label":`Forward 30 seconds`,title:`Forward 30 seconds`,onClick:()=>U(30),children:[`↷`,(0,G.jsx)(`small`,{children:`30`})]}),(0,G.jsxs)(`label`,{className:`document-narration-timeline`,children:[(0,G.jsx)(`span`,{className:`sr-only`,children:`Narration position`}),(0,G.jsx)(`input`,{type:`range`,min:0,max:Math.max(k,.1),step:.1,value:Math.min(T,Math.max(k,.1)),onChange:e=>re(Number(e.currentTarget.value))}),(0,G.jsxs)(`span`,{"aria-hidden":`true`,children:[Y(T),` / `,Y(k)]})]}),(0,G.jsx)(`button`,{type:`button`,className:`document-narration-download`,"aria-label":`Download WAV`,title:`Download WAV`,onClick:ie,children:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M12 3v11m0 0 4-4m-4 4-4-4M5 17v3h14v-3`})})}),(0,G.jsx)(`button`,{type:`button`,className:`document-narration-close`,"aria-label":`Close narration`,title:`Close`,onClick:V,children:`×`})]}),_===`error`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`document-narration-summary`,role:`alert`,children:[(0,G.jsx)(`strong`,{children:`Narration unavailable`}),(0,G.jsx)(`span`,{children:x})]}),(0,G.jsx)(`button`,{type:`button`,className:`document-narration-cancel`,onClick:V,children:`Close`})]})]}),document.body);return(0,G.jsxs)(`span`,{className:`document-narration-root`,children:[(0,G.jsx)(`button`,{type:`button`,className:`squisq-toolbar-button document-narration-trigger`,"aria-label":`Narrate document`,title:`Narrate document`,disabled:!te||_===`creating`,onClick:()=>void H(te,`document`),children:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M4 9v6h4l5 4V5L8 9H4Zm12.5 3a4.5 4.5 0 0 0-2-3.74v7.48a4.5 4.5 0 0 0 2-3.74Zm-2-8.65v2.12a7.5 7.5 0 0 1 0 13.06v2.12a9.5 9.5 0 0 0 0-17.3Z`})})}),ae]})}function ye({entries:e,selectedPath:t,onSelect:n,iconFor:r=g,trailingForEntry:i,detailForEntry:a,emptyMessage:o}){return e.length===0?o?(0,G.jsx)(`div`,{className:`file-flat-empty muted`,children:o}):null:(0,G.jsx)(`div`,{className:`file-flat-list`,children:e.map(e=>{let o=v(e.path),s=i?.(e),c=a?.(e);return(0,G.jsxs)(`div`,{className:`tree-row${t===e.path?` tree-row-selected`:``}${c?` file-flat-row-card`:``}`,children:[(0,G.jsx)(`span`,{className:`tree-toggle-spacer`}),(0,G.jsxs)(`button`,{type:`button`,className:`tree-label${c?` file-flat-card`:``}`,onClick:()=>n(e),children:[(0,G.jsxs)(`span`,{className:`file-flat-card-name`,children:[r(e),e.name,o&&(0,G.jsx)(`span`,{className:`file-flat-parent`,children:o})]}),c&&(0,G.jsx)(`span`,{className:`file-flat-card-detail`,children:c})]}),s&&(0,G.jsx)(`button`,{type:`button`,className:`tree-row-trailing tree-row-trailing-select`,tabIndex:-1,onClick:()=>n(e),children:s})]},e.path)})})}var X={width:14,height:14,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,focusable:!1},be=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M1.8 4.6h3.6l1.4 1.5h7.4v6.9H1.8Z`}),(0,G.jsx)(`path`,{d:`M6.3 11.2 7.9 7.4l1.6 3.8`,strokeWidth:`1.3`}),(0,G.jsx)(`path`,{d:`M6.9 10h2`,strokeWidth:`1.3`})]}),xe=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M1.8 4.6h3.6l1.4 1.5h7.4v6.9H1.8Z`}),(0,G.jsx)(`circle`,{cx:`8`,cy:`9.5`,r:`2.2`,strokeWidth:`1.3`}),(0,G.jsx)(`path`,{d:`M8 8.5v1l0.9 0.6`,strokeWidth:`1.3`})]}),Se=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M2.4 3.6h11.2`}),(0,G.jsx)(`path`,{d:`M2.4 7.4h5`}),(0,G.jsx)(`path`,{d:`M2.4 11.2h5`}),(0,G.jsx)(`circle`,{cx:`11.4`,cy:`10.4`,r:`3`,strokeWidth:`1.3`}),(0,G.jsx)(`path`,{d:`M11.4 9v1.4l1.1 0.7`,strokeWidth:`1.3`})]}),Ce=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M2.4 3.9h7`}),(0,G.jsx)(`path`,{d:`M2.4 7.7h7`}),(0,G.jsx)(`path`,{d:`M2.4 11.5h7`}),(0,G.jsx)(`path`,{d:`M12.6 3.4v5.2`}),(0,G.jsx)(`path`,{d:`M12.6 11.6v0.01`,strokeWidth:`2.4`})]}),we=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M2.8 11.8a5.2 5.2 0 0 1 10.4 0`}),(0,G.jsx)(`path`,{d:`M8 11.8 10.7 8`}),(0,G.jsx)(`path`,{d:`M8 11.8v0.01`,strokeWidth:`2.4`})]}),Te=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M1.4 8S3.8 3.8 8 3.8 14.6 8 14.6 8 12.2 12.2 8 12.2 1.4 8 1.4 8Z`}),(0,G.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.9`,strokeWidth:`1.3`})]}),Ee=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M1.4 8S3.8 3.8 8 3.8 14.6 8 14.6 8 12.2 12.2 8 12.2 1.4 8 1.4 8Z`}),(0,G.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.9`,strokeWidth:`1.3`}),(0,G.jsx)(`path`,{d:`M2.6 13.4 13.4 2.6`})]}),De=()=>(0,G.jsxs)(`svg`,{...X,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M8.6 2.9H3.1v10h10V7.4`}),(0,G.jsx)(`path`,{d:`M9.4 6.6 13.4 2.6`}),(0,G.jsx)(`path`,{d:`M10.3 2.6h3.1v3.1`})]}),Oe={"tree-alpha":{label:`Folders, A to Z`,hint:`Folder view — folders and files sorted by name.`,icon:be},"tree-modified":{label:`Folders, newest first`,hint:`Folder view — folders by name, files with the newest changes on top.`,icon:xe},"flat-modified":{label:`All files by last modified`,hint:`Every file across all folders, newest changes on top.`,icon:Se},"flat-issues":{label:`Files by issues`,hint:`Files with open review issues, most issues on top.`,icon:Ce},"flat-criticality":{label:`Files by criticality`,hint:`Files with open review issues, weighted so major issues rank first.`,icon:we}};function ke({value:e,modes:t,onChange:n}){return(0,G.jsx)(`div`,{className:`gz-tray file-view-tray`,role:`radiogroup`,"aria-label":`File list view`,children:t.map(t=>{let r=Oe[t],i=r.icon,a=t===e;return(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":a,className:`gz-key gz-key--icon${a?` gz-key-active`:``}`,title:r.hint,"aria-label":r.label,onClick:()=>{a||n(t)},children:(0,G.jsx)(i,{})},t)})})}function Ae({kind:e,value:t,onChange:n}){return(0,G.jsx)(`div`,{className:`gz-tray file-hidden-tray`,children:(0,G.jsx)(`button`,{type:`button`,"aria-pressed":t,className:`gz-key gz-key--icon${t?` gz-key-active`:``}`,title:t?`Hide hidden files again.`:e===`workspace`?`Show hidden files — Office lock files, dot-files, and folders like node_modules.`:e===`artifacts`?`Show hidden files — Office lock files, dot-files, and the generated shadow folder.`:`Show hidden files — Office lock files, dot-files, and companion folders.`,"aria-label":`Show hidden files`,onClick:()=>n(!t),children:(0,G.jsx)(t?Te:Ee,{})})})}function je({onReveal:e}){return(0,G.jsx)(`div`,{className:`gz-tray file-reveal-tray`,children:(0,G.jsx)(`button`,{type:`button`,className:`gz-key gz-key--icon`,title:`Open in file manager`,"aria-label":`Open in file manager`,onClick:e,children:(0,G.jsx)(De,{})})})}var Me=new Set([`md`,`markdown`,`mdx`,`txt`,`csv`,`json`,`yaml`,`yml`]),Ne=[...Me,`html`,`htm`,`docx`,`pdf`,`pptx`,`xlsx`],Pe=new Set(Ne);function Fe(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1).toLocaleLowerCase(`en-US`):``}function Ie(e){return[...e].map(e=>{let t=e.charCodeAt(0);return e===`/`||e===`\\`||t<32?`-`:e}).join(``).trim()}function Le(e,t){let n=e.replace(/^\/+|\/+$/g,``);return n?`${n}/${t}`:t}function Re(e){let t=e.lastIndexOf(`.`);return t<=0?{stem:e,extension:``}:{stem:e.slice(0,t),extension:e.slice(t)}}function ze(e,t,n){let{stem:r,extension:i}=Re(t),a=Le(e,t),o=2,s=e=>{if(n.has(e.toLocaleLowerCase(`en-US`)))return!0;let t=B(e);if(!t)return!1;let r=t.companionDirectory.toLocaleLowerCase(`en-US`);return[...n].some(e=>e===r||e.startsWith(`${r}/`))};for(;s(a);)a=Le(e,`${r} ${o}${i}`),o+=1;n.add(a.toLocaleLowerCase(`en-US`));let c=B(a);return c&&n.add(c.companionDirectory.toLocaleLowerCase(`en-US`)),a}function Be(e,t){if(t)return t;switch(Fe(e)){case`md`:case`markdown`:case`mdx`:return`text/markdown`;case`html`:case`htm`:return`text/html`;case`docx`:return`application/vnd.openxmlformats-officedocument.wordprocessingml.document`;case`pdf`:return`application/pdf`;case`pptx`:return`application/vnd.openxmlformats-officedocument.presentationml.presentation`;case`xlsx`:return`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`;default:return`application/octet-stream`}}function Ve(e){return Pe.has(Fe(e.name))}async function He(e,t,n){let r=B(n);if(!r)throw Error(`${t.name} is not a supported rendered document.`);return await e.writeBinary(r.targetPath,t,Be(n,t.type)),[]}async function Ue(e){let t=e.destination?.replace(/^\/+|\/+$/g,``)??``,n=new Set(e.existingPaths.map(e=>e.toLocaleLowerCase(`en-US`))),r={importedPaths:[],warnings:[],rejected:[]};for(let i of e.files){let a=Ie(i.name);if(!a||!Ve({name:a})){r.rejected.push({name:i.name||`Unnamed file`,reason:`Unsupported document type`});continue}let o=ze(t,a,n);try{if(B(o))r.warnings.push(...await He(e.target,i,o));else if(Me.has(Fe(a)))await e.target.writeText(o,await i.text());else throw Error(`Unsupported document type`);r.importedPaths.push(o)}catch(e){r.rejected.push({name:i.name,reason:e instanceof Error?e.message:String(e)})}}return r}function We(e,t){let n=e.replace(/\/[^/]*$/,``);return n&&t.startsWith(`${n}/`)?t.slice(n.length+1):t}function Ge(e){let{client:t,currentDocumentPath:n,limit:r=20,source:i=`documents`,projectId:a}=e;return async e=>{let o=e.trim().toLowerCase();try{return(i===`project-artifacts`&&a?await t.listProjectArtifacts(a,void 0,!0):await t.listDocuments(void 0,!0)).files.filter(e=>!e.isDirectory).filter(e=>e.path!==n).filter(e=>/\.(md|markdown|mdx|txt)$/i.test(e.name)).filter(e=>!o||e.name.toLowerCase().includes(o)||e.path.toLowerCase().includes(o)).slice(0,r).map(e=>({path:We(n,e.path),label:e.name.replace(/\.(md|markdown|mdx|txt)$/i,``),description:e.path}))}catch{return[]}}}var Ke=`gezel:proof-dictionary`,qe=`gezel:proof-ignored`,Je={spelling:!0,grammar:!0};function Ye(e){Je={...e}}function Xe(e){return e===`spelling`?Je.spelling:Je.grammar}var Ze=250;function Qe(){try{let e=window.localStorage.getItem(Ke);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function $e(e){try{let t=new Set(Qe());t.add(e),window.localStorage.setItem(Ke,JSON.stringify([...t]))}catch{}}var et=null;function tt(){if(!et){let e=re({wasmUrl:`/harper/harper_wasm_bg.wasm`,initialWords:Qe(),onDictionaryWord:$e});et={...e,async lint(t,n){return(await e.lint(t,n)).filter(e=>Xe(e.category))}}}return et}function nt(e){return e.fileName??e.articleId}function rt(){try{let e=window.localStorage.getItem(qe);if(!e)return{};let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var it={load(e){return rt()[nt(e)]},save(e,t){try{let n=rt(),r=nt(e);delete n[r],n[r]=t;let i=Object.keys(n);for(let e of i.slice(0,Math.max(0,i.length-Ze)))delete n[e];window.localStorage.setItem(qe,JSON.stringify(n))}catch{}}},Z,at=null,ot=new Set;function st(e){Z=e,Ye(e);for(let t of ot)t(e)}function ct(e){return{spelling:e.inlineSpellChecking!==!1,grammar:e.inlineGrammarChecking!==!1}}function lt(){Z!==void 0||at||(at=d.getConfig().then(e=>{st(ct(e))}).catch(()=>{}).finally(()=>{at=null}))}typeof window<`u`&&window.addEventListener(`gezel:config-updated`,e=>{let t=e.detail;t&&st(ct(t))});function ut(){let[e,t]=(0,W.useState)(Z??null);return(0,W.useEffect)(()=>(ot.add(t),Z===void 0?lt():t(Z),()=>{ot.delete(t)}),[]),e}function dt(){let e=ut(),t=e?`${e.spelling}:${e.grammar}`:`unknown`,[n,r]=(0,W.useState)(t);return(0,W.useEffect)(()=>{if(n===t)return;let e=window.setTimeout(()=>r(t),0);return()=>{window.clearTimeout(e)}},[t,n]),!e||!e.spelling&&!e.grammar||n!==t?null:tt()}var ft=`gezel:project-file-tree-width:v1`,pt=`gezel:project-file-tree-collapsed:v1`,mt=150,ht=560,Q=240,gt=100,_t=34;function vt(e){return Number.isFinite(e)?Math.max(mt,Math.min(ht,Math.round(e))):Q}function yt(){if(typeof window>`u`)return Q;try{let e=window.localStorage.getItem(ft);return e?vt(Number.parseFloat(e)):Q}catch{return Q}}function bt(){if(typeof window>`u`)return!1;try{return window.localStorage.getItem(pt)===`1`}catch{return!1}}function xt({source:e,entries:t,truncated:n,viewMode:r,modes:i,onViewModeChange:a,showHidden:o,onShowHiddenChange:s,selectedPath:c,onSelect:l,selectableFolders:u,labelFor:d,emptyMessage:m,mutations:g,viewer:_,extraPane:v,headerExtra:y,titleReplacement:b,notices:x,trailingForEntry:S,actionsForEntry:C,customList:T,layoutClassName:E}){let[D,O]=(0,W.useState)(()=>yt()),[k,A]=(0,W.useState)(()=>bt()),j=(0,W.useRef)(null),M=(0,W.useCallback)(e=>{let t=vt(e);O(t);try{window.localStorage.setItem(ft,String(t))}catch{}},[]),N=(0,W.useCallback)(e=>{A(e);try{window.localStorage.setItem(pt,e?`1`:`0`)}catch{}},[]),P=(0,W.useCallback)(e=>{e.preventDefault(),j.current={startX:e.clientX,startWidth:k?_t:D},document.body.classList.add(`chat-rail-resizing`),document.body.style.cursor=`col-resize`;let t=e=>{let t=j.current;if(!t)return;let n=t.startWidth+(e.clientX-t.startX);if(n<gt){N(!0);return}N(!1),M(n)},n=()=>{j.current=null,document.body.style.cursor=``,document.body.classList.remove(`chat-rail-resizing`),window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n)};window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n)},[k,N,M,D]),ee=(0,W.useCallback)(e=>{let t=e.shiftKey?24:8;if(e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault();let n=e.key===`ArrowLeft`?-t:t;if(k){if(n<0)return;N(!1);return}let r=D+n;if(r<gt){N(!0);return}M(r)}else e.key===`Home`?(e.preventDefault(),N(!1),M(ht)):e.key===`End`&&(e.preventDefault(),N(!0))},[k,N,M,D]),F=r===`tree-alpha`||r===`tree-modified`,I=r===`flat-modified`&&!T?t.filter(e=>!e.isDirectory).slice().sort(p):[],L=e.title.toLowerCase();return(0,G.jsxs)(`div`,{className:`project-files-layout has-tree-grip${k?` tree-collapsed`:``}${v?` has-index-pane`:``}${E?` ${E}`:``}`,style:{"--file-tree-user-width":`${D}px`},children:[g.dialogs,k&&(0,G.jsx)(`div`,{className:`file-tree-panel file-tree-panel-collapsed`,children:(0,G.jsxs)(`button`,{type:`button`,className:`file-tree-expand-btn`,onClick:()=>N(!1),"aria-expanded":!1,"aria-label":`Show ${e.title} files`,title:`Show ${e.title} files`,children:[(0,G.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,G.jsx)(`span`,{className:`file-tree-collapsed-label`,children:e.title})]})}),!k&&(0,G.jsxs)(`div`,{className:`file-tree-panel document-drop-zone${g.activeDropZone===`tree`?` document-drop-zone-active`:``}`,...g.dropZoneProps(`tree`,``),children:[(0,G.jsxs)(`div`,{className:`file-tree-header`,children:[b??(0,G.jsx)(`span`,{className:`file-tree-title`,children:e.title}),(0,G.jsx)(`div`,{className:`file-tree-header-actions`,children:(g.newFolder||g.newFile)&&(0,G.jsxs)(`div`,{className:`gz-tray file-create-tray`,children:[g.newFolder&&(0,G.jsx)(`button`,{type:`button`,className:`gz-key gz-key--icon`,"aria-label":`New folder`,title:`New folder`,onClick:()=>g.newFolder?.(),children:(0,G.jsx)(`i`,{className:`fa-solid fa-folder-plus`,"aria-hidden":`true`})}),g.newFile&&(0,G.jsx)(`button`,{type:`button`,className:`gz-key gz-key--icon`,"aria-label":e.kind===`documents`?`New document`:`New file`,title:e.kind===`documents`?`New document`:`New file`,onClick:()=>g.newFile?.(),children:(0,G.jsx)(`i`,{className:`fa-solid fa-file-circle-plus`,"aria-hidden":`true`})})]})}),y,(0,G.jsxs)(`div`,{className:`file-tree-toolbar`,children:[(0,G.jsx)(ke,{value:r,modes:i,onChange:a}),(0,G.jsx)(Ae,{kind:e.kind,value:o,onChange:s}),e.reveal&&(0,G.jsx)(je,{onReveal:()=>void e.reveal?.()})]})]}),g.status&&(0,G.jsx)(`output`,{className:`file-tree-status`,children:g.status}),x,(0,G.jsxs)(`div`,{className:`file-tree`,children:[T?(0,G.jsx)(ye,{entries:T.entries,selectedPath:c,onSelect:T.onSelect??l,trailingForEntry:T.trailingForEntry,detailForEntry:T.detailForEntry,emptyMessage:T.emptyMessage}):F?t.length===0?(0,G.jsx)(`p`,{className:`muted`,style:{padding:`0.5rem`,fontSize:`0.85rem`},children:m}):(0,G.jsx)(h,{entries:t,selectedPath:c,sortMode:r===`tree-modified`?`modified`:`alpha`,labelFor:d,selectableFolders:u,onSelect:l,onRename:g.rename,onDelete:g.remove,trailingForEntry:S,actionsForEntry:C}):(0,G.jsx)(ye,{entries:I,selectedPath:c,onSelect:l,trailingForEntry:e=>e.mtimeMs===void 0?null:(0,G.jsx)(`span`,{className:`file-flat-time`,title:w(new Date(e.mtimeMs)),children:f(new Date(e.mtimeMs).toISOString())}),emptyMessage:`No ${L} files yet.`}),!T&&n&&(0,G.jsxs)(`p`,{className:`muted`,style:{padding:`0.5rem`,fontSize:`0.8rem`},children:[`This folder has more files than can be shown — the listing is incomplete.`,e.reveal?` Use "Open in file manager" above to browse everything.`:``]})]}),g.activeDropZone===`tree`&&(0,G.jsxs)(`div`,{className:`document-drop-overlay`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{className:`fa-solid fa-file-arrow-down`}),(0,G.jsxs)(`span`,{children:[`Drop to add to `,e.title]})]})]}),(0,G.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize ${L} files`,tabIndex:0,className:`chat-rail-grip file-tree-grip`,onMouseDown:P,onKeyDown:ee,onDoubleClick:()=>N(!k)}),(0,G.jsxs)(`div`,{className:`file-viewer-panel document-drop-zone${g.activeDropZone===`detail`?` document-drop-zone-active`:``}`,...g.dropZoneProps(`detail`,Ct(c,t)),children:[_,g.activeDropZone===`detail`&&(0,G.jsxs)(`div`,{className:`document-drop-overlay`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{className:`fa-solid fa-file-arrow-down`}),(0,G.jsxs)(`span`,{children:[`Drop to add to `,wt(c,t,e.title)]})]})]}),v]})}function St(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}function Ct(e,t){return e?t.find(t=>t.path===e)?.isDirectory?e:St(e):``}function wt(e,t,n){let r=Ct(e,t);return r?r.slice(r.lastIndexOf(`/`)+1):n}var Tt=`__IMAGE__`,Et=`__VIDEO__`,Dt=`__AUDIO__`,Ot=`__BINARY__`,kt=new Set([Tt,Et,Dt,Ot]);function At(e){return/\.(png|jpe?g|gif|svg|webp|bmp)$/i.test(e)}function jt(e){return/\.(mp4|webm|mov|m4v|avi|mkv|ogv)$/i.test(e)}function Mt(e){return/\.(mp3|wav|ogg|oga|m4a|aac|flac|opus)$/i.test(e)}function Nt(e){return At(e)?Tt:jt(e)?Et:Mt(e)?Dt:null}function Pt(e){let t=e.slice(0,4096);if(!t)return!1;let n=0;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e);(r===65533||r<9||r>13&&r<32)&&n++}return n/t.length>.1}function Ft({kind:e,path:t,fetchBlob:n}){let[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let e=!1,r=null;return(async()=>{try{let a=await n(t);if(e)return;r=URL.createObjectURL(a),i(r)}catch(t){e||o(t.message)}})(),()=>{e=!0,r&&URL.revokeObjectURL(r)}},[n,t]),a?(0,G.jsxs)(`p`,{className:`muted small`,children:[`Preview failed: `,a]}):r?e===`image`?(0,G.jsx)(`img`,{src:r,alt:t}):e===`audio`?(0,G.jsx)(`audio`,{src:r,controls:!0,style:{width:`100%`}}):(0,G.jsx)(`video`,{src:r,controls:!0,style:{maxWidth:`100%`,maxHeight:`100%`}}):(0,G.jsx)(`p`,{className:`muted small`,children:`Loading…`})}function It({content:e,path:t,fetchBlob:n,sizeBytes:r}){let i=e===`__IMAGE__`?`image`:e===`__VIDEO__`?`video`:e===`__AUDIO__`?`audio`:null;return(0,G.jsxs)(`div`,{className:`image-preview`,children:[i?(0,G.jsx)(Ft,{kind:i,path:t,fetchBlob:n}):(0,G.jsx)(`p`,{className:`muted`,style:{textAlign:`center`},children:`Binary file — no text preview available.`}),(0,G.jsx)(`p`,{className:`muted`,style:{textAlign:`center`},children:r===void 0?t:`${t} · ${m(r)}`})]})}function Lt(){return{kind:`documents`,title:`Documents`,canWrite:!0,list:({hidden:e})=>d.listDocuments(``,!0,{stats:!0,hidden:e}),read:e=>d.readDocument(e),fetchBlob:e=>d.fetchDocumentBlob(e),write:async(e,t)=>{await d.writeDocument(e,t)},writeBinary:async(e,t,n)=>{await d.writeDocumentBinary(e,t,n)},remove:async e=>{await d.deleteDocument(e)},mkdir:async e=>{await d.createDocumentFolder(e)},rename:async(e,t)=>{await d.renameDocument(e,t)},reveal:async()=>{await d.revealDocuments()},changeEventPrefix:`gezel:document`}}function Rt(e,t,n){let r=t===`workspace`;return{kind:t,title:r?`Workspace`:`Artifacts`,canWrite:n.canWrite,list:({hidden:t})=>r?d.listProjectWorkspace(e,``,!0,{stats:!0,hidden:t}):d.listProjectArtifacts(e,``,!0,{stats:!0,hidden:t}),read:t=>r?d.readProjectWorkspaceFile(e,t):d.readProjectArtifact(e,t),fetchBlob:t=>r?d.fetchProjectWorkspaceBlob(e,t):d.fetchProjectArtifactBlob(e,t),write:async(t,n)=>{r?await d.writeProjectWorkspaceFile(e,{path:t,content:n}):await d.writeProjectArtifact(e,t,n)},writeBinary:async(t,n,i)=>{r?await d.writeProjectWorkspaceBinary(e,t,n,i):await d.writeProjectArtifactBinary(e,t,n,i)},remove:async t=>{r?await d.rmProjectWorkspacePath(e,t,{recursive:!0}):await d.deleteProjectArtifact(e,t)},mkdir:async t=>{r?await d.mkdirProjectWorkspace(e,{path:t}):await d.createProjectArtifactFolder(e,t)},rename:async(t,n)=>{r?await d.renameProjectWorkspacePath(e,{fromPath:t,toPath:n}):await d.renameProjectArtifactPath(e,t,n)},reveal:async()=>{await d.revealProject(e,t)}}}function $(e){return Array.from(e.dataTransfer.types).includes(`Files`)}function zt(e){if(!(!e||e.isDirectory))return!e.name.includes(`.`)||/\.md$/i.test(e.name)?`.md`:void 0}function Bt(e,t){let n=e.kind===`documents`?[`document:${t}`]:[`file:${e.kind}:${t}`,`document:${t}`],r=B(t);return r&&n.push(e.kind===`documents`?`outside-in:documents:${r.markdownPath}`:`outside-in:${e.kind}:${r.markdownPath}`),n}function Vt(e){let{source:t,entries:n,selectedPath:r,onSelectPath:i,refresh:a}=e,o=e.newFileSuffix??(t.kind===`documents`?`.md`:void 0),[s,c]=(0,W.useState)(``),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(``),[h,g]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(null),w=t.canWrite,E=(0,W.useCallback)((e,n)=>{t.changeEventPrefix&&window.dispatchEvent(new CustomEvent(`${t.changeEventPrefix}-${e}`,{detail:{path:n}}))},[t.changeEventPrefix]),D=(0,W.useCallback)(async e=>{if(r&&!(r!==e.path&&!r.startsWith(`${e.path}/`)))for(let e of Bt(t,r))await P(e)},[r,t]),O=(0,W.useCallback)(async()=>{let e=h;if(e)try{await D(e),await t.remove(e.path);let n=e.isDirectory?null:B(e.path);n&&await t.remove(n.companionDirectory),E(`deleted`,e.path),r&&(r===e.path||r.startsWith(`${e.path}/`))&&i(null),await a()}catch(e){c(`delete failed: ${e.message}`)}finally{g(null)}},[E,h,D,i,a,r,t]),k=(0,W.useCallback)(async e=>{let o=v,s=t.rename;if(!o||!s)return;let c=e.trim();if(!c||/[\\/]/.test(c)){x(`Enter a name without slashes.`);return}let l=o.path.lastIndexOf(`/`),u=`${l>=0?o.path.slice(0,l+1):``}${c}`;if(u===o.path){y(null),x(null);return}let d=o.isDirectory?null:B(o.path),f=o.isDirectory?null:B(u);if(d&&f?.format!==d.format){x(`Keep the .${d.format} extension when renaming this document.`);return}if(d&&f&&n.some(e=>e.path===u||e.path===f.companionDirectory||e.path.startsWith(`${f.companionDirectory}/`))){x(`A document or companion folder with that name already exists.`);return}try{if(await D(o),await s(o.path,u),d&&f){let e=V(d,n.filter(e=>!e.isDirectory).map(e=>e.path));if(n.some(e=>e.path===d.companionDirectory||e.path.startsWith(`${d.companionDirectory}/`))&&(await s(d.companionDirectory,f.companionDirectory),e)){let n=`${f.companionDirectory}${e.slice(d.companionDirectory.length)}`;e===d.markdownPath&&n!==f.markdownPath&&(await s(n,f.markdownPath),n=f.markdownPath);let r=await t.read(n),i=H(r.content,f);i!==r.content&&await t.write(n,i)}}await a(),r&&(r===o.path||r.startsWith(`${o.path}/`))&&i(`${u}${r.slice(o.path.length)}`),t.changeEventPrefix&&window.dispatchEvent(new CustomEvent(`${t.changeEventPrefix}-renamed`,{detail:{fromPath:o.path,toPath:u,isDirectory:o.isDirectory}})),y(null),x(null)}catch(e){x(e.message||`Rename failed.`)}},[n,D,i,a,v,r,t]),A=(0,W.useCallback)(async e=>{let n=e.trim();if(n)try{await t.write(n,``),u(!1),await a(),i(n),E(`created`,n)}catch(e){c(`create failed: ${e.message}`)}},[E,i,a,t]),j=(0,W.useCallback)(async e=>{let n=e.trim(),r=t.mkdir;if(!(!n||!r))try{await r(n),f(!1),await a(),E(`created`,n)}catch(e){c(`create folder failed: ${e.message}`)}},[E,a,t]),M=(0,W.useCallback)(async(e,r)=>{if(!$(e))return;e.preventDefault(),e.stopPropagation(),C(null);let o=Array.from(e.dataTransfer.files);if(o.length===0)return;c(`Adding ${o.length===1?o[0]?.name:`${o.length} files`}…`);let s=await Ue({target:{writeText:(e,n)=>t.write(e,n),writeBinary:(e,n,r)=>t.writeBinary(e,n,r)},files:o,destination:r,existingPaths:n.map(e=>e.path)});if(s.importedPaths.length>0){await a();let e=s.importedPaths.at(-1);i(e),t.changeEventPrefix&&window.dispatchEvent(new CustomEvent(`${t.changeEventPrefix}-created`,{detail:{path:e,paths:s.importedPaths}}))}let l=s.importedPaths.length,u=s.rejected.length;if(u>0){let e=s.rejected[0];c(`${l>0?`Added ${l}; `:``}couldn't add ${e.name}: ${e.reason}${u>1?` (+${u-1} more)`:``}`)}else c(`Added ${l} ${l===1?`file`:`files`}.`)},[n,i,a,t]),N=(0,W.useCallback)((e,t)=>w?{onDragEnterCapture:t=>{$(t)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=`copy`,C(e))},onDragOverCapture:t=>{$(t)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=`copy`,C(t=>t===e?t:e))},onDragLeaveCapture:e=>{if(!$(e))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||C(null)},onDropCapture:e=>void M(e,t)}:{},[M,w]);return{dialogs:(0,W.useMemo)(()=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(_,{open:l,title:`New ${t.kind===`documents`?`document`:`file`}`,placeholder:t.kind===`documents`?`e.g. guidelines/coding`:`e.g. notes/report.md`,submitLabel:`Create`,initialValue:p,suffix:o,onSubmit:A,onCancel:()=>u(!1)}),(0,G.jsx)(_,{open:d,title:`New folder`,placeholder:`e.g. guidelines`,submitLabel:`Create`,initialValue:p,onSubmit:j,onCancel:()=>f(!1)}),(0,G.jsx)(_,{open:v!==null,title:v?.isDirectory?`Rename folder`:`Rename file`,fieldLabel:`Name`,placeholder:`New name`,submitLabel:`Rename`,initialValue:v?.name??``,suffix:zt(v),error:b,onSubmit:k,onCancel:()=>{y(null),x(null)}}),(0,G.jsx)(T,{open:h!==null,title:h?.isDirectory?`Delete folder?`:`Delete file?`,message:h?.isDirectory?`This will remove "${h.path}" and everything inside it. This cannot be undone.`:h?`"${h.path}" will be permanently removed.`:``,confirmLabel:`Delete`,danger:!0,onCancel:()=>g(null),onConfirm:O})]}),[O,k,h,A,j,o,p,b,v,l,d,t.kind]),status:s,setStatus:c,newFile:w?(e=``)=>{m(e),u(!0)}:void 0,newFolder:w&&t.mkdir?(e=``)=>{m(e),f(!0)}:void 0,rename:w&&t.rename?e=>{x(null),y(e)}:void 0,remove:w?e=>g(e):void 0,activeDropZone:S,dropZoneProps:N}}export{Tt as a,Pt as c,dt as d,it as f,le as h,Ot as i,Nt as l,ve as m,Lt as n,kt as o,Ge as p,Rt as r,It as s,Vt as t,xt as u};
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{N as n,lt as r,m as i}from"./doc-s6H7T0IO.js";import{a,l as o,s}from"./chunk-O7JILDEF-CqcO1qaI.js";import{O as c,p as l}from"./chunk-GAZKTT4R-BkP6-w3z.js";import{F as u,P as d,n as f}from"./chunk-MIKKUKOD-XIkmalSN.js";import{l as p}from"./markdown-Bi9b5f5Y.js";import"./schemas-JY4jmLbC.js";import{t as m}from"./jszip.min-DhiFe-R7.js";import{n as h,t as g}from"./chunk-BXWNU4T5-CFA9w1DZ.js";import{n as _,r as v,t as y}from"./chunk-6RQOV3B3-CwvKotJw.js";var b=e(m(),1);function x(e){let t=new Set;function n(e){!e||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`http://`)||e.startsWith(`https://`)||t.add(e)}function r(e){if(e)for(let t of e)t.type===`image`&&n(t.content.src),t.type===`video`&&(n(t.content.src),n(t.content.posterSrc)),t.type===`map`&&n(t.content.staticSrc)}function i(e){r(e.layers),e.contents&&S(e.contents,n),e.children&&e.children.forEach(i)}if(e.blocks.forEach(i),e.startBlock?.heroSrc&&n(e.startBlock.heroSrc),e.persistentLayers){for(let t of e.persistentLayers.bottomLayers??[])`src`in t&&typeof t.src==`string`&&n(t.src);for(let t of e.persistentLayers.topLayers??[])`src`in t&&typeof t.src==`string`&&n(t.src)}for(let n of e.blocks)w(n,t);return t}function S(e,t){for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;e.type===`image`&&typeof e.url==`string`&&t(e.url),(e.type===`htmlBlock`||e.type===`htmlInline`)&&Array.isArray(e.htmlChildren)&&C(e.htmlChildren,t),Array.isArray(e.children)&&S(e.children,t)}}function C(e,t){for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;if(e.type===`htmlElement`){if(e.tagName===`img`){let n=e.attributes;n&&typeof n.src==`string`&&t(n.src)}Array.isArray(e.children)&&C(e.children,t)}}}function w(e,t){if(!(!e||typeof e!=`object`)){for(let n of[`imageSrc`,`src`,`heroSrc`,`backgroundImage`,`posterSrc`,`staticSrc`,`videoSrc`,`thumbnailSrc`]){let r=e[n];typeof r==`string`&&r&&!r.startsWith(`data:`)&&!r.startsWith(`http`)&&t.add(r),r&&typeof r==`object`&&!Array.isArray(r)&&w(r,t)}if(Array.isArray(e))for(let n of e)n&&typeof n==`object`&&w(n,t);for(let n of[`images`,`accentImage`,`backgroundVideo`,`children`,`blocks`]){let r=e[n];if(Array.isArray(r))for(let e of r)e&&typeof e==`object`&&w(e,t);else r&&typeof r==`object`&&w(r,t)}}}function T(e){return e.replace(/<(?=!--|\/?script)/gi,`\\u003c`)}function ee(e){let t={},n={};if(!e)return{imageMap:t,imageAliases:n};let r=new Map;for(let[i,a]of e.entries()){let e=r.get(a);if(e!==void 0){n[i]=e;continue}r.set(a,i),t[i]=y(a,v(i))}return{imageMap:t,imageAliases:n}}function te(e,t){let{playerScript:n,basePath:r=`.`,images:i,mode:a=`slideshow`,title:o=`Squisq Document`,autoPlay:s=!1,showCodeCopyButton:c=!1,captionStyle:l,themeId:u,themeRegistry:d}=t;e=ne(e,u,d);let{imageMap:f,imageAliases:p}=ee(i),m=T(JSON.stringify(e)),h=T(JSON.stringify(f)),g=T(JSON.stringify(p));return`<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>${D(o)}</title>
|
|
7
|
-
<style>
|
|
8
|
-
*,*::before,*::after{box-sizing:border-box}
|
|
9
|
-
html,body{margin:0;padding:0;height:100%;background:#1a1a2e;color:#e0e0e0;font-family:system-ui,-apple-system,sans-serif}
|
|
10
|
-
#squisq-root{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
|
|
11
|
-
${a===`static`?`#squisq-root{display:block}`:``}
|
|
12
|
-
</style>
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<div id="squisq-root"></div>
|
|
16
|
-
<script type="application/json" id="squisq-doc" data-squisq-doc="1">${m}<\/script>
|
|
17
|
-
<script>${T(n)}<\/script>
|
|
18
|
-
<script>
|
|
19
|
-
(function(){
|
|
20
|
-
var doc = JSON.parse(document.getElementById("squisq-doc").textContent);
|
|
21
|
-
var images = JSON.parse(${JSON.stringify(h)});
|
|
22
|
-
// Re-expand path/basename aliases that share a payload (see
|
|
23
|
-
// buildInlineImageMaps) so \`images\` has every key the resolver may ask for.
|
|
24
|
-
var aliases = JSON.parse(${JSON.stringify(g)});
|
|
25
|
-
for (var alias in aliases) {
|
|
26
|
-
if (Object.prototype.hasOwnProperty.call(aliases, alias)) {
|
|
27
|
-
images[alias] = images[aliases[alias]];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
SquisqPlayer.mount(document.getElementById("squisq-root"), doc, {
|
|
31
|
-
mode: ${JSON.stringify(a)},
|
|
32
|
-
images: images,
|
|
33
|
-
autoPlay: ${JSON.stringify(s)},${l?`
|
|
34
|
-
captionStyle: ${JSON.stringify(l)},`:``}
|
|
35
|
-
showCodeCopyButton: ${JSON.stringify(c)},
|
|
36
|
-
basePath: ${JSON.stringify(r)}
|
|
37
|
-
});
|
|
38
|
-
})();
|
|
39
|
-
<\/script>
|
|
40
|
-
</body>
|
|
41
|
-
</html>`}function E(e,t){let{playerScriptPath:n,imagePathMap:r,audioPathMap:i,mode:a=`slideshow`,title:o=`Squisq Document`,autoPlay:s=!1,showCodeCopyButton:c=!1,captionStyle:l,themeId:u,themeRegistry:d,basePath:f=`.`}=t;e=ne(e,u,d);let p=T(JSON.stringify(e)),m=r?T(JSON.stringify(r)):`{}`,h=i?T(JSON.stringify(i)):`null`;return`<!DOCTYPE html>
|
|
42
|
-
<html lang="en">
|
|
43
|
-
<head>
|
|
44
|
-
<meta charset="UTF-8">
|
|
45
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
46
|
-
<title>${D(o)}</title>
|
|
47
|
-
<style>
|
|
48
|
-
*,*::before,*::after{box-sizing:border-box}
|
|
49
|
-
html,body{margin:0;padding:0;height:100%;background:#1a1a2e;color:#e0e0e0;font-family:system-ui,-apple-system,sans-serif}
|
|
50
|
-
#squisq-root{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
|
|
51
|
-
${a===`static`?`#squisq-root{display:block}`:``}
|
|
52
|
-
</style>
|
|
53
|
-
</head>
|
|
54
|
-
<body>
|
|
55
|
-
<div id="squisq-root"></div>
|
|
56
|
-
<script type="application/json" id="squisq-doc" data-squisq-doc="1">${p}<\/script>
|
|
57
|
-
<script src="${D(n)}"><\/script>
|
|
58
|
-
<script>
|
|
59
|
-
(function(){
|
|
60
|
-
var doc = JSON.parse(document.getElementById("squisq-doc").textContent);
|
|
61
|
-
var images = JSON.parse(${JSON.stringify(m)});
|
|
62
|
-
var audio = ${h};
|
|
63
|
-
SquisqPlayer.mount(document.getElementById("squisq-root"), doc, {
|
|
64
|
-
mode: ${JSON.stringify(a)},
|
|
65
|
-
images: images,
|
|
66
|
-
audio: audio,
|
|
67
|
-
autoPlay: ${JSON.stringify(s)},${l?`
|
|
68
|
-
captionStyle: ${JSON.stringify(l)},`:``}
|
|
69
|
-
showCodeCopyButton: ${JSON.stringify(c)},
|
|
70
|
-
basePath: ${JSON.stringify(f)}
|
|
71
|
-
});
|
|
72
|
-
})();
|
|
73
|
-
<\/script>
|
|
74
|
-
</body>
|
|
75
|
-
</html>`}function ne(e,t,n){let r=t??e.themeId??o(e.frontmatter);if(!r)return e;if(e.customThemes?.some(e=>e.id===r)||!n)return r===e.themeId?e:{...e,themeId:r};let i=n.get(r);return i?{...e,themeId:r,customThemes:[...e.customThemes??[],i]}:r===e.themeId?e:{...e,themeId:r}}function D(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function re(e,t={}){let{title:r=`Document`,images:i,links:a,themeId:s,iconsCss:c,htmlPolicy:l=`sanitize`,externalResources:u=`deny`}=t,d=s??o(e.frontmatter),f=t.theme??(d?n(e,d,t.themeRegistry):void 0),p=new g(e),m={images:i,links:a,htmlPolicy:l,footnotes:p},h=se(e.children,m)+ce(p,m),_=f&&u===`allow`?ye(f):``,v=oe(e),y=``;v&&(y=c?`<style data-fa-inline>
|
|
76
|
-
${ie(c)}
|
|
77
|
-
</style>
|
|
78
|
-
`:u===`allow`?ae:``);let b=ie(`${f?ve(f):_e}
|
|
79
|
-
${ge}`);return`<!DOCTYPE html>
|
|
80
|
-
<html lang="en">
|
|
81
|
-
<head>
|
|
82
|
-
<meta charset="UTF-8">
|
|
83
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
84
|
-
<title>${N(r)}</title>
|
|
85
|
-
${_}${y}<style>
|
|
86
|
-
${b}
|
|
87
|
-
</style>
|
|
88
|
-
</head>
|
|
89
|
-
<body>
|
|
90
|
-
${h}
|
|
91
|
-
</body>
|
|
92
|
-
</html>`}function ie(e){return e.replace(/</g,`\\3c `)}var ae=`<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.2.0/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
|
|
93
|
-
`;function oe(e){function t(e){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type===`inlineIcon`)return!0;if(Array.isArray(n.children)){for(let e of n.children)if(t(e))return!0}return!1}return t(e)}function se(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i&&i.type===`heading`){let a=i,o=a.templateAnnotation?.template;if(o===`leftFeature`||o===`rightFeature`){let i=le(e,r),s=e.slice(r+1,i);n.push(ue(a,s,o,t)),r=i-1;continue}}n.push(k(i,t))}return n.join(`
|
|
94
|
-
`)}function ce(e,t){return e.isEmpty?``:[``,`<section class="squisq-footnotes" data-footnotes><hr>`,`<ol>`,...e.ordered().map(e=>{let{def:n}=h(e.identifier),r=e.definition?A(e.definition,t):``,i=Array.from({length:Math.max(e.citations,1)},(t,n)=>{let{ref:r}=h(e.identifier,n+1),i=e.citations>1?`\u21A9︎${n+1}`:`↩`;return`<a href="#${P(r)}" class="squisq-footnote-backref" aria-label="Back to reference ${e.number}">${i}</a>`}).join(` `);return`<li id="${P(n)}">${r}${i}</li>`}),`</ol>`,`</section>`].join(`
|
|
95
|
-
`)}function le(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&t.type===`heading`)return n}return e.length}function ue(e,t,n,r){let i=`h${Math.min(Math.max(e.depth??2,1),6)}`,a=`<${i}>${A({children:e.children},r)}</${i}>`,o=fe(t),s=o.image?de(o.image,r):`<div class="squisq-feature__media squisq-feature__media--empty"></div>`,c=[a,...o.remaining.map(e=>k(e,r))].filter(e=>e.length>0).join(`
|
|
96
|
-
`);return`<section class="squisq-feature ${n===`leftFeature`?`squisq-feature--left`:`squisq-feature--right`}">
|
|
97
|
-
${s}
|
|
98
|
-
<div class="squisq-feature__body">
|
|
99
|
-
${c}
|
|
100
|
-
</div>
|
|
101
|
-
</section>`}function de(e,t){let n=u(t?.images?.get(e.src)??e.src,`media`);if(!n)return`<div class="squisq-feature__media squisq-feature__media--empty"></div>`;let r=[`src="${P(n)}"`,`alt="${P(e.alt)}"`];return typeof e.width==`number`&&r.push(`width="${e.width}"`),typeof e.height==`number`&&r.push(`height="${e.height}"`),`<div class="squisq-feature__media${typeof e.width==`number`||typeof e.height==`number`?` squisq-feature__media--sized`:``}"><img ${r.join(` `)} /></div>`}function fe(e){for(let t=0;t<e.length;t++){let n=pe(e[t]);if(!n)continue;let r=[...e];return n.replacement===null?r.splice(t,1):r[t]=n.replacement,{image:n.image,remaining:r}}return{image:null,remaining:e}}function pe(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.type===`paragraph`&&Array.isArray(t.children)){let e=t.children,n=e.findIndex(e=>e.type===`image`&&typeof e.url==`string`);if(n>=0){let r=e[n],i=[...e.slice(0,n),...e.slice(n+1)].filter(e=>!me(e)),a=i.length===0?null:{...t,children:i};return{image:{src:r.url,alt:r.alt??``},replacement:a}}}if(t.type===`htmlBlock`&&Array.isArray(t.htmlChildren)){let e=he(t.htmlChildren);if(e)return{image:e,replacement:null}}return null}function me(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`text`&&typeof t.value==`string`&&t.value.trim().length===0}function he(e){for(let t of e){if(t.type!==`htmlElement`)continue;if(t.tagName.toLowerCase()===`img`){let e=t.attributes.src;if(typeof e==`string`&&e)return{src:e,alt:typeof t.attributes.alt==`string`?t.attributes.alt:``,width:O(t.attributes.width),height:O(t.attributes.height)}}let e=he(t.children);if(e)return e}return null}function O(e){if(e===void 0)return;let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:void 0}var ge=` .squisq-feature {
|
|
102
|
-
display: flex;
|
|
103
|
-
flex-wrap: wrap;
|
|
104
|
-
gap: 1.5em;
|
|
105
|
-
align-items: center;
|
|
106
|
-
margin: 1.75em 0;
|
|
107
|
-
}
|
|
108
|
-
.squisq-feature--right { flex-direction: row-reverse; }
|
|
109
|
-
.squisq-feature__media {
|
|
110
|
-
flex: 0 0 42%;
|
|
111
|
-
min-width: 0;
|
|
112
|
-
}
|
|
113
|
-
.squisq-feature__media--empty { display: none; }
|
|
114
|
-
/* Default: image fills the media column. */
|
|
115
|
-
.squisq-feature__media img {
|
|
116
|
-
width: 100%;
|
|
117
|
-
height: auto;
|
|
118
|
-
display: block;
|
|
119
|
-
border-radius: 6px;
|
|
120
|
-
}
|
|
121
|
-
/* "Sized" media: the image carried explicit width/height attrs (the
|
|
122
|
-
WYSIWYG editor wrote them after a resize). Honor the attribute
|
|
123
|
-
values and center the image inside the media column with padding. */
|
|
124
|
-
.squisq-feature__media--sized {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
justify-content: center;
|
|
128
|
-
padding: 1em;
|
|
129
|
-
box-sizing: border-box;
|
|
130
|
-
}
|
|
131
|
-
/* Leave width and height untouched here -- the HTML attributes set
|
|
132
|
-
the intrinsic dimensions, and CSS overrides would silently discard
|
|
133
|
-
the author's sizing. max-width: 100% still keeps the image from
|
|
134
|
-
overflowing the column on narrow viewports; HTML5 derives the
|
|
135
|
-
aspect ratio from the width/height pair so the scale stays right. */
|
|
136
|
-
.squisq-feature__media--sized img {
|
|
137
|
-
max-width: 100%;
|
|
138
|
-
display: block;
|
|
139
|
-
border-radius: 6px;
|
|
140
|
-
}
|
|
141
|
-
.squisq-feature__body {
|
|
142
|
-
flex: 1 1 0;
|
|
143
|
-
min-width: 0;
|
|
144
|
-
}
|
|
145
|
-
.squisq-feature__body > :first-child { margin-top: 0; }
|
|
146
|
-
.squisq-feature__body > :last-child { margin-bottom: 0; }
|
|
147
|
-
@media (max-width: 600px) {
|
|
148
|
-
.squisq-feature, .squisq-feature--right { flex-direction: column; }
|
|
149
|
-
.squisq-feature__media { flex-basis: auto; width: 100%; }
|
|
150
|
-
}`,_e=` body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 2em auto; padding: 0 1em; line-height: 1.6; color: #1f2937; }
|
|
151
|
-
h1, h2, h3, h4, h5, h6 { margin-top: 1.5em; margin-bottom: 0.5em; }
|
|
152
|
-
pre { background: #f3f4f6; padding: 1em; border-radius: 4px; overflow-x: auto; }
|
|
153
|
-
code { background: #f3f4f6; padding: 0.15em 0.3em; border-radius: 3px; font-size: 0.9em; }
|
|
154
|
-
pre code { background: none; padding: 0; }
|
|
155
|
-
blockquote { border-left: 3px solid #d1d5db; margin-left: 0; padding-left: 1em; color: #6b7280; }
|
|
156
|
-
/* Images: cap at the container width so nothing overflows, but only
|
|
157
|
-
force aspect-ratio height when the author didn't set explicit
|
|
158
|
-
dimensions on the <img> tag. The WYSIWYG editor writes width/height
|
|
159
|
-
attributes after a resize — overriding them here would silently
|
|
160
|
-
ignore the user's sizing. */
|
|
161
|
-
img { max-width: 100%; }
|
|
162
|
-
img:not([width]):not([height]) { height: auto; }
|
|
163
|
-
a { color: #3b82f6; }
|
|
164
|
-
table { border-collapse: collapse; width: 100%; margin: 1em 0; }
|
|
165
|
-
th, td { border: 1px solid #d1d5db; padding: 6px 10px; text-align: left; }
|
|
166
|
-
th { background: #f3f4f6; font-weight: 600; }
|
|
167
|
-
hr { border: none; border-top: 1px solid #d1d5db; margin: 1.5em 0; }`;function ve(e){let t=c(e.typography.bodyFont,`system-ui, sans-serif`),n=c(e.typography.titleFont,`Georgia, serif`),r=c(e.typography.monoFont,`Consolas, monospace`),i=e.typography.lineHeight??1.6,a=e.typography.titleLineHeight??1.25,o=e.typography.titleWeight===`normal`?400:700,s=e.colors;return` :root {
|
|
168
|
-
--plain-bg: ${s.background};
|
|
169
|
-
--plain-text: ${s.text};
|
|
170
|
-
--plain-muted: ${s.textMuted};
|
|
171
|
-
--plain-primary: ${s.primary};
|
|
172
|
-
--plain-secondary: ${s.secondary};
|
|
173
|
-
--plain-accent: ${s.highlight};
|
|
174
|
-
--plain-bg-light: ${s.backgroundLight};
|
|
175
|
-
--plain-body-font: ${t};
|
|
176
|
-
--plain-title-font: ${n};
|
|
177
|
-
--plain-mono-font: ${r};
|
|
178
|
-
}
|
|
179
|
-
body {
|
|
180
|
-
font-family: var(--plain-body-font);
|
|
181
|
-
max-width: 800px;
|
|
182
|
-
margin: 2em auto;
|
|
183
|
-
padding: 0 1em;
|
|
184
|
-
line-height: ${i};
|
|
185
|
-
color: var(--plain-text);
|
|
186
|
-
background: var(--plain-bg);
|
|
187
|
-
}
|
|
188
|
-
h1, h2, h3, h4, h5, h6 {
|
|
189
|
-
font-family: var(--plain-title-font);
|
|
190
|
-
color: var(--plain-text);
|
|
191
|
-
margin-top: 1.5em;
|
|
192
|
-
margin-bottom: 0.5em;
|
|
193
|
-
line-height: ${a};
|
|
194
|
-
font-weight: ${o};
|
|
195
|
-
}
|
|
196
|
-
p { margin: 0.75em 0; }
|
|
197
|
-
pre {
|
|
198
|
-
background: var(--plain-bg-light);
|
|
199
|
-
padding: 1em;
|
|
200
|
-
border-radius: 4px;
|
|
201
|
-
overflow-x: auto;
|
|
202
|
-
font-family: var(--plain-mono-font);
|
|
203
|
-
}
|
|
204
|
-
code {
|
|
205
|
-
background: var(--plain-bg-light);
|
|
206
|
-
padding: 0.15em 0.3em;
|
|
207
|
-
border-radius: 3px;
|
|
208
|
-
font-size: 0.9em;
|
|
209
|
-
font-family: var(--plain-mono-font);
|
|
210
|
-
}
|
|
211
|
-
pre code { background: none; padding: 0; }
|
|
212
|
-
blockquote {
|
|
213
|
-
border-left: 3px solid var(--plain-primary);
|
|
214
|
-
margin-left: 0;
|
|
215
|
-
padding-left: 1em;
|
|
216
|
-
color: var(--plain-muted);
|
|
217
|
-
}
|
|
218
|
-
/* See DEFAULT_CSS comment: only auto-scale height when the author
|
|
219
|
-
didn't set explicit width/height attributes. */
|
|
220
|
-
img { max-width: 100%; }
|
|
221
|
-
img:not([width]):not([height]) { height: auto; }
|
|
222
|
-
/* Blend the theme primary toward the body text color so links stay
|
|
223
|
-
theme-flavored but read clearly on every theme's background \u2014 some
|
|
224
|
-
themes (e.g. Gezellig) pick a mid-tone primary that's almost
|
|
225
|
-
invisible on a dark page when used neat. Underline makes the link
|
|
226
|
-
unambiguous independent of the color contrast. */
|
|
227
|
-
a {
|
|
228
|
-
color: color-mix(in srgb, var(--plain-primary) 65%, var(--plain-text));
|
|
229
|
-
text-decoration: underline;
|
|
230
|
-
text-decoration-thickness: 1px;
|
|
231
|
-
text-underline-offset: 2px;
|
|
232
|
-
}
|
|
233
|
-
a:hover { color: var(--plain-accent); }
|
|
234
|
-
table { border-collapse: collapse; width: 100%; margin: 1em 0; }
|
|
235
|
-
th, td {
|
|
236
|
-
border: 1px solid color-mix(in srgb, var(--plain-muted) 30%, transparent);
|
|
237
|
-
padding: 6px 10px;
|
|
238
|
-
text-align: left;
|
|
239
|
-
}
|
|
240
|
-
th {
|
|
241
|
-
background: var(--plain-bg-light);
|
|
242
|
-
color: var(--plain-text);
|
|
243
|
-
font-family: var(--plain-title-font);
|
|
244
|
-
font-weight: 600;
|
|
245
|
-
}
|
|
246
|
-
hr {
|
|
247
|
-
border: none;
|
|
248
|
-
border-top: 1px solid color-mix(in srgb, var(--plain-muted) 40%, transparent);
|
|
249
|
-
margin: 1.5em 0;
|
|
250
|
-
}`}function ye(e){let t=l([e.typography.bodyFont,e.typography.titleFont,e.typography.monoFont]);return t?`<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
251
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
252
|
-
<link rel="stylesheet" href="${P(t)}">
|
|
253
|
-
`:``}function k(e,t){if(!e)return``;switch(e.type){case`heading`:{let n=Math.min(Math.max(e.depth??1,1),6);return`<h${n}>${A(e,t)}</h${n}>`}case`paragraph`:return`<p>${A(e,t)}</p>`;case`text`:return N(e.value??``);case`strong`:return`<strong>${A(e,t)}</strong>`;case`emphasis`:return`<em>${A(e,t)}</em>`;case`delete`:return`<del>${A(e,t)}</del>`;case`superscript`:return`<sup>${A(e,t)}</sup>`;case`footnoteReference`:{if(!t?.footnotes)return`<sup class="squisq-footnote-ref">${N(e.label??e.identifier)}</sup>`;let{number:n,occurrence:r}=t.footnotes.cite(e.identifier),{ref:i,def:a}=h(e.identifier,r);return`<sup class="squisq-footnote-ref"><a href="#${P(a)}" id="${P(i)}">${n}</a></sup>`}case`footnoteDefinition`:return``;case`subscript`:return`<sub>${A(e,t)}</sub>`;case`inlineCode`:return`<code>${N(e.value??``)}</code>`;case`code`:return`<pre class="squisq-code-block"><code${e.lang?` class="language-${P(e.lang)}"`:``}>${N(e.value??``)}</code></pre>`;case`blockquote`:return`<blockquote>${A(e,t)}</blockquote>`;case`list`:{let n=e.ordered?`ol`:`ul`;return`<${n}${e.ordered&&typeof e.start==`number`&&e.start!==1?` start="${e.start}"`:``}>${A(e,t)}</${n}>`}case`listItem`:return`<li>${A(e,t)}</li>`;case`link`:{let n=e.url??``,r=u(t?.links?.get(n)??n,`link`);return r?`<a href="${P(r)}">${A(e,t)}</a>`:A(e,t)}case`image`:{let n=e.url??``,r=u(t?.images?.get(n)??n,`media`);return r?`<img src="${P(r)}" alt="${P(e.alt??``)}" />`:N(e.alt??``)}case`thematicBreak`:return`<hr />`;case`table`:return be(e,t);case`inlineIcon`:return`<i class="fa-${P(e.family??`solid`)} fa-${P(e.name??``)}" data-icon="${P(e.token??`${e.family}:${e.name}`)}" aria-hidden="true"></i>`;case`htmlBlock`:case`htmlInline`:return j(t)===`strip`?``:M(xe(e.htmlChildren,t),t);default:{let n=e;return Array.isArray(n.children)?A(e,t):typeof n.value==`string`?N(n.value):``}}}function A(e,t){return e.children?e.children.map(e=>k(e,t)).join(``):e.value?N(e.value):``}function be(e,t){let[n,...r]=e.children,i=[`<table>`];if(n){i.push(`<thead><tr>`);for(let e of n.children)i.push(`<th>${A(e,t)}</th>`);i.push(`</tr></thead>`)}if(r.length>0){i.push(`<tbody>`);for(let e of r){i.push(`<tr>`);for(let n of e.children)i.push(`<td>${A(n,t)}</td>`);i.push(`</tr>`)}i.push(`</tbody>`)}return i.push(`</table>`),i.join(``)}function j(e){return e?.htmlPolicy??`sanitize`}function xe(e,t){return!e||e.length===0?[]:j(t)===`trusted`?e:d(e)}function M(e,t){if(!e||e.length===0)return``;let n=j(t)===`trusted`,r=[];for(let i of e){if(i.type===`htmlText`){r.push(n?i.value:N(i.value));continue}if(i.type===`htmlComment`){n&&r.push(`<!--${i.value}-->`);continue}let e=i.tagName.toLowerCase(),a={...i.attributes};if((e===`img`||e===`video`||e===`audio`||e===`source`)&&typeof a.src==`string`&&(a.src=t?.images?.get(a.src)??a.src),(e===`video`||e===`audio`)&&typeof a.poster==`string`&&(a.poster=t?.images?.get(a.poster)??a.poster),!n){if(typeof a.src==`string`){let e=u(a.src,`media`);e?a.src=e:delete a.src}if(typeof a.poster==`string`){let e=u(a.poster,`media`);e?a.poster=e:delete a.poster}if(typeof a.href==`string`){let e=u(a.href,`link`);e?a.href=e:delete a.href}}let o=Object.entries(a).map(([e,t])=>` ${e}="${P(t)}"`).join(``);i.selfClosing?r.push(`<${e}${o} />`):r.push(`<${e}${o}>${M(i.children,t)}</${e}>`)}return r.join(``)}function N(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function P(e){return N(e).replace(/"/g,`"`)}async function Se(e){let{entryPath:t,readDocument:n,readBinary:r,title:i,theme:a,themeId:o,themeRegistry:s,maxDepth:c=1/0,entryAsIndex:l=!1}=e,u=L(t);if(!u)throw Error(`markdownDocsToPlainHtmlBundle: entryPath is required`);let d=I(u),p=l?d?`${d}/index.html`:`index.html`:u.slice(0,-3)+`.html`,m=e=>e===u?p:e.slice(0,-3)+`.html`,h=new b.default,g=new Set,_=[{path:u,depth:0}];for(;_.length>0;){let{path:e,depth:t}=_.shift();if(g.has(e))continue;g.add(e);let l=await n(e);if(l===null)throw Error(`markdownDocsToPlainHtmlBundle: failed to read "${e}"`);let u=f(l),p=I(e),v=new Map;for(let e of F(u)){let n=we(e);if(!n)continue;let r=R(p,n.path);if(r===null||!Ee(r,d)||!r.toLowerCase().endsWith(`.md`))continue;let i=z(p,m(r))+n.fragment;v.set(e,i),t+1<=c&&!g.has(r)&&_.push({path:r,depth:t+1})}let y=await Te(u,p,r);for(let[,{data:e,zipPath:t}]of y){let n=De(t);n&&h.file(n,e)}let b=new Map;for(let[e,{zipPath:t}]of y)b.set(e,z(p,t));let x=re(u,{title:(t===0?i:void 0)??Oe(e,u),images:b,links:v,theme:a,themeId:o,themeRegistry:s}),S=m(e);h.file(S,x)}return h.generateAsync({type:`blob`,compression:`DEFLATE`,compressionOptions:{level:6}})}function F(e){let t=new Set;function n(e){for(let r of e)if(r.type===`htmlElement`){if(r.tagName.toLowerCase()===`a`){let e=r.attributes.href;typeof e==`string`&&e&&t.add(e)}n(r.children)}}function r(e){if(!e||typeof e!=`object`)return;let i=e;if(i.type===`link`&&typeof i.url==`string`&&i.url&&t.add(i.url),(i.type===`htmlBlock`||i.type===`htmlInline`)&&Array.isArray(i.htmlChildren)&&n(i.htmlChildren),Array.isArray(i.children))for(let e of i.children)r(e)}for(let t of e.children)r(t);return t}function Ce(e){let t=new Set;function n(e){for(let r of e){if(r.type!==`htmlElement`)continue;let e=r.tagName.toLowerCase();if(e===`img`||e===`video`||e===`audio`||e===`source`){let e=r.attributes.src;typeof e==`string`&&e&&t.add(e)}if(e===`video`||e===`audio`){let e=r.attributes.poster;typeof e==`string`&&e&&t.add(e)}n(r.children)}}function r(e){if(!e||typeof e!=`object`)return;let i=e;if(i.type===`image`&&typeof i.url==`string`&&i.url&&t.add(i.url),(i.type===`htmlBlock`||i.type===`htmlInline`)&&Array.isArray(i.htmlChildren)&&n(i.htmlChildren),Array.isArray(i.children))for(let e of i.children)r(e)}for(let t of e.children)r(t);return t}function we(e){if(!e||e.startsWith(`#`)||/^[a-z][a-z0-9+.-]*:/.test(e)||e.startsWith(`//`)||e.startsWith(`/`))return null;let t=e.indexOf(`#`),n=e.indexOf(`?`),r=t>=0&&n>=0?Math.min(t,n):t>=0?t:n;return{path:r>=0?e.slice(0,r):e,fragment:t>=0?e.slice(t):``}}async function Te(e,t,n){let r=new Map;for(let i of Ce(e)){if(/^[a-z][a-z0-9+.-]*:/.test(i)||i.startsWith(`//`))continue;let e=R(t,i.replace(/[#?].*$/,``));if(e===null)continue;let a=await n(e);a&&r.set(i,{data:a,zipPath:e})}return r}function I(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}function L(e){let t=e.split(`/`),n=[];for(let e of t)if(!(e===``||e===`.`)){if(e===`..`){if(n.length===0)return null;n.pop();continue}n.push(e)}return n.join(`/`)}function R(e,t){return t.startsWith(`/`)?null:L(e?`${e}/${t}`:t)}function Ee(e,t){return!t||e===t||e.startsWith(t+`/`)}function z(e,t){let n=e?e.split(`/`):[],r=t.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i++;let a=n.length-i,o=r.slice(i),s=Array(a).fill(`..`).join(`/`);return s?`${s}/${o.join(`/`)}`:o.join(`/`)}function De(e){let t=e.replace(/\\/g,`/`).replace(/^\/+/,``);return!t||t.split(`/`).some(e=>e===`..`)?null:t}function Oe(e,t){return a(t)||(e.split(`/`).pop()??e).replace(/\.md$/i,``)}async function ke(e){let{entryPath:t,readDocument:n,readBinary:i,playerScript:a,title:o,themeId:s,themeRegistry:c,mode:l=`static`,showCodeCopyButton:u=!1,maxDepth:d=1/0,entryAsIndex:p=!1}=e,m=L(t);if(!m)throw Error(`markdownDocsToHtmlBundle: entryPath is required`);let h=I(m),g=p?h?`${h}/index.html`:`index.html`:m.slice(0,-3)+`.html`,_=e=>e===m?g:e.slice(0,-3)+`.html`,v=new b.default;v.file(`squisq-player.js`,a);let y=new Set,x=[{path:m,depth:0}];for(;x.length>0;){let{path:e,depth:t}=x.shift();if(y.has(e))continue;y.add(e);let a=await n(e);if(a===null)throw Error(`markdownDocsToHtmlBundle: failed to read "${e}"`);let p=f(a),m=I(e),g=new Map;for(let e of F(p)){let n=Me(e);if(!n)continue;let r=R(m,n.path);if(r===null||!Ee(r,h)||!r.toLowerCase().endsWith(`.md`))continue;let i=z(m,_(r))+n.fragment;g.set(e,i),t+1<=d&&!y.has(r)&&x.push({path:r,depth:t+1})}let b=new Map;for(let e of Ne(p)){if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`//`))continue;let t=R(m,e.replace(/[#?].*$/,``));if(t===null)continue;let n=await i(t);if(!n)continue;let r=Pe(t);r&&(v.file(r,n),b.set(e,z(m,t)))}let S=r(p);g.size>0&&(S=Ae(S,g));let C=t===0?o??Fe(e,p):Fe(e,p),w=_(e),T=z(m,`squisq-player.js`),ee=E(S,{playerScriptPath:T,imagePathMap:b.size>0?Object.fromEntries(b.entries()):void 0,mode:l,showCodeCopyButton:u,title:C,themeId:s,themeRegistry:c});v.file(w,ee)}return v.generateAsync({type:`blob`,compression:`DEFLATE`,compressionOptions:{level:6}})}function Ae(e,t){if(t.size===0)return e;function n(e){return e.map(e=>{if(e.type!==`htmlElement`)return e;let r=e.tagName.toLowerCase()===`a`&&typeof e.attributes.href==`string`&&t.has(e.attributes.href)?{...e.attributes,href:t.get(e.attributes.href)}:e.attributes;return{...e,attributes:r,children:n(e.children)}})}function r(e){if(e.type===`link`){let n=t.get(e.url)??e.url;return{...e,url:n,children:e.children.map(r)}}if(e.type===`htmlInline`){let t=e;return Array.isArray(t.htmlChildren)?{...e,htmlChildren:n(t.htmlChildren)}:e}if(`children`in e&&Array.isArray(e.children)){let t=e.children.map(r);return{...e,children:t}}return e}function i(e){if(e.type===`htmlBlock`){let t=e;return Array.isArray(t.htmlChildren)?{...e,htmlChildren:n(t.htmlChildren)}:e}if(`children`in e&&Array.isArray(e.children)){let t=e.children.map(e=>{let t=e;return t&&typeof t==`object`&&`type`in t?je(t.type)?i(e):r(e):e});return{...e,children:t}}return e}function a(e){let t={...e};return Array.isArray(e.contents)&&(t.contents=e.contents.map(i)),Array.isArray(e.children)&&(t.children=e.children.map(a)),t}return{...e,blocks:e.blocks.map(a)}}function je(e){return e===`paragraph`||e===`heading`||e===`list`||e===`listItem`||e===`blockquote`||e===`code`||e===`thematicBreak`||e===`table`||e===`tableRow`||e===`tableCell`||e===`htmlBlock`}function Me(e){if(!e||e.startsWith(`#`)||/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`//`)||e.startsWith(`/`))return null;let t=e.indexOf(`#`),n=e.indexOf(`?`),r=t>=0&&n>=0?Math.min(t,n):t>=0?t:n;return{path:r>=0?e.slice(0,r):e,fragment:t>=0?e.slice(t):``}}function Ne(e){let t=new Set;function n(e){for(let r of e)if(r.type===`htmlElement`){if(r.tagName.toLowerCase()===`img`){let e=r.attributes.src;typeof e==`string`&&e&&t.add(e)}n(r.children)}}function r(e){if(!e||typeof e!=`object`)return;let i=e;if(i.type===`image`&&typeof i.url==`string`&&i.url&&t.add(i.url),(i.type===`htmlBlock`||i.type===`htmlInline`)&&Array.isArray(i.htmlChildren)&&n(i.htmlChildren),Array.isArray(i.children))for(let e of i.children)r(e)}for(let t of e.children)r(t);return t}function Pe(e){let t=e.replace(/\\/g,`/`).replace(/^\/+/,``);return!t||t.split(`/`).some(e=>e===`..`)?null:t}function Fe(e,t){return a(t)||(e.split(`/`).pop()??e).replace(/\.md$/i,``)}var Ie=/[ \t\r\n]+$/,Le=/[ \t\r\n]+/,Re=/[\ufe0e\ufe0f]/gu,ze=/^[ \t\r\n\u2191\u21a9\u21b5^]+$/u,Be=/^[ \t[(]*(?:[0-9]{1,4}|[a-z]|[*†‡])[ \t\])]*$/i;function B(e){return e.type===`htmlElement`}function V(e,t){return e.attributes[t]}function H(e){return(V(e,`class`)??``).split(Le).filter(Boolean)}function Ve(e){if(V(e,`data-footnotes`)!==void 0||V(e,`epub:type`)?.includes(`footnotes`))return!0;let t=e.tagName.toLowerCase();return t!==`section`&&t!==`aside`&&t!==`div`&&t!==`ol`?!1:H(e).some(e=>e===`footnotes`||e===`footnote-list`||e===`squisq-footnotes`)}function U(e){return e.type===`htmlText`?e.value:B(e)?e.children.map(U).join(``):``}function He(e){return e.tagName.toLowerCase()===`a`?V(e,`data-footnote-backref`)!==void 0||H(e).some(e=>e.includes(`backref`)||e===`footnote-back`)?!0:ze.test(U(e).replace(Re,``)):!1}function W(e,t){for(let n of e){if(!B(n))continue;if(t(n))return n;let e=W(n.children,t);if(e)return e}return null}function G(e){let t=[];for(let n of e){if(B(n)){if(He(n))continue;t.push({...n,children:G(n.children)});continue}t.push(n)}return t}function K(e,t){let n=[];for(let r of e)if(r!==t){if(B(r)){n.push({...r,children:K(r.children,t)});continue}n.push(r)}return n}function q(e){let t=[...e];for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===`htmlText`){let r=n.value.replace(Ie,``);if(r===``){t.pop();continue}t[e]={...n,value:r};break}B(n)&&(t[e]={...n,children:q(n.children)});break}return t}function Ue(e){let t=new Map,n=e=>{for(let r of e){if(!B(r))continue;let e=V(r,`id`);if(r.tagName.toLowerCase()===`li`&&e){t.set(e,q(G(r.children)));continue}n(r.children)}};return n(e.children),t}function We(e,t){let n=e.replace(/^user-content-/,``).replace(/^fn[-_:]?/i,``).replace(/^footnote[-_:]?/i,``);return n===``||t.has(n)?e:n}function Ge(e){let t=W(e,Ve);if(!t)return{nodes:e,bodies:new Map};let n=Ue(t);if(n.size===0)return{nodes:e,bodies:new Map};let r=new Map,i=new Map,a=new Set;for(let[e,t]of n){let n=We(e,a);a.add(n),i.set(e,n),r.set(n,t)}return{nodes:K(e,t),bodies:r,identifiers:i}}function Ke(e){return e.map(e=>`value`in e&&typeof e.value==`string`?e.value:`children`in e&&Array.isArray(e.children)?Ke(e.children):``).join(``)}function qe(e){switch(e.type){case`paragraph`:case`heading`:case`blockquote`:case`list`:case`listItem`:case`table`:case`tableRow`:case`tableCell`:case`code`:case`footnoteDefinition`:return!0;default:return!1}}function Je(e,t){let n=(e,r)=>{for(let i=0;i<e.length;i++){let a=e[i];if(a.type===`link`){let n=a.url.startsWith(`#`)?a.url.slice(1):null,o=n?t.get(n):void 0;o&&(r||Be.test(Ke(a.children)))&&(e[i]={type:`footnoteReference`,identifier:o});continue}if(a.type===`superscript`){n(a.children,!0);let t=a.children.length===1?a.children[0]:null;t?.type===`footnoteReference`&&(e[i]=t);continue}`children`in a&&Array.isArray(a.children)&&n(a.children,r)}},r=e=>{for(let t of e){if(!(`children`in t)||!Array.isArray(t.children))continue;let e=t.children;e.length>0&&e.every(qe)?r(e):n(e,!1)}};r(e)}function Ye(e){return[...e.entries()].map(([e,t])=>({type:`footnoteDefinition`,identifier:e,children:t}))}var Xe={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},Ze=new Set([`div`,`section`,`article`,`header`,`footer`,`main`,`aside`,`nav`,`figure`,`figcaption`,`form`,`fieldset`,`body`,`html`,`center`]),Qe=new Set([`script`,`style`,`head`,`title`,`noscript`,`template`,`svg`]),$e=new Set([`strong`,`b`]),et=new Set([`em`,`i`]),tt=new Set([`del`,`s`,`strike`]),nt=new Set([`sup`]),rt=new Set([`sub`]),it=new Set([`span`,`font`,`abbr`,`mark`,`small`,`u`]),J=e=>e.type===`htmlElement`,Y=e=>e.type===`htmlText`,at=e=>e.replace(/\s+/g,` `);function X(e){let t=[];for(let n of e){if(Y(n)){let e=at(n.value);e&&t.push({type:`text`,value:e});continue}if(!J(n))continue;let e=n.tagName.toLowerCase();if(!Qe.has(e))if(e===`br`)t.push({type:`break`});else if($e.has(e))t.push({type:`strong`,children:X(n.children)});else if(et.has(e))t.push({type:`emphasis`,children:X(n.children)});else if(tt.has(e))t.push({type:`delete`,children:X(n.children)});else if(nt.has(e))t.push({type:`superscript`,children:X(n.children)});else if(rt.has(e))t.push({type:`subscript`,children:X(n.children)});else if(e===`code`||e===`kbd`||e===`samp`||e===`tt`)t.push({type:`inlineCode`,value:Z(n)});else if(e===`a`){let e=n.attributes.href??``,r=X(n.children);t.push({type:`link`,url:e,children:r.length>0?r:[{type:`text`,value:e}]})}else if(e===`img`){let e=n.attributes.src??``,r=n.attributes.alt;e&&t.push({type:`image`,url:e,...r?{alt:r}:{}})}else t.push(...X(n.children))}return t}function Z(e){return Y(e)?e.value:J(e)?e.children.map(Z).join(``):``}var ot=e=>e.every(e=>e.type===`text`&&e.value.trim()===``);function Q(e){let t=[],n=[],r=()=>{if(n.length===0)return;let e=X(n);n=[],e.length>0&&!ot(e)&&t.push({type:`paragraph`,children:e})};for(let i of e){if(Y(i)){n.push(i);continue}if(!J(i))continue;let e=i.tagName.toLowerCase();if(Qe.has(e))continue;let a=st(i,e);a===`inline`?n.push(i):a&&(r(),t.push(...a))}return r(),t}function st(e,t){if(t in Xe){let n=X(e.children);return[{type:`heading`,depth:Xe[t],children:n}]}if(t===`p`){let t=X(e.children);return t.length>0&&!ot(t)?[{type:`paragraph`,children:t}]:[]}if(t===`br`)return`inline`;if(t===`hr`)return[{type:`thematicBreak`}];if(t===`blockquote`)return[{type:`blockquote`,children:Q(e.children)}];if(t===`pre`)return[{type:`code`,value:ut(Z(e))}];if(t===`ul`||t===`ol`)return[ct(e,t===`ol`)];if(t===`table`){let t=lt(e);return t?[t]:[]}return Ze.has(t)?Q(e.children):$e.has(t)||et.has(t)||tt.has(t)||it.has(t)||t===`a`||t===`img`||t===`code`||t===`kbd`||t===`samp`?`inline`:Q(e.children)}function ct(e,t){let n=[];for(let t of e.children)if(J(t)&&t.tagName.toLowerCase()===`li`){let e=Q(t.children);n.push({type:`listItem`,children:e})}let r=e.attributes.start,i=t&&r?Number.parseInt(r,10):void 0;return{type:`list`,ordered:t,...i!==void 0&&Number.isFinite(i)?{start:i}:{},children:n}}function lt(e){let t=[],n=e=>{for(let r of e.children){if(!J(r))continue;let e=r.tagName.toLowerCase();if(e===`tr`){let e=[];for(let t of r.children)J(t)&&(t.tagName.toLowerCase()===`td`||t.tagName.toLowerCase()===`th`)&&e.push({type:`tableCell`,children:X(t.children)});e.length>0&&t.push({type:`tableRow`,children:e})}else(e===`thead`||e===`tbody`||e===`tfoot`)&&n(r)}};return n(e),t.length===0?null:{type:`table`,children:t}}var ut=e=>e.replace(/\n+$/,``);function dt(e){if(typeof e==`string`)return e;let t=e instanceof Uint8Array?e:new Uint8Array(e);return new TextDecoder(`utf-8`).decode(t)}function ft(e){for(let t of e){if(!J(t))continue;if(t.tagName.toLowerCase()===`script`&&`data-squisq-doc`in t.attributes)return t;let e=ft(t.children);if(e)return e}}function pt(e){let t=e.attributes[`data-squisq-doc`];if(t!==`1`)throw Error(`Unsupported embedded Squisq Doc version "${t||`(missing)`}"`);let n;try{n=JSON.parse(Z(e))}catch{throw SyntaxError(`Invalid embedded Squisq Doc JSON`)}if(typeof n!=`object`||!n||typeof n.articleId!=`string`||!Number.isFinite(n.duration)||!Array.isArray(n.blocks)||n.audio===null||typeof n.audio!=`object`)throw TypeError(`Embedded Squisq Doc has an invalid shape`);return n}function $(e,t={}){t.signal?.throwIfAborted();let n=t.maxInputChars??16*1024*1024;if(!Number.isSafeInteger(n)||n<0)throw RangeError(`maxInputChars must be a non-negative safe integer`);if(e.length>n)throw RangeError(`HTML exceeds the ${n}-character safety limit`);let r=s(e),a=ft(r);if(a)return i(pt(a));let{nodes:o,bodies:c,identifiers:l}=Ge(r),u=e=>t.sanitize===!1?e:d(e),f=Q(u(o));if(c.size>0){Je(f,l??new Map);let e=new Map;for(let[t,n]of c)e.set(t,Q(u(n)));f.push(...Ye(e))}return{type:`document`,children:f}}async function mt(e,t={}){return $(dt(e),t)}function ht(e,t={}){return p($(e,t),{signal:t.signal})}function gt(e){let t=e.replace(/\\/g,`/`).replace(/^\/+/,``);return!t||t.split(`/`).some(e=>e===`..`)?null:t}function _t(e,t){if(!t.has(e))return e;let n=e.lastIndexOf(`.`),r=n>0?e.slice(0,n):e,i=n>0?e.slice(n):``,a=2;for(;t.has(`${r}-${a}${i}`);)a++;return`${r}-${a}${i}`}function vt(e,t){return t.signal?.throwIfAborted(),te(e,t)}async function yt(e,t){t.signal?.throwIfAborted();let{playerScript:n,images:r,audio:i,mode:a=`slideshow`,title:o,autoPlay:s,showCodeCopyButton:c,themeId:l,themeRegistry:u}=t,d=new b.default;d.file(`squisq-player.js`,n);let f={};if(r){let e=0;for(let[n,i]of r.entries()){e++&63||t.signal?.throwIfAborted();let r=gt(n);if(!r){console.warn(`[squisq] docToHtmlZip: skipped image with unsafe path "${n}" \u2014 the exported document will have a broken reference to it.`);continue}d.file(r,i),f[n]=r}}let p={};if(i){let e=0,n=new Set;for(let[r,a]of i.entries()){e++&63||t.signal?.throwIfAborted();let i=_(r),o=_t(i.includes(`.`)?i:`${i}.mp3`,n);n.add(o);let s=`audio/${o}`;d.file(s,a),p[r]=s}}let m=E(e,{playerScriptPath:`squisq-player.js`,imagePathMap:Object.keys(f).length>0?f:void 0,audioPathMap:Object.keys(p).length>0?p:void 0,mode:a,title:o,autoPlay:s,showCodeCopyButton:c,themeId:l,themeRegistry:u});return d.file(`index.html`,m),d.generateAsync({type:`blob`,compression:`DEFLATE`,compressionOptions:{level:6}})}var bt=t({arrayBufferToBase64DataUrl:()=>y,collectImagePaths:()=>x,collectLinkRefs:()=>F,docToHtml:()=>vt,docToHtmlZip:()=>yt,extractFilename:()=>_,generateExternalHtml:()=>E,htmlToMarkdown:()=>ht,htmlToMarkdownDoc:()=>mt,htmlToMarkdownDocSync:()=>$,inferMimeType:()=>v,markdownDocToPlainHtml:()=>re,markdownDocsToHtmlBundle:()=>ke,markdownDocsToPlainHtmlBundle:()=>Se});export{x as n,E as r,bt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-MIKKUKOD-XIkmalSN.js";import"./chunk-7ZAAICW4-BsCpYJH6.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./chunk-AONELFLA-Cv2nS9ga.js";export{e as extToMime};
|