excalidrop 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +411 -0
- package/dist/cli.d.ts +24 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +533 -0
- package/dist/cli.js.map +1 -0
- package/dist/frontend/assets/Assistant-Bold-gm-uSS1B.woff2 +0 -0
- package/dist/frontend/assets/Assistant-Medium-DrcxCXg3.woff2 +0 -0
- package/dist/frontend/assets/Assistant-Regular-DVxZuzxb.woff2 +0 -0
- package/dist/frontend/assets/Assistant-SemiBold-SCI4bEL9.woff2 +0 -0
- package/dist/frontend/assets/Tableau10-B-NsZVaP.js +1 -0
- package/dist/frontend/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
- package/dist/frontend/assets/advancedFormat-bKUmsig-.js +1 -0
- package/dist/frontend/assets/ar-SA-G6X2FPQ2-C7K_UR3P.js +10 -0
- package/dist/frontend/assets/arc-BI_FJWE7.js +1 -0
- package/dist/frontend/assets/array-BKyUJesY.js +1 -0
- package/dist/frontend/assets/az-AZ-76LH7QW2-PkhuRuSr.js +1 -0
- package/dist/frontend/assets/band-dPffDWoQ.js +1 -0
- package/dist/frontend/assets/bg-BG-XCXSNQG7-CgLRSYTl.js +5 -0
- package/dist/frontend/assets/blockDiagram-38ab4fdb-BFdBRYSn.js +118 -0
- package/dist/frontend/assets/blockDiagram-68f4deed-Ynbqr7bQ.js +118 -0
- package/dist/frontend/assets/bn-BD-2XOGV67Q-CEvkU0mz.js +5 -0
- package/dist/frontend/assets/c4Diagram-15b5d702-Dm7F1Pn_.js +10 -0
- package/dist/frontend/assets/c4Diagram-3d4e48cf-COkK-e67.js +10 -0
- package/dist/frontend/assets/ca-ES-6MX7JW3Y-DzP6q9bE.js +8 -0
- package/dist/frontend/assets/channel-BqCiG5n3.js +1 -0
- package/dist/frontend/assets/classDiagram-70f12bd4-CRzulwvH.js +2 -0
- package/dist/frontend/assets/classDiagram-d40c83e7-DNbA-n-a.js +2 -0
- package/dist/frontend/assets/classDiagram-v2-d5a6b087-l-GglywH.js +2 -0
- package/dist/frontend/assets/classDiagram-v2-f2320105-B_TY1zoc.js +2 -0
- package/dist/frontend/assets/clone-B6Jqcrku.js +1 -0
- package/dist/frontend/assets/createText-2e5e7dd3-DB_k52Pn.js +5 -0
- package/dist/frontend/assets/createText-d213de94-D-G49giw.js +5 -0
- package/dist/frontend/assets/cs-CZ-2BRQDIVT-Bf4TOzpR.js +11 -0
- package/dist/frontend/assets/cytoscape-cose-bilkent-DQYypj0P.js +331 -0
- package/dist/frontend/assets/da-DK-5WZEPLOC-jO-5kyXb.js +5 -0
- package/dist/frontend/assets/de-DE-XR44H4JA-BkNXWOVh.js +8 -0
- package/dist/frontend/assets/directory-open-01563666-DWU9wJ6I.js +1 -0
- package/dist/frontend/assets/directory-open-4ed118d0-BzWybGaI.js +1 -0
- package/dist/frontend/assets/edges-332bd1c7-CVvMtkTa.js +4 -0
- package/dist/frontend/assets/edges-e0da2a9e-DQBAvC8-.js +4 -0
- package/dist/frontend/assets/el-GR-BZB4AONW-Dv7Y9hMk.js +10 -0
- package/dist/frontend/assets/elk.bundled-YVS3PsMH.js +26 -0
- package/dist/frontend/assets/erDiagram-880f2ed8-BjBeR38f.js +51 -0
- package/dist/frontend/assets/erDiagram-9861fffd-B2Bi3R45.js +51 -0
- package/dist/frontend/assets/es-ES-U4NZUMDT-CWhs0SQY.js +9 -0
- package/dist/frontend/assets/eu-ES-A7QVB2H4-BfkFwc3e.js +11 -0
- package/dist/frontend/assets/fa-IR-HGAKTJCU-BgWzSj46.js +8 -0
- package/dist/frontend/assets/fi-FI-Z5N7JZ37-CUyvkum-.js +6 -0
- package/dist/frontend/assets/file-open-002ab408-DIuFHtCF.js +1 -0
- package/dist/frontend/assets/file-open-7c801643-684qeFg4.js +1 -0
- package/dist/frontend/assets/file-save-3189631c-x92wctJd.js +1 -0
- package/dist/frontend/assets/file-save-745eba88-Bb9F9Kg7.js +1 -0
- package/dist/frontend/assets/flowDb-7c981674-BSZyyVBf.js +10 -0
- package/dist/frontend/assets/flowDb-956e92f1-BC3-CLkF.js +10 -0
- package/dist/frontend/assets/flowDiagram-66a62f08-H57DAvmM.js +4 -0
- package/dist/frontend/assets/flowDiagram-cbd28bf7-Bw4Z2nBD.js +4 -0
- package/dist/frontend/assets/flowDiagram-v2-96b9c2cf-CBjbm_oB.js +1 -0
- package/dist/frontend/assets/flowDiagram-v2-ffc7f31a-CoQufPp2.js +1 -0
- package/dist/frontend/assets/flowchart-elk-definition-36e2d292-1kZNdf3X.js +114 -0
- package/dist/frontend/assets/flowchart-elk-definition-4a651766-DDhG2Esi.js +114 -0
- package/dist/frontend/assets/fr-FR-RHASNOE6-7xzoRwbd.js +9 -0
- package/dist/frontend/assets/ganttDiagram-04f9e578-CtUSsXCz.js +257 -0
- package/dist/frontend/assets/ganttDiagram-c361ad54-K42AklFY.js +257 -0
- package/dist/frontend/assets/gitGraphDiagram-21fc4d3e-uW6XA6Y6.js +70 -0
- package/dist/frontend/assets/gitGraphDiagram-72cf32ee-CCNbhnBg.js +70 -0
- package/dist/frontend/assets/gl-ES-HMX3MZ6V-CXuDDwNP.js +10 -0
- package/dist/frontend/assets/graph-CYOmcSYN.js +1 -0
- package/dist/frontend/assets/graph-o42dOfI7.js +1 -0
- package/dist/frontend/assets/he-IL-6SHJWFNN-O9dzh9EM.js +10 -0
- package/dist/frontend/assets/hi-IN-IWLTKZ5I-DlrOXhWs.js +4 -0
- package/dist/frontend/assets/hu-HU-A5ZG7DT2-C3eNg-uI.js +7 -0
- package/dist/frontend/assets/id-ID-SAP4L64H-6iM4pI5c.js +10 -0
- package/dist/frontend/assets/image-blob-reduce.esm-B6b2_-a4.js +7 -0
- package/dist/frontend/assets/index-3862675e-DrvLhypC.js +1 -0
- package/dist/frontend/assets/index-6079d271-BgVTRqg2.js +1 -0
- package/dist/frontend/assets/index-BRA5OktX.css +1 -0
- package/dist/frontend/assets/index-D-cr7jpJ.js +349 -0
- package/dist/frontend/assets/index-DGmpr33w.js +3 -0
- package/dist/frontend/assets/index-HkUXslJy.js +87 -0
- package/dist/frontend/assets/infoDiagram-4a4f5b27-ZxmAcaW1.js +7 -0
- package/dist/frontend/assets/infoDiagram-f8f76790-Bn-PhiFG.js +7 -0
- package/dist/frontend/assets/init-Gi6I4Gst.js +1 -0
- package/dist/frontend/assets/it-IT-JPQ66NNP-B26NQzGp.js +11 -0
- package/dist/frontend/assets/ja-JP-DBVTYXUO-CB0fvnYJ.js +8 -0
- package/dist/frontend/assets/journeyDiagram-29694f62-ggDKs06f.js +139 -0
- package/dist/frontend/assets/journeyDiagram-49397b02-pdDS-n-z.js +139 -0
- package/dist/frontend/assets/kaa-6HZHGXH3-YNdBdcwJ.js +1 -0
- package/dist/frontend/assets/kab-KAB-ZGHBKWFO-D86pwZO0.js +8 -0
- package/dist/frontend/assets/katex-ChWnQ-fc.js +261 -0
- package/dist/frontend/assets/kk-KZ-P5N5QNE5-CpG5oheM.js +1 -0
- package/dist/frontend/assets/km-KH-HSX4SM5Z-DYOZ3Azw.js +11 -0
- package/dist/frontend/assets/ko-KR-MTYHY66A-BHorm6lC.js +9 -0
- package/dist/frontend/assets/ku-TR-6OUDTVRD-CM9RgEHv.js +9 -0
- package/dist/frontend/assets/layout-CCtkxrAf.js +1 -0
- package/dist/frontend/assets/layout-DW9Qf-At.js +1 -0
- package/dist/frontend/assets/line-DvZfgg9P.js +1 -0
- package/dist/frontend/assets/linear-FwFrGRfa.js +1 -0
- package/dist/frontend/assets/lt-LT-XHIRWOB4-DvriKXBj.js +3 -0
- package/dist/frontend/assets/lv-LV-5QDEKY6T-DzQpwk87.js +7 -0
- package/dist/frontend/assets/mindmap-definition-ac74a2e8-DsRo8f2w.js +95 -0
- package/dist/frontend/assets/mindmap-definition-fc14e90a-dQ9reluI.js +95 -0
- package/dist/frontend/assets/mr-IN-CRQNXWMA-C7RzxxP5.js +13 -0
- package/dist/frontend/assets/my-MM-5M5IBNSE-B-RRuy29.js +1 -0
- package/dist/frontend/assets/nb-NO-T6EIAALU-B47x16Ik.js +10 -0
- package/dist/frontend/assets/nl-NL-IS3SIHDZ-BxAKoQne.js +8 -0
- package/dist/frontend/assets/nn-NO-6E72VCQL-dfpbEDSZ.js +8 -0
- package/dist/frontend/assets/oc-FR-POXYY2M6-gv6geBjV.js +8 -0
- package/dist/frontend/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/frontend/assets/pa-IN-N4M65BXN-CY30-qH7.js +4 -0
- package/dist/frontend/assets/path-CbwjOpE9.js +1 -0
- package/dist/frontend/assets/pica-DWYGHLQV.js +7 -0
- package/dist/frontend/assets/pie-CDiWh1rj.js +1 -0
- package/dist/frontend/assets/pieDiagram-421022e6-Bgy-duyf.js +35 -0
- package/dist/frontend/assets/pieDiagram-8a3498a8-DH7FsbPK.js +35 -0
- package/dist/frontend/assets/pl-PL-T2D74RX3-TrHugsIA.js +9 -0
- package/dist/frontend/assets/pt-BR-5N22H2LF-CJxdFp9c.js +9 -0
- package/dist/frontend/assets/pt-PT-UZXXM6DQ-CB-1q6YJ.js +9 -0
- package/dist/frontend/assets/quadrantDiagram-0957ecba-DcwYI1oi.js +7 -0
- package/dist/frontend/assets/quadrantDiagram-120e2f19-CvHU5a9v.js +7 -0
- package/dist/frontend/assets/requirementDiagram-23d650b8-tdagN8HP.js +52 -0
- package/dist/frontend/assets/requirementDiagram-deff3bca-BMGM-fSI.js +52 -0
- package/dist/frontend/assets/ro-RO-JPDTUUEW-DQq9DBOd.js +11 -0
- package/dist/frontend/assets/roundRect-0PYZxl1G.js +1 -0
- package/dist/frontend/assets/ru-RU-B4JR7IUQ-CWX32rfh.js +9 -0
- package/dist/frontend/assets/sankeyDiagram-04a897e0-3i6zWpY2.js +8 -0
- package/dist/frontend/assets/sankeyDiagram-23345273-ncj1Ol7S.js +8 -0
- package/dist/frontend/assets/sankeyLinkHorizontal-DgqkLiUE.js +1 -0
- package/dist/frontend/assets/selectAll-DJwesbwT.js +1 -0
- package/dist/frontend/assets/sequenceDiagram-17ac3bff-ChyKKRZA.js +122 -0
- package/dist/frontend/assets/sequenceDiagram-704730f1-D57_wP9k.js +122 -0
- package/dist/frontend/assets/si-LK-N5RQ5JYF-Lkc5ZxyG.js +1 -0
- package/dist/frontend/assets/sk-SK-C5VTKIMK-DyvYXjqZ.js +6 -0
- package/dist/frontend/assets/sl-SI-NN7IZMDC-D_MvP9Rh.js +6 -0
- package/dist/frontend/assets/stateDiagram-587899a1-OjFTnFLS.js +1 -0
- package/dist/frontend/assets/stateDiagram-9c5f0230-BzU36S5C.js +1 -0
- package/dist/frontend/assets/stateDiagram-v2-51a3dcff-CfX1qo7U.js +1 -0
- package/dist/frontend/assets/stateDiagram-v2-d93cdb3a-BH7Ud4sU.js +1 -0
- package/dist/frontend/assets/styles-2ab5d517-CA8x9Nh5.js +116 -0
- package/dist/frontend/assets/styles-5f03d8d2-BnO2pLhV.js +160 -0
- package/dist/frontend/assets/styles-6aaf32cf-COnot1ea.js +207 -0
- package/dist/frontend/assets/styles-9a916d00-C3QkBgTF.js +160 -0
- package/dist/frontend/assets/styles-c10674c1-CPAG2_rr.js +116 -0
- package/dist/frontend/assets/styles-edf9a4b0-B8Q9fyu0.js +207 -0
- package/dist/frontend/assets/subset-shared.chunk.js +84 -0
- package/dist/frontend/assets/subset-worker.chunk.js +1 -0
- package/dist/frontend/assets/sv-SE-XGPEYMSR-t6voGQSI.js +10 -0
- package/dist/frontend/assets/svgDrawCommon-08f97a94-CdT21LWf.js +1 -0
- package/dist/frontend/assets/svgDrawCommon-3ba9043b-D1MU7jAE.js +1 -0
- package/dist/frontend/assets/ta-IN-2NMHFXQM-7VmfDDyV.js +9 -0
- package/dist/frontend/assets/th-TH-HPSO5L25-B5rLEY9P.js +2 -0
- package/dist/frontend/assets/timeline-definition-7e6b55e7-BIcL44O_.js +61 -0
- package/dist/frontend/assets/timeline-definition-85554ec2-TgrYYwpU.js +61 -0
- package/dist/frontend/assets/tr-TR-DEFEU3FU-0CgOHXTn.js +7 -0
- package/dist/frontend/assets/uk-UA-QMV73CPH-CzSFsIsx.js +6 -0
- package/dist/frontend/assets/union-CnQAJu0l.js +1 -0
- package/dist/frontend/assets/vi-VN-M7AON7JQ-Bhx3rYU9.js +5 -0
- package/dist/frontend/assets/xml-BOsq7VnW.js +1 -0
- package/dist/frontend/assets/xychartDiagram-b6496bcd-BMKDop6v.js +7 -0
- package/dist/frontend/assets/xychartDiagram-e933f94c-DAWithrN.js +7 -0
- package/dist/frontend/assets/zh-CN-LNUGB5OW-Br52_wH4.js +10 -0
- package/dist/frontend/assets/zh-HK-E62DVLB3-Cj6mnIQ9.js +1 -0
- package/dist/frontend/assets/zh-TW-RAJ6MFWO-yLEsVBbC.js +9 -0
- package/dist/frontend/assets/zipObject-BeXj5PVd.js +1 -0
- package/dist/frontend/index.html +339 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2305 -0
- package/dist/index.js.map +1 -0
- package/dist/remote.d.ts +4 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +133 -0
- package/dist/remote.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1217 -0
- package/dist/server.js.map +1 -0
- package/dist/target.d.ts +41 -0
- package/dist/target.d.ts.map +1 -0
- package/dist/target.js +244 -0
- package/dist/target.js.map +1 -0
- package/dist/types.d.ts +228 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +53 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/auth.d.ts +15 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +68 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/github.d.ts +26 -0
- package/dist/utils/github.d.ts.map +1 -0
- package/dist/utils/github.js +111 -0
- package/dist/utils/github.js.map +1 -0
- package/dist/utils/logger.d.ts +4 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +25 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/r2store.d.ts +19 -0
- package/dist/utils/r2store.d.ts.map +1 -0
- package/dist/utils/r2store.js +75 -0
- package/dist/utils/r2store.js.map +1 -0
- package/frontend/index.html +338 -0
- package/frontend/src/App.tsx +1091 -0
- package/frontend/src/main.tsx +15 -0
- package/frontend/src/utils/ghSync.ts +171 -0
- package/frontend/src/utils/mermaidConverter.ts +49 -0
- package/frontend/src/utils/webmcp.ts +285 -0
- package/package.json +101 -0
- package/scripts/check-local-bind.mjs +164 -0
- package/scripts/postinstall.mjs +23 -0
- package/scripts/publish-pages.sh +39 -0
- package/scripts/seed-r2.mjs +9 -0
- package/skills/excalidraw-skill/SKILL.md +303 -0
- package/skills/excalidraw-skill/evals/evals.json +23 -0
- package/skills/excalidraw-skill/references/cheatsheet.md +142 -0
- package/skills/excalidraw-skill/scripts/clear-canvas.cjs +38 -0
- package/skills/excalidraw-skill/scripts/create-element.cjs +68 -0
- package/skills/excalidraw-skill/scripts/delete-element.cjs +48 -0
- package/skills/excalidraw-skill/scripts/export-elements.cjs +53 -0
- package/skills/excalidraw-skill/scripts/healthcheck.cjs +35 -0
- package/skills/excalidraw-skill/scripts/import-elements.cjs +81 -0
- package/skills/excalidraw-skill/scripts/update-element.cjs +70 -0
- package/src/cli.ts +559 -0
- package/src/index.ts +2557 -0
- package/src/remote.ts +96 -0
- package/src/server.ts +1349 -0
- package/src/target.ts +208 -0
- package/src/types.ts +338 -0
- package/src/utils/auth.ts +61 -0
- package/src/utils/github.ts +93 -0
- package/src/utils/logger.ts +35 -0
- package/src/utils/r2store.ts +76 -0
- package/tsconfig.json +50 -0
- package/vite.config.js +37 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./subset-worker.chunk.js","./subset-shared.chunk.js","./pica-DWYGHLQV.js","./_commonjs-dynamic-modules-TDtrdbi3.js","./c4Diagram-15b5d702-Dm7F1Pn_.js","./svgDrawCommon-3ba9043b-D1MU7jAE.js","./flowDiagram-cbd28bf7-Bw4Z2nBD.js","./flowDb-7c981674-BSZyyVBf.js","./graph-o42dOfI7.js","./union-CnQAJu0l.js","./layout-DW9Qf-At.js","./zipObject-BeXj5PVd.js","./styles-2ab5d517-CA8x9Nh5.js","./index-6079d271-BgVTRqg2.js","./clone-B6Jqcrku.js","./edges-332bd1c7-CVvMtkTa.js","./createText-d213de94-D-G49giw.js","./index-DGmpr33w.js","./line-DvZfgg9P.js","./array-BKyUJesY.js","./path-CbwjOpE9.js","./channel-BqCiG5n3.js","./selectAll-DJwesbwT.js","./xml-BOsq7VnW.js","./flowDiagram-v2-ffc7f31a-CoQufPp2.js","./erDiagram-880f2ed8-BjBeR38f.js","./ganttDiagram-04f9e578-CtUSsXCz.js","./advancedFormat-bKUmsig-.js","./linear-FwFrGRfa.js","./init-Gi6I4Gst.js","./pieDiagram-421022e6-Bgy-duyf.js","./arc-BI_FJWE7.js","./ordinal-Cboi1Yqb.js","./pie-CDiWh1rj.js","./quadrantDiagram-0957ecba-DcwYI1oi.js","./xychartDiagram-b6496bcd-BMKDop6v.js","./band-dPffDWoQ.js","./requirementDiagram-23d650b8-tdagN8HP.js","./sequenceDiagram-17ac3bff-ChyKKRZA.js","./classDiagram-d40c83e7-DNbA-n-a.js","./styles-5f03d8d2-BnO2pLhV.js","./classDiagram-v2-d5a6b087-l-GglywH.js","./stateDiagram-9c5f0230-BzU36S5C.js","./styles-edf9a4b0-B8Q9fyu0.js","./stateDiagram-v2-51a3dcff-CfX1qo7U.js","./journeyDiagram-29694f62-ggDKs06f.js","./flowchart-elk-definition-36e2d292-1kZNdf3X.js","./elk.bundled-YVS3PsMH.js","./timeline-definition-7e6b55e7-BIcL44O_.js","./mindmap-definition-ac74a2e8-DsRo8f2w.js","./cytoscape-cose-bilkent-DQYypj0P.js","./sankeyDiagram-23345273-ncj1Ol7S.js","./sankeyLinkHorizontal-DgqkLiUE.js","./Tableau10-B-NsZVaP.js","./blockDiagram-68f4deed-Ynbqr7bQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function f$(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var xl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q5={exports:{}},vf={},J5={exports:{}},xt={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var nw;function p$(){if(nw)return xt;nw=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),h=Symbol.iterator;function f(V){return V===null||typeof V!="object"?null:(V=h&&V[h]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,y={};function v(V,te,ce){this.props=V,this.context=te,this.refs=y,this.updater=ce||g}v.prototype.isReactComponent={},v.prototype.setState=function(V,te){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,te,"setState")},v.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function x(){}x.prototype=v.prototype;function w(V,te,ce){this.props=V,this.context=te,this.refs=y,this.updater=ce||g}var C=w.prototype=new x;C.constructor=w,U(C,v.prototype),C.isPureReactComponent=!0;var S=Array.isArray,T=Object.prototype.hasOwnProperty,M={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function R(V,te,ce){var be,fe={},Se=null,Ue=null;if(te!=null)for(be in te.ref!==void 0&&(Ue=te.ref),te.key!==void 0&&(Se=""+te.key),te)T.call(te,be)&&!_.hasOwnProperty(be)&&(fe[be]=te[be]);var ye=arguments.length-2;if(ye===1)fe.children=ce;else if(1<ye){for(var je=Array(ye),Le=0;Le<ye;Le++)je[Le]=arguments[Le+2];fe.children=je}if(V&&V.defaultProps)for(be in ye=V.defaultProps,ye)fe[be]===void 0&&(fe[be]=ye[be]);return{$$typeof:e,type:V,key:Se,ref:Ue,props:fe,_owner:M.current}}function P(V,te){return{$$typeof:e,type:V.type,key:te,ref:V.ref,props:V.props,_owner:V._owner}}function j(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function N(V){var te={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(ce){return te[ce]})}var F=/\/+/g;function B(V,te){return typeof V=="object"&&V!==null&&V.key!=null?N(""+V.key):te.toString(36)}function G(V,te,ce,be,fe){var Se=typeof V;(Se==="undefined"||Se==="boolean")&&(V=null);var Ue=!1;if(V===null)Ue=!0;else switch(Se){case"string":case"number":Ue=!0;break;case"object":switch(V.$$typeof){case e:case t:Ue=!0}}if(Ue)return Ue=V,fe=fe(Ue),V=be===""?"."+B(Ue,0):be,S(fe)?(ce="",V!=null&&(ce=V.replace(F,"$&/")+"/"),G(fe,te,ce,"",function(Le){return Le})):fe!=null&&(j(fe)&&(fe=P(fe,ce+(!fe.key||Ue&&Ue.key===fe.key?"":(""+fe.key).replace(F,"$&/")+"/")+V)),te.push(fe)),1;if(Ue=0,be=be===""?".":be+":",S(V))for(var ye=0;ye<V.length;ye++){Se=V[ye];var je=be+B(Se,ye);Ue+=G(Se,te,ce,je,fe)}else if(je=f(V),typeof je=="function")for(V=je.call(V),ye=0;!(Se=V.next()).done;)Se=Se.value,je=be+B(Se,ye++),Ue+=G(Se,te,ce,je,fe);else if(Se==="object")throw te=String(V),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.");return Ue}function W(V,te,ce){if(V==null)return V;var be=[],fe=0;return G(V,be,"","",function(Se){return te.call(ce,Se,fe++)}),be}function X(V){if(V._status===-1){var te=V._result;te=te(),te.then(function(ce){(V._status===0||V._status===-1)&&(V._status=1,V._result=ce)},function(ce){(V._status===0||V._status===-1)&&(V._status=2,V._result=ce)}),V._status===-1&&(V._status=0,V._result=te)}if(V._status===1)return V._result.default;throw V._result}var $={current:null},Y={transition:null},H={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:Y,ReactCurrentOwner:M};function Z(){throw Error("act(...) is not supported in production builds of React.")}return xt.Children={map:W,forEach:function(V,te,ce){W(V,function(){te.apply(this,arguments)},ce)},count:function(V){var te=0;return W(V,function(){te++}),te},toArray:function(V){return W(V,function(te){return te})||[]},only:function(V){if(!j(V))throw Error("React.Children.only expected to receive a single React element child.");return V}},xt.Component=v,xt.Fragment=n,xt.Profiler=i,xt.PureComponent=w,xt.StrictMode=r,xt.Suspense=c,xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,xt.act=Z,xt.cloneElement=function(V,te,ce){if(V==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+V+".");var be=U({},V.props),fe=V.key,Se=V.ref,Ue=V._owner;if(te!=null){if(te.ref!==void 0&&(Se=te.ref,Ue=M.current),te.key!==void 0&&(fe=""+te.key),V.type&&V.type.defaultProps)var ye=V.type.defaultProps;for(je in te)T.call(te,je)&&!_.hasOwnProperty(je)&&(be[je]=te[je]===void 0&&ye!==void 0?ye[je]:te[je])}var je=arguments.length-2;if(je===1)be.children=ce;else if(1<je){ye=Array(je);for(var Le=0;Le<je;Le++)ye[Le]=arguments[Le+2];be.children=ye}return{$$typeof:e,type:V.type,key:fe,ref:Se,props:be,_owner:Ue}},xt.createContext=function(V){return V={$$typeof:s,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},V.Provider={$$typeof:a,_context:V},V.Consumer=V},xt.createElement=R,xt.createFactory=function(V){var te=R.bind(null,V);return te.type=V,te},xt.createRef=function(){return{current:null}},xt.forwardRef=function(V){return{$$typeof:o,render:V}},xt.isValidElement=j,xt.lazy=function(V){return{$$typeof:l,_payload:{_status:-1,_result:V},_init:X}},xt.memo=function(V,te){return{$$typeof:d,type:V,compare:te===void 0?null:te}},xt.startTransition=function(V){var te=Y.transition;Y.transition={};try{V()}finally{Y.transition=te}},xt.unstable_act=Z,xt.useCallback=function(V,te){return $.current.useCallback(V,te)},xt.useContext=function(V){return $.current.useContext(V)},xt.useDebugValue=function(){},xt.useDeferredValue=function(V){return $.current.useDeferredValue(V)},xt.useEffect=function(V,te){return $.current.useEffect(V,te)},xt.useId=function(){return $.current.useId()},xt.useImperativeHandle=function(V,te,ce){return $.current.useImperativeHandle(V,te,ce)},xt.useInsertionEffect=function(V,te){return $.current.useInsertionEffect(V,te)},xt.useLayoutEffect=function(V,te){return $.current.useLayoutEffect(V,te)},xt.useMemo=function(V,te){return $.current.useMemo(V,te)},xt.useReducer=function(V,te,ce){return $.current.useReducer(V,te,ce)},xt.useRef=function(V){return $.current.useRef(V)},xt.useState=function(V){return $.current.useState(V)},xt.useSyncExternalStore=function(V,te,ce){return $.current.useSyncExternalStore(V,te,ce)},xt.useTransition=function(){return $.current.useTransition()},xt.version="18.3.1",xt}var rw;function E1(){return rw||(rw=1,J5.exports=p$()),J5.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var iw;function m$(){if(iw)return vf;iw=1;var e=E1(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(o,c,d){var l,h={},f=null,g=null;d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),c.ref!==void 0&&(g=c.ref);for(l in c)r.call(c,l)&&!a.hasOwnProperty(l)&&(h[l]=c[l]);if(o&&o.defaultProps)for(l in c=o.defaultProps,c)h[l]===void 0&&(h[l]=c[l]);return{$$typeof:t,type:o,key:f,ref:g,props:h,_owner:i.current}}return vf.Fragment=n,vf.jsx=s,vf.jsxs=s,vf}var aw;function g$(){return aw||(aw=1,Q5.exports=m$()),Q5.exports}var m=g$(),I=E1();const xe=ta(I),O8=f$({__proto__:null,default:xe},[I]);var sm={},eb={exports:{}},Kr={},tb={exports:{}},nb={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var sw;function U$(){return sw||(sw=1,function(e){function t(Y,H){var Z=Y.length;Y.push(H);e:for(;0<Z;){var V=Z-1>>>1,te=Y[V];if(0<i(te,H))Y[V]=H,Y[Z]=te,Z=V;else break e}}function n(Y){return Y.length===0?null:Y[0]}function r(Y){if(Y.length===0)return null;var H=Y[0],Z=Y.pop();if(Z!==H){Y[0]=Z;e:for(var V=0,te=Y.length,ce=te>>>1;V<ce;){var be=2*(V+1)-1,fe=Y[be],Se=be+1,Ue=Y[Se];if(0>i(fe,Z))Se<te&&0>i(Ue,fe)?(Y[V]=Ue,Y[Se]=Z,V=Se):(Y[V]=fe,Y[be]=Z,V=be);else if(Se<te&&0>i(Ue,Z))Y[V]=Ue,Y[Se]=Z,V=Se;else break e}}return H}function i(Y,H){var Z=Y.sortIndex-H.sortIndex;return Z!==0?Z:Y.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var c=[],d=[],l=1,h=null,f=3,g=!1,U=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(Y){for(var H=n(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=Y)r(d),H.sortIndex=H.expirationTime,t(c,H);else break;H=n(d)}}function S(Y){if(y=!1,C(Y),!U)if(n(c)!==null)U=!0,X(T);else{var H=n(d);H!==null&&$(S,H.startTime-Y)}}function T(Y,H){U=!1,y&&(y=!1,x(R),R=-1),g=!0;var Z=f;try{for(C(H),h=n(c);h!==null&&(!(h.expirationTime>H)||Y&&!N());){var V=h.callback;if(typeof V=="function"){h.callback=null,f=h.priorityLevel;var te=V(h.expirationTime<=H);H=e.unstable_now(),typeof te=="function"?h.callback=te:h===n(c)&&r(c),C(H)}else r(c);h=n(c)}if(h!==null)var ce=!0;else{var be=n(d);be!==null&&$(S,be.startTime-H),ce=!1}return ce}finally{h=null,f=Z,g=!1}}var M=!1,_=null,R=-1,P=5,j=-1;function N(){return!(e.unstable_now()-j<P)}function F(){if(_!==null){var Y=e.unstable_now();j=Y;var H=!0;try{H=_(!0,Y)}finally{H?B():(M=!1,_=null)}}else M=!1}var B;if(typeof w=="function")B=function(){w(F)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,W=G.port2;G.port1.onmessage=F,B=function(){W.postMessage(null)}}else B=function(){v(F,0)};function X(Y){_=Y,M||(M=!0,B())}function $(Y,H){R=v(function(){Y(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Y){Y.callback=null},e.unstable_continueExecution=function(){U||g||(U=!0,X(T))},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(Y){switch(f){case 1:case 2:case 3:var H=3;break;default:H=f}var Z=f;f=H;try{return Y()}finally{f=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Y,H){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var Z=f;f=Y;try{return H()}finally{f=Z}},e.unstable_scheduleCallback=function(Y,H,Z){var V=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?V+Z:V):Z=V,Y){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=Z+te,Y={id:l++,callback:H,priorityLevel:Y,startTime:Z,expirationTime:te,sortIndex:-1},Z>V?(Y.sortIndex=Z,t(d,Y),n(c)===null&&Y===n(d)&&(y?(x(R),R=-1):y=!0,$(S,Z-V))):(Y.sortIndex=te,t(c,Y),U||g||(U=!0,X(T))),Y},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(Y){var H=f;return function(){var Z=f;f=H;try{return Y.apply(this,arguments)}finally{f=Z}}}}(nb)),nb}var ow;function b$(){return ow||(ow=1,tb.exports=U$()),tb.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var lw;function y$(){if(lw)return Kr;lw=1;var e=E1(),t=b$();function n(u){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+u,b=1;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+u+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(u,p){s(u,p),s(u+"Capture",p)}function s(u,p){for(i[u]=p,u=0;u<p.length;u++)r.add(p[u])}var o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,l={},h={};function f(u){return c.call(h,u)?!0:c.call(l,u)?!1:d.test(u)?h[u]=!0:(l[u]=!0,!1)}function g(u,p,b,E){if(b!==null&&b.type===0)return!1;switch(typeof p){case"function":case"symbol":return!0;case"boolean":return E?!1:b!==null?!b.acceptsBooleans:(u=u.toLowerCase().slice(0,5),u!=="data-"&&u!=="aria-");default:return!1}}function U(u,p,b,E){if(p===null||typeof p>"u"||g(u,p,b,E))return!0;if(E)return!1;if(b!==null)switch(b.type){case 3:return!p;case 4:return p===!1;case 5:return isNaN(p);case 6:return isNaN(p)||1>p}return!1}function y(u,p,b,E,k,L,O){this.acceptsBooleans=p===2||p===3||p===4,this.attributeName=E,this.attributeNamespace=k,this.mustUseProperty=b,this.propertyName=u,this.type=p,this.sanitizeURL=L,this.removeEmptyString=O}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(u){v[u]=new y(u,0,!1,u,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(u){var p=u[0];v[p]=new y(p,1,!1,u[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(u){v[u]=new y(u,2,!1,u.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(u){v[u]=new y(u,2,!1,u,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(u){v[u]=new y(u,3,!1,u.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(u){v[u]=new y(u,3,!0,u,null,!1,!1)}),["capture","download"].forEach(function(u){v[u]=new y(u,4,!1,u,null,!1,!1)}),["cols","rows","size","span"].forEach(function(u){v[u]=new y(u,6,!1,u,null,!1,!1)}),["rowSpan","start"].forEach(function(u){v[u]=new y(u,5,!1,u.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function w(u){return u[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(u){var p=u.replace(x,w);v[p]=new y(p,1,!1,u,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(u){var p=u.replace(x,w);v[p]=new y(p,1,!1,u,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(u){var p=u.replace(x,w);v[p]=new y(p,1,!1,u,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(u){v[u]=new y(u,1,!1,u.toLowerCase(),null,!1,!1)}),v.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(u){v[u]=new y(u,1,!1,u.toLowerCase(),null,!0,!0)});function C(u,p,b,E){var k=v.hasOwnProperty(p)?v[p]:null;(k!==null?k.type!==0:E||!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(U(p,b,k,E)&&(b=null),E||k===null?f(p)&&(b===null?u.removeAttribute(p):u.setAttribute(p,""+b)):k.mustUseProperty?u[k.propertyName]=b===null?k.type===3?!1:"":b:(p=k.attributeName,E=k.attributeNamespace,b===null?u.removeAttribute(p):(k=k.type,b=k===3||k===4&&b===!0?"":""+b,E?u.setAttributeNS(E,p,b):u.setAttribute(p,b))))}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),M=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),N=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),Y=Symbol.iterator;function H(u){return u===null||typeof u!="object"?null:(u=Y&&u[Y]||u["@@iterator"],typeof u=="function"?u:null)}var Z=Object.assign,V;function te(u){if(V===void 0)try{throw Error()}catch(b){var p=b.stack.trim().match(/\n( *(at )?)/);V=p&&p[1]||""}return`
|
|
35
|
+
`+V+u}var ce=!1;function be(u,p){if(!u||ce)return"";ce=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(p)if(p=function(){throw Error()},Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(le){var E=le}Reflect.construct(u,[],p)}else{try{p.call()}catch(le){E=le}u.call(p.prototype)}else{try{throw Error()}catch(le){E=le}u()}}catch(le){if(le&&E&&typeof le.stack=="string"){for(var k=le.stack.split(`
|
|
36
|
+
`),L=E.stack.split(`
|
|
37
|
+
`),O=k.length-1,K=L.length-1;1<=O&&0<=K&&k[O]!==L[K];)K--;for(;1<=O&&0<=K;O--,K--)if(k[O]!==L[K]){if(O!==1||K!==1)do if(O--,K--,0>K||k[O]!==L[K]){var Q=`
|
|
38
|
+
`+k[O].replace(" at new "," at ");return u.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",u.displayName)),Q}while(1<=O&&0<=K);break}}}finally{ce=!1,Error.prepareStackTrace=b}return(u=u?u.displayName||u.name:"")?te(u):""}function fe(u){switch(u.tag){case 5:return te(u.type);case 16:return te("Lazy");case 13:return te("Suspense");case 19:return te("SuspenseList");case 0:case 2:case 15:return u=be(u.type,!1),u;case 11:return u=be(u.type.render,!1),u;case 1:return u=be(u.type,!0),u;default:return""}}function Se(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case _:return"Fragment";case M:return"Portal";case P:return"Profiler";case R:return"StrictMode";case B:return"Suspense";case G:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case N:return(u.displayName||"Context")+".Consumer";case j:return(u._context.displayName||"Context")+".Provider";case F:var p=u.render;return u=u.displayName,u||(u=p.displayName||p.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case W:return p=u.displayName||null,p!==null?p:Se(u.type)||"Memo";case X:p=u._payload,u=u._init;try{return Se(u(p))}catch{}}return null}function Ue(u){var p=u.type;switch(u.tag){case 24:return"Cache";case 9:return(p.displayName||"Context")+".Consumer";case 10:return(p._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=p.render,u=u.displayName||u.name||"",p.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return p;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(p);case 8:return p===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p}return null}function ye(u){switch(typeof u){case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function je(u){var p=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(p==="checkbox"||p==="radio")}function Le(u){var p=je(u)?"checked":"value",b=Object.getOwnPropertyDescriptor(u.constructor.prototype,p),E=""+u[p];if(!u.hasOwnProperty(p)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var k=b.get,L=b.set;return Object.defineProperty(u,p,{configurable:!0,get:function(){return k.call(this)},set:function(O){E=""+O,L.call(this,O)}}),Object.defineProperty(u,p,{enumerable:b.enumerable}),{getValue:function(){return E},setValue:function(O){E=""+O},stopTracking:function(){u._valueTracker=null,delete u[p]}}}}function de(u){u._valueTracker||(u._valueTracker=Le(u))}function Te(u){if(!u)return!1;var p=u._valueTracker;if(!p)return!0;var b=p.getValue(),E="";return u&&(E=je(u)?u.checked?"true":"false":u.value),u=E,u!==b?(p.setValue(u),!0):!1}function qe(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}function Ut(u,p){var b=p.checked;return Z({},p,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:b??u._wrapperState.initialChecked})}function Pe(u,p){var b=p.defaultValue==null?"":p.defaultValue,E=p.checked!=null?p.checked:p.defaultChecked;b=ye(p.value!=null?p.value:b),u._wrapperState={initialChecked:E,initialValue:b,controlled:p.type==="checkbox"||p.type==="radio"?p.checked!=null:p.value!=null}}function bt(u,p){p=p.checked,p!=null&&C(u,"checked",p,!1)}function Tt(u,p){bt(u,p);var b=ye(p.value),E=p.type;if(b!=null)E==="number"?(b===0&&u.value===""||u.value!=b)&&(u.value=""+b):u.value!==""+b&&(u.value=""+b);else if(E==="submit"||E==="reset"){u.removeAttribute("value");return}p.hasOwnProperty("value")?Et(u,p.type,b):p.hasOwnProperty("defaultValue")&&Et(u,p.type,ye(p.defaultValue)),p.checked==null&&p.defaultChecked!=null&&(u.defaultChecked=!!p.defaultChecked)}function zn(u,p,b){if(p.hasOwnProperty("value")||p.hasOwnProperty("defaultValue")){var E=p.type;if(!(E!=="submit"&&E!=="reset"||p.value!==void 0&&p.value!==null))return;p=""+u._wrapperState.initialValue,b||p===u.value||(u.value=p),u.defaultValue=p}b=u.name,b!==""&&(u.name=""),u.defaultChecked=!!u._wrapperState.initialChecked,b!==""&&(u.name=b)}function Et(u,p,b){(p!=="number"||qe(u.ownerDocument)!==u)&&(b==null?u.defaultValue=""+u._wrapperState.initialValue:u.defaultValue!==""+b&&(u.defaultValue=""+b))}var nn=Array.isArray;function Wr(u,p,b,E){if(u=u.options,p){p={};for(var k=0;k<b.length;k++)p["$"+b[k]]=!0;for(b=0;b<u.length;b++)k=p.hasOwnProperty("$"+u[b].value),u[b].selected!==k&&(u[b].selected=k),k&&E&&(u[b].defaultSelected=!0)}else{for(b=""+ye(b),p=null,k=0;k<u.length;k++){if(u[k].value===b){u[k].selected=!0,E&&(u[k].defaultSelected=!0);return}p!==null||u[k].disabled||(p=u[k])}p!==null&&(p.selected=!0)}}function Ah(u,p){if(p.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},p,{value:void 0,defaultValue:void 0,children:""+u._wrapperState.initialValue})}function xd(u,p){var b=p.value;if(b==null){if(b=p.children,p=p.defaultValue,b!=null){if(p!=null)throw Error(n(92));if(nn(b)){if(1<b.length)throw Error(n(93));b=b[0]}p=b}p==null&&(p=""),b=p}u._wrapperState={initialValue:ye(b)}}function jo(u,p){var b=ye(p.value),E=ye(p.defaultValue);b!=null&&(b=""+b,b!==u.value&&(u.value=b),p.defaultValue==null&&u.defaultValue!==b&&(u.defaultValue=b)),E!=null&&(u.defaultValue=""+E)}function Rs(u){var p=u.textContent;p===u._wrapperState.initialValue&&p!==""&&p!==null&&(u.value=p)}function Ds(u){switch(u){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function wd(u,p){return u==null||u==="http://www.w3.org/1999/xhtml"?Ds(p):u==="http://www.w3.org/2000/svg"&&p==="foreignObject"?"http://www.w3.org/1999/xhtml":u}var Zl,Lh=function(u){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(p,b,E,k){MSApp.execUnsafeLocalFunction(function(){return u(p,b,E,k)})}:u}(function(u,p){if(u.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in u)u.innerHTML=p;else{for(Zl=Zl||document.createElement("div"),Zl.innerHTML="<svg>"+p.valueOf().toString()+"</svg>",p=Zl.firstChild;u.firstChild;)u.removeChild(u.firstChild);for(;p.firstChild;)u.appendChild(p.firstChild)}});function js(u,p){if(p){var b=u.firstChild;if(b&&b===u.lastChild&&b.nodeType===3){b.nodeValue=p;return}}u.textContent=p}var Po={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ed=["Webkit","ms","Moz","O"];Object.keys(Po).forEach(function(u){Ed.forEach(function(p){p=p+u.charAt(0).toUpperCase()+u.substring(1),Po[p]=Po[u]})});function Kl(u,p,b){return p==null||typeof p=="boolean"||p===""?"":b||typeof p!="number"||p===0||Po.hasOwnProperty(u)&&Po[u]?(""+p).trim():p+"px"}function Ti(u,p){u=u.style;for(var b in p)if(p.hasOwnProperty(b)){var E=b.indexOf("--")===0,k=Kl(b,p[b],E);b==="float"&&(b="cssFloat"),E?u.setProperty(b,k):u[b]=k}}var No=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ql(u,p){if(p){if(No[u]&&(p.children!=null||p.dangerouslySetInnerHTML!=null))throw Error(n(137,u));if(p.dangerouslySetInnerHTML!=null){if(p.children!=null)throw Error(n(60));if(typeof p.dangerouslySetInnerHTML!="object"||!("__html"in p.dangerouslySetInnerHTML))throw Error(n(61))}if(p.style!=null&&typeof p.style!="object")throw Error(n(62))}}function Jl(u,p){if(u.indexOf("-")===-1)return typeof p.is=="string";switch(u){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rh=null;function Ps(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var Dh=null,Oo=null,rn=null;function Ns(u){if(u=af(u)){if(typeof Dh!="function")throw Error(n(280));var p=u.stateNode;p&&(p=x0(p),Dh(u.stateNode,u.type,p))}}function K1(u){Oo?rn?rn.push(u):rn=[u]:Oo=u}function jh(){if(Oo){var u=Oo,p=rn;if(rn=Oo=null,Ns(u),p)for(u=0;u<p.length;u++)Ns(p[u])}}function Cd(u,p){return u(p)}function Ph(){}var Sd=!1;function Q1(u,p,b){if(Sd)return u(p,b);Sd=!0;try{return Cd(u,p,b)}finally{Sd=!1,(Oo!==null||rn!==null)&&(Ph(),jh())}}function Fo(u,p){var b=u.stateNode;if(b===null)return null;var E=x0(b);if(E===null)return null;b=E[p];e:switch(p){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(E=!E.disabled)||(u=u.type,E=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!E;break e;default:u=!1}if(u)return null;if(b&&typeof b!="function")throw Error(n(231,p,typeof b));return b}var _d=!1;if(o)try{var ec={};Object.defineProperty(ec,"passive",{get:function(){_d=!0}}),window.addEventListener("test",ec,ec),window.removeEventListener("test",ec,ec)}catch{_d=!1}function Mi(u,p,b,E,k,L,O,K,Q){var le=Array.prototype.slice.call(arguments,3);try{p.apply(b,le)}catch(me){this.onError(me)}}var Ba=!1,tc=null,nc=!1,kd=null,J1={onError:function(u){Ba=!0,tc=u}};function ra(u,p,b,E,k,L,O,K,Q){Ba=!1,tc=null,Mi.apply(J1,arguments)}function e0(u,p,b,E,k,L,O,K,Q){if(ra.apply(this,arguments),Ba){if(Ba){var le=tc;Ba=!1,tc=null}else throw Error(n(198));nc||(nc=!0,kd=le)}}function $a(u){var p=u,b=u;if(u.alternate)for(;p.return;)p=p.return;else{u=p;do p=u,(p.flags&4098)!==0&&(b=p.return),u=p.return;while(u)}return p.tag===3?b:null}function Nh(u){if(u.tag===13){var p=u.memoizedState;if(p===null&&(u=u.alternate,u!==null&&(p=u.memoizedState)),p!==null)return p.dehydrated}return null}function Oh(u){if($a(u)!==u)throw Error(n(188))}function b6(u){var p=u.alternate;if(!p){if(p=$a(u),p===null)throw Error(n(188));return p!==u?null:u}for(var b=u,E=p;;){var k=b.return;if(k===null)break;var L=k.alternate;if(L===null){if(E=k.return,E!==null){b=E;continue}break}if(k.child===L.child){for(L=k.child;L;){if(L===b)return Oh(k),u;if(L===E)return Oh(k),p;L=L.sibling}throw Error(n(188))}if(b.return!==E.return)b=k,E=L;else{for(var O=!1,K=k.child;K;){if(K===b){O=!0,b=k,E=L;break}if(K===E){O=!0,E=k,b=L;break}K=K.sibling}if(!O){for(K=L.child;K;){if(K===b){O=!0,b=L,E=k;break}if(K===E){O=!0,E=L,b=k;break}K=K.sibling}if(!O)throw Error(n(189))}}if(b.alternate!==E)throw Error(n(190))}if(b.tag!==3)throw Error(n(188));return b.stateNode.current===b?u:p}function Ve(u){return u=b6(u),u!==null?ee(u):null}function ee(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var p=ee(u);if(p!==null)return p;u=u.sibling}return null}var Ee=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Wt=t.unstable_shouldYield,Qn=t.unstable_requestPaint,vt=t.unstable_now,mr=t.unstable_getCurrentPriorityLevel,Xr=t.unstable_ImmediatePriority,Bo=t.unstable_UserBlockingPriority,Rn=t.unstable_NormalPriority,t0=t.unstable_LowPriority,Fh=t.unstable_IdlePriority,n0=null,za=null;function TF(u){if(za&&typeof za.onCommitFiberRoot=="function")try{za.onCommitFiberRoot(n0,u,void 0,(u.current.flags&128)===128)}catch{}}var ia=Math.clz32?Math.clz32:AF,MF=Math.log,IF=Math.LN2;function AF(u){return u>>>=0,u===0?32:31-(MF(u)/IF|0)|0}var r0=64,i0=4194304;function Bh(u){switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function a0(u,p){var b=u.pendingLanes;if(b===0)return 0;var E=0,k=u.suspendedLanes,L=u.pingedLanes,O=b&268435455;if(O!==0){var K=O&~k;K!==0?E=Bh(K):(L&=O,L!==0&&(E=Bh(L)))}else O=b&~k,O!==0?E=Bh(O):L!==0&&(E=Bh(L));if(E===0)return 0;if(p!==0&&p!==E&&(p&k)===0&&(k=E&-E,L=p&-p,k>=L||k===16&&(L&4194240)!==0))return p;if((E&4)!==0&&(E|=b&16),p=u.entangledLanes,p!==0)for(u=u.entanglements,p&=E;0<p;)b=31-ia(p),k=1<<b,E|=u[b],p&=~k;return E}function LF(u,p){switch(u){case 1:case 2:case 4:return p+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function RF(u,p){for(var b=u.suspendedLanes,E=u.pingedLanes,k=u.expirationTimes,L=u.pendingLanes;0<L;){var O=31-ia(L),K=1<<O,Q=k[O];Q===-1?((K&b)===0||(K&E)!==0)&&(k[O]=LF(K,p)):Q<=p&&(u.expiredLanes|=K),L&=~K}}function y6(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function Rx(){var u=r0;return r0<<=1,(r0&4194240)===0&&(r0=64),u}function v6(u){for(var p=[],b=0;31>b;b++)p.push(u);return p}function $h(u,p,b){u.pendingLanes|=p,p!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,p=31-ia(p),u[p]=b}function DF(u,p){var b=u.pendingLanes&~p;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=p,u.mutableReadLanes&=p,u.entangledLanes&=p,p=u.entanglements;var E=u.eventTimes;for(u=u.expirationTimes;0<b;){var k=31-ia(b),L=1<<k;p[k]=0,E[k]=-1,u[k]=-1,b&=~L}}function x6(u,p){var b=u.entangledLanes|=p;for(u=u.entanglements;b;){var E=31-ia(b),k=1<<E;k&p|u[E]&p&&(u[E]|=p),b&=~k}}var zt=0;function Dx(u){return u&=-u,1<u?4<u?(u&268435455)!==0?16:536870912:4:1}var jx,w6,Px,Nx,Ox,E6=!1,s0=[],$o=null,zo=null,Ho=null,zh=new Map,Hh=new Map,Wo=[],jF="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fx(u,p){switch(u){case"focusin":case"focusout":$o=null;break;case"dragenter":case"dragleave":zo=null;break;case"mouseover":case"mouseout":Ho=null;break;case"pointerover":case"pointerout":zh.delete(p.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hh.delete(p.pointerId)}}function Wh(u,p,b,E,k,L){return u===null||u.nativeEvent!==L?(u={blockedOn:p,domEventName:b,eventSystemFlags:E,nativeEvent:L,targetContainers:[k]},p!==null&&(p=af(p),p!==null&&w6(p)),u):(u.eventSystemFlags|=E,p=u.targetContainers,k!==null&&p.indexOf(k)===-1&&p.push(k),u)}function PF(u,p,b,E,k){switch(p){case"focusin":return $o=Wh($o,u,p,b,E,k),!0;case"dragenter":return zo=Wh(zo,u,p,b,E,k),!0;case"mouseover":return Ho=Wh(Ho,u,p,b,E,k),!0;case"pointerover":var L=k.pointerId;return zh.set(L,Wh(zh.get(L)||null,u,p,b,E,k)),!0;case"gotpointercapture":return L=k.pointerId,Hh.set(L,Wh(Hh.get(L)||null,u,p,b,E,k)),!0}return!1}function Bx(u){var p=rc(u.target);if(p!==null){var b=$a(p);if(b!==null){if(p=b.tag,p===13){if(p=Nh(b),p!==null){u.blockedOn=p,Ox(u.priority,function(){Px(b)});return}}else if(p===3&&b.stateNode.current.memoizedState.isDehydrated){u.blockedOn=b.tag===3?b.stateNode.containerInfo:null;return}}}u.blockedOn=null}function o0(u){if(u.blockedOn!==null)return!1;for(var p=u.targetContainers;0<p.length;){var b=S6(u.domEventName,u.eventSystemFlags,p[0],u.nativeEvent);if(b===null){b=u.nativeEvent;var E=new b.constructor(b.type,b);Rh=E,b.target.dispatchEvent(E),Rh=null}else return p=af(b),p!==null&&w6(p),u.blockedOn=b,!1;p.shift()}return!0}function $x(u,p,b){o0(u)&&b.delete(p)}function NF(){E6=!1,$o!==null&&o0($o)&&($o=null),zo!==null&&o0(zo)&&(zo=null),Ho!==null&&o0(Ho)&&(Ho=null),zh.forEach($x),Hh.forEach($x)}function Xh(u,p){u.blockedOn===p&&(u.blockedOn=null,E6||(E6=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,NF)))}function Vh(u){function p(k){return Xh(k,u)}if(0<s0.length){Xh(s0[0],u);for(var b=1;b<s0.length;b++){var E=s0[b];E.blockedOn===u&&(E.blockedOn=null)}}for($o!==null&&Xh($o,u),zo!==null&&Xh(zo,u),Ho!==null&&Xh(Ho,u),zh.forEach(p),Hh.forEach(p),b=0;b<Wo.length;b++)E=Wo[b],E.blockedOn===u&&(E.blockedOn=null);for(;0<Wo.length&&(b=Wo[0],b.blockedOn===null);)Bx(b),b.blockedOn===null&&Wo.shift()}var Td=S.ReactCurrentBatchConfig,l0=!0;function OF(u,p,b,E){var k=zt,L=Td.transition;Td.transition=null;try{zt=1,C6(u,p,b,E)}finally{zt=k,Td.transition=L}}function FF(u,p,b,E){var k=zt,L=Td.transition;Td.transition=null;try{zt=4,C6(u,p,b,E)}finally{zt=k,Td.transition=L}}function C6(u,p,b,E){if(l0){var k=S6(u,p,b,E);if(k===null)z6(u,p,E,c0,b),Fx(u,E);else if(PF(k,u,p,b,E))E.stopPropagation();else if(Fx(u,E),p&4&&-1<jF.indexOf(u)){for(;k!==null;){var L=af(k);if(L!==null&&jx(L),L=S6(u,p,b,E),L===null&&z6(u,p,E,c0,b),L===k)break;k=L}k!==null&&E.stopPropagation()}else z6(u,p,E,null,b)}}var c0=null;function S6(u,p,b,E){if(c0=null,u=Ps(E),u=rc(u),u!==null)if(p=$a(u),p===null)u=null;else if(b=p.tag,b===13){if(u=Nh(p),u!==null)return u;u=null}else if(b===3){if(p.stateNode.current.memoizedState.isDehydrated)return p.tag===3?p.stateNode.containerInfo:null;u=null}else p!==u&&(u=null);return c0=u,null}function zx(u){switch(u){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mr()){case Xr:return 1;case Bo:return 4;case Rn:case t0:return 16;case Fh:return 536870912;default:return 16}default:return 16}}var Xo=null,_6=null,d0=null;function Hx(){if(d0)return d0;var u,p=_6,b=p.length,E,k="value"in Xo?Xo.value:Xo.textContent,L=k.length;for(u=0;u<b&&p[u]===k[u];u++);var O=b-u;for(E=1;E<=O&&p[b-E]===k[L-E];E++);return d0=k.slice(u,1<E?1-E:void 0)}function u0(u){var p=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&p===13&&(u=13)):u=p,u===10&&(u=13),32<=u||u===13?u:0}function h0(){return!0}function Wx(){return!1}function hi(u){function p(b,E,k,L,O){this._reactName=b,this._targetInst=k,this.type=E,this.nativeEvent=L,this.target=O,this.currentTarget=null;for(var K in u)u.hasOwnProperty(K)&&(b=u[K],this[K]=b?b(L):L[K]);return this.isDefaultPrevented=(L.defaultPrevented!=null?L.defaultPrevented:L.returnValue===!1)?h0:Wx,this.isPropagationStopped=Wx,this}return Z(p.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():typeof b.returnValue!="unknown"&&(b.returnValue=!1),this.isDefaultPrevented=h0)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():typeof b.cancelBubble!="unknown"&&(b.cancelBubble=!0),this.isPropagationStopped=h0)},persist:function(){},isPersistent:h0}),p}var Md={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},k6=hi(Md),Yh=Z({},Md,{view:0,detail:0}),BF=hi(Yh),T6,M6,Gh,f0=Z({},Yh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:A6,button:0,buttons:0,relatedTarget:function(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==Gh&&(Gh&&u.type==="mousemove"?(T6=u.screenX-Gh.screenX,M6=u.screenY-Gh.screenY):M6=T6=0,Gh=u),T6)},movementY:function(u){return"movementY"in u?u.movementY:M6}}),Xx=hi(f0),$F=Z({},f0,{dataTransfer:0}),zF=hi($F),HF=Z({},Yh,{relatedTarget:0}),I6=hi(HF),WF=Z({},Md,{animationName:0,elapsedTime:0,pseudoElement:0}),XF=hi(WF),VF=Z({},Md,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),YF=hi(VF),GF=Z({},Md,{data:0}),Vx=hi(GF),qF={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZF={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},KF={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QF(u){var p=this.nativeEvent;return p.getModifierState?p.getModifierState(u):(u=KF[u])?!!p[u]:!1}function A6(){return QF}var JF=Z({},Yh,{key:function(u){if(u.key){var p=qF[u.key]||u.key;if(p!=="Unidentified")return p}return u.type==="keypress"?(u=u0(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?ZF[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:A6,charCode:function(u){return u.type==="keypress"?u0(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?u0(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),eB=hi(JF),tB=Z({},f0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yx=hi(tB),nB=Z({},Yh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:A6}),rB=hi(nB),iB=Z({},Md,{propertyName:0,elapsedTime:0,pseudoElement:0}),aB=hi(iB),sB=Z({},f0,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),oB=hi(sB),lB=[9,13,27,32],L6=o&&"CompositionEvent"in window,qh=null;o&&"documentMode"in document&&(qh=document.documentMode);var cB=o&&"TextEvent"in window&&!qh,Gx=o&&(!L6||qh&&8<qh&&11>=qh),qx=" ",Zx=!1;function Kx(u,p){switch(u){case"keyup":return lB.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qx(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var Id=!1;function dB(u,p){switch(u){case"compositionend":return Qx(p);case"keypress":return p.which!==32?null:(Zx=!0,qx);case"textInput":return u=p.data,u===qx&&Zx?null:u;default:return null}}function uB(u,p){if(Id)return u==="compositionend"||!L6&&Kx(u,p)?(u=Hx(),d0=_6=Xo=null,Id=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1<p.char.length)return p.char;if(p.which)return String.fromCharCode(p.which)}return null;case"compositionend":return Gx&&p.locale!=="ko"?null:p.data;default:return null}}var hB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Jx(u){var p=u&&u.nodeName&&u.nodeName.toLowerCase();return p==="input"?!!hB[u.type]:p==="textarea"}function e4(u,p,b,E){K1(E),p=b0(p,"onChange"),0<p.length&&(b=new k6("onChange","change",null,b,E),u.push({event:b,listeners:p}))}var Zh=null,Kh=null;function fB(u){b4(u,0)}function p0(u){var p=jd(u);if(Te(p))return u}function pB(u,p){if(u==="change")return p}var t4=!1;if(o){var R6;if(o){var D6="oninput"in document;if(!D6){var n4=document.createElement("div");n4.setAttribute("oninput","return;"),D6=typeof n4.oninput=="function"}R6=D6}else R6=!1;t4=R6&&(!document.documentMode||9<document.documentMode)}function r4(){Zh&&(Zh.detachEvent("onpropertychange",i4),Kh=Zh=null)}function i4(u){if(u.propertyName==="value"&&p0(Kh)){var p=[];e4(p,Kh,u,Ps(u)),Q1(fB,p)}}function mB(u,p,b){u==="focusin"?(r4(),Zh=p,Kh=b,Zh.attachEvent("onpropertychange",i4)):u==="focusout"&&r4()}function gB(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return p0(Kh)}function UB(u,p){if(u==="click")return p0(p)}function bB(u,p){if(u==="input"||u==="change")return p0(p)}function yB(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var aa=typeof Object.is=="function"?Object.is:yB;function Qh(u,p){if(aa(u,p))return!0;if(typeof u!="object"||u===null||typeof p!="object"||p===null)return!1;var b=Object.keys(u),E=Object.keys(p);if(b.length!==E.length)return!1;for(E=0;E<b.length;E++){var k=b[E];if(!c.call(p,k)||!aa(u[k],p[k]))return!1}return!0}function a4(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function s4(u,p){var b=a4(u);u=0;for(var E;b;){if(b.nodeType===3){if(E=u+b.textContent.length,u<=p&&E>=p)return{node:b,offset:p-u};u=E}e:{for(;b;){if(b.nextSibling){b=b.nextSibling;break e}b=b.parentNode}b=void 0}b=a4(b)}}function o4(u,p){return u&&p?u===p?!0:u&&u.nodeType===3?!1:p&&p.nodeType===3?o4(u,p.parentNode):"contains"in u?u.contains(p):u.compareDocumentPosition?!!(u.compareDocumentPosition(p)&16):!1:!1}function l4(){for(var u=window,p=qe();p instanceof u.HTMLIFrameElement;){try{var b=typeof p.contentWindow.location.href=="string"}catch{b=!1}if(b)u=p.contentWindow;else break;p=qe(u.document)}return p}function j6(u){var p=u&&u.nodeName&&u.nodeName.toLowerCase();return p&&(p==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||p==="textarea"||u.contentEditable==="true")}function vB(u){var p=l4(),b=u.focusedElem,E=u.selectionRange;if(p!==b&&b&&b.ownerDocument&&o4(b.ownerDocument.documentElement,b)){if(E!==null&&j6(b)){if(p=E.start,u=E.end,u===void 0&&(u=p),"selectionStart"in b)b.selectionStart=p,b.selectionEnd=Math.min(u,b.value.length);else if(u=(p=b.ownerDocument||document)&&p.defaultView||window,u.getSelection){u=u.getSelection();var k=b.textContent.length,L=Math.min(E.start,k);E=E.end===void 0?L:Math.min(E.end,k),!u.extend&&L>E&&(k=E,E=L,L=k),k=s4(b,L);var O=s4(b,E);k&&O&&(u.rangeCount!==1||u.anchorNode!==k.node||u.anchorOffset!==k.offset||u.focusNode!==O.node||u.focusOffset!==O.offset)&&(p=p.createRange(),p.setStart(k.node,k.offset),u.removeAllRanges(),L>E?(u.addRange(p),u.extend(O.node,O.offset)):(p.setEnd(O.node,O.offset),u.addRange(p)))}}for(p=[],u=b;u=u.parentNode;)u.nodeType===1&&p.push({element:u,left:u.scrollLeft,top:u.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<p.length;b++)u=p[b],u.element.scrollLeft=u.left,u.element.scrollTop=u.top}}var xB=o&&"documentMode"in document&&11>=document.documentMode,Ad=null,P6=null,Jh=null,N6=!1;function c4(u,p,b){var E=b.window===b?b.document:b.nodeType===9?b:b.ownerDocument;N6||Ad==null||Ad!==qe(E)||(E=Ad,"selectionStart"in E&&j6(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),Jh&&Qh(Jh,E)||(Jh=E,E=b0(P6,"onSelect"),0<E.length&&(p=new k6("onSelect","select",null,p,b),u.push({event:p,listeners:E}),p.target=Ad)))}function m0(u,p){var b={};return b[u.toLowerCase()]=p.toLowerCase(),b["Webkit"+u]="webkit"+p,b["Moz"+u]="moz"+p,b}var Ld={animationend:m0("Animation","AnimationEnd"),animationiteration:m0("Animation","AnimationIteration"),animationstart:m0("Animation","AnimationStart"),transitionend:m0("Transition","TransitionEnd")},O6={},d4={};o&&(d4=document.createElement("div").style,"AnimationEvent"in window||(delete Ld.animationend.animation,delete Ld.animationiteration.animation,delete Ld.animationstart.animation),"TransitionEvent"in window||delete Ld.transitionend.transition);function g0(u){if(O6[u])return O6[u];if(!Ld[u])return u;var p=Ld[u],b;for(b in p)if(p.hasOwnProperty(b)&&b in d4)return O6[u]=p[b];return u}var u4=g0("animationend"),h4=g0("animationiteration"),f4=g0("animationstart"),p4=g0("transitionend"),m4=new Map,g4="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Vo(u,p){m4.set(u,p),a(p,[u])}for(var F6=0;F6<g4.length;F6++){var B6=g4[F6],wB=B6.toLowerCase(),EB=B6[0].toUpperCase()+B6.slice(1);Vo(wB,"on"+EB)}Vo(u4,"onAnimationEnd"),Vo(h4,"onAnimationIteration"),Vo(f4,"onAnimationStart"),Vo("dblclick","onDoubleClick"),Vo("focusin","onFocus"),Vo("focusout","onBlur"),Vo(p4,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ef="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),CB=new Set("cancel close invalid load scroll toggle".split(" ").concat(ef));function U4(u,p,b){var E=u.type||"unknown-event";u.currentTarget=b,e0(E,p,void 0,u),u.currentTarget=null}function b4(u,p){p=(p&4)!==0;for(var b=0;b<u.length;b++){var E=u[b],k=E.event;E=E.listeners;e:{var L=void 0;if(p)for(var O=E.length-1;0<=O;O--){var K=E[O],Q=K.instance,le=K.currentTarget;if(K=K.listener,Q!==L&&k.isPropagationStopped())break e;U4(k,K,le),L=Q}else for(O=0;O<E.length;O++){if(K=E[O],Q=K.instance,le=K.currentTarget,K=K.listener,Q!==L&&k.isPropagationStopped())break e;U4(k,K,le),L=Q}}}if(nc)throw u=kd,nc=!1,kd=null,u}function an(u,p){var b=p[G6];b===void 0&&(b=p[G6]=new Set);var E=u+"__bubble";b.has(E)||(y4(p,u,2,!1),b.add(E))}function $6(u,p,b){var E=0;p&&(E|=4),y4(b,u,E,p)}var U0="_reactListening"+Math.random().toString(36).slice(2);function tf(u){if(!u[U0]){u[U0]=!0,r.forEach(function(b){b!=="selectionchange"&&(CB.has(b)||$6(b,!1,u),$6(b,!0,u))});var p=u.nodeType===9?u:u.ownerDocument;p===null||p[U0]||(p[U0]=!0,$6("selectionchange",!1,p))}}function y4(u,p,b,E){switch(zx(p)){case 1:var k=OF;break;case 4:k=FF;break;default:k=C6}b=k.bind(null,p,b,u),k=void 0,!_d||p!=="touchstart"&&p!=="touchmove"&&p!=="wheel"||(k=!0),E?k!==void 0?u.addEventListener(p,b,{capture:!0,passive:k}):u.addEventListener(p,b,!0):k!==void 0?u.addEventListener(p,b,{passive:k}):u.addEventListener(p,b,!1)}function z6(u,p,b,E,k){var L=E;if((p&1)===0&&(p&2)===0&&E!==null)e:for(;;){if(E===null)return;var O=E.tag;if(O===3||O===4){var K=E.stateNode.containerInfo;if(K===k||K.nodeType===8&&K.parentNode===k)break;if(O===4)for(O=E.return;O!==null;){var Q=O.tag;if((Q===3||Q===4)&&(Q=O.stateNode.containerInfo,Q===k||Q.nodeType===8&&Q.parentNode===k))return;O=O.return}for(;K!==null;){if(O=rc(K),O===null)return;if(Q=O.tag,Q===5||Q===6){E=L=O;continue e}K=K.parentNode}}E=E.return}Q1(function(){var le=L,me=Ps(b),ve=[];e:{var pe=m4.get(u);if(pe!==void 0){var Ne=k6,$e=u;switch(u){case"keypress":if(u0(b)===0)break e;case"keydown":case"keyup":Ne=eB;break;case"focusin":$e="focus",Ne=I6;break;case"focusout":$e="blur",Ne=I6;break;case"beforeblur":case"afterblur":Ne=I6;break;case"click":if(b.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ne=Xx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ne=zF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ne=rB;break;case u4:case h4:case f4:Ne=XF;break;case p4:Ne=aB;break;case"scroll":Ne=BF;break;case"wheel":Ne=oB;break;case"copy":case"cut":case"paste":Ne=YF;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ne=Yx}var We=(p&4)!==0,In=!We&&u==="scroll",ie=We?pe!==null?pe+"Capture":null:pe;We=[];for(var J=le,ae;J!==null;){ae=J;var Ce=ae.stateNode;if(ae.tag===5&&Ce!==null&&(ae=Ce,ie!==null&&(Ce=Fo(J,ie),Ce!=null&&We.push(nf(J,Ce,ae)))),In)break;J=J.return}0<We.length&&(pe=new Ne(pe,$e,null,b,me),ve.push({event:pe,listeners:We}))}}if((p&7)===0){e:{if(pe=u==="mouseover"||u==="pointerover",Ne=u==="mouseout"||u==="pointerout",pe&&b!==Rh&&($e=b.relatedTarget||b.fromElement)&&(rc($e)||$e[Os]))break e;if((Ne||pe)&&(pe=me.window===me?me:(pe=me.ownerDocument)?pe.defaultView||pe.parentWindow:window,Ne?($e=b.relatedTarget||b.toElement,Ne=le,$e=$e?rc($e):null,$e!==null&&(In=$a($e),$e!==In||$e.tag!==5&&$e.tag!==6)&&($e=null)):(Ne=null,$e=le),Ne!==$e)){if(We=Xx,Ce="onMouseLeave",ie="onMouseEnter",J="mouse",(u==="pointerout"||u==="pointerover")&&(We=Yx,Ce="onPointerLeave",ie="onPointerEnter",J="pointer"),In=Ne==null?pe:jd(Ne),ae=$e==null?pe:jd($e),pe=new We(Ce,J+"leave",Ne,b,me),pe.target=In,pe.relatedTarget=ae,Ce=null,rc(me)===le&&(We=new We(ie,J+"enter",$e,b,me),We.target=ae,We.relatedTarget=In,Ce=We),In=Ce,Ne&&$e)t:{for(We=Ne,ie=$e,J=0,ae=We;ae;ae=Rd(ae))J++;for(ae=0,Ce=ie;Ce;Ce=Rd(Ce))ae++;for(;0<J-ae;)We=Rd(We),J--;for(;0<ae-J;)ie=Rd(ie),ae--;for(;J--;){if(We===ie||ie!==null&&We===ie.alternate)break t;We=Rd(We),ie=Rd(ie)}We=null}else We=null;Ne!==null&&v4(ve,pe,Ne,We,!1),$e!==null&&In!==null&&v4(ve,In,$e,We,!0)}}e:{if(pe=le?jd(le):window,Ne=pe.nodeName&&pe.nodeName.toLowerCase(),Ne==="select"||Ne==="input"&&pe.type==="file")var Xe=pB;else if(Jx(pe))if(t4)Xe=bB;else{Xe=gB;var Je=mB}else(Ne=pe.nodeName)&&Ne.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Xe=UB);if(Xe&&(Xe=Xe(u,le))){e4(ve,Xe,b,me);break e}Je&&Je(u,pe,le),u==="focusout"&&(Je=pe._wrapperState)&&Je.controlled&&pe.type==="number"&&Et(pe,"number",pe.value)}switch(Je=le?jd(le):window,u){case"focusin":(Jx(Je)||Je.contentEditable==="true")&&(Ad=Je,P6=le,Jh=null);break;case"focusout":Jh=P6=Ad=null;break;case"mousedown":N6=!0;break;case"contextmenu":case"mouseup":case"dragend":N6=!1,c4(ve,b,me);break;case"selectionchange":if(xB)break;case"keydown":case"keyup":c4(ve,b,me)}var et;if(L6)e:{switch(u){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Id?Kx(u,b)&&(st="onCompositionEnd"):u==="keydown"&&b.keyCode===229&&(st="onCompositionStart");st&&(Gx&&b.locale!=="ko"&&(Id||st!=="onCompositionStart"?st==="onCompositionEnd"&&Id&&(et=Hx()):(Xo=me,_6="value"in Xo?Xo.value:Xo.textContent,Id=!0)),Je=b0(le,st),0<Je.length&&(st=new Vx(st,u,null,b,me),ve.push({event:st,listeners:Je}),et?st.data=et:(et=Qx(b),et!==null&&(st.data=et)))),(et=cB?dB(u,b):uB(u,b))&&(le=b0(le,"onBeforeInput"),0<le.length&&(me=new Vx("onBeforeInput","beforeinput",null,b,me),ve.push({event:me,listeners:le}),me.data=et))}b4(ve,p)})}function nf(u,p,b){return{instance:u,listener:p,currentTarget:b}}function b0(u,p){for(var b=p+"Capture",E=[];u!==null;){var k=u,L=k.stateNode;k.tag===5&&L!==null&&(k=L,L=Fo(u,b),L!=null&&E.unshift(nf(u,L,k)),L=Fo(u,p),L!=null&&E.push(nf(u,L,k))),u=u.return}return E}function Rd(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5);return u||null}function v4(u,p,b,E,k){for(var L=p._reactName,O=[];b!==null&&b!==E;){var K=b,Q=K.alternate,le=K.stateNode;if(Q!==null&&Q===E)break;K.tag===5&&le!==null&&(K=le,k?(Q=Fo(b,L),Q!=null&&O.unshift(nf(b,Q,K))):k||(Q=Fo(b,L),Q!=null&&O.push(nf(b,Q,K)))),b=b.return}O.length!==0&&u.push({event:p,listeners:O})}var SB=/\r\n?/g,_B=/\u0000|\uFFFD/g;function x4(u){return(typeof u=="string"?u:""+u).replace(SB,`
|
|
39
|
+
`).replace(_B,"")}function y0(u,p,b){if(p=x4(p),x4(u)!==p&&b)throw Error(n(425))}function v0(){}var H6=null,W6=null;function X6(u,p){return u==="textarea"||u==="noscript"||typeof p.children=="string"||typeof p.children=="number"||typeof p.dangerouslySetInnerHTML=="object"&&p.dangerouslySetInnerHTML!==null&&p.dangerouslySetInnerHTML.__html!=null}var V6=typeof setTimeout=="function"?setTimeout:void 0,kB=typeof clearTimeout=="function"?clearTimeout:void 0,w4=typeof Promise=="function"?Promise:void 0,TB=typeof queueMicrotask=="function"?queueMicrotask:typeof w4<"u"?function(u){return w4.resolve(null).then(u).catch(MB)}:V6;function MB(u){setTimeout(function(){throw u})}function Y6(u,p){var b=p,E=0;do{var k=b.nextSibling;if(u.removeChild(b),k&&k.nodeType===8)if(b=k.data,b==="/$"){if(E===0){u.removeChild(k),Vh(p);return}E--}else b!=="$"&&b!=="$?"&&b!=="$!"||E++;b=k}while(b);Vh(p)}function Yo(u){for(;u!=null;u=u.nextSibling){var p=u.nodeType;if(p===1||p===3)break;if(p===8){if(p=u.data,p==="$"||p==="$!"||p==="$?")break;if(p==="/$")return null}}return u}function E4(u){u=u.previousSibling;for(var p=0;u;){if(u.nodeType===8){var b=u.data;if(b==="$"||b==="$!"||b==="$?"){if(p===0)return u;p--}else b==="/$"&&p++}u=u.previousSibling}return null}var Dd=Math.random().toString(36).slice(2),Ha="__reactFiber$"+Dd,rf="__reactProps$"+Dd,Os="__reactContainer$"+Dd,G6="__reactEvents$"+Dd,IB="__reactListeners$"+Dd,AB="__reactHandles$"+Dd;function rc(u){var p=u[Ha];if(p)return p;for(var b=u.parentNode;b;){if(p=b[Os]||b[Ha]){if(b=p.alternate,p.child!==null||b!==null&&b.child!==null)for(u=E4(u);u!==null;){if(b=u[Ha])return b;u=E4(u)}return p}u=b,b=u.parentNode}return null}function af(u){return u=u[Ha]||u[Os],!u||u.tag!==5&&u.tag!==6&&u.tag!==13&&u.tag!==3?null:u}function jd(u){if(u.tag===5||u.tag===6)return u.stateNode;throw Error(n(33))}function x0(u){return u[rf]||null}var q6=[],Pd=-1;function Go(u){return{current:u}}function sn(u){0>Pd||(u.current=q6[Pd],q6[Pd]=null,Pd--)}function Kt(u,p){Pd++,q6[Pd]=u.current,u.current=p}var qo={},gr=Go(qo),Vr=Go(!1),ic=qo;function Nd(u,p){var b=u.type.contextTypes;if(!b)return qo;var E=u.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===p)return E.__reactInternalMemoizedMaskedChildContext;var k={},L;for(L in b)k[L]=p[L];return E&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=p,u.__reactInternalMemoizedMaskedChildContext=k),k}function Yr(u){return u=u.childContextTypes,u!=null}function w0(){sn(Vr),sn(gr)}function C4(u,p,b){if(gr.current!==qo)throw Error(n(168));Kt(gr,p),Kt(Vr,b)}function S4(u,p,b){var E=u.stateNode;if(p=p.childContextTypes,typeof E.getChildContext!="function")return b;E=E.getChildContext();for(var k in E)if(!(k in p))throw Error(n(108,Ue(u)||"Unknown",k));return Z({},b,E)}function E0(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||qo,ic=gr.current,Kt(gr,u),Kt(Vr,Vr.current),!0}function _4(u,p,b){var E=u.stateNode;if(!E)throw Error(n(169));b?(u=S4(u,p,ic),E.__reactInternalMemoizedMergedChildContext=u,sn(Vr),sn(gr),Kt(gr,u)):sn(Vr),Kt(Vr,b)}var Fs=null,C0=!1,Z6=!1;function k4(u){Fs===null?Fs=[u]:Fs.push(u)}function LB(u){C0=!0,k4(u)}function Zo(){if(!Z6&&Fs!==null){Z6=!0;var u=0,p=zt;try{var b=Fs;for(zt=1;u<b.length;u++){var E=b[u];do E=E(!0);while(E!==null)}Fs=null,C0=!1}catch(k){throw Fs!==null&&(Fs=Fs.slice(u+1)),Ee(Xr,Zo),k}finally{zt=p,Z6=!1}}return null}var Od=[],Fd=0,S0=null,_0=0,Ii=[],Ai=0,ac=null,Bs=1,$s="";function sc(u,p){Od[Fd++]=_0,Od[Fd++]=S0,S0=u,_0=p}function T4(u,p,b){Ii[Ai++]=Bs,Ii[Ai++]=$s,Ii[Ai++]=ac,ac=u;var E=Bs;u=$s;var k=32-ia(E)-1;E&=~(1<<k),b+=1;var L=32-ia(p)+k;if(30<L){var O=k-k%5;L=(E&(1<<O)-1).toString(32),E>>=O,k-=O,Bs=1<<32-ia(p)+k|b<<k|E,$s=L+u}else Bs=1<<L|b<<k|E,$s=u}function K6(u){u.return!==null&&(sc(u,1),T4(u,1,0))}function Q6(u){for(;u===S0;)S0=Od[--Fd],Od[Fd]=null,_0=Od[--Fd],Od[Fd]=null;for(;u===ac;)ac=Ii[--Ai],Ii[Ai]=null,$s=Ii[--Ai],Ii[Ai]=null,Bs=Ii[--Ai],Ii[Ai]=null}var fi=null,pi=null,cn=!1,sa=null;function M4(u,p){var b=ji(5,null,null,0);b.elementType="DELETED",b.stateNode=p,b.return=u,p=u.deletions,p===null?(u.deletions=[b],u.flags|=16):p.push(b)}function I4(u,p){switch(u.tag){case 5:var b=u.type;return p=p.nodeType!==1||b.toLowerCase()!==p.nodeName.toLowerCase()?null:p,p!==null?(u.stateNode=p,fi=u,pi=Yo(p.firstChild),!0):!1;case 6:return p=u.pendingProps===""||p.nodeType!==3?null:p,p!==null?(u.stateNode=p,fi=u,pi=null,!0):!1;case 13:return p=p.nodeType!==8?null:p,p!==null?(b=ac!==null?{id:Bs,overflow:$s}:null,u.memoizedState={dehydrated:p,treeContext:b,retryLane:1073741824},b=ji(18,null,null,0),b.stateNode=p,b.return=u,u.child=b,fi=u,pi=null,!0):!1;default:return!1}}function J6(u){return(u.mode&1)!==0&&(u.flags&128)===0}function e5(u){if(cn){var p=pi;if(p){var b=p;if(!I4(u,p)){if(J6(u))throw Error(n(418));p=Yo(b.nextSibling);var E=fi;p&&I4(u,p)?M4(E,b):(u.flags=u.flags&-4097|2,cn=!1,fi=u)}}else{if(J6(u))throw Error(n(418));u.flags=u.flags&-4097|2,cn=!1,fi=u}}}function A4(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;fi=u}function k0(u){if(u!==fi)return!1;if(!cn)return A4(u),cn=!0,!1;var p;if((p=u.tag!==3)&&!(p=u.tag!==5)&&(p=u.type,p=p!=="head"&&p!=="body"&&!X6(u.type,u.memoizedProps)),p&&(p=pi)){if(J6(u))throw L4(),Error(n(418));for(;p;)M4(u,p),p=Yo(p.nextSibling)}if(A4(u),u.tag===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(n(317));e:{for(u=u.nextSibling,p=0;u;){if(u.nodeType===8){var b=u.data;if(b==="/$"){if(p===0){pi=Yo(u.nextSibling);break e}p--}else b!=="$"&&b!=="$!"&&b!=="$?"||p++}u=u.nextSibling}pi=null}}else pi=fi?Yo(u.stateNode.nextSibling):null;return!0}function L4(){for(var u=pi;u;)u=Yo(u.nextSibling)}function Bd(){pi=fi=null,cn=!1}function t5(u){sa===null?sa=[u]:sa.push(u)}var RB=S.ReactCurrentBatchConfig;function sf(u,p,b){if(u=b.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(b._owner){if(b=b._owner,b){if(b.tag!==1)throw Error(n(309));var E=b.stateNode}if(!E)throw Error(n(147,u));var k=E,L=""+u;return p!==null&&p.ref!==null&&typeof p.ref=="function"&&p.ref._stringRef===L?p.ref:(p=function(O){var K=k.refs;O===null?delete K[L]:K[L]=O},p._stringRef=L,p)}if(typeof u!="string")throw Error(n(284));if(!b._owner)throw Error(n(290,u))}return u}function T0(u,p){throw u=Object.prototype.toString.call(p),Error(n(31,u==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":u))}function R4(u){var p=u._init;return p(u._payload)}function D4(u){function p(ie,J){if(u){var ae=ie.deletions;ae===null?(ie.deletions=[J],ie.flags|=16):ae.push(J)}}function b(ie,J){if(!u)return null;for(;J!==null;)p(ie,J),J=J.sibling;return null}function E(ie,J){for(ie=new Map;J!==null;)J.key!==null?ie.set(J.key,J):ie.set(J.index,J),J=J.sibling;return ie}function k(ie,J){return ie=il(ie,J),ie.index=0,ie.sibling=null,ie}function L(ie,J,ae){return ie.index=ae,u?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<J?(ie.flags|=2,J):ae):(ie.flags|=2,J)):(ie.flags|=1048576,J)}function O(ie){return u&&ie.alternate===null&&(ie.flags|=2),ie}function K(ie,J,ae,Ce){return J===null||J.tag!==6?(J=V5(ae,ie.mode,Ce),J.return=ie,J):(J=k(J,ae),J.return=ie,J)}function Q(ie,J,ae,Ce){var Xe=ae.type;return Xe===_?me(ie,J,ae.props.children,Ce,ae.key):J!==null&&(J.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===X&&R4(Xe)===J.type)?(Ce=k(J,ae.props),Ce.ref=sf(ie,J,ae),Ce.return=ie,Ce):(Ce=Q0(ae.type,ae.key,ae.props,null,ie.mode,Ce),Ce.ref=sf(ie,J,ae),Ce.return=ie,Ce)}function le(ie,J,ae,Ce){return J===null||J.tag!==4||J.stateNode.containerInfo!==ae.containerInfo||J.stateNode.implementation!==ae.implementation?(J=Y5(ae,ie.mode,Ce),J.return=ie,J):(J=k(J,ae.children||[]),J.return=ie,J)}function me(ie,J,ae,Ce,Xe){return J===null||J.tag!==7?(J=pc(ae,ie.mode,Ce,Xe),J.return=ie,J):(J=k(J,ae),J.return=ie,J)}function ve(ie,J,ae){if(typeof J=="string"&&J!==""||typeof J=="number")return J=V5(""+J,ie.mode,ae),J.return=ie,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case T:return ae=Q0(J.type,J.key,J.props,null,ie.mode,ae),ae.ref=sf(ie,null,J),ae.return=ie,ae;case M:return J=Y5(J,ie.mode,ae),J.return=ie,J;case X:var Ce=J._init;return ve(ie,Ce(J._payload),ae)}if(nn(J)||H(J))return J=pc(J,ie.mode,ae,null),J.return=ie,J;T0(ie,J)}return null}function pe(ie,J,ae,Ce){var Xe=J!==null?J.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return Xe!==null?null:K(ie,J,""+ae,Ce);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case T:return ae.key===Xe?Q(ie,J,ae,Ce):null;case M:return ae.key===Xe?le(ie,J,ae,Ce):null;case X:return Xe=ae._init,pe(ie,J,Xe(ae._payload),Ce)}if(nn(ae)||H(ae))return Xe!==null?null:me(ie,J,ae,Ce,null);T0(ie,ae)}return null}function Ne(ie,J,ae,Ce,Xe){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return ie=ie.get(ae)||null,K(J,ie,""+Ce,Xe);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case T:return ie=ie.get(Ce.key===null?ae:Ce.key)||null,Q(J,ie,Ce,Xe);case M:return ie=ie.get(Ce.key===null?ae:Ce.key)||null,le(J,ie,Ce,Xe);case X:var Je=Ce._init;return Ne(ie,J,ae,Je(Ce._payload),Xe)}if(nn(Ce)||H(Ce))return ie=ie.get(ae)||null,me(J,ie,Ce,Xe,null);T0(J,Ce)}return null}function $e(ie,J,ae,Ce){for(var Xe=null,Je=null,et=J,st=J=0,tr=null;et!==null&&st<ae.length;st++){et.index>st?(tr=et,et=null):tr=et.sibling;var Dt=pe(ie,et,ae[st],Ce);if(Dt===null){et===null&&(et=tr);break}u&&et&&Dt.alternate===null&&p(ie,et),J=L(Dt,J,st),Je===null?Xe=Dt:Je.sibling=Dt,Je=Dt,et=tr}if(st===ae.length)return b(ie,et),cn&&sc(ie,st),Xe;if(et===null){for(;st<ae.length;st++)et=ve(ie,ae[st],Ce),et!==null&&(J=L(et,J,st),Je===null?Xe=et:Je.sibling=et,Je=et);return cn&&sc(ie,st),Xe}for(et=E(ie,et);st<ae.length;st++)tr=Ne(et,ie,st,ae[st],Ce),tr!==null&&(u&&tr.alternate!==null&&et.delete(tr.key===null?st:tr.key),J=L(tr,J,st),Je===null?Xe=tr:Je.sibling=tr,Je=tr);return u&&et.forEach(function(al){return p(ie,al)}),cn&&sc(ie,st),Xe}function We(ie,J,ae,Ce){var Xe=H(ae);if(typeof Xe!="function")throw Error(n(150));if(ae=Xe.call(ae),ae==null)throw Error(n(151));for(var Je=Xe=null,et=J,st=J=0,tr=null,Dt=ae.next();et!==null&&!Dt.done;st++,Dt=ae.next()){et.index>st?(tr=et,et=null):tr=et.sibling;var al=pe(ie,et,Dt.value,Ce);if(al===null){et===null&&(et=tr);break}u&&et&&al.alternate===null&&p(ie,et),J=L(al,J,st),Je===null?Xe=al:Je.sibling=al,Je=al,et=tr}if(Dt.done)return b(ie,et),cn&&sc(ie,st),Xe;if(et===null){for(;!Dt.done;st++,Dt=ae.next())Dt=ve(ie,Dt.value,Ce),Dt!==null&&(J=L(Dt,J,st),Je===null?Xe=Dt:Je.sibling=Dt,Je=Dt);return cn&&sc(ie,st),Xe}for(et=E(ie,et);!Dt.done;st++,Dt=ae.next())Dt=Ne(et,ie,st,Dt.value,Ce),Dt!==null&&(u&&Dt.alternate!==null&&et.delete(Dt.key===null?st:Dt.key),J=L(Dt,J,st),Je===null?Xe=Dt:Je.sibling=Dt,Je=Dt);return u&&et.forEach(function(h$){return p(ie,h$)}),cn&&sc(ie,st),Xe}function In(ie,J,ae,Ce){if(typeof ae=="object"&&ae!==null&&ae.type===_&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case T:e:{for(var Xe=ae.key,Je=J;Je!==null;){if(Je.key===Xe){if(Xe=ae.type,Xe===_){if(Je.tag===7){b(ie,Je.sibling),J=k(Je,ae.props.children),J.return=ie,ie=J;break e}}else if(Je.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===X&&R4(Xe)===Je.type){b(ie,Je.sibling),J=k(Je,ae.props),J.ref=sf(ie,Je,ae),J.return=ie,ie=J;break e}b(ie,Je);break}else p(ie,Je);Je=Je.sibling}ae.type===_?(J=pc(ae.props.children,ie.mode,Ce,ae.key),J.return=ie,ie=J):(Ce=Q0(ae.type,ae.key,ae.props,null,ie.mode,Ce),Ce.ref=sf(ie,J,ae),Ce.return=ie,ie=Ce)}return O(ie);case M:e:{for(Je=ae.key;J!==null;){if(J.key===Je)if(J.tag===4&&J.stateNode.containerInfo===ae.containerInfo&&J.stateNode.implementation===ae.implementation){b(ie,J.sibling),J=k(J,ae.children||[]),J.return=ie,ie=J;break e}else{b(ie,J);break}else p(ie,J);J=J.sibling}J=Y5(ae,ie.mode,Ce),J.return=ie,ie=J}return O(ie);case X:return Je=ae._init,In(ie,J,Je(ae._payload),Ce)}if(nn(ae))return $e(ie,J,ae,Ce);if(H(ae))return We(ie,J,ae,Ce);T0(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,J!==null&&J.tag===6?(b(ie,J.sibling),J=k(J,ae),J.return=ie,ie=J):(b(ie,J),J=V5(ae,ie.mode,Ce),J.return=ie,ie=J),O(ie)):b(ie,J)}return In}var $d=D4(!0),j4=D4(!1),M0=Go(null),I0=null,zd=null,n5=null;function r5(){n5=zd=I0=null}function i5(u){var p=M0.current;sn(M0),u._currentValue=p}function a5(u,p,b){for(;u!==null;){var E=u.alternate;if((u.childLanes&p)!==p?(u.childLanes|=p,E!==null&&(E.childLanes|=p)):E!==null&&(E.childLanes&p)!==p&&(E.childLanes|=p),u===b)break;u=u.return}}function Hd(u,p){I0=u,n5=zd=null,u=u.dependencies,u!==null&&u.firstContext!==null&&((u.lanes&p)!==0&&(Gr=!0),u.firstContext=null)}function Li(u){var p=u._currentValue;if(n5!==u)if(u={context:u,memoizedValue:p,next:null},zd===null){if(I0===null)throw Error(n(308));zd=u,I0.dependencies={lanes:0,firstContext:u}}else zd=zd.next=u;return p}var oc=null;function s5(u){oc===null?oc=[u]:oc.push(u)}function P4(u,p,b,E){var k=p.interleaved;return k===null?(b.next=b,s5(p)):(b.next=k.next,k.next=b),p.interleaved=b,zs(u,E)}function zs(u,p){u.lanes|=p;var b=u.alternate;for(b!==null&&(b.lanes|=p),b=u,u=u.return;u!==null;)u.childLanes|=p,b=u.alternate,b!==null&&(b.childLanes|=p),b=u,u=u.return;return b.tag===3?b.stateNode:null}var Ko=!1;function o5(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function N4(u,p){u=u.updateQueue,p.updateQueue===u&&(p.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function Hs(u,p){return{eventTime:u,lane:p,tag:0,payload:null,callback:null,next:null}}function Qo(u,p,b){var E=u.updateQueue;if(E===null)return null;if(E=E.shared,(Mt&2)!==0){var k=E.pending;return k===null?p.next=p:(p.next=k.next,k.next=p),E.pending=p,zs(u,b)}return k=E.interleaved,k===null?(p.next=p,s5(E)):(p.next=k.next,k.next=p),E.interleaved=p,zs(u,b)}function A0(u,p,b){if(p=p.updateQueue,p!==null&&(p=p.shared,(b&4194240)!==0)){var E=p.lanes;E&=u.pendingLanes,b|=E,p.lanes=b,x6(u,b)}}function O4(u,p){var b=u.updateQueue,E=u.alternate;if(E!==null&&(E=E.updateQueue,b===E)){var k=null,L=null;if(b=b.firstBaseUpdate,b!==null){do{var O={eventTime:b.eventTime,lane:b.lane,tag:b.tag,payload:b.payload,callback:b.callback,next:null};L===null?k=L=O:L=L.next=O,b=b.next}while(b!==null);L===null?k=L=p:L=L.next=p}else k=L=p;b={baseState:E.baseState,firstBaseUpdate:k,lastBaseUpdate:L,shared:E.shared,effects:E.effects},u.updateQueue=b;return}u=b.lastBaseUpdate,u===null?b.firstBaseUpdate=p:u.next=p,b.lastBaseUpdate=p}function L0(u,p,b,E){var k=u.updateQueue;Ko=!1;var L=k.firstBaseUpdate,O=k.lastBaseUpdate,K=k.shared.pending;if(K!==null){k.shared.pending=null;var Q=K,le=Q.next;Q.next=null,O===null?L=le:O.next=le,O=Q;var me=u.alternate;me!==null&&(me=me.updateQueue,K=me.lastBaseUpdate,K!==O&&(K===null?me.firstBaseUpdate=le:K.next=le,me.lastBaseUpdate=Q))}if(L!==null){var ve=k.baseState;O=0,me=le=Q=null,K=L;do{var pe=K.lane,Ne=K.eventTime;if((E&pe)===pe){me!==null&&(me=me.next={eventTime:Ne,lane:0,tag:K.tag,payload:K.payload,callback:K.callback,next:null});e:{var $e=u,We=K;switch(pe=p,Ne=b,We.tag){case 1:if($e=We.payload,typeof $e=="function"){ve=$e.call(Ne,ve,pe);break e}ve=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=We.payload,pe=typeof $e=="function"?$e.call(Ne,ve,pe):$e,pe==null)break e;ve=Z({},ve,pe);break e;case 2:Ko=!0}}K.callback!==null&&K.lane!==0&&(u.flags|=64,pe=k.effects,pe===null?k.effects=[K]:pe.push(K))}else Ne={eventTime:Ne,lane:pe,tag:K.tag,payload:K.payload,callback:K.callback,next:null},me===null?(le=me=Ne,Q=ve):me=me.next=Ne,O|=pe;if(K=K.next,K===null){if(K=k.shared.pending,K===null)break;pe=K,K=pe.next,pe.next=null,k.lastBaseUpdate=pe,k.shared.pending=null}}while(!0);if(me===null&&(Q=ve),k.baseState=Q,k.firstBaseUpdate=le,k.lastBaseUpdate=me,p=k.shared.interleaved,p!==null){k=p;do O|=k.lane,k=k.next;while(k!==p)}else L===null&&(k.shared.lanes=0);dc|=O,u.lanes=O,u.memoizedState=ve}}function F4(u,p,b){if(u=p.effects,p.effects=null,u!==null)for(p=0;p<u.length;p++){var E=u[p],k=E.callback;if(k!==null){if(E.callback=null,E=b,typeof k!="function")throw Error(n(191,k));k.call(E)}}}var of={},Wa=Go(of),lf=Go(of),cf=Go(of);function lc(u){if(u===of)throw Error(n(174));return u}function l5(u,p){switch(Kt(cf,p),Kt(lf,u),Kt(Wa,of),u=p.nodeType,u){case 9:case 11:p=(p=p.documentElement)?p.namespaceURI:wd(null,"");break;default:u=u===8?p.parentNode:p,p=u.namespaceURI||null,u=u.tagName,p=wd(p,u)}sn(Wa),Kt(Wa,p)}function Wd(){sn(Wa),sn(lf),sn(cf)}function B4(u){lc(cf.current);var p=lc(Wa.current),b=wd(p,u.type);p!==b&&(Kt(lf,u),Kt(Wa,b))}function c5(u){lf.current===u&&(sn(Wa),sn(lf))}var Un=Go(0);function R0(u){for(var p=u;p!==null;){if(p.tag===13){var b=p.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||b.data==="$?"||b.data==="$!"))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var d5=[];function u5(){for(var u=0;u<d5.length;u++)d5[u]._workInProgressVersionPrimary=null;d5.length=0}var D0=S.ReactCurrentDispatcher,h5=S.ReactCurrentBatchConfig,cc=0,bn=null,Hn=null,Jn=null,j0=!1,df=!1,uf=0,DB=0;function Ur(){throw Error(n(321))}function f5(u,p){if(p===null)return!1;for(var b=0;b<p.length&&b<u.length;b++)if(!aa(u[b],p[b]))return!1;return!0}function p5(u,p,b,E,k,L){if(cc=L,bn=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,D0.current=u===null||u.memoizedState===null?OB:FB,u=b(E,k),df){L=0;do{if(df=!1,uf=0,25<=L)throw Error(n(301));L+=1,Jn=Hn=null,p.updateQueue=null,D0.current=BB,u=b(E,k)}while(df)}if(D0.current=O0,p=Hn!==null&&Hn.next!==null,cc=0,Jn=Hn=bn=null,j0=!1,p)throw Error(n(300));return u}function m5(){var u=uf!==0;return uf=0,u}function Xa(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jn===null?bn.memoizedState=Jn=u:Jn=Jn.next=u,Jn}function Ri(){if(Hn===null){var u=bn.alternate;u=u!==null?u.memoizedState:null}else u=Hn.next;var p=Jn===null?bn.memoizedState:Jn.next;if(p!==null)Jn=p,Hn=u;else{if(u===null)throw Error(n(310));Hn=u,u={memoizedState:Hn.memoizedState,baseState:Hn.baseState,baseQueue:Hn.baseQueue,queue:Hn.queue,next:null},Jn===null?bn.memoizedState=Jn=u:Jn=Jn.next=u}return Jn}function hf(u,p){return typeof p=="function"?p(u):p}function g5(u){var p=Ri(),b=p.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=u;var E=Hn,k=E.baseQueue,L=b.pending;if(L!==null){if(k!==null){var O=k.next;k.next=L.next,L.next=O}E.baseQueue=k=L,b.pending=null}if(k!==null){L=k.next,E=E.baseState;var K=O=null,Q=null,le=L;do{var me=le.lane;if((cc&me)===me)Q!==null&&(Q=Q.next={lane:0,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),E=le.hasEagerState?le.eagerState:u(E,le.action);else{var ve={lane:me,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null};Q===null?(K=Q=ve,O=E):Q=Q.next=ve,bn.lanes|=me,dc|=me}le=le.next}while(le!==null&&le!==L);Q===null?O=E:Q.next=K,aa(E,p.memoizedState)||(Gr=!0),p.memoizedState=E,p.baseState=O,p.baseQueue=Q,b.lastRenderedState=E}if(u=b.interleaved,u!==null){k=u;do L=k.lane,bn.lanes|=L,dc|=L,k=k.next;while(k!==u)}else k===null&&(b.lanes=0);return[p.memoizedState,b.dispatch]}function U5(u){var p=Ri(),b=p.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=u;var E=b.dispatch,k=b.pending,L=p.memoizedState;if(k!==null){b.pending=null;var O=k=k.next;do L=u(L,O.action),O=O.next;while(O!==k);aa(L,p.memoizedState)||(Gr=!0),p.memoizedState=L,p.baseQueue===null&&(p.baseState=L),b.lastRenderedState=L}return[L,E]}function $4(){}function z4(u,p){var b=bn,E=Ri(),k=p(),L=!aa(E.memoizedState,k);if(L&&(E.memoizedState=k,Gr=!0),E=E.queue,b5(X4.bind(null,b,E,u),[u]),E.getSnapshot!==p||L||Jn!==null&&Jn.memoizedState.tag&1){if(b.flags|=2048,ff(9,W4.bind(null,b,E,k,p),void 0,null),er===null)throw Error(n(349));(cc&30)!==0||H4(b,p,k)}return k}function H4(u,p,b){u.flags|=16384,u={getSnapshot:p,value:b},p=bn.updateQueue,p===null?(p={lastEffect:null,stores:null},bn.updateQueue=p,p.stores=[u]):(b=p.stores,b===null?p.stores=[u]:b.push(u))}function W4(u,p,b,E){p.value=b,p.getSnapshot=E,V4(p)&&Y4(u)}function X4(u,p,b){return b(function(){V4(p)&&Y4(u)})}function V4(u){var p=u.getSnapshot;u=u.value;try{var b=p();return!aa(u,b)}catch{return!0}}function Y4(u){var p=zs(u,1);p!==null&&da(p,u,1,-1)}function G4(u){var p=Xa();return typeof u=="function"&&(u=u()),p.memoizedState=p.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hf,lastRenderedState:u},p.queue=u,u=u.dispatch=NB.bind(null,bn,u),[p.memoizedState,u]}function ff(u,p,b,E){return u={tag:u,create:p,destroy:b,deps:E,next:null},p=bn.updateQueue,p===null?(p={lastEffect:null,stores:null},bn.updateQueue=p,p.lastEffect=u.next=u):(b=p.lastEffect,b===null?p.lastEffect=u.next=u:(E=b.next,b.next=u,u.next=E,p.lastEffect=u)),u}function q4(){return Ri().memoizedState}function P0(u,p,b,E){var k=Xa();bn.flags|=u,k.memoizedState=ff(1|p,b,void 0,E===void 0?null:E)}function N0(u,p,b,E){var k=Ri();E=E===void 0?null:E;var L=void 0;if(Hn!==null){var O=Hn.memoizedState;if(L=O.destroy,E!==null&&f5(E,O.deps)){k.memoizedState=ff(p,b,L,E);return}}bn.flags|=u,k.memoizedState=ff(1|p,b,L,E)}function Z4(u,p){return P0(8390656,8,u,p)}function b5(u,p){return N0(2048,8,u,p)}function K4(u,p){return N0(4,2,u,p)}function Q4(u,p){return N0(4,4,u,p)}function J4(u,p){if(typeof p=="function")return u=u(),p(u),function(){p(null)};if(p!=null)return u=u(),p.current=u,function(){p.current=null}}function e9(u,p,b){return b=b!=null?b.concat([u]):null,N0(4,4,J4.bind(null,p,u),b)}function y5(){}function t9(u,p){var b=Ri();p=p===void 0?null:p;var E=b.memoizedState;return E!==null&&p!==null&&f5(p,E[1])?E[0]:(b.memoizedState=[u,p],u)}function n9(u,p){var b=Ri();p=p===void 0?null:p;var E=b.memoizedState;return E!==null&&p!==null&&f5(p,E[1])?E[0]:(u=u(),b.memoizedState=[u,p],u)}function r9(u,p,b){return(cc&21)===0?(u.baseState&&(u.baseState=!1,Gr=!0),u.memoizedState=b):(aa(b,p)||(b=Rx(),bn.lanes|=b,dc|=b,u.baseState=!0),p)}function jB(u,p){var b=zt;zt=b!==0&&4>b?b:4,u(!0);var E=h5.transition;h5.transition={};try{u(!1),p()}finally{zt=b,h5.transition=E}}function i9(){return Ri().memoizedState}function PB(u,p,b){var E=nl(u);if(b={lane:E,action:b,hasEagerState:!1,eagerState:null,next:null},a9(u))s9(p,b);else if(b=P4(u,p,b,E),b!==null){var k=Rr();da(b,u,E,k),o9(b,p,E)}}function NB(u,p,b){var E=nl(u),k={lane:E,action:b,hasEagerState:!1,eagerState:null,next:null};if(a9(u))s9(p,k);else{var L=u.alternate;if(u.lanes===0&&(L===null||L.lanes===0)&&(L=p.lastRenderedReducer,L!==null))try{var O=p.lastRenderedState,K=L(O,b);if(k.hasEagerState=!0,k.eagerState=K,aa(K,O)){var Q=p.interleaved;Q===null?(k.next=k,s5(p)):(k.next=Q.next,Q.next=k),p.interleaved=k;return}}catch{}finally{}b=P4(u,p,k,E),b!==null&&(k=Rr(),da(b,u,E,k),o9(b,p,E))}}function a9(u){var p=u.alternate;return u===bn||p!==null&&p===bn}function s9(u,p){df=j0=!0;var b=u.pending;b===null?p.next=p:(p.next=b.next,b.next=p),u.pending=p}function o9(u,p,b){if((b&4194240)!==0){var E=p.lanes;E&=u.pendingLanes,b|=E,p.lanes=b,x6(u,b)}}var O0={readContext:Li,useCallback:Ur,useContext:Ur,useEffect:Ur,useImperativeHandle:Ur,useInsertionEffect:Ur,useLayoutEffect:Ur,useMemo:Ur,useReducer:Ur,useRef:Ur,useState:Ur,useDebugValue:Ur,useDeferredValue:Ur,useTransition:Ur,useMutableSource:Ur,useSyncExternalStore:Ur,useId:Ur,unstable_isNewReconciler:!1},OB={readContext:Li,useCallback:function(u,p){return Xa().memoizedState=[u,p===void 0?null:p],u},useContext:Li,useEffect:Z4,useImperativeHandle:function(u,p,b){return b=b!=null?b.concat([u]):null,P0(4194308,4,J4.bind(null,p,u),b)},useLayoutEffect:function(u,p){return P0(4194308,4,u,p)},useInsertionEffect:function(u,p){return P0(4,2,u,p)},useMemo:function(u,p){var b=Xa();return p=p===void 0?null:p,u=u(),b.memoizedState=[u,p],u},useReducer:function(u,p,b){var E=Xa();return p=b!==void 0?b(p):p,E.memoizedState=E.baseState=p,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:p},E.queue=u,u=u.dispatch=PB.bind(null,bn,u),[E.memoizedState,u]},useRef:function(u){var p=Xa();return u={current:u},p.memoizedState=u},useState:G4,useDebugValue:y5,useDeferredValue:function(u){return Xa().memoizedState=u},useTransition:function(){var u=G4(!1),p=u[0];return u=jB.bind(null,u[1]),Xa().memoizedState=u,[p,u]},useMutableSource:function(){},useSyncExternalStore:function(u,p,b){var E=bn,k=Xa();if(cn){if(b===void 0)throw Error(n(407));b=b()}else{if(b=p(),er===null)throw Error(n(349));(cc&30)!==0||H4(E,p,b)}k.memoizedState=b;var L={value:b,getSnapshot:p};return k.queue=L,Z4(X4.bind(null,E,L,u),[u]),E.flags|=2048,ff(9,W4.bind(null,E,L,b,p),void 0,null),b},useId:function(){var u=Xa(),p=er.identifierPrefix;if(cn){var b=$s,E=Bs;b=(E&~(1<<32-ia(E)-1)).toString(32)+b,p=":"+p+"R"+b,b=uf++,0<b&&(p+="H"+b.toString(32)),p+=":"}else b=DB++,p=":"+p+"r"+b.toString(32)+":";return u.memoizedState=p},unstable_isNewReconciler:!1},FB={readContext:Li,useCallback:t9,useContext:Li,useEffect:b5,useImperativeHandle:e9,useInsertionEffect:K4,useLayoutEffect:Q4,useMemo:n9,useReducer:g5,useRef:q4,useState:function(){return g5(hf)},useDebugValue:y5,useDeferredValue:function(u){var p=Ri();return r9(p,Hn.memoizedState,u)},useTransition:function(){var u=g5(hf)[0],p=Ri().memoizedState;return[u,p]},useMutableSource:$4,useSyncExternalStore:z4,useId:i9,unstable_isNewReconciler:!1},BB={readContext:Li,useCallback:t9,useContext:Li,useEffect:b5,useImperativeHandle:e9,useInsertionEffect:K4,useLayoutEffect:Q4,useMemo:n9,useReducer:U5,useRef:q4,useState:function(){return U5(hf)},useDebugValue:y5,useDeferredValue:function(u){var p=Ri();return Hn===null?p.memoizedState=u:r9(p,Hn.memoizedState,u)},useTransition:function(){var u=U5(hf)[0],p=Ri().memoizedState;return[u,p]},useMutableSource:$4,useSyncExternalStore:z4,useId:i9,unstable_isNewReconciler:!1};function oa(u,p){if(u&&u.defaultProps){p=Z({},p),u=u.defaultProps;for(var b in u)p[b]===void 0&&(p[b]=u[b]);return p}return p}function v5(u,p,b,E){p=u.memoizedState,b=b(E,p),b=b==null?p:Z({},p,b),u.memoizedState=b,u.lanes===0&&(u.updateQueue.baseState=b)}var F0={isMounted:function(u){return(u=u._reactInternals)?$a(u)===u:!1},enqueueSetState:function(u,p,b){u=u._reactInternals;var E=Rr(),k=nl(u),L=Hs(E,k);L.payload=p,b!=null&&(L.callback=b),p=Qo(u,L,k),p!==null&&(da(p,u,k,E),A0(p,u,k))},enqueueReplaceState:function(u,p,b){u=u._reactInternals;var E=Rr(),k=nl(u),L=Hs(E,k);L.tag=1,L.payload=p,b!=null&&(L.callback=b),p=Qo(u,L,k),p!==null&&(da(p,u,k,E),A0(p,u,k))},enqueueForceUpdate:function(u,p){u=u._reactInternals;var b=Rr(),E=nl(u),k=Hs(b,E);k.tag=2,p!=null&&(k.callback=p),p=Qo(u,k,E),p!==null&&(da(p,u,E,b),A0(p,u,E))}};function l9(u,p,b,E,k,L,O){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(E,L,O):p.prototype&&p.prototype.isPureReactComponent?!Qh(b,E)||!Qh(k,L):!0}function c9(u,p,b){var E=!1,k=qo,L=p.contextType;return typeof L=="object"&&L!==null?L=Li(L):(k=Yr(p)?ic:gr.current,E=p.contextTypes,L=(E=E!=null)?Nd(u,k):qo),p=new p(b,L),u.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=F0,u.stateNode=p,p._reactInternals=u,E&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=k,u.__reactInternalMemoizedMaskedChildContext=L),p}function d9(u,p,b,E){u=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(b,E),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(b,E),p.state!==u&&F0.enqueueReplaceState(p,p.state,null)}function x5(u,p,b,E){var k=u.stateNode;k.props=b,k.state=u.memoizedState,k.refs={},o5(u);var L=p.contextType;typeof L=="object"&&L!==null?k.context=Li(L):(L=Yr(p)?ic:gr.current,k.context=Nd(u,L)),k.state=u.memoizedState,L=p.getDerivedStateFromProps,typeof L=="function"&&(v5(u,p,L,b),k.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(p=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),p!==k.state&&F0.enqueueReplaceState(k,k.state,null),L0(u,b,k,E),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308)}function Xd(u,p){try{var b="",E=p;do b+=fe(E),E=E.return;while(E);var k=b}catch(L){k=`
|
|
40
|
+
Error generating stack: `+L.message+`
|
|
41
|
+
`+L.stack}return{value:u,source:p,stack:k,digest:null}}function w5(u,p,b){return{value:u,source:null,stack:b??null,digest:p??null}}function E5(u,p){try{console.error(p.value)}catch(b){setTimeout(function(){throw b})}}var $B=typeof WeakMap=="function"?WeakMap:Map;function u9(u,p,b){b=Hs(-1,b),b.tag=3,b.payload={element:null};var E=p.value;return b.callback=function(){V0||(V0=!0,O5=E),E5(u,p)},b}function h9(u,p,b){b=Hs(-1,b),b.tag=3;var E=u.type.getDerivedStateFromError;if(typeof E=="function"){var k=p.value;b.payload=function(){return E(k)},b.callback=function(){E5(u,p)}}var L=u.stateNode;return L!==null&&typeof L.componentDidCatch=="function"&&(b.callback=function(){E5(u,p),typeof E!="function"&&(el===null?el=new Set([this]):el.add(this));var O=p.stack;this.componentDidCatch(p.value,{componentStack:O!==null?O:""})}),b}function f9(u,p,b){var E=u.pingCache;if(E===null){E=u.pingCache=new $B;var k=new Set;E.set(p,k)}else k=E.get(p),k===void 0&&(k=new Set,E.set(p,k));k.has(b)||(k.add(b),u=t$.bind(null,u,p,b),p.then(u,u))}function p9(u){do{var p;if((p=u.tag===13)&&(p=u.memoizedState,p=p!==null?p.dehydrated!==null:!0),p)return u;u=u.return}while(u!==null);return null}function m9(u,p,b,E,k){return(u.mode&1)===0?(u===p?u.flags|=65536:(u.flags|=128,b.flags|=131072,b.flags&=-52805,b.tag===1&&(b.alternate===null?b.tag=17:(p=Hs(-1,1),p.tag=2,Qo(b,p,1))),b.lanes|=1),u):(u.flags|=65536,u.lanes=k,u)}var zB=S.ReactCurrentOwner,Gr=!1;function Lr(u,p,b,E){p.child=u===null?j4(p,null,b,E):$d(p,u.child,b,E)}function g9(u,p,b,E,k){b=b.render;var L=p.ref;return Hd(p,k),E=p5(u,p,b,E,L,k),b=m5(),u!==null&&!Gr?(p.updateQueue=u.updateQueue,p.flags&=-2053,u.lanes&=~k,Ws(u,p,k)):(cn&&b&&K6(p),p.flags|=1,Lr(u,p,E,k),p.child)}function U9(u,p,b,E,k){if(u===null){var L=b.type;return typeof L=="function"&&!X5(L)&&L.defaultProps===void 0&&b.compare===null&&b.defaultProps===void 0?(p.tag=15,p.type=L,b9(u,p,L,E,k)):(u=Q0(b.type,null,E,p,p.mode,k),u.ref=p.ref,u.return=p,p.child=u)}if(L=u.child,(u.lanes&k)===0){var O=L.memoizedProps;if(b=b.compare,b=b!==null?b:Qh,b(O,E)&&u.ref===p.ref)return Ws(u,p,k)}return p.flags|=1,u=il(L,E),u.ref=p.ref,u.return=p,p.child=u}function b9(u,p,b,E,k){if(u!==null){var L=u.memoizedProps;if(Qh(L,E)&&u.ref===p.ref)if(Gr=!1,p.pendingProps=E=L,(u.lanes&k)!==0)(u.flags&131072)!==0&&(Gr=!0);else return p.lanes=u.lanes,Ws(u,p,k)}return C5(u,p,b,E,k)}function y9(u,p,b){var E=p.pendingProps,k=E.children,L=u!==null?u.memoizedState:null;if(E.mode==="hidden")if((p.mode&1)===0)p.memoizedState={baseLanes:0,cachePool:null,transitions:null},Kt(Yd,mi),mi|=b;else{if((b&1073741824)===0)return u=L!==null?L.baseLanes|b:b,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:u,cachePool:null,transitions:null},p.updateQueue=null,Kt(Yd,mi),mi|=u,null;p.memoizedState={baseLanes:0,cachePool:null,transitions:null},E=L!==null?L.baseLanes:b,Kt(Yd,mi),mi|=E}else L!==null?(E=L.baseLanes|b,p.memoizedState=null):E=b,Kt(Yd,mi),mi|=E;return Lr(u,p,k,b),p.child}function v9(u,p){var b=p.ref;(u===null&&b!==null||u!==null&&u.ref!==b)&&(p.flags|=512,p.flags|=2097152)}function C5(u,p,b,E,k){var L=Yr(b)?ic:gr.current;return L=Nd(p,L),Hd(p,k),b=p5(u,p,b,E,L,k),E=m5(),u!==null&&!Gr?(p.updateQueue=u.updateQueue,p.flags&=-2053,u.lanes&=~k,Ws(u,p,k)):(cn&&E&&K6(p),p.flags|=1,Lr(u,p,b,k),p.child)}function x9(u,p,b,E,k){if(Yr(b)){var L=!0;E0(p)}else L=!1;if(Hd(p,k),p.stateNode===null)$0(u,p),c9(p,b,E),x5(p,b,E,k),E=!0;else if(u===null){var O=p.stateNode,K=p.memoizedProps;O.props=K;var Q=O.context,le=b.contextType;typeof le=="object"&&le!==null?le=Li(le):(le=Yr(b)?ic:gr.current,le=Nd(p,le));var me=b.getDerivedStateFromProps,ve=typeof me=="function"||typeof O.getSnapshotBeforeUpdate=="function";ve||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(K!==E||Q!==le)&&d9(p,O,E,le),Ko=!1;var pe=p.memoizedState;O.state=pe,L0(p,E,O,k),Q=p.memoizedState,K!==E||pe!==Q||Vr.current||Ko?(typeof me=="function"&&(v5(p,b,me,E),Q=p.memoizedState),(K=Ko||l9(p,b,K,E,pe,Q,le))?(ve||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(p.flags|=4194308)):(typeof O.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=E,p.memoizedState=Q),O.props=E,O.state=Q,O.context=le,E=K):(typeof O.componentDidMount=="function"&&(p.flags|=4194308),E=!1)}else{O=p.stateNode,N4(u,p),K=p.memoizedProps,le=p.type===p.elementType?K:oa(p.type,K),O.props=le,ve=p.pendingProps,pe=O.context,Q=b.contextType,typeof Q=="object"&&Q!==null?Q=Li(Q):(Q=Yr(b)?ic:gr.current,Q=Nd(p,Q));var Ne=b.getDerivedStateFromProps;(me=typeof Ne=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(K!==ve||pe!==Q)&&d9(p,O,E,Q),Ko=!1,pe=p.memoizedState,O.state=pe,L0(p,E,O,k);var $e=p.memoizedState;K!==ve||pe!==$e||Vr.current||Ko?(typeof Ne=="function"&&(v5(p,b,Ne,E),$e=p.memoizedState),(le=Ko||l9(p,b,le,E,pe,$e,Q)||!1)?(me||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(E,$e,Q),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(E,$e,Q)),typeof O.componentDidUpdate=="function"&&(p.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof O.componentDidUpdate!="function"||K===u.memoizedProps&&pe===u.memoizedState||(p.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||K===u.memoizedProps&&pe===u.memoizedState||(p.flags|=1024),p.memoizedProps=E,p.memoizedState=$e),O.props=E,O.state=$e,O.context=Q,E=le):(typeof O.componentDidUpdate!="function"||K===u.memoizedProps&&pe===u.memoizedState||(p.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||K===u.memoizedProps&&pe===u.memoizedState||(p.flags|=1024),E=!1)}return S5(u,p,b,E,L,k)}function S5(u,p,b,E,k,L){v9(u,p);var O=(p.flags&128)!==0;if(!E&&!O)return k&&_4(p,b,!1),Ws(u,p,L);E=p.stateNode,zB.current=p;var K=O&&typeof b.getDerivedStateFromError!="function"?null:E.render();return p.flags|=1,u!==null&&O?(p.child=$d(p,u.child,null,L),p.child=$d(p,null,K,L)):Lr(u,p,K,L),p.memoizedState=E.state,k&&_4(p,b,!0),p.child}function w9(u){var p=u.stateNode;p.pendingContext?C4(u,p.pendingContext,p.pendingContext!==p.context):p.context&&C4(u,p.context,!1),l5(u,p.containerInfo)}function E9(u,p,b,E,k){return Bd(),t5(k),p.flags|=256,Lr(u,p,b,E),p.child}var _5={dehydrated:null,treeContext:null,retryLane:0};function k5(u){return{baseLanes:u,cachePool:null,transitions:null}}function C9(u,p,b){var E=p.pendingProps,k=Un.current,L=!1,O=(p.flags&128)!==0,K;if((K=O)||(K=u!==null&&u.memoizedState===null?!1:(k&2)!==0),K?(L=!0,p.flags&=-129):(u===null||u.memoizedState!==null)&&(k|=1),Kt(Un,k&1),u===null)return e5(p),u=p.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?((p.mode&1)===0?p.lanes=1:u.data==="$!"?p.lanes=8:p.lanes=1073741824,null):(O=E.children,u=E.fallback,L?(E=p.mode,L=p.child,O={mode:"hidden",children:O},(E&1)===0&&L!==null?(L.childLanes=0,L.pendingProps=O):L=J0(O,E,0,null),u=pc(u,E,b,null),L.return=p,u.return=p,L.sibling=u,p.child=L,p.child.memoizedState=k5(b),p.memoizedState=_5,u):T5(p,O));if(k=u.memoizedState,k!==null&&(K=k.dehydrated,K!==null))return HB(u,p,O,E,K,k,b);if(L){L=E.fallback,O=p.mode,k=u.child,K=k.sibling;var Q={mode:"hidden",children:E.children};return(O&1)===0&&p.child!==k?(E=p.child,E.childLanes=0,E.pendingProps=Q,p.deletions=null):(E=il(k,Q),E.subtreeFlags=k.subtreeFlags&14680064),K!==null?L=il(K,L):(L=pc(L,O,b,null),L.flags|=2),L.return=p,E.return=p,E.sibling=L,p.child=E,E=L,L=p.child,O=u.child.memoizedState,O=O===null?k5(b):{baseLanes:O.baseLanes|b,cachePool:null,transitions:O.transitions},L.memoizedState=O,L.childLanes=u.childLanes&~b,p.memoizedState=_5,E}return L=u.child,u=L.sibling,E=il(L,{mode:"visible",children:E.children}),(p.mode&1)===0&&(E.lanes=b),E.return=p,E.sibling=null,u!==null&&(b=p.deletions,b===null?(p.deletions=[u],p.flags|=16):b.push(u)),p.child=E,p.memoizedState=null,E}function T5(u,p){return p=J0({mode:"visible",children:p},u.mode,0,null),p.return=u,u.child=p}function B0(u,p,b,E){return E!==null&&t5(E),$d(p,u.child,null,b),u=T5(p,p.pendingProps.children),u.flags|=2,p.memoizedState=null,u}function HB(u,p,b,E,k,L,O){if(b)return p.flags&256?(p.flags&=-257,E=w5(Error(n(422))),B0(u,p,O,E)):p.memoizedState!==null?(p.child=u.child,p.flags|=128,null):(L=E.fallback,k=p.mode,E=J0({mode:"visible",children:E.children},k,0,null),L=pc(L,k,O,null),L.flags|=2,E.return=p,L.return=p,E.sibling=L,p.child=E,(p.mode&1)!==0&&$d(p,u.child,null,O),p.child.memoizedState=k5(O),p.memoizedState=_5,L);if((p.mode&1)===0)return B0(u,p,O,null);if(k.data==="$!"){if(E=k.nextSibling&&k.nextSibling.dataset,E)var K=E.dgst;return E=K,L=Error(n(419)),E=w5(L,E,void 0),B0(u,p,O,E)}if(K=(O&u.childLanes)!==0,Gr||K){if(E=er,E!==null){switch(O&-O){case 4:k=2;break;case 16:k=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:k=32;break;case 536870912:k=268435456;break;default:k=0}k=(k&(E.suspendedLanes|O))!==0?0:k,k!==0&&k!==L.retryLane&&(L.retryLane=k,zs(u,k),da(E,u,k,-1))}return W5(),E=w5(Error(n(421))),B0(u,p,O,E)}return k.data==="$?"?(p.flags|=128,p.child=u.child,p=n$.bind(null,u),k._reactRetry=p,null):(u=L.treeContext,pi=Yo(k.nextSibling),fi=p,cn=!0,sa=null,u!==null&&(Ii[Ai++]=Bs,Ii[Ai++]=$s,Ii[Ai++]=ac,Bs=u.id,$s=u.overflow,ac=p),p=T5(p,E.children),p.flags|=4096,p)}function S9(u,p,b){u.lanes|=p;var E=u.alternate;E!==null&&(E.lanes|=p),a5(u.return,p,b)}function M5(u,p,b,E,k){var L=u.memoizedState;L===null?u.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:E,tail:b,tailMode:k}:(L.isBackwards=p,L.rendering=null,L.renderingStartTime=0,L.last=E,L.tail=b,L.tailMode=k)}function _9(u,p,b){var E=p.pendingProps,k=E.revealOrder,L=E.tail;if(Lr(u,p,E.children,b),E=Un.current,(E&2)!==0)E=E&1|2,p.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=p.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&S9(u,b,p);else if(u.tag===19)S9(u,b,p);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===p)break e;for(;u.sibling===null;){if(u.return===null||u.return===p)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}E&=1}if(Kt(Un,E),(p.mode&1)===0)p.memoizedState=null;else switch(k){case"forwards":for(b=p.child,k=null;b!==null;)u=b.alternate,u!==null&&R0(u)===null&&(k=b),b=b.sibling;b=k,b===null?(k=p.child,p.child=null):(k=b.sibling,b.sibling=null),M5(p,!1,k,b,L);break;case"backwards":for(b=null,k=p.child,p.child=null;k!==null;){if(u=k.alternate,u!==null&&R0(u)===null){p.child=k;break}u=k.sibling,k.sibling=b,b=k,k=u}M5(p,!0,b,null,L);break;case"together":M5(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function $0(u,p){(p.mode&1)===0&&u!==null&&(u.alternate=null,p.alternate=null,p.flags|=2)}function Ws(u,p,b){if(u!==null&&(p.dependencies=u.dependencies),dc|=p.lanes,(b&p.childLanes)===0)return null;if(u!==null&&p.child!==u.child)throw Error(n(153));if(p.child!==null){for(u=p.child,b=il(u,u.pendingProps),p.child=b,b.return=p;u.sibling!==null;)u=u.sibling,b=b.sibling=il(u,u.pendingProps),b.return=p;b.sibling=null}return p.child}function WB(u,p,b){switch(p.tag){case 3:w9(p),Bd();break;case 5:B4(p);break;case 1:Yr(p.type)&&E0(p);break;case 4:l5(p,p.stateNode.containerInfo);break;case 10:var E=p.type._context,k=p.memoizedProps.value;Kt(M0,E._currentValue),E._currentValue=k;break;case 13:if(E=p.memoizedState,E!==null)return E.dehydrated!==null?(Kt(Un,Un.current&1),p.flags|=128,null):(b&p.child.childLanes)!==0?C9(u,p,b):(Kt(Un,Un.current&1),u=Ws(u,p,b),u!==null?u.sibling:null);Kt(Un,Un.current&1);break;case 19:if(E=(b&p.childLanes)!==0,(u.flags&128)!==0){if(E)return _9(u,p,b);p.flags|=128}if(k=p.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Kt(Un,Un.current),E)break;return null;case 22:case 23:return p.lanes=0,y9(u,p,b)}return Ws(u,p,b)}var k9,I5,T9,M9;k9=function(u,p){for(var b=p.child;b!==null;){if(b.tag===5||b.tag===6)u.appendChild(b.stateNode);else if(b.tag!==4&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===p)break;for(;b.sibling===null;){if(b.return===null||b.return===p)return;b=b.return}b.sibling.return=b.return,b=b.sibling}},I5=function(){},T9=function(u,p,b,E){var k=u.memoizedProps;if(k!==E){u=p.stateNode,lc(Wa.current);var L=null;switch(b){case"input":k=Ut(u,k),E=Ut(u,E),L=[];break;case"select":k=Z({},k,{value:void 0}),E=Z({},E,{value:void 0}),L=[];break;case"textarea":k=Ah(u,k),E=Ah(u,E),L=[];break;default:typeof k.onClick!="function"&&typeof E.onClick=="function"&&(u.onclick=v0)}Ql(b,E);var O;b=null;for(le in k)if(!E.hasOwnProperty(le)&&k.hasOwnProperty(le)&&k[le]!=null)if(le==="style"){var K=k[le];for(O in K)K.hasOwnProperty(O)&&(b||(b={}),b[O]="")}else le!=="dangerouslySetInnerHTML"&&le!=="children"&&le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&le!=="autoFocus"&&(i.hasOwnProperty(le)?L||(L=[]):(L=L||[]).push(le,null));for(le in E){var Q=E[le];if(K=k!=null?k[le]:void 0,E.hasOwnProperty(le)&&Q!==K&&(Q!=null||K!=null))if(le==="style")if(K){for(O in K)!K.hasOwnProperty(O)||Q&&Q.hasOwnProperty(O)||(b||(b={}),b[O]="");for(O in Q)Q.hasOwnProperty(O)&&K[O]!==Q[O]&&(b||(b={}),b[O]=Q[O])}else b||(L||(L=[]),L.push(le,b)),b=Q;else le==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,K=K?K.__html:void 0,Q!=null&&K!==Q&&(L=L||[]).push(le,Q)):le==="children"?typeof Q!="string"&&typeof Q!="number"||(L=L||[]).push(le,""+Q):le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&(i.hasOwnProperty(le)?(Q!=null&&le==="onScroll"&&an("scroll",u),L||K===Q||(L=[])):(L=L||[]).push(le,Q))}b&&(L=L||[]).push("style",b);var le=L;(p.updateQueue=le)&&(p.flags|=4)}},M9=function(u,p,b,E){b!==E&&(p.flags|=4)};function pf(u,p){if(!cn)switch(u.tailMode){case"hidden":p=u.tail;for(var b=null;p!==null;)p.alternate!==null&&(b=p),p=p.sibling;b===null?u.tail=null:b.sibling=null;break;case"collapsed":b=u.tail;for(var E=null;b!==null;)b.alternate!==null&&(E=b),b=b.sibling;E===null?p||u.tail===null?u.tail=null:u.tail.sibling=null:E.sibling=null}}function br(u){var p=u.alternate!==null&&u.alternate.child===u.child,b=0,E=0;if(p)for(var k=u.child;k!==null;)b|=k.lanes|k.childLanes,E|=k.subtreeFlags&14680064,E|=k.flags&14680064,k.return=u,k=k.sibling;else for(k=u.child;k!==null;)b|=k.lanes|k.childLanes,E|=k.subtreeFlags,E|=k.flags,k.return=u,k=k.sibling;return u.subtreeFlags|=E,u.childLanes=b,p}function XB(u,p,b){var E=p.pendingProps;switch(Q6(p),p.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return br(p),null;case 1:return Yr(p.type)&&w0(),br(p),null;case 3:return E=p.stateNode,Wd(),sn(Vr),sn(gr),u5(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(u===null||u.child===null)&&(k0(p)?p.flags|=4:u===null||u.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,sa!==null&&($5(sa),sa=null))),I5(u,p),br(p),null;case 5:c5(p);var k=lc(cf.current);if(b=p.type,u!==null&&p.stateNode!=null)T9(u,p,b,E,k),u.ref!==p.ref&&(p.flags|=512,p.flags|=2097152);else{if(!E){if(p.stateNode===null)throw Error(n(166));return br(p),null}if(u=lc(Wa.current),k0(p)){E=p.stateNode,b=p.type;var L=p.memoizedProps;switch(E[Ha]=p,E[rf]=L,u=(p.mode&1)!==0,b){case"dialog":an("cancel",E),an("close",E);break;case"iframe":case"object":case"embed":an("load",E);break;case"video":case"audio":for(k=0;k<ef.length;k++)an(ef[k],E);break;case"source":an("error",E);break;case"img":case"image":case"link":an("error",E),an("load",E);break;case"details":an("toggle",E);break;case"input":Pe(E,L),an("invalid",E);break;case"select":E._wrapperState={wasMultiple:!!L.multiple},an("invalid",E);break;case"textarea":xd(E,L),an("invalid",E)}Ql(b,L),k=null;for(var O in L)if(L.hasOwnProperty(O)){var K=L[O];O==="children"?typeof K=="string"?E.textContent!==K&&(L.suppressHydrationWarning!==!0&&y0(E.textContent,K,u),k=["children",K]):typeof K=="number"&&E.textContent!==""+K&&(L.suppressHydrationWarning!==!0&&y0(E.textContent,K,u),k=["children",""+K]):i.hasOwnProperty(O)&&K!=null&&O==="onScroll"&&an("scroll",E)}switch(b){case"input":de(E),zn(E,L,!0);break;case"textarea":de(E),Rs(E);break;case"select":case"option":break;default:typeof L.onClick=="function"&&(E.onclick=v0)}E=k,p.updateQueue=E,E!==null&&(p.flags|=4)}else{O=k.nodeType===9?k:k.ownerDocument,u==="http://www.w3.org/1999/xhtml"&&(u=Ds(b)),u==="http://www.w3.org/1999/xhtml"?b==="script"?(u=O.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild)):typeof E.is=="string"?u=O.createElement(b,{is:E.is}):(u=O.createElement(b),b==="select"&&(O=u,E.multiple?O.multiple=!0:E.size&&(O.size=E.size))):u=O.createElementNS(u,b),u[Ha]=p,u[rf]=E,k9(u,p,!1,!1),p.stateNode=u;e:{switch(O=Jl(b,E),b){case"dialog":an("cancel",u),an("close",u),k=E;break;case"iframe":case"object":case"embed":an("load",u),k=E;break;case"video":case"audio":for(k=0;k<ef.length;k++)an(ef[k],u);k=E;break;case"source":an("error",u),k=E;break;case"img":case"image":case"link":an("error",u),an("load",u),k=E;break;case"details":an("toggle",u),k=E;break;case"input":Pe(u,E),k=Ut(u,E),an("invalid",u);break;case"option":k=E;break;case"select":u._wrapperState={wasMultiple:!!E.multiple},k=Z({},E,{value:void 0}),an("invalid",u);break;case"textarea":xd(u,E),k=Ah(u,E),an("invalid",u);break;default:k=E}Ql(b,k),K=k;for(L in K)if(K.hasOwnProperty(L)){var Q=K[L];L==="style"?Ti(u,Q):L==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&Lh(u,Q)):L==="children"?typeof Q=="string"?(b!=="textarea"||Q!=="")&&js(u,Q):typeof Q=="number"&&js(u,""+Q):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(i.hasOwnProperty(L)?Q!=null&&L==="onScroll"&&an("scroll",u):Q!=null&&C(u,L,Q,O))}switch(b){case"input":de(u),zn(u,E,!1);break;case"textarea":de(u),Rs(u);break;case"option":E.value!=null&&u.setAttribute("value",""+ye(E.value));break;case"select":u.multiple=!!E.multiple,L=E.value,L!=null?Wr(u,!!E.multiple,L,!1):E.defaultValue!=null&&Wr(u,!!E.multiple,E.defaultValue,!0);break;default:typeof k.onClick=="function"&&(u.onclick=v0)}switch(b){case"button":case"input":case"select":case"textarea":E=!!E.autoFocus;break e;case"img":E=!0;break e;default:E=!1}}E&&(p.flags|=4)}p.ref!==null&&(p.flags|=512,p.flags|=2097152)}return br(p),null;case 6:if(u&&p.stateNode!=null)M9(u,p,u.memoizedProps,E);else{if(typeof E!="string"&&p.stateNode===null)throw Error(n(166));if(b=lc(cf.current),lc(Wa.current),k0(p)){if(E=p.stateNode,b=p.memoizedProps,E[Ha]=p,(L=E.nodeValue!==b)&&(u=fi,u!==null))switch(u.tag){case 3:y0(E.nodeValue,b,(u.mode&1)!==0);break;case 5:u.memoizedProps.suppressHydrationWarning!==!0&&y0(E.nodeValue,b,(u.mode&1)!==0)}L&&(p.flags|=4)}else E=(b.nodeType===9?b:b.ownerDocument).createTextNode(E),E[Ha]=p,p.stateNode=E}return br(p),null;case 13:if(sn(Un),E=p.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(cn&&pi!==null&&(p.mode&1)!==0&&(p.flags&128)===0)L4(),Bd(),p.flags|=98560,L=!1;else if(L=k0(p),E!==null&&E.dehydrated!==null){if(u===null){if(!L)throw Error(n(318));if(L=p.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(n(317));L[Ha]=p}else Bd(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;br(p),L=!1}else sa!==null&&($5(sa),sa=null),L=!0;if(!L)return p.flags&65536?p:null}return(p.flags&128)!==0?(p.lanes=b,p):(E=E!==null,E!==(u!==null&&u.memoizedState!==null)&&E&&(p.child.flags|=8192,(p.mode&1)!==0&&(u===null||(Un.current&1)!==0?Wn===0&&(Wn=3):W5())),p.updateQueue!==null&&(p.flags|=4),br(p),null);case 4:return Wd(),I5(u,p),u===null&&tf(p.stateNode.containerInfo),br(p),null;case 10:return i5(p.type._context),br(p),null;case 17:return Yr(p.type)&&w0(),br(p),null;case 19:if(sn(Un),L=p.memoizedState,L===null)return br(p),null;if(E=(p.flags&128)!==0,O=L.rendering,O===null)if(E)pf(L,!1);else{if(Wn!==0||u!==null&&(u.flags&128)!==0)for(u=p.child;u!==null;){if(O=R0(u),O!==null){for(p.flags|=128,pf(L,!1),E=O.updateQueue,E!==null&&(p.updateQueue=E,p.flags|=4),p.subtreeFlags=0,E=b,b=p.child;b!==null;)L=b,u=E,L.flags&=14680066,O=L.alternate,O===null?(L.childLanes=0,L.lanes=u,L.child=null,L.subtreeFlags=0,L.memoizedProps=null,L.memoizedState=null,L.updateQueue=null,L.dependencies=null,L.stateNode=null):(L.childLanes=O.childLanes,L.lanes=O.lanes,L.child=O.child,L.subtreeFlags=0,L.deletions=null,L.memoizedProps=O.memoizedProps,L.memoizedState=O.memoizedState,L.updateQueue=O.updateQueue,L.type=O.type,u=O.dependencies,L.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),b=b.sibling;return Kt(Un,Un.current&1|2),p.child}u=u.sibling}L.tail!==null&&vt()>Gd&&(p.flags|=128,E=!0,pf(L,!1),p.lanes=4194304)}else{if(!E)if(u=R0(O),u!==null){if(p.flags|=128,E=!0,b=u.updateQueue,b!==null&&(p.updateQueue=b,p.flags|=4),pf(L,!0),L.tail===null&&L.tailMode==="hidden"&&!O.alternate&&!cn)return br(p),null}else 2*vt()-L.renderingStartTime>Gd&&b!==1073741824&&(p.flags|=128,E=!0,pf(L,!1),p.lanes=4194304);L.isBackwards?(O.sibling=p.child,p.child=O):(b=L.last,b!==null?b.sibling=O:p.child=O,L.last=O)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=vt(),p.sibling=null,b=Un.current,Kt(Un,E?b&1|2:b&1),p):(br(p),null);case 22:case 23:return H5(),E=p.memoizedState!==null,u!==null&&u.memoizedState!==null!==E&&(p.flags|=8192),E&&(p.mode&1)!==0?(mi&1073741824)!==0&&(br(p),p.subtreeFlags&6&&(p.flags|=8192)):br(p),null;case 24:return null;case 25:return null}throw Error(n(156,p.tag))}function VB(u,p){switch(Q6(p),p.tag){case 1:return Yr(p.type)&&w0(),u=p.flags,u&65536?(p.flags=u&-65537|128,p):null;case 3:return Wd(),sn(Vr),sn(gr),u5(),u=p.flags,(u&65536)!==0&&(u&128)===0?(p.flags=u&-65537|128,p):null;case 5:return c5(p),null;case 13:if(sn(Un),u=p.memoizedState,u!==null&&u.dehydrated!==null){if(p.alternate===null)throw Error(n(340));Bd()}return u=p.flags,u&65536?(p.flags=u&-65537|128,p):null;case 19:return sn(Un),null;case 4:return Wd(),null;case 10:return i5(p.type._context),null;case 22:case 23:return H5(),null;case 24:return null;default:return null}}var z0=!1,yr=!1,YB=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Vd(u,p){var b=u.ref;if(b!==null)if(typeof b=="function")try{b(null)}catch(E){Sn(u,p,E)}else b.current=null}function A5(u,p,b){try{b()}catch(E){Sn(u,p,E)}}var I9=!1;function GB(u,p){if(H6=l0,u=l4(),j6(u)){if("selectionStart"in u)var b={start:u.selectionStart,end:u.selectionEnd};else e:{b=(b=u.ownerDocument)&&b.defaultView||window;var E=b.getSelection&&b.getSelection();if(E&&E.rangeCount!==0){b=E.anchorNode;var k=E.anchorOffset,L=E.focusNode;E=E.focusOffset;try{b.nodeType,L.nodeType}catch{b=null;break e}var O=0,K=-1,Q=-1,le=0,me=0,ve=u,pe=null;t:for(;;){for(var Ne;ve!==b||k!==0&&ve.nodeType!==3||(K=O+k),ve!==L||E!==0&&ve.nodeType!==3||(Q=O+E),ve.nodeType===3&&(O+=ve.nodeValue.length),(Ne=ve.firstChild)!==null;)pe=ve,ve=Ne;for(;;){if(ve===u)break t;if(pe===b&&++le===k&&(K=O),pe===L&&++me===E&&(Q=O),(Ne=ve.nextSibling)!==null)break;ve=pe,pe=ve.parentNode}ve=Ne}b=K===-1||Q===-1?null:{start:K,end:Q}}else b=null}b=b||{start:0,end:0}}else b=null;for(W6={focusedElem:u,selectionRange:b},l0=!1,Oe=p;Oe!==null;)if(p=Oe,u=p.child,(p.subtreeFlags&1028)!==0&&u!==null)u.return=p,Oe=u;else for(;Oe!==null;){p=Oe;try{var $e=p.alternate;if((p.flags&1024)!==0)switch(p.tag){case 0:case 11:case 15:break;case 1:if($e!==null){var We=$e.memoizedProps,In=$e.memoizedState,ie=p.stateNode,J=ie.getSnapshotBeforeUpdate(p.elementType===p.type?We:oa(p.type,We),In);ie.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var ae=p.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){Sn(p,p.return,Ce)}if(u=p.sibling,u!==null){u.return=p.return,Oe=u;break}Oe=p.return}return $e=I9,I9=!1,$e}function mf(u,p,b){var E=p.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var k=E=E.next;do{if((k.tag&u)===u){var L=k.destroy;k.destroy=void 0,L!==void 0&&A5(p,b,L)}k=k.next}while(k!==E)}}function H0(u,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var b=p=p.next;do{if((b.tag&u)===u){var E=b.create;b.destroy=E()}b=b.next}while(b!==p)}}function L5(u){var p=u.ref;if(p!==null){var b=u.stateNode;switch(u.tag){case 5:u=b;break;default:u=b}typeof p=="function"?p(u):p.current=u}}function A9(u){var p=u.alternate;p!==null&&(u.alternate=null,A9(p)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(p=u.stateNode,p!==null&&(delete p[Ha],delete p[rf],delete p[G6],delete p[IB],delete p[AB])),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function L9(u){return u.tag===5||u.tag===3||u.tag===4}function R9(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||L9(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function R5(u,p,b){var E=u.tag;if(E===5||E===6)u=u.stateNode,p?b.nodeType===8?b.parentNode.insertBefore(u,p):b.insertBefore(u,p):(b.nodeType===8?(p=b.parentNode,p.insertBefore(u,b)):(p=b,p.appendChild(u)),b=b._reactRootContainer,b!=null||p.onclick!==null||(p.onclick=v0));else if(E!==4&&(u=u.child,u!==null))for(R5(u,p,b),u=u.sibling;u!==null;)R5(u,p,b),u=u.sibling}function D5(u,p,b){var E=u.tag;if(E===5||E===6)u=u.stateNode,p?b.insertBefore(u,p):b.appendChild(u);else if(E!==4&&(u=u.child,u!==null))for(D5(u,p,b),u=u.sibling;u!==null;)D5(u,p,b),u=u.sibling}var dr=null,la=!1;function Jo(u,p,b){for(b=b.child;b!==null;)D9(u,p,b),b=b.sibling}function D9(u,p,b){if(za&&typeof za.onCommitFiberUnmount=="function")try{za.onCommitFiberUnmount(n0,b)}catch{}switch(b.tag){case 5:yr||Vd(b,p);case 6:var E=dr,k=la;dr=null,Jo(u,p,b),dr=E,la=k,dr!==null&&(la?(u=dr,b=b.stateNode,u.nodeType===8?u.parentNode.removeChild(b):u.removeChild(b)):dr.removeChild(b.stateNode));break;case 18:dr!==null&&(la?(u=dr,b=b.stateNode,u.nodeType===8?Y6(u.parentNode,b):u.nodeType===1&&Y6(u,b),Vh(u)):Y6(dr,b.stateNode));break;case 4:E=dr,k=la,dr=b.stateNode.containerInfo,la=!0,Jo(u,p,b),dr=E,la=k;break;case 0:case 11:case 14:case 15:if(!yr&&(E=b.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){k=E=E.next;do{var L=k,O=L.destroy;L=L.tag,O!==void 0&&((L&2)!==0||(L&4)!==0)&&A5(b,p,O),k=k.next}while(k!==E)}Jo(u,p,b);break;case 1:if(!yr&&(Vd(b,p),E=b.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=b.memoizedProps,E.state=b.memoizedState,E.componentWillUnmount()}catch(K){Sn(b,p,K)}Jo(u,p,b);break;case 21:Jo(u,p,b);break;case 22:b.mode&1?(yr=(E=yr)||b.memoizedState!==null,Jo(u,p,b),yr=E):Jo(u,p,b);break;default:Jo(u,p,b)}}function j9(u){var p=u.updateQueue;if(p!==null){u.updateQueue=null;var b=u.stateNode;b===null&&(b=u.stateNode=new YB),p.forEach(function(E){var k=r$.bind(null,u,E);b.has(E)||(b.add(E),E.then(k,k))})}}function ca(u,p){var b=p.deletions;if(b!==null)for(var E=0;E<b.length;E++){var k=b[E];try{var L=u,O=p,K=O;e:for(;K!==null;){switch(K.tag){case 5:dr=K.stateNode,la=!1;break e;case 3:dr=K.stateNode.containerInfo,la=!0;break e;case 4:dr=K.stateNode.containerInfo,la=!0;break e}K=K.return}if(dr===null)throw Error(n(160));D9(L,O,k),dr=null,la=!1;var Q=k.alternate;Q!==null&&(Q.return=null),k.return=null}catch(le){Sn(k,p,le)}}if(p.subtreeFlags&12854)for(p=p.child;p!==null;)P9(p,u),p=p.sibling}function P9(u,p){var b=u.alternate,E=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(ca(p,u),Va(u),E&4){try{mf(3,u,u.return),H0(3,u)}catch(We){Sn(u,u.return,We)}try{mf(5,u,u.return)}catch(We){Sn(u,u.return,We)}}break;case 1:ca(p,u),Va(u),E&512&&b!==null&&Vd(b,b.return);break;case 5:if(ca(p,u),Va(u),E&512&&b!==null&&Vd(b,b.return),u.flags&32){var k=u.stateNode;try{js(k,"")}catch(We){Sn(u,u.return,We)}}if(E&4&&(k=u.stateNode,k!=null)){var L=u.memoizedProps,O=b!==null?b.memoizedProps:L,K=u.type,Q=u.updateQueue;if(u.updateQueue=null,Q!==null)try{K==="input"&&L.type==="radio"&&L.name!=null&&bt(k,L),Jl(K,O);var le=Jl(K,L);for(O=0;O<Q.length;O+=2){var me=Q[O],ve=Q[O+1];me==="style"?Ti(k,ve):me==="dangerouslySetInnerHTML"?Lh(k,ve):me==="children"?js(k,ve):C(k,me,ve,le)}switch(K){case"input":Tt(k,L);break;case"textarea":jo(k,L);break;case"select":var pe=k._wrapperState.wasMultiple;k._wrapperState.wasMultiple=!!L.multiple;var Ne=L.value;Ne!=null?Wr(k,!!L.multiple,Ne,!1):pe!==!!L.multiple&&(L.defaultValue!=null?Wr(k,!!L.multiple,L.defaultValue,!0):Wr(k,!!L.multiple,L.multiple?[]:"",!1))}k[rf]=L}catch(We){Sn(u,u.return,We)}}break;case 6:if(ca(p,u),Va(u),E&4){if(u.stateNode===null)throw Error(n(162));k=u.stateNode,L=u.memoizedProps;try{k.nodeValue=L}catch(We){Sn(u,u.return,We)}}break;case 3:if(ca(p,u),Va(u),E&4&&b!==null&&b.memoizedState.isDehydrated)try{Vh(p.containerInfo)}catch(We){Sn(u,u.return,We)}break;case 4:ca(p,u),Va(u);break;case 13:ca(p,u),Va(u),k=u.child,k.flags&8192&&(L=k.memoizedState!==null,k.stateNode.isHidden=L,!L||k.alternate!==null&&k.alternate.memoizedState!==null||(N5=vt())),E&4&&j9(u);break;case 22:if(me=b!==null&&b.memoizedState!==null,u.mode&1?(yr=(le=yr)||me,ca(p,u),yr=le):ca(p,u),Va(u),E&8192){if(le=u.memoizedState!==null,(u.stateNode.isHidden=le)&&!me&&(u.mode&1)!==0)for(Oe=u,me=u.child;me!==null;){for(ve=Oe=me;Oe!==null;){switch(pe=Oe,Ne=pe.child,pe.tag){case 0:case 11:case 14:case 15:mf(4,pe,pe.return);break;case 1:Vd(pe,pe.return);var $e=pe.stateNode;if(typeof $e.componentWillUnmount=="function"){E=pe,b=pe.return;try{p=E,$e.props=p.memoizedProps,$e.state=p.memoizedState,$e.componentWillUnmount()}catch(We){Sn(E,b,We)}}break;case 5:Vd(pe,pe.return);break;case 22:if(pe.memoizedState!==null){F9(ve);continue}}Ne!==null?(Ne.return=pe,Oe=Ne):F9(ve)}me=me.sibling}e:for(me=null,ve=u;;){if(ve.tag===5){if(me===null){me=ve;try{k=ve.stateNode,le?(L=k.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none"):(K=ve.stateNode,Q=ve.memoizedProps.style,O=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,K.style.display=Kl("display",O))}catch(We){Sn(u,u.return,We)}}}else if(ve.tag===6){if(me===null)try{ve.stateNode.nodeValue=le?"":ve.memoizedProps}catch(We){Sn(u,u.return,We)}}else if((ve.tag!==22&&ve.tag!==23||ve.memoizedState===null||ve===u)&&ve.child!==null){ve.child.return=ve,ve=ve.child;continue}if(ve===u)break e;for(;ve.sibling===null;){if(ve.return===null||ve.return===u)break e;me===ve&&(me=null),ve=ve.return}me===ve&&(me=null),ve.sibling.return=ve.return,ve=ve.sibling}}break;case 19:ca(p,u),Va(u),E&4&&j9(u);break;case 21:break;default:ca(p,u),Va(u)}}function Va(u){var p=u.flags;if(p&2){try{e:{for(var b=u.return;b!==null;){if(L9(b)){var E=b;break e}b=b.return}throw Error(n(160))}switch(E.tag){case 5:var k=E.stateNode;E.flags&32&&(js(k,""),E.flags&=-33);var L=R9(u);D5(u,L,k);break;case 3:case 4:var O=E.stateNode.containerInfo,K=R9(u);R5(u,K,O);break;default:throw Error(n(161))}}catch(Q){Sn(u,u.return,Q)}u.flags&=-3}p&4096&&(u.flags&=-4097)}function qB(u,p,b){Oe=u,N9(u)}function N9(u,p,b){for(var E=(u.mode&1)!==0;Oe!==null;){var k=Oe,L=k.child;if(k.tag===22&&E){var O=k.memoizedState!==null||z0;if(!O){var K=k.alternate,Q=K!==null&&K.memoizedState!==null||yr;K=z0;var le=yr;if(z0=O,(yr=Q)&&!le)for(Oe=k;Oe!==null;)O=Oe,Q=O.child,O.tag===22&&O.memoizedState!==null?B9(k):Q!==null?(Q.return=O,Oe=Q):B9(k);for(;L!==null;)Oe=L,N9(L),L=L.sibling;Oe=k,z0=K,yr=le}O9(u)}else(k.subtreeFlags&8772)!==0&&L!==null?(L.return=k,Oe=L):O9(u)}}function O9(u){for(;Oe!==null;){var p=Oe;if((p.flags&8772)!==0){var b=p.alternate;try{if((p.flags&8772)!==0)switch(p.tag){case 0:case 11:case 15:yr||H0(5,p);break;case 1:var E=p.stateNode;if(p.flags&4&&!yr)if(b===null)E.componentDidMount();else{var k=p.elementType===p.type?b.memoizedProps:oa(p.type,b.memoizedProps);E.componentDidUpdate(k,b.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var L=p.updateQueue;L!==null&&F4(p,L,E);break;case 3:var O=p.updateQueue;if(O!==null){if(b=null,p.child!==null)switch(p.child.tag){case 5:b=p.child.stateNode;break;case 1:b=p.child.stateNode}F4(p,O,b)}break;case 5:var K=p.stateNode;if(b===null&&p.flags&4){b=K;var Q=p.memoizedProps;switch(p.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&b.focus();break;case"img":Q.src&&(b.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(p.memoizedState===null){var le=p.alternate;if(le!==null){var me=le.memoizedState;if(me!==null){var ve=me.dehydrated;ve!==null&&Vh(ve)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yr||p.flags&512&&L5(p)}catch(pe){Sn(p,p.return,pe)}}if(p===u){Oe=null;break}if(b=p.sibling,b!==null){b.return=p.return,Oe=b;break}Oe=p.return}}function F9(u){for(;Oe!==null;){var p=Oe;if(p===u){Oe=null;break}var b=p.sibling;if(b!==null){b.return=p.return,Oe=b;break}Oe=p.return}}function B9(u){for(;Oe!==null;){var p=Oe;try{switch(p.tag){case 0:case 11:case 15:var b=p.return;try{H0(4,p)}catch(Q){Sn(p,b,Q)}break;case 1:var E=p.stateNode;if(typeof E.componentDidMount=="function"){var k=p.return;try{E.componentDidMount()}catch(Q){Sn(p,k,Q)}}var L=p.return;try{L5(p)}catch(Q){Sn(p,L,Q)}break;case 5:var O=p.return;try{L5(p)}catch(Q){Sn(p,O,Q)}}}catch(Q){Sn(p,p.return,Q)}if(p===u){Oe=null;break}var K=p.sibling;if(K!==null){K.return=p.return,Oe=K;break}Oe=p.return}}var ZB=Math.ceil,W0=S.ReactCurrentDispatcher,j5=S.ReactCurrentOwner,Di=S.ReactCurrentBatchConfig,Mt=0,er=null,Dn=null,ur=0,mi=0,Yd=Go(0),Wn=0,gf=null,dc=0,X0=0,P5=0,Uf=null,qr=null,N5=0,Gd=1/0,Xs=null,V0=!1,O5=null,el=null,Y0=!1,tl=null,G0=0,bf=0,F5=null,q0=-1,Z0=0;function Rr(){return(Mt&6)!==0?vt():q0!==-1?q0:q0=vt()}function nl(u){return(u.mode&1)===0?1:(Mt&2)!==0&&ur!==0?ur&-ur:RB.transition!==null?(Z0===0&&(Z0=Rx()),Z0):(u=zt,u!==0||(u=window.event,u=u===void 0?16:zx(u.type)),u)}function da(u,p,b,E){if(50<bf)throw bf=0,F5=null,Error(n(185));$h(u,b,E),((Mt&2)===0||u!==er)&&(u===er&&((Mt&2)===0&&(X0|=b),Wn===4&&rl(u,ur)),Zr(u,E),b===1&&Mt===0&&(p.mode&1)===0&&(Gd=vt()+500,C0&&Zo()))}function Zr(u,p){var b=u.callbackNode;RF(u,p);var E=a0(u,u===er?ur:0);if(E===0)b!==null&&ze(b),u.callbackNode=null,u.callbackPriority=0;else if(p=E&-E,u.callbackPriority!==p){if(b!=null&&ze(b),p===1)u.tag===0?LB(z9.bind(null,u)):k4(z9.bind(null,u)),TB(function(){(Mt&6)===0&&Zo()}),b=null;else{switch(Dx(E)){case 1:b=Xr;break;case 4:b=Bo;break;case 16:b=Rn;break;case 536870912:b=Fh;break;default:b=Rn}b=Z9(b,$9.bind(null,u))}u.callbackPriority=p,u.callbackNode=b}}function $9(u,p){if(q0=-1,Z0=0,(Mt&6)!==0)throw Error(n(327));var b=u.callbackNode;if(qd()&&u.callbackNode!==b)return null;var E=a0(u,u===er?ur:0);if(E===0)return null;if((E&30)!==0||(E&u.expiredLanes)!==0||p)p=K0(u,E);else{p=E;var k=Mt;Mt|=2;var L=W9();(er!==u||ur!==p)&&(Xs=null,Gd=vt()+500,hc(u,p));do try{JB();break}catch(K){H9(u,K)}while(!0);r5(),W0.current=L,Mt=k,Dn!==null?p=0:(er=null,ur=0,p=Wn)}if(p!==0){if(p===2&&(k=y6(u),k!==0&&(E=k,p=B5(u,k))),p===1)throw b=gf,hc(u,0),rl(u,E),Zr(u,vt()),b;if(p===6)rl(u,E);else{if(k=u.current.alternate,(E&30)===0&&!KB(k)&&(p=K0(u,E),p===2&&(L=y6(u),L!==0&&(E=L,p=B5(u,L))),p===1))throw b=gf,hc(u,0),rl(u,E),Zr(u,vt()),b;switch(u.finishedWork=k,u.finishedLanes=E,p){case 0:case 1:throw Error(n(345));case 2:fc(u,qr,Xs);break;case 3:if(rl(u,E),(E&130023424)===E&&(p=N5+500-vt(),10<p)){if(a0(u,0)!==0)break;if(k=u.suspendedLanes,(k&E)!==E){Rr(),u.pingedLanes|=u.suspendedLanes&k;break}u.timeoutHandle=V6(fc.bind(null,u,qr,Xs),p);break}fc(u,qr,Xs);break;case 4:if(rl(u,E),(E&4194240)===E)break;for(p=u.eventTimes,k=-1;0<E;){var O=31-ia(E);L=1<<O,O=p[O],O>k&&(k=O),E&=~L}if(E=k,E=vt()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*ZB(E/1960))-E,10<E){u.timeoutHandle=V6(fc.bind(null,u,qr,Xs),E);break}fc(u,qr,Xs);break;case 5:fc(u,qr,Xs);break;default:throw Error(n(329))}}}return Zr(u,vt()),u.callbackNode===b?$9.bind(null,u):null}function B5(u,p){var b=Uf;return u.current.memoizedState.isDehydrated&&(hc(u,p).flags|=256),u=K0(u,p),u!==2&&(p=qr,qr=b,p!==null&&$5(p)),u}function $5(u){qr===null?qr=u:qr.push.apply(qr,u)}function KB(u){for(var p=u;;){if(p.flags&16384){var b=p.updateQueue;if(b!==null&&(b=b.stores,b!==null))for(var E=0;E<b.length;E++){var k=b[E],L=k.getSnapshot;k=k.value;try{if(!aa(L(),k))return!1}catch{return!1}}}if(b=p.child,p.subtreeFlags&16384&&b!==null)b.return=p,p=b;else{if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function rl(u,p){for(p&=~P5,p&=~X0,u.suspendedLanes|=p,u.pingedLanes&=~p,u=u.expirationTimes;0<p;){var b=31-ia(p),E=1<<b;u[b]=-1,p&=~E}}function z9(u){if((Mt&6)!==0)throw Error(n(327));qd();var p=a0(u,0);if((p&1)===0)return Zr(u,vt()),null;var b=K0(u,p);if(u.tag!==0&&b===2){var E=y6(u);E!==0&&(p=E,b=B5(u,E))}if(b===1)throw b=gf,hc(u,0),rl(u,p),Zr(u,vt()),b;if(b===6)throw Error(n(345));return u.finishedWork=u.current.alternate,u.finishedLanes=p,fc(u,qr,Xs),Zr(u,vt()),null}function z5(u,p){var b=Mt;Mt|=1;try{return u(p)}finally{Mt=b,Mt===0&&(Gd=vt()+500,C0&&Zo())}}function uc(u){tl!==null&&tl.tag===0&&(Mt&6)===0&&qd();var p=Mt;Mt|=1;var b=Di.transition,E=zt;try{if(Di.transition=null,zt=1,u)return u()}finally{zt=E,Di.transition=b,Mt=p,(Mt&6)===0&&Zo()}}function H5(){mi=Yd.current,sn(Yd)}function hc(u,p){u.finishedWork=null,u.finishedLanes=0;var b=u.timeoutHandle;if(b!==-1&&(u.timeoutHandle=-1,kB(b)),Dn!==null)for(b=Dn.return;b!==null;){var E=b;switch(Q6(E),E.tag){case 1:E=E.type.childContextTypes,E!=null&&w0();break;case 3:Wd(),sn(Vr),sn(gr),u5();break;case 5:c5(E);break;case 4:Wd();break;case 13:sn(Un);break;case 19:sn(Un);break;case 10:i5(E.type._context);break;case 22:case 23:H5()}b=b.return}if(er=u,Dn=u=il(u.current,null),ur=mi=p,Wn=0,gf=null,P5=X0=dc=0,qr=Uf=null,oc!==null){for(p=0;p<oc.length;p++)if(b=oc[p],E=b.interleaved,E!==null){b.interleaved=null;var k=E.next,L=b.pending;if(L!==null){var O=L.next;L.next=k,E.next=O}b.pending=E}oc=null}return u}function H9(u,p){do{var b=Dn;try{if(r5(),D0.current=O0,j0){for(var E=bn.memoizedState;E!==null;){var k=E.queue;k!==null&&(k.pending=null),E=E.next}j0=!1}if(cc=0,Jn=Hn=bn=null,df=!1,uf=0,j5.current=null,b===null||b.return===null){Wn=1,gf=p,Dn=null;break}e:{var L=u,O=b.return,K=b,Q=p;if(p=ur,K.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var le=Q,me=K,ve=me.tag;if((me.mode&1)===0&&(ve===0||ve===11||ve===15)){var pe=me.alternate;pe?(me.updateQueue=pe.updateQueue,me.memoizedState=pe.memoizedState,me.lanes=pe.lanes):(me.updateQueue=null,me.memoizedState=null)}var Ne=p9(O);if(Ne!==null){Ne.flags&=-257,m9(Ne,O,K,L,p),Ne.mode&1&&f9(L,le,p),p=Ne,Q=le;var $e=p.updateQueue;if($e===null){var We=new Set;We.add(Q),p.updateQueue=We}else $e.add(Q);break e}else{if((p&1)===0){f9(L,le,p),W5();break e}Q=Error(n(426))}}else if(cn&&K.mode&1){var In=p9(O);if(In!==null){(In.flags&65536)===0&&(In.flags|=256),m9(In,O,K,L,p),t5(Xd(Q,K));break e}}L=Q=Xd(Q,K),Wn!==4&&(Wn=2),Uf===null?Uf=[L]:Uf.push(L),L=O;do{switch(L.tag){case 3:L.flags|=65536,p&=-p,L.lanes|=p;var ie=u9(L,Q,p);O4(L,ie);break e;case 1:K=Q;var J=L.type,ae=L.stateNode;if((L.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(el===null||!el.has(ae)))){L.flags|=65536,p&=-p,L.lanes|=p;var Ce=h9(L,K,p);O4(L,Ce);break e}}L=L.return}while(L!==null)}V9(b)}catch(Xe){p=Xe,Dn===b&&b!==null&&(Dn=b=b.return);continue}break}while(!0)}function W9(){var u=W0.current;return W0.current=O0,u===null?O0:u}function W5(){(Wn===0||Wn===3||Wn===2)&&(Wn=4),er===null||(dc&268435455)===0&&(X0&268435455)===0||rl(er,ur)}function K0(u,p){var b=Mt;Mt|=2;var E=W9();(er!==u||ur!==p)&&(Xs=null,hc(u,p));do try{QB();break}catch(k){H9(u,k)}while(!0);if(r5(),Mt=b,W0.current=E,Dn!==null)throw Error(n(261));return er=null,ur=0,Wn}function QB(){for(;Dn!==null;)X9(Dn)}function JB(){for(;Dn!==null&&!Wt();)X9(Dn)}function X9(u){var p=q9(u.alternate,u,mi);u.memoizedProps=u.pendingProps,p===null?V9(u):Dn=p,j5.current=null}function V9(u){var p=u;do{var b=p.alternate;if(u=p.return,(p.flags&32768)===0){if(b=XB(b,p,mi),b!==null){Dn=b;return}}else{if(b=VB(b,p),b!==null){b.flags&=32767,Dn=b;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{Wn=6,Dn=null;return}}if(p=p.sibling,p!==null){Dn=p;return}Dn=p=u}while(p!==null);Wn===0&&(Wn=5)}function fc(u,p,b){var E=zt,k=Di.transition;try{Di.transition=null,zt=1,e$(u,p,b,E)}finally{Di.transition=k,zt=E}return null}function e$(u,p,b,E){do qd();while(tl!==null);if((Mt&6)!==0)throw Error(n(327));b=u.finishedWork;var k=u.finishedLanes;if(b===null)return null;if(u.finishedWork=null,u.finishedLanes=0,b===u.current)throw Error(n(177));u.callbackNode=null,u.callbackPriority=0;var L=b.lanes|b.childLanes;if(DF(u,L),u===er&&(Dn=er=null,ur=0),(b.subtreeFlags&2064)===0&&(b.flags&2064)===0||Y0||(Y0=!0,Z9(Rn,function(){return qd(),null})),L=(b.flags&15990)!==0,(b.subtreeFlags&15990)!==0||L){L=Di.transition,Di.transition=null;var O=zt;zt=1;var K=Mt;Mt|=4,j5.current=null,GB(u,b),P9(b,u),vB(W6),l0=!!H6,W6=H6=null,u.current=b,qB(b),Qn(),Mt=K,zt=O,Di.transition=L}else u.current=b;if(Y0&&(Y0=!1,tl=u,G0=k),L=u.pendingLanes,L===0&&(el=null),TF(b.stateNode),Zr(u,vt()),p!==null)for(E=u.onRecoverableError,b=0;b<p.length;b++)k=p[b],E(k.value,{componentStack:k.stack,digest:k.digest});if(V0)throw V0=!1,u=O5,O5=null,u;return(G0&1)!==0&&u.tag!==0&&qd(),L=u.pendingLanes,(L&1)!==0?u===F5?bf++:(bf=0,F5=u):bf=0,Zo(),null}function qd(){if(tl!==null){var u=Dx(G0),p=Di.transition,b=zt;try{if(Di.transition=null,zt=16>u?16:u,tl===null)var E=!1;else{if(u=tl,tl=null,G0=0,(Mt&6)!==0)throw Error(n(331));var k=Mt;for(Mt|=4,Oe=u.current;Oe!==null;){var L=Oe,O=L.child;if((Oe.flags&16)!==0){var K=L.deletions;if(K!==null){for(var Q=0;Q<K.length;Q++){var le=K[Q];for(Oe=le;Oe!==null;){var me=Oe;switch(me.tag){case 0:case 11:case 15:mf(8,me,L)}var ve=me.child;if(ve!==null)ve.return=me,Oe=ve;else for(;Oe!==null;){me=Oe;var pe=me.sibling,Ne=me.return;if(A9(me),me===le){Oe=null;break}if(pe!==null){pe.return=Ne,Oe=pe;break}Oe=Ne}}}var $e=L.alternate;if($e!==null){var We=$e.child;if(We!==null){$e.child=null;do{var In=We.sibling;We.sibling=null,We=In}while(We!==null)}}Oe=L}}if((L.subtreeFlags&2064)!==0&&O!==null)O.return=L,Oe=O;else e:for(;Oe!==null;){if(L=Oe,(L.flags&2048)!==0)switch(L.tag){case 0:case 11:case 15:mf(9,L,L.return)}var ie=L.sibling;if(ie!==null){ie.return=L.return,Oe=ie;break e}Oe=L.return}}var J=u.current;for(Oe=J;Oe!==null;){O=Oe;var ae=O.child;if((O.subtreeFlags&2064)!==0&&ae!==null)ae.return=O,Oe=ae;else e:for(O=J;Oe!==null;){if(K=Oe,(K.flags&2048)!==0)try{switch(K.tag){case 0:case 11:case 15:H0(9,K)}}catch(Xe){Sn(K,K.return,Xe)}if(K===O){Oe=null;break e}var Ce=K.sibling;if(Ce!==null){Ce.return=K.return,Oe=Ce;break e}Oe=K.return}}if(Mt=k,Zo(),za&&typeof za.onPostCommitFiberRoot=="function")try{za.onPostCommitFiberRoot(n0,u)}catch{}E=!0}return E}finally{zt=b,Di.transition=p}}return!1}function Y9(u,p,b){p=Xd(b,p),p=u9(u,p,1),u=Qo(u,p,1),p=Rr(),u!==null&&($h(u,1,p),Zr(u,p))}function Sn(u,p,b){if(u.tag===3)Y9(u,u,b);else for(;p!==null;){if(p.tag===3){Y9(p,u,b);break}else if(p.tag===1){var E=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(el===null||!el.has(E))){u=Xd(b,u),u=h9(p,u,1),p=Qo(p,u,1),u=Rr(),p!==null&&($h(p,1,u),Zr(p,u));break}}p=p.return}}function t$(u,p,b){var E=u.pingCache;E!==null&&E.delete(p),p=Rr(),u.pingedLanes|=u.suspendedLanes&b,er===u&&(ur&b)===b&&(Wn===4||Wn===3&&(ur&130023424)===ur&&500>vt()-N5?hc(u,0):P5|=b),Zr(u,p)}function G9(u,p){p===0&&((u.mode&1)===0?p=1:(p=i0,i0<<=1,(i0&130023424)===0&&(i0=4194304)));var b=Rr();u=zs(u,p),u!==null&&($h(u,p,b),Zr(u,b))}function n$(u){var p=u.memoizedState,b=0;p!==null&&(b=p.retryLane),G9(u,b)}function r$(u,p){var b=0;switch(u.tag){case 13:var E=u.stateNode,k=u.memoizedState;k!==null&&(b=k.retryLane);break;case 19:E=u.stateNode;break;default:throw Error(n(314))}E!==null&&E.delete(p),G9(u,b)}var q9;q9=function(u,p,b){if(u!==null)if(u.memoizedProps!==p.pendingProps||Vr.current)Gr=!0;else{if((u.lanes&b)===0&&(p.flags&128)===0)return Gr=!1,WB(u,p,b);Gr=(u.flags&131072)!==0}else Gr=!1,cn&&(p.flags&1048576)!==0&&T4(p,_0,p.index);switch(p.lanes=0,p.tag){case 2:var E=p.type;$0(u,p),u=p.pendingProps;var k=Nd(p,gr.current);Hd(p,b),k=p5(null,p,E,u,k,b);var L=m5();return p.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,Yr(E)?(L=!0,E0(p)):L=!1,p.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,o5(p),k.updater=F0,p.stateNode=k,k._reactInternals=p,x5(p,E,u,b),p=S5(null,p,E,!0,L,b)):(p.tag=0,cn&&L&&K6(p),Lr(null,p,k,b),p=p.child),p;case 16:E=p.elementType;e:{switch($0(u,p),u=p.pendingProps,k=E._init,E=k(E._payload),p.type=E,k=p.tag=a$(E),u=oa(E,u),k){case 0:p=C5(null,p,E,u,b);break e;case 1:p=x9(null,p,E,u,b);break e;case 11:p=g9(null,p,E,u,b);break e;case 14:p=U9(null,p,E,oa(E.type,u),b);break e}throw Error(n(306,E,""))}return p;case 0:return E=p.type,k=p.pendingProps,k=p.elementType===E?k:oa(E,k),C5(u,p,E,k,b);case 1:return E=p.type,k=p.pendingProps,k=p.elementType===E?k:oa(E,k),x9(u,p,E,k,b);case 3:e:{if(w9(p),u===null)throw Error(n(387));E=p.pendingProps,L=p.memoizedState,k=L.element,N4(u,p),L0(p,E,null,b);var O=p.memoizedState;if(E=O.element,L.isDehydrated)if(L={element:E,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},p.updateQueue.baseState=L,p.memoizedState=L,p.flags&256){k=Xd(Error(n(423)),p),p=E9(u,p,E,b,k);break e}else if(E!==k){k=Xd(Error(n(424)),p),p=E9(u,p,E,b,k);break e}else for(pi=Yo(p.stateNode.containerInfo.firstChild),fi=p,cn=!0,sa=null,b=j4(p,null,E,b),p.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling;else{if(Bd(),E===k){p=Ws(u,p,b);break e}Lr(u,p,E,b)}p=p.child}return p;case 5:return B4(p),u===null&&e5(p),E=p.type,k=p.pendingProps,L=u!==null?u.memoizedProps:null,O=k.children,X6(E,k)?O=null:L!==null&&X6(E,L)&&(p.flags|=32),v9(u,p),Lr(u,p,O,b),p.child;case 6:return u===null&&e5(p),null;case 13:return C9(u,p,b);case 4:return l5(p,p.stateNode.containerInfo),E=p.pendingProps,u===null?p.child=$d(p,null,E,b):Lr(u,p,E,b),p.child;case 11:return E=p.type,k=p.pendingProps,k=p.elementType===E?k:oa(E,k),g9(u,p,E,k,b);case 7:return Lr(u,p,p.pendingProps,b),p.child;case 8:return Lr(u,p,p.pendingProps.children,b),p.child;case 12:return Lr(u,p,p.pendingProps.children,b),p.child;case 10:e:{if(E=p.type._context,k=p.pendingProps,L=p.memoizedProps,O=k.value,Kt(M0,E._currentValue),E._currentValue=O,L!==null)if(aa(L.value,O)){if(L.children===k.children&&!Vr.current){p=Ws(u,p,b);break e}}else for(L=p.child,L!==null&&(L.return=p);L!==null;){var K=L.dependencies;if(K!==null){O=L.child;for(var Q=K.firstContext;Q!==null;){if(Q.context===E){if(L.tag===1){Q=Hs(-1,b&-b),Q.tag=2;var le=L.updateQueue;if(le!==null){le=le.shared;var me=le.pending;me===null?Q.next=Q:(Q.next=me.next,me.next=Q),le.pending=Q}}L.lanes|=b,Q=L.alternate,Q!==null&&(Q.lanes|=b),a5(L.return,b,p),K.lanes|=b;break}Q=Q.next}}else if(L.tag===10)O=L.type===p.type?null:L.child;else if(L.tag===18){if(O=L.return,O===null)throw Error(n(341));O.lanes|=b,K=O.alternate,K!==null&&(K.lanes|=b),a5(O,b,p),O=L.sibling}else O=L.child;if(O!==null)O.return=L;else for(O=L;O!==null;){if(O===p){O=null;break}if(L=O.sibling,L!==null){L.return=O.return,O=L;break}O=O.return}L=O}Lr(u,p,k.children,b),p=p.child}return p;case 9:return k=p.type,E=p.pendingProps.children,Hd(p,b),k=Li(k),E=E(k),p.flags|=1,Lr(u,p,E,b),p.child;case 14:return E=p.type,k=oa(E,p.pendingProps),k=oa(E.type,k),U9(u,p,E,k,b);case 15:return b9(u,p,p.type,p.pendingProps,b);case 17:return E=p.type,k=p.pendingProps,k=p.elementType===E?k:oa(E,k),$0(u,p),p.tag=1,Yr(E)?(u=!0,E0(p)):u=!1,Hd(p,b),c9(p,E,k),x5(p,E,k,b),S5(null,p,E,!0,u,b);case 19:return _9(u,p,b);case 22:return y9(u,p,b)}throw Error(n(156,p.tag))};function Z9(u,p){return Ee(u,p)}function i$(u,p,b,E){this.tag=u,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ji(u,p,b,E){return new i$(u,p,b,E)}function X5(u){return u=u.prototype,!(!u||!u.isReactComponent)}function a$(u){if(typeof u=="function")return X5(u)?1:0;if(u!=null){if(u=u.$$typeof,u===F)return 11;if(u===W)return 14}return 2}function il(u,p){var b=u.alternate;return b===null?(b=ji(u.tag,p,u.key,u.mode),b.elementType=u.elementType,b.type=u.type,b.stateNode=u.stateNode,b.alternate=u,u.alternate=b):(b.pendingProps=p,b.type=u.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=u.flags&14680064,b.childLanes=u.childLanes,b.lanes=u.lanes,b.child=u.child,b.memoizedProps=u.memoizedProps,b.memoizedState=u.memoizedState,b.updateQueue=u.updateQueue,p=u.dependencies,b.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},b.sibling=u.sibling,b.index=u.index,b.ref=u.ref,b}function Q0(u,p,b,E,k,L){var O=2;if(E=u,typeof u=="function")X5(u)&&(O=1);else if(typeof u=="string")O=5;else e:switch(u){case _:return pc(b.children,k,L,p);case R:O=8,k|=8;break;case P:return u=ji(12,b,p,k|2),u.elementType=P,u.lanes=L,u;case B:return u=ji(13,b,p,k),u.elementType=B,u.lanes=L,u;case G:return u=ji(19,b,p,k),u.elementType=G,u.lanes=L,u;case $:return J0(b,k,L,p);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case j:O=10;break e;case N:O=9;break e;case F:O=11;break e;case W:O=14;break e;case X:O=16,E=null;break e}throw Error(n(130,u==null?u:typeof u,""))}return p=ji(O,b,p,k),p.elementType=u,p.type=E,p.lanes=L,p}function pc(u,p,b,E){return u=ji(7,u,E,p),u.lanes=b,u}function J0(u,p,b,E){return u=ji(22,u,E,p),u.elementType=$,u.lanes=b,u.stateNode={isHidden:!1},u}function V5(u,p,b){return u=ji(6,u,null,p),u.lanes=b,u}function Y5(u,p,b){return p=ji(4,u.children!==null?u.children:[],u.key,p),p.lanes=b,p.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},p}function s$(u,p,b,E,k){this.tag=p,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v6(0),this.expirationTimes=v6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v6(0),this.identifierPrefix=E,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function G5(u,p,b,E,k,L,O,K,Q){return u=new s$(u,p,b,K,Q),p===1?(p=1,L===!0&&(p|=8)):p=0,L=ji(3,null,null,p),u.current=L,L.stateNode=u,L.memoizedState={element:E,isDehydrated:b,cache:null,transitions:null,pendingSuspenseBoundaries:null},o5(L),u}function o$(u,p,b){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:E==null?null:""+E,children:u,containerInfo:p,implementation:b}}function K9(u){if(!u)return qo;u=u._reactInternals;e:{if($a(u)!==u||u.tag!==1)throw Error(n(170));var p=u;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(Yr(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(n(171))}if(u.tag===1){var b=u.type;if(Yr(b))return S4(u,b,p)}return p}function Q9(u,p,b,E,k,L,O,K,Q){return u=G5(b,E,!0,u,k,L,O,K,Q),u.context=K9(null),b=u.current,E=Rr(),k=nl(b),L=Hs(E,k),L.callback=p??null,Qo(b,L,k),u.current.lanes=k,$h(u,k,E),Zr(u,E),u}function em(u,p,b,E){var k=p.current,L=Rr(),O=nl(k);return b=K9(b),p.context===null?p.context=b:p.pendingContext=b,p=Hs(L,O),p.payload={element:u},E=E===void 0?null:E,E!==null&&(p.callback=E),u=Qo(k,p,O),u!==null&&(da(u,k,O,L),A0(u,k,O)),O}function tm(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return u.child.stateNode;default:return u.child.stateNode}}function J9(u,p){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var b=u.retryLane;u.retryLane=b!==0&&b<p?b:p}}function q5(u,p){J9(u,p),(u=u.alternate)&&J9(u,p)}function l$(){return null}var ew=typeof reportError=="function"?reportError:function(u){console.error(u)};function Z5(u){this._internalRoot=u}nm.prototype.render=Z5.prototype.render=function(u){var p=this._internalRoot;if(p===null)throw Error(n(409));em(u,p,null,null)},nm.prototype.unmount=Z5.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var p=u.containerInfo;uc(function(){em(null,u,null,null)}),p[Os]=null}};function nm(u){this._internalRoot=u}nm.prototype.unstable_scheduleHydration=function(u){if(u){var p=Nx();u={blockedOn:null,target:u,priority:p};for(var b=0;b<Wo.length&&p!==0&&p<Wo[b].priority;b++);Wo.splice(b,0,u),b===0&&Bx(u)}};function K5(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function rm(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11&&(u.nodeType!==8||u.nodeValue!==" react-mount-point-unstable "))}function tw(){}function c$(u,p,b,E,k){if(k){if(typeof E=="function"){var L=E;E=function(){var le=tm(O);L.call(le)}}var O=Q9(p,E,u,0,null,!1,!1,"",tw);return u._reactRootContainer=O,u[Os]=O.current,tf(u.nodeType===8?u.parentNode:u),uc(),O}for(;k=u.lastChild;)u.removeChild(k);if(typeof E=="function"){var K=E;E=function(){var le=tm(Q);K.call(le)}}var Q=G5(u,0,!1,null,null,!1,!1,"",tw);return u._reactRootContainer=Q,u[Os]=Q.current,tf(u.nodeType===8?u.parentNode:u),uc(function(){em(p,Q,b,E)}),Q}function im(u,p,b,E,k){var L=b._reactRootContainer;if(L){var O=L;if(typeof k=="function"){var K=k;k=function(){var Q=tm(O);K.call(Q)}}em(p,O,u,k)}else O=c$(b,p,u,k,E);return tm(O)}jx=function(u){switch(u.tag){case 3:var p=u.stateNode;if(p.current.memoizedState.isDehydrated){var b=Bh(p.pendingLanes);b!==0&&(x6(p,b|1),Zr(p,vt()),(Mt&6)===0&&(Gd=vt()+500,Zo()))}break;case 13:uc(function(){var E=zs(u,1);if(E!==null){var k=Rr();da(E,u,1,k)}}),q5(u,1)}},w6=function(u){if(u.tag===13){var p=zs(u,134217728);if(p!==null){var b=Rr();da(p,u,134217728,b)}q5(u,134217728)}},Px=function(u){if(u.tag===13){var p=nl(u),b=zs(u,p);if(b!==null){var E=Rr();da(b,u,p,E)}q5(u,p)}},Nx=function(){return zt},Ox=function(u,p){var b=zt;try{return zt=u,p()}finally{zt=b}},Dh=function(u,p,b){switch(p){case"input":if(Tt(u,b),p=b.name,b.type==="radio"&&p!=null){for(b=u;b.parentNode;)b=b.parentNode;for(b=b.querySelectorAll("input[name="+JSON.stringify(""+p)+'][type="radio"]'),p=0;p<b.length;p++){var E=b[p];if(E!==u&&E.form===u.form){var k=x0(E);if(!k)throw Error(n(90));Te(E),Tt(E,k)}}}break;case"textarea":jo(u,b);break;case"select":p=b.value,p!=null&&Wr(u,!!b.multiple,p,!1)}},Cd=z5,Ph=uc;var d$={usingClientEntryPoint:!1,Events:[af,jd,x0,K1,jh,z5]},yf={findFiberByHostInstance:rc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},u$={bundleType:yf.bundleType,version:yf.version,rendererPackageName:yf.rendererPackageName,rendererConfig:yf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(u){return u=Ve(u),u===null?null:u.stateNode},findFiberByHostInstance:yf.findFiberByHostInstance||l$,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var am=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!am.isDisabled&&am.supportsFiber)try{n0=am.inject(u$),za=am}catch{}}return Kr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d$,Kr.createPortal=function(u,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K5(p))throw Error(n(200));return o$(u,p,null,b)},Kr.createRoot=function(u,p){if(!K5(u))throw Error(n(299));var b=!1,E="",k=ew;return p!=null&&(p.unstable_strictMode===!0&&(b=!0),p.identifierPrefix!==void 0&&(E=p.identifierPrefix),p.onRecoverableError!==void 0&&(k=p.onRecoverableError)),p=G5(u,1,!1,null,null,b,!1,E,k),u[Os]=p.current,tf(u.nodeType===8?u.parentNode:u),new Z5(p)},Kr.findDOMNode=function(u){if(u==null)return null;if(u.nodeType===1)return u;var p=u._reactInternals;if(p===void 0)throw typeof u.render=="function"?Error(n(188)):(u=Object.keys(u).join(","),Error(n(268,u)));return u=Ve(p),u=u===null?null:u.stateNode,u},Kr.flushSync=function(u){return uc(u)},Kr.hydrate=function(u,p,b){if(!rm(p))throw Error(n(200));return im(null,u,p,!0,b)},Kr.hydrateRoot=function(u,p,b){if(!K5(u))throw Error(n(405));var E=b!=null&&b.hydratedSources||null,k=!1,L="",O=ew;if(b!=null&&(b.unstable_strictMode===!0&&(k=!0),b.identifierPrefix!==void 0&&(L=b.identifierPrefix),b.onRecoverableError!==void 0&&(O=b.onRecoverableError)),p=Q9(p,null,u,1,b??null,k,!1,L,O),u[Os]=p.current,tf(u),E)for(u=0;u<E.length;u++)b=E[u],k=b._getVersion,k=k(b._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[b,k]:p.mutableSourceEagerHydrationData.push(b,k);return new nm(p)},Kr.render=function(u,p,b){if(!rm(p))throw Error(n(200));return im(null,u,p,!1,b)},Kr.unmountComponentAtNode=function(u){if(!rm(u))throw Error(n(40));return u._reactRootContainer?(uc(function(){im(null,null,u,!1,function(){u._reactRootContainer=null,u[Os]=null})}),!0):!1},Kr.unstable_batchedUpdates=z5,Kr.unstable_renderSubtreeIntoContainer=function(u,p,b,E){if(!rm(b))throw Error(n(200));if(u==null||u._reactInternals===void 0)throw Error(n(38));return im(u,p,b,!1,E)},Kr.version="18.3.1-next-f1338f8080-20240426",Kr}var cw;function PT(){if(cw)return eb.exports;cw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),eb.exports=y$(),eb.exports}var dw;function v$(){if(dw)return sm;dw=1;var e=PT();return sm.createRoot=e.createRoot,sm.hydrateRoot=e.hydrateRoot,sm}var x$=v$();const w$=ta(x$),E$="modulepreload",C$=function(e,t){return new URL(e,t).href},uw={},ge=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(l){return Promise.all(l.map(h=>Promise.resolve(h).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=s(n.map(l=>{if(l=C$(l,r),l in uw)return;uw[l]=!0;const h=l.endsWith(".css"),f=h?'[rel="stylesheet"]':"";if(!!r)for(let y=o.length-1;y>=0;y--){const v=o[y];if(v.href===l&&(!h||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${f}`))return;const U=document.createElement("link");if(U.rel=h?"stylesheet":E$,h||(U.as="script"),U.crossOrigin="",U.href=l,d&&U.setAttribute("nonce",d),document.head.appendChild(U),h)return new Promise((y,v)=>{U.addEventListener("load",y),U.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return t().catch(a)})};var dt={VITE_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",VITE_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",VITE_APP_LIBRARY_URL:"https://libraries.excalidraw.com",VITE_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",VITE_APP_PLUS_LP:"https://plus.excalidraw.com",VITE_APP_PLUS_APP:"https://app.excalidraw.com",VITE_APP_AI_BACKEND:"https://oss-ai.excalidraw.com",VITE_APP_WS_SERVER_URL:"https://oss-collab.excalidraw.com",VITE_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',VITE_APP_ENABLE_TRACKING:"false",VITE_APP_PLUS_EXPORT_PUBLIC_KEY:`MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQ0jM9Qz8TdFLzcuAZZX
|
|
42
|
+
/WvuKSOJxiw6AR/ZcE3eFQWM/mbFdhQgyK8eHGkKQifKzH1xUZjCxyXcxW6ZO02t
|
|
43
|
+
kPOPxhz+nxUrIoWCD/V4NGmUA1lxwHuO21HN1gzKrN3xHg5EGjyouR9vibT9VDGF
|
|
44
|
+
gq6+4Ic/kJX+AD2MM7Yre2+FsOdysrmuW2Fu3ahuC1uQE7pOe1j0k7auNP0y1q53
|
|
45
|
+
PrB8Ts2LUpepWC1l7zIXFm4ViDULuyWXTEpUcHSsEH8vpd1tckjypxCwkipfZsXx
|
|
46
|
+
iPszy0o0Dx2iArPfWMXlFAI9mvyFCyFC3+nSvfyAUb2C4uZgCwAuyFh/ydPF4DEE
|
|
47
|
+
PQIDAQAB`,VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX:"false",VITE_APP_COLLAPSE_OVERLAY:"false",VITE_APP_ENABLE_ESLINT:"false",PKG_NAME:"@excalidraw/excalidraw",PKG_VERSION:"0.18.0",PROD:!0},NT=Object.defineProperty,S$=(e,t,n)=>t in e?NT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hxe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),_$=e=>t=>{var n=e[t];if(n)return n();throw new Error("Module not found in bundle: "+t)},OT=(e,t)=>{for(var n in t)NT(e,n,{get:t[n],enumerable:!0})},z=(e,t,n)=>(S$(e,typeof t!="symbol"?t+"":t,n),n),rb={},hw;function FT(){return hw||(hw=1,function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="0.3.0";function n(){for(var d=0,l=new Array(256),h=0;h!=256;++h)d=h,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,l[h]=d;return typeof Int32Array<"u"?new Int32Array(l):l}var r=n(),i=typeof Buffer<"u";function a(d){if(d.length>32768&&i)return o(new Buffer(d));for(var l=-1,h=d.length-1,f=0;f<h;)l=r[(l^d.charCodeAt(f++))&255]^l>>>8,l=r[(l^d.charCodeAt(f++))&255]^l>>>8;return f===h&&(l=l>>>8^r[(l^d.charCodeAt(f))&255]),l^-1}function s(d){if(d.length>1e4)return o(d);for(var l=-1,h=0,f=d.length-3;h<f;)l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255];for(;h<f+3;)l=l>>>8^r[(l^d[h++])&255];return l^-1}function o(d){for(var l=-1,h=0,f=d.length-7;h<f;)l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255];for(;h<f+7;)l=l>>>8^r[(l^d[h++])&255];return l^-1}function c(d){for(var l=-1,h=0,f=d.length,g,U;h<f;)g=d.charCodeAt(h++),g<128?l=l>>>8^r[(l^g)&255]:g<2048?(l=l>>>8^r[(l^(192|g>>6&31))&255],l=l>>>8^r[(l^(128|g&63))&255]):g>=55296&&g<57344?(g=(g&1023)+64,U=d.charCodeAt(h++)&1023,l=l>>>8^r[(l^(240|g>>8&7))&255],l=l>>>8^r[(l^(128|g>>2&63))&255],l=l>>>8^r[(l^(128|U>>6&15|g&3))&255],l=l>>>8^r[(l^(128|U&63))&255]):(l=l>>>8^r[(l^(224|g>>12&15))&255],l=l>>>8^r[(l^(128|g>>6&63))&255],l=l>>>8^r[(l^(128|g&63))&255]);return l^-1}t.table=r,t.bstr=a,t.buf=s,t.str=c})}(rb)),rb}var ib,fw;function k$(){if(fw)return ib;fw=1;var e=FT();ib=i;var t=new Uint8Array(4),n=new Int32Array(t.buffer),r=new Uint32Array(t.buffer);function i(a){if(a[0]!==137)throw new Error("Invalid .png file header");if(a[1]!==80)throw new Error("Invalid .png file header");if(a[2]!==78)throw new Error("Invalid .png file header");if(a[3]!==71)throw new Error("Invalid .png file header");if(a[4]!==13)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(a[5]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(a[6]!==26)throw new Error("Invalid .png file header");if(a[7]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");for(var s=!1,o=[],c=8;c<a.length;){t[3]=a[c++],t[2]=a[c++],t[1]=a[c++],t[0]=a[c++];var d=r[0]+4,l=new Uint8Array(d);l[0]=a[c++],l[1]=a[c++],l[2]=a[c++],l[3]=a[c++];var h=String.fromCharCode(l[0])+String.fromCharCode(l[1])+String.fromCharCode(l[2])+String.fromCharCode(l[3]);if(!o.length&&h!=="IHDR")throw new Error("IHDR header missing");if(h==="IEND"){s=!0,o.push({name:h,data:new Uint8Array(0)});break}for(var f=4;f<d;f++)l[f]=a[c++];t[3]=a[c++],t[2]=a[c++],t[1]=a[c++],t[0]=a[c++];var g=n[0],U=e.buf(l);if(U!==g)throw new Error("CRC values for "+h+" header do not match, PNG file is likely corrupted");var y=new Uint8Array(l.buffer.slice(4));o.push({name:h,data:y})}if(!s)throw new Error(".png file ended prematurely: no IEND header was found");return o}return ib}var T$=k$();const BT=ta(T$);var om={},ab,pw;function M$(){if(pw)return ab;pw=1,ab=e;function e(t,n){if(t=String(t),n=String(n),!/^[\x00-\xFF]+$/.test(t)||!/^[\x00-\xFF]+$/.test(n))throw new Error("Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression");if(t.length>=80)throw new Error('Keyword "'+t+'" is longer than the 79-character limit imposed by the PNG specification');for(var r=t.length+n.length+1,i=new Uint8Array(r),a=0,s,o=0;o<t.length;o++){if(!(s=t.charCodeAt(o)))throw new Error("0x00 character is not permitted in tEXt keywords");i[a++]=s}i[a++]=0;for(var c=0;c<n.length;c++){if(!(s=n.charCodeAt(c)))throw new Error("0x00 character is not permitted in tEXt content");i[a++]=s}return{name:"tEXt",data:i}}return ab}var sb,mw;function I$(){if(mw)return sb;mw=1,sb=e;function e(t){t.data&&t.name&&(t=t.data);for(var n=!0,r="",i="",a=0;a<t.length;a++){var s=t[a];if(n)s?i+=String.fromCharCode(s):n=!1;else if(s)r+=String.fromCharCode(s);else throw new Error("Invalid NULL character found. 0x00 character is not permitted in tEXt content")}return{keyword:i,text:r}}return sb}var gw;function A$(){return gw||(gw=1,om.encode=M$(),om.decode=I$()),om}var L$=A$();const $T=ta(L$);var ob,Uw;function R$(){return Uw||(Uw=1,ob=function(e,t,n){var r=[],i=e.length;if(i===0)return r;var a=t<0?Math.max(0,t+i):t||0;for(n!==void 0&&(i=n<0?n+i:n);i-- >a;)r[i-a]=e[i];return r}),ob}var lb,bw;function D$(){if(bw)return lb;bw=1;var e=R$(),t=FT();lb=a;var n=new Uint8Array(4),r=new Int32Array(n.buffer),i=new Uint32Array(n.buffer);function a(s){var o=8,c=o,d;for(d=0;d<s.length;d++)o+=s[d].data.length,o+=12;var l=new Uint8Array(o);for(l[0]=137,l[1]=80,l[2]=78,l[3]=71,l[4]=13,l[5]=10,l[6]=26,l[7]=10,d=0;d<s.length;d++){var h=s[d],f=h.name,g=h.data,U=g.length,y=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)];i[0]=U,l[c++]=n[3],l[c++]=n[2],l[c++]=n[1],l[c++]=n[0],l[c++]=y[0],l[c++]=y[1],l[c++]=y[2],l[c++]=y[3];for(var v=0;v<U;)l[c++]=g[v++];var x=y.concat(e(g)),w=t.buf(x);r[0]=w,l[c++]=n[3],l[c++]=n[2],l[c++]=n[1],l[c++]=n[0]}return l}return lb}var j$=D$();const P$=ta(j$);/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */const N$=4,yw=0,vw=1,O$=2;function gh(e){let t=e.length;for(;--t>=0;)e[t]=0}const F$=0,zT=1,B$=2,$$=3,z$=258,F8=29,C1=256,Pp=C1+1+F8,Tu=30,B8=19,HT=2*Pp+1,Lc=15,cb=16,H$=7,$8=256,WT=16,XT=17,VT=18,Vy=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ym=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),W$=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),YT=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),X$=512,to=new Array((Pp+2)*2);gh(to);const hp=new Array(Tu*2);gh(hp);const Np=new Array(X$);gh(Np);const Op=new Array(z$-$$+1);gh(Op);const z8=new Array(F8);gh(z8);const jg=new Array(Tu);gh(jg);function db(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let GT,qT,ZT;function ub(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const KT=e=>e<256?Np[e]:Np[256+(e>>>7)],Fp=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},ai=(e,t,n)=>{e.bi_valid>cb-n?(e.bi_buf|=t<<e.bi_valid&65535,Fp(e,e.bi_buf),e.bi_buf=t>>cb-e.bi_valid,e.bi_valid+=n-cb):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},ss=(e,t,n)=>{ai(e,n[t*2],n[t*2+1])},QT=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},V$=e=>{e.bi_valid===16?(Fp(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Y$=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,l,h,f,g,U,y=0;for(f=0;f<=Lc;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,d=e.heap_max+1;d<HT;d++)l=e.heap[d],f=n[n[l*2+1]*2+1]+1,f>c&&(f=c,y++),n[l*2+1]=f,!(l>r)&&(e.bl_count[f]++,g=0,l>=o&&(g=s[l-o]),U=n[l*2],e.opt_len+=U*(f+g),a&&(e.static_len+=U*(i[l*2+1]+g)));if(y!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,y-=2}while(y>0);for(f=c;f!==0;f--)for(l=e.bl_count[f];l!==0;)h=e.heap[--d],!(h>r)&&(n[h*2+1]!==f&&(e.opt_len+=(f-n[h*2+1])*n[h*2],n[h*2+1]=f),l--)}},JT=(e,t,n)=>{const r=new Array(Lc+1);let i=0,a,s;for(a=1;a<=Lc;a++)r[a]=i=i+n[a-1]<<1;for(s=0;s<=t;s++){let o=e[s*2+1];o!==0&&(e[s*2]=QT(r[o]++,o))}},G$=()=>{let e,t,n,r,i;const a=new Array(Lc+1);for(n=0,r=0;r<F8-1;r++)for(z8[r]=n,e=0;e<1<<Vy[r];e++)Op[n++]=r;for(Op[n-1]=r,i=0,r=0;r<16;r++)for(jg[r]=i,e=0;e<1<<Ym[r];e++)Np[i++]=r;for(i>>=7;r<Tu;r++)for(jg[r]=i<<7,e=0;e<1<<Ym[r]-7;e++)Np[256+i++]=r;for(t=0;t<=Lc;t++)a[t]=0;for(e=0;e<=143;)to[e*2+1]=8,e++,a[8]++;for(;e<=255;)to[e*2+1]=9,e++,a[9]++;for(;e<=279;)to[e*2+1]=7,e++,a[7]++;for(;e<=287;)to[e*2+1]=8,e++,a[8]++;for(JT(to,Pp+1,a),e=0;e<Tu;e++)hp[e*2+1]=5,hp[e*2]=QT(e,5);GT=new db(to,Vy,C1+1,Pp,Lc),qT=new db(hp,Ym,0,Tu,Lc),ZT=new db(new Array(0),W$,0,B8,H$)},eM=e=>{let t;for(t=0;t<Pp;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Tu;t++)e.dyn_dtree[t*2]=0;for(t=0;t<B8;t++)e.bl_tree[t*2]=0;e.dyn_ltree[$8*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},tM=e=>{e.bi_valid>8?Fp(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},q$=(e,t,n,r)=>{tM(e),Fp(e,n),Fp(e,~n),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},xw=(e,t,n,r)=>{const i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},hb=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&xw(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!xw(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},ww=(e,t,n)=>{let r,i,a=0,s,o;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?ss(e,i,t):(s=Op[i],ss(e,s+C1+1,t),o=Vy[s],o!==0&&(i-=z8[s],ai(e,i,o)),r--,s=KT(r),ss(e,s,n),o=Ym[s],o!==0&&(r-=jg[s],ai(e,r,o)));while(a<e.last_lit);ss(e,$8,t)},Yy=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let s,o,c=-1,d;for(e.heap_len=0,e.heap_max=HT,s=0;s<a;s++)n[s*2]!==0?(e.heap[++e.heap_len]=c=s,e.depth[s]=0):n[s*2+1]=0;for(;e.heap_len<2;)d=e.heap[++e.heap_len]=c<2?++c:0,n[d*2]=1,e.depth[d]=0,e.opt_len--,i&&(e.static_len-=r[d*2+1]);for(t.max_code=c,s=e.heap_len>>1;s>=1;s--)hb(e,n,s);d=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hb(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,n[d*2]=n[s*2]+n[o*2],e.depth[d]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,n[s*2+1]=n[o*2+1]=d,e.heap[1]=d++,hb(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Y$(e,t),JT(n,c,e.bl_count)},Ew=(e,t,n)=>{let r,i=-1,a,s=t[0*2+1],o=0,c=7,d=4;for(s===0&&(c=138,d=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=s,s=t[(r+1)*2+1],!(++o<c&&a===s)&&(o<d?e.bl_tree[a*2]+=o:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[WT*2]++):o<=10?e.bl_tree[XT*2]++:e.bl_tree[VT*2]++,o=0,i=a,s===0?(c=138,d=3):a===s?(c=6,d=3):(c=7,d=4))},Cw=(e,t,n)=>{let r,i=-1,a,s=t[0*2+1],o=0,c=7,d=4;for(s===0&&(c=138,d=3),r=0;r<=n;r++)if(a=s,s=t[(r+1)*2+1],!(++o<c&&a===s)){if(o<d)do ss(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==i&&(ss(e,a,e.bl_tree),o--),ss(e,WT,e.bl_tree),ai(e,o-3,2)):o<=10?(ss(e,XT,e.bl_tree),ai(e,o-3,3)):(ss(e,VT,e.bl_tree),ai(e,o-11,7));o=0,i=a,s===0?(c=138,d=3):a===s?(c=6,d=3):(c=7,d=4)}},Z$=e=>{let t;for(Ew(e,e.dyn_ltree,e.l_desc.max_code),Ew(e,e.dyn_dtree,e.d_desc.max_code),Yy(e,e.bl_desc),t=B8-1;t>=3&&e.bl_tree[YT[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},K$=(e,t,n,r)=>{let i;for(ai(e,t-257,5),ai(e,n-1,5),ai(e,r-4,4),i=0;i<r;i++)ai(e,e.bl_tree[YT[i]*2+1],3);Cw(e,e.dyn_ltree,t-1),Cw(e,e.dyn_dtree,n-1)},Q$=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return yw;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return vw;for(n=32;n<C1;n++)if(e.dyn_ltree[n*2]!==0)return vw;return yw};let Sw=!1;const J$=e=>{Sw||(G$(),Sw=!0),e.l_desc=new ub(e.dyn_ltree,GT),e.d_desc=new ub(e.dyn_dtree,qT),e.bl_desc=new ub(e.bl_tree,ZT),e.bi_buf=0,e.bi_valid=0,eM(e)},nM=(e,t,n,r)=>{ai(e,(F$<<1)+(r?1:0),3),q$(e,t,n)},ez=e=>{ai(e,zT<<1,3),ss(e,$8,to),V$(e)},tz=(e,t,n,r)=>{let i,a,s=0;e.level>0?(e.strm.data_type===O$&&(e.strm.data_type=Q$(e)),Yy(e,e.l_desc),Yy(e,e.d_desc),s=Z$(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?nM(e,t,n,r):e.strategy===N$||a===i?(ai(e,(zT<<1)+(r?1:0),3),ww(e,to,hp)):(ai(e,(B$<<1)+(r?1:0),3),K$(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),ww(e,e.dyn_ltree,e.dyn_dtree)),eM(e),r&&tM(e)},nz=(e,t,n)=>(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Op[n]+C1+1)*2]++,e.dyn_dtree[KT(t)*2]++),e.last_lit===e.lit_bufsize-1);var rz=J$,iz=nM,az=tz,sz=nz,oz=ez,lz={_tr_init:rz,_tr_stored_block:iz,_tr_flush_block:az,_tr_tally:sz,_tr_align:oz};const cz=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+t[r++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0};var Bp=cz;const dz=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},uz=new Uint32Array(dz()),hz=(e,t,n,r)=>{const i=uz,a=r+n;e^=-1;for(let s=r;s<a;s++)e=e>>>8^i[(e^t[s])&255];return e^-1};var rr=hz,qc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},J2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:fz,_tr_stored_block:pz,_tr_flush_block:mz,_tr_tally:Tl,_tr_align:gz}=lz,{Z_NO_FLUSH:pd,Z_PARTIAL_FLUSH:Uz,Z_FULL_FLUSH:bz,Z_FINISH:Ml,Z_BLOCK:_w,Z_OK:os,Z_STREAM_END:kw,Z_STREAM_ERROR:Xi,Z_DATA_ERROR:yz,Z_BUF_ERROR:fb,Z_DEFAULT_COMPRESSION:vz,Z_FILTERED:xz,Z_HUFFMAN_ONLY:lm,Z_RLE:wz,Z_FIXED:Ez,Z_DEFAULT_STRATEGY:Cz,Z_UNKNOWN:Sz,Z_DEFLATED:eU}=J2,_z=9,kz=15,Tz=8,Mz=29,Iz=256,Gy=Iz+1+Mz,Az=30,Lz=19,Rz=2*Gy+1,Dz=15,St=3,wl=258,_a=wl+St+1,jz=32,tU=42,qy=69,Gm=73,qm=91,Zm=103,Rc=113,Gf=666,Gn=1,S1=2,Zc=3,Uh=4,Pz=3,El=(e,t)=>(e.msg=qc[t],t),Tw=e=>(e<<1)-(e>4?9:0),vl=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let Nz=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Il=Nz;const ul=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},fr=(e,t)=>{mz(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ul(e.strm)},jt=(e,t)=>{e.pending_buf[e.pending++]=t},xf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Oz=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Bp(e.adler,t,i,n):e.state.wrap===2&&(e.adler=rr(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},rM=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,s=e.prev_length,o=e.nice_match;const c=e.strstart>e.w_size-_a?e.strstart-(e.w_size-_a):0,d=e.window,l=e.w_mask,h=e.prev,f=e.strstart+wl;let g=d[r+s-1],U=d[r+s];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(d[i+s]!==U||d[i+s-1]!==g||d[i]!==d[r]||d[++i]!==d[r+1])){r+=2,i++;do;while(d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&r<f);if(a=wl-(f-r),r=f-wl,a>s){if(e.match_start=t,s=a,a>=o)break;g=d[r+s-1],U=d[r+s]}}while((t=h[t&l])>c&&--n!==0);return s<=e.lookahead?s:e.lookahead},Kc=e=>{const t=e.w_size;let n,r,i,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-_a)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=Oz(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=St)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Il(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=Il(e,e.ins_h,e.window[s+St-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<St)););}while(e.lookahead<_a&&e.strm.avail_in!==0)},Fz=(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Kc(e),e.lookahead===0&&t===pd)return Gn;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,fr(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-_a&&(fr(e,!1),e.strm.avail_out===0))return Gn}return e.insert=0,t===Ml?(fr(e,!0),e.strm.avail_out===0?Zc:Uh):(e.strstart>e.block_start&&(fr(e,!1),e.strm.avail_out===0),Gn)},pb=(e,t)=>{let n,r;for(;;){if(e.lookahead<_a){if(Kc(e),e.lookahead<_a&&t===pd)return Gn;if(e.lookahead===0)break}if(n=0,e.lookahead>=St&&(e.ins_h=Il(e,e.ins_h,e.window[e.strstart+St-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-_a&&(e.match_length=rM(e,n)),e.match_length>=St)if(r=Tl(e,e.strstart-e.match_start,e.match_length-St),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=St){e.match_length--;do e.strstart++,e.ins_h=Il(e,e.ins_h,e.window[e.strstart+St-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Il(e,e.ins_h,e.window[e.strstart+1]);else r=Tl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(fr(e,!1),e.strm.avail_out===0))return Gn}return e.insert=e.strstart<St-1?e.strstart:St-1,t===Ml?(fr(e,!0),e.strm.avail_out===0?Zc:Uh):e.last_lit&&(fr(e,!1),e.strm.avail_out===0)?Gn:S1},Zd=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<_a){if(Kc(e),e.lookahead<_a&&t===pd)return Gn;if(e.lookahead===0)break}if(n=0,e.lookahead>=St&&(e.ins_h=Il(e,e.ins_h,e.window[e.strstart+St-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=St-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-_a&&(e.match_length=rM(e,n),e.match_length<=5&&(e.strategy===xz||e.match_length===St&&e.strstart-e.match_start>4096)&&(e.match_length=St-1)),e.prev_length>=St&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-St,r=Tl(e,e.strstart-1-e.prev_match,e.prev_length-St),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Il(e,e.ins_h,e.window[e.strstart+St-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=St-1,e.strstart++,r&&(fr(e,!1),e.strm.avail_out===0))return Gn}else if(e.match_available){if(r=Tl(e,0,e.window[e.strstart-1]),r&&fr(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Gn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Tl(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<St-1?e.strstart:St-1,t===Ml?(fr(e,!0),e.strm.avail_out===0?Zc:Uh):e.last_lit&&(fr(e,!1),e.strm.avail_out===0)?Gn:S1},Bz=(e,t)=>{let n,r,i,a;const s=e.window;for(;;){if(e.lookahead<=wl){if(Kc(e),e.lookahead<=wl&&t===pd)return Gn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=St&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){a=e.strstart+wl;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=wl-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=St?(n=Tl(e,1,e.match_length-St),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Tl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(fr(e,!1),e.strm.avail_out===0))return Gn}return e.insert=0,t===Ml?(fr(e,!0),e.strm.avail_out===0?Zc:Uh):e.last_lit&&(fr(e,!1),e.strm.avail_out===0)?Gn:S1},$z=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Kc(e),e.lookahead===0)){if(t===pd)return Gn;break}if(e.match_length=0,n=Tl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(fr(e,!1),e.strm.avail_out===0))return Gn}return e.insert=0,t===Ml?(fr(e,!0),e.strm.avail_out===0?Zc:Uh):e.last_lit&&(fr(e,!1),e.strm.avail_out===0)?Gn:S1};function Ya(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const qf=[new Ya(0,0,0,0,Fz),new Ya(4,4,8,4,pb),new Ya(4,5,16,8,pb),new Ya(4,6,32,32,pb),new Ya(4,4,16,16,Zd),new Ya(8,16,32,32,Zd),new Ya(8,16,128,128,Zd),new Ya(8,32,128,256,Zd),new Ya(32,128,258,1024,Zd),new Ya(32,258,258,4096,Zd)],zz=e=>{e.window_size=2*e.w_size,vl(e.head),e.max_lazy_match=qf[e.level].max_lazy,e.good_match=qf[e.level].good_length,e.nice_match=qf[e.level].nice_length,e.max_chain_length=qf[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=St-1,e.match_available=0,e.ins_h=0};function Hz(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=eU,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Rz*2),this.dyn_dtree=new Uint16Array((2*Az+1)*2),this.bl_tree=new Uint16Array((2*Lz+1)*2),vl(this.dyn_ltree),vl(this.dyn_dtree),vl(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Dz+1),this.heap=new Uint16Array(2*Gy+1),vl(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Gy+1),vl(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const iM=e=>{if(!e||!e.state)return El(e,Xi);e.total_in=e.total_out=0,e.data_type=Sz;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?tU:Rc,e.adler=t.wrap===2?0:1,t.last_flush=pd,fz(t),os},aM=e=>{const t=iM(e);return t===os&&zz(e.state),t},Wz=(e,t)=>!e||!e.state||e.state.wrap!==2?Xi:(e.state.gzhead=t,os),sM=(e,t,n,r,i,a)=>{if(!e)return Xi;let s=1;if(t===vz&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>_z||n!==eU||r<8||r>15||t<0||t>9||a<0||a>Ez)return El(e,Xi);r===8&&(r=9);const o=new Hz;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+St-1)/St),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=n,aM(e)},Xz=(e,t)=>sM(e,t,eU,kz,Tz,Cz),Vz=(e,t)=>{let n,r;if(!e||!e.state||t>_w||t<0)return e?El(e,Xi):Xi;const i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===Gf&&t!==Ml)return El(e,e.avail_out===0?fb:Xi);i.strm=e;const a=i.last_flush;if(i.last_flush=t,i.status===tU)if(i.wrap===2)e.adler=0,jt(i,31),jt(i,139),jt(i,8),i.gzhead?(jt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),jt(i,i.gzhead.time&255),jt(i,i.gzhead.time>>8&255),jt(i,i.gzhead.time>>16&255),jt(i,i.gzhead.time>>24&255),jt(i,i.level===9?2:i.strategy>=lm||i.level<2?4:0),jt(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(jt(i,i.gzhead.extra.length&255),jt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=rr(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=qy):(jt(i,0),jt(i,0),jt(i,0),jt(i,0),jt(i,0),jt(i,i.level===9?2:i.strategy>=lm||i.level<2?4:0),jt(i,Pz),i.status=Rc);else{let s=eU+(i.w_bits-8<<4)<<8,o=-1;i.strategy>=lm||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,s|=o<<6,i.strstart!==0&&(s|=jz),s+=31-s%31,i.status=Rc,xf(i,s),i.strstart!==0&&(xf(i,e.adler>>>16),xf(i,e.adler&65535)),e.adler=1}if(i.status===qy)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=rr(e.adler,i.pending_buf,i.pending-n,n)),ul(e),n=i.pending,i.pending===i.pending_buf_size));)jt(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=rr(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Gm)}else i.status=Gm;if(i.status===Gm)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=rr(e.adler,i.pending_buf,i.pending-n,n)),ul(e),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}i.gzindex<i.gzhead.name.length?r=i.gzhead.name.charCodeAt(i.gzindex++)&255:r=0,jt(i,r)}while(r!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=rr(e.adler,i.pending_buf,i.pending-n,n)),r===0&&(i.gzindex=0,i.status=qm)}else i.status=qm;if(i.status===qm)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=rr(e.adler,i.pending_buf,i.pending-n,n)),ul(e),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}i.gzindex<i.gzhead.comment.length?r=i.gzhead.comment.charCodeAt(i.gzindex++)&255:r=0,jt(i,r)}while(r!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=rr(e.adler,i.pending_buf,i.pending-n,n)),r===0&&(i.status=Zm)}else i.status=Zm;if(i.status===Zm&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ul(e),i.pending+2<=i.pending_buf_size&&(jt(i,e.adler&255),jt(i,e.adler>>8&255),e.adler=0,i.status=Rc)):i.status=Rc),i.pending!==0){if(ul(e),e.avail_out===0)return i.last_flush=-1,os}else if(e.avail_in===0&&Tw(t)<=Tw(a)&&t!==Ml)return El(e,fb);if(i.status===Gf&&e.avail_in!==0)return El(e,fb);if(e.avail_in!==0||i.lookahead!==0||t!==pd&&i.status!==Gf){let s=i.strategy===lm?$z(i,t):i.strategy===wz?Bz(i,t):qf[i.level].func(i,t);if((s===Zc||s===Uh)&&(i.status=Gf),s===Gn||s===Zc)return e.avail_out===0&&(i.last_flush=-1),os;if(s===S1&&(t===Uz?gz(i):t!==_w&&(pz(i,0,0,!1),t===bz&&(vl(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),ul(e),e.avail_out===0))return i.last_flush=-1,os}return t!==Ml?os:i.wrap<=0?kw:(i.wrap===2?(jt(i,e.adler&255),jt(i,e.adler>>8&255),jt(i,e.adler>>16&255),jt(i,e.adler>>24&255),jt(i,e.total_in&255),jt(i,e.total_in>>8&255),jt(i,e.total_in>>16&255),jt(i,e.total_in>>24&255)):(xf(i,e.adler>>>16),xf(i,e.adler&65535)),ul(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?os:kw)},Yz=e=>{if(!e||!e.state)return Xi;const t=e.state.status;return t!==tU&&t!==qy&&t!==Gm&&t!==qm&&t!==Zm&&t!==Rc&&t!==Gf?El(e,Xi):(e.state=null,t===Rc?El(e,yz):os)},Gz=(e,t)=>{let n=t.length;if(!e||!e.state)return Xi;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==tU||r.lookahead)return Xi;if(i===1&&(e.adler=Bp(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(vl(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const a=e.avail_in,s=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Kc(r);r.lookahead>=St;){let c=r.strstart,d=r.lookahead-(St-1);do r.ins_h=Il(r,r.ins_h,r.window[c+St-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--d);r.strstart=c,r.lookahead=St-1,Kc(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=St-1,r.match_available=0,e.next_in=s,e.input=o,e.avail_in=a,r.wrap=i,os};var qz=Xz,Zz=sM,Kz=aM,Qz=iM,Jz=Wz,eH=Vz,tH=Yz,nH=Gz,rH="pako deflate (from Nodeca project)",fp={deflateInit:qz,deflateInit2:Zz,deflateReset:Kz,deflateResetKeep:Qz,deflateSetHeader:Jz,deflate:eH,deflateEnd:tH,deflateSetDictionary:nH,deflateInfo:rH};const iH=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var aH=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)iH(n,r)&&(e[r]=n[r])}}return e},sH=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,a=e.length;r<a;r++){let s=e[r];n.set(s,i),i+=s.length}return n},nU={assign:aH,flattenChunks:sH};let oM=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{oM=!1}const $p=new Uint8Array(256);for(let e=0;e<256;e++)$p[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;$p[254]=$p[254]=1;var oH=e=>{let t,n,r,i,a,s=e.length,o=0;for(i=0;i<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(o),a=0,i=0;a<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};const lH=(e,t)=>{if(t<65534&&e.subarray&&oM)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var cH=(e,t)=>{let n,r;const i=t||e.length,a=new Array(i*2);for(r=0,n=0;n<i;){let s=e[n++];if(s<128){a[r++]=s;continue}let o=$p[s];if(o>4){a[r++]=65533,n+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&n<i;)s=s<<6|e[n++]&63,o--;if(o>1){a[r++]=65533;continue}s<65536?a[r++]=s:(s-=65536,a[r++]=55296|s>>10&1023,a[r++]=56320|s&1023)}return lH(a,r)},dH=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+$p[e[n]]>t?n:t},zp={string2buf:oH,buf2string:cH,utf8border:dH};function uH(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var lM=uH;const cM=Object.prototype.toString,{Z_NO_FLUSH:hH,Z_SYNC_FLUSH:fH,Z_FULL_FLUSH:pH,Z_FINISH:mH,Z_OK:Pg,Z_STREAM_END:gH,Z_DEFAULT_COMPRESSION:UH,Z_DEFAULT_STRATEGY:bH,Z_DEFLATED:yH}=J2;function rU(e){this.options=nU.assign({level:UH,method:yH,chunkSize:16384,windowBits:15,memLevel:8,strategy:bH},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new lM,this.strm.avail_out=0;let n=fp.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Pg)throw new Error(qc[n]);if(t.header&&fp.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=zp.string2buf(t.dictionary):cM.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=fp.deflateSetDictionary(this.strm,r),n!==Pg)throw new Error(qc[n]);this._dict_set=!0}}rU.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?mH:hH,typeof e=="string"?n.input=zp.string2buf(e):cM.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===fH||a===pH)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=fp.deflate(n,a),i===gH)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=fp.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Pg;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};rU.prototype.onData=function(e){this.chunks.push(e)};rU.prototype.onEnd=function(e){e===Pg&&(this.result=nU.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function vH(e,t){const n=new rU(t);if(n.push(e,!0),n.err)throw n.msg||qc[n.err];return n.result}var xH=vH,wH={deflate:xH};const cm=30,EH=12;var CH=function(t,n){let r,i,a,s,o,c,d,l,h,f,g,U,y,v,x,w,C,S,T,M,_,R,P,j;const N=t.state;r=t.next_in,P=t.input,i=r+(t.avail_in-5),a=t.next_out,j=t.output,s=a-(n-t.avail_out),o=a+(t.avail_out-257),c=N.dmax,d=N.wsize,l=N.whave,h=N.wnext,f=N.window,g=N.hold,U=N.bits,y=N.lencode,v=N.distcode,x=(1<<N.lenbits)-1,w=(1<<N.distbits)-1;e:do{U<15&&(g+=P[r++]<<U,U+=8,g+=P[r++]<<U,U+=8),C=y[g&x];t:for(;;){if(S=C>>>24,g>>>=S,U-=S,S=C>>>16&255,S===0)j[a++]=C&65535;else if(S&16){T=C&65535,S&=15,S&&(U<S&&(g+=P[r++]<<U,U+=8),T+=g&(1<<S)-1,g>>>=S,U-=S),U<15&&(g+=P[r++]<<U,U+=8,g+=P[r++]<<U,U+=8),C=v[g&w];n:for(;;){if(S=C>>>24,g>>>=S,U-=S,S=C>>>16&255,S&16){if(M=C&65535,S&=15,U<S&&(g+=P[r++]<<U,U+=8,U<S&&(g+=P[r++]<<U,U+=8)),M+=g&(1<<S)-1,M>c){t.msg="invalid distance too far back",N.mode=cm;break e}if(g>>>=S,U-=S,S=a-s,M>S){if(S=M-S,S>l&&N.sane){t.msg="invalid distance too far back",N.mode=cm;break e}if(_=0,R=f,h===0){if(_+=d-S,S<T){T-=S;do j[a++]=f[_++];while(--S);_=a-M,R=j}}else if(h<S){if(_+=d+h-S,S-=h,S<T){T-=S;do j[a++]=f[_++];while(--S);if(_=0,h<T){S=h,T-=S;do j[a++]=f[_++];while(--S);_=a-M,R=j}}}else if(_+=h-S,S<T){T-=S;do j[a++]=f[_++];while(--S);_=a-M,R=j}for(;T>2;)j[a++]=R[_++],j[a++]=R[_++],j[a++]=R[_++],T-=3;T&&(j[a++]=R[_++],T>1&&(j[a++]=R[_++]))}else{_=a-M;do j[a++]=j[_++],j[a++]=j[_++],j[a++]=j[_++],T-=3;while(T>2);T&&(j[a++]=j[_++],T>1&&(j[a++]=j[_++]))}}else if((S&64)===0){C=v[(C&65535)+(g&(1<<S)-1)];continue n}else{t.msg="invalid distance code",N.mode=cm;break e}break}}else if((S&64)===0){C=y[(C&65535)+(g&(1<<S)-1)];continue t}else if(S&32){N.mode=EH;break e}else{t.msg="invalid literal/length code",N.mode=cm;break e}break}}while(r<i&&a<o);T=U>>3,r-=T,U-=T<<3,g&=(1<<U)-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=a<o?257+(o-a):257-(a-o),N.hold=g,N.bits=U};const Kd=15,Mw=852,Iw=592,Aw=0,mb=1,Lw=2,SH=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),_H=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),kH=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),TH=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),MH=(e,t,n,r,i,a,s,o)=>{const c=o.bits;let d=0,l=0,h=0,f=0,g=0,U=0,y=0,v=0,x=0,w=0,C,S,T,M,_,R=null,P=0,j;const N=new Uint16Array(Kd+1),F=new Uint16Array(Kd+1);let B=null,G=0,W,X,$;for(d=0;d<=Kd;d++)N[d]=0;for(l=0;l<r;l++)N[t[n+l]]++;for(g=c,f=Kd;f>=1&&N[f]===0;f--);if(g>f&&(g=f),f===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,o.bits=1,0;for(h=1;h<f&&N[h]===0;h++);for(g<h&&(g=h),v=1,d=1;d<=Kd;d++)if(v<<=1,v-=N[d],v<0)return-1;if(v>0&&(e===Aw||f!==1))return-1;for(F[1]=0,d=1;d<Kd;d++)F[d+1]=F[d]+N[d];for(l=0;l<r;l++)t[n+l]!==0&&(s[F[t[n+l]]++]=l);if(e===Aw?(R=B=s,j=19):e===mb?(R=SH,P-=257,B=_H,G-=257,j=256):(R=kH,B=TH,j=-1),w=0,l=0,d=h,_=a,U=g,y=0,T=-1,x=1<<g,M=x-1,e===mb&&x>Mw||e===Lw&&x>Iw)return 1;for(;;){W=d-y,s[l]<j?(X=0,$=s[l]):s[l]>j?(X=B[G+s[l]],$=R[P+s[l]]):(X=96,$=0),C=1<<d-y,S=1<<U,h=S;do S-=C,i[_+(w>>y)+S]=W<<24|X<<16|$|0;while(S!==0);for(C=1<<d-1;w&C;)C>>=1;if(C!==0?(w&=C-1,w+=C):w=0,l++,--N[d]===0){if(d===f)break;d=t[n+s[l]]}if(d>g&&(w&M)!==T){for(y===0&&(y=g),_+=h,U=d-y,v=1<<U;U+y<f&&(v-=N[U+y],!(v<=0));)U++,v<<=1;if(x+=1<<U,e===mb&&x>Mw||e===Lw&&x>Iw)return 1;T=w&M,i[T]=g<<24|U<<16|_-a|0}}return w!==0&&(i[_+w]=d-y<<24|64<<16|0),o.bits=g,0};var pp=MH;const IH=0,dM=1,uM=2,{Z_FINISH:Rw,Z_BLOCK:AH,Z_TREES:dm,Z_OK:Qc,Z_STREAM_END:LH,Z_NEED_DICT:RH,Z_STREAM_ERROR:Gi,Z_DATA_ERROR:hM,Z_MEM_ERROR:fM,Z_BUF_ERROR:DH,Z_DEFLATED:Dw}=J2,pM=1,jw=2,Pw=3,Nw=4,Ow=5,Fw=6,Bw=7,$w=8,zw=9,Hw=10,Ng=11,Vs=12,gb=13,Ww=14,Ub=15,Xw=16,Vw=17,Yw=18,Gw=19,um=20,hm=21,qw=22,Zw=23,Kw=24,Qw=25,Jw=26,bb=27,eE=28,tE=29,dn=30,mM=31,jH=32,PH=852,NH=592,OH=15,FH=OH,nE=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function BH(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const gM=e=>{if(!e||!e.state)return Gi;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=pM,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(PH),t.distcode=t.distdyn=new Int32Array(NH),t.sane=1,t.back=-1,Qc},UM=e=>{if(!e||!e.state)return Gi;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,gM(e)},bM=(e,t)=>{let n;if(!e||!e.state)return Gi;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?Gi:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,UM(e))},yM=(e,t)=>{if(!e)return Gi;const n=new BH;e.state=n,n.window=null;const r=bM(e,t);return r!==Qc&&(e.state=null),r},$H=e=>yM(e,FH);let rE=!0,yb,vb;const zH=e=>{if(rE){yb=new Int32Array(512),vb=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(pp(dM,e.lens,0,288,yb,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;pp(uM,e.lens,0,32,vb,0,e.work,{bits:5}),rE=!1}e.lencode=yb,e.lenbits=9,e.distcode=vb,e.distbits=5},vM=(e,t,n,r)=>{let i;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},HH=(e,t)=>{let n,r,i,a,s,o,c,d,l,h,f,g,U,y,v=0,x,w,C,S,T,M,_,R;const P=new Uint8Array(4);let j,N;const F=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Gi;n=e.state,n.mode===Vs&&(n.mode=gb),s=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,o=e.avail_in,d=n.hold,l=n.bits,h=o,f=c,R=Qc;e:for(;;)switch(n.mode){case pM:if(n.wrap===0){n.mode=gb;break}for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(n.wrap&2&&d===35615){n.check=0,P[0]=d&255,P[1]=d>>>8&255,n.check=rr(n.check,P,2,0),d=0,l=0,n.mode=jw;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((d&255)<<8)+(d>>8))%31){e.msg="incorrect header check",n.mode=dn;break}if((d&15)!==Dw){e.msg="unknown compression method",n.mode=dn;break}if(d>>>=4,l-=4,_=(d&15)+8,n.wbits===0)n.wbits=_;else if(_>n.wbits){e.msg="invalid window size",n.mode=dn;break}n.dmax=1<<n.wbits,e.adler=n.check=1,n.mode=d&512?Hw:Vs,d=0,l=0;break;case jw:for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(n.flags=d,(n.flags&255)!==Dw){e.msg="unknown compression method",n.mode=dn;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=dn;break}n.head&&(n.head.text=d>>8&1),n.flags&512&&(P[0]=d&255,P[1]=d>>>8&255,n.check=rr(n.check,P,2,0)),d=0,l=0,n.mode=Pw;case Pw:for(;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.head&&(n.head.time=d),n.flags&512&&(P[0]=d&255,P[1]=d>>>8&255,P[2]=d>>>16&255,P[3]=d>>>24&255,n.check=rr(n.check,P,4,0)),d=0,l=0,n.mode=Nw;case Nw:for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.head&&(n.head.xflags=d&255,n.head.os=d>>8),n.flags&512&&(P[0]=d&255,P[1]=d>>>8&255,n.check=rr(n.check,P,2,0)),d=0,l=0,n.mode=Ow;case Ow:if(n.flags&1024){for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.length=d,n.head&&(n.head.extra_len=d),n.flags&512&&(P[0]=d&255,P[1]=d>>>8&255,n.check=rr(n.check,P,2,0)),d=0,l=0}else n.head&&(n.head.extra=null);n.mode=Fw;case Fw:if(n.flags&1024&&(g=n.length,g>o&&(g=o),g&&(n.head&&(_=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+g),_)),n.flags&512&&(n.check=rr(n.check,r,g,a)),o-=g,a+=g,n.length-=g),n.length))break e;n.length=0,n.mode=Bw;case Bw:if(n.flags&2048){if(o===0)break e;g=0;do _=r[a+g++],n.head&&_&&n.length<65536&&(n.head.name+=String.fromCharCode(_));while(_&&g<o);if(n.flags&512&&(n.check=rr(n.check,r,g,a)),o-=g,a+=g,_)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=$w;case $w:if(n.flags&4096){if(o===0)break e;g=0;do _=r[a+g++],n.head&&_&&n.length<65536&&(n.head.comment+=String.fromCharCode(_));while(_&&g<o);if(n.flags&512&&(n.check=rr(n.check,r,g,a)),o-=g,a+=g,_)break e}else n.head&&(n.head.comment=null);n.mode=zw;case zw:if(n.flags&512){for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(d!==(n.check&65535)){e.msg="header crc mismatch",n.mode=dn;break}d=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Vs;break;case Hw:for(;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}e.adler=n.check=nE(d),d=0,l=0,n.mode=Ng;case Ng:if(n.havedict===0)return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,n.hold=d,n.bits=l,RH;e.adler=n.check=1,n.mode=Vs;case Vs:if(t===AH||t===dm)break e;case gb:if(n.last){d>>>=l&7,l-=l&7,n.mode=bb;break}for(;l<3;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}switch(n.last=d&1,d>>>=1,l-=1,d&3){case 0:n.mode=Ww;break;case 1:if(zH(n),n.mode=um,t===dm){d>>>=2,l-=2;break e}break;case 2:n.mode=Vw;break;case 3:e.msg="invalid block type",n.mode=dn}d>>>=2,l-=2;break;case Ww:for(d>>>=l&7,l-=l&7;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if((d&65535)!==(d>>>16^65535)){e.msg="invalid stored block lengths",n.mode=dn;break}if(n.length=d&65535,d=0,l=0,n.mode=Ub,t===dm)break e;case Ub:n.mode=Xw;case Xw:if(g=n.length,g){if(g>o&&(g=o),g>c&&(g=c),g===0)break e;i.set(r.subarray(a,a+g),s),o-=g,a+=g,c-=g,s+=g,n.length-=g;break}n.mode=Vs;break;case Vw:for(;l<14;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(n.nlen=(d&31)+257,d>>>=5,l-=5,n.ndist=(d&31)+1,d>>>=5,l-=5,n.ncode=(d&15)+4,d>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=dn;break}n.have=0,n.mode=Yw;case Yw:for(;n.have<n.ncode;){for(;l<3;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.lens[F[n.have++]]=d&7,d>>>=3,l-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,j={bits:n.lenbits},R=pp(IH,n.lens,0,19,n.lencode,0,n.work,j),n.lenbits=j.bits,R){e.msg="invalid code lengths set",n.mode=dn;break}n.have=0,n.mode=Gw;case Gw:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[d&(1<<n.lenbits)-1],x=v>>>24,w=v>>>16&255,C=v&65535,!(x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(C<16)d>>>=x,l-=x,n.lens[n.have++]=C;else{if(C===16){for(N=x+2;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(d>>>=x,l-=x,n.have===0){e.msg="invalid bit length repeat",n.mode=dn;break}_=n.lens[n.have-1],g=3+(d&3),d>>>=2,l-=2}else if(C===17){for(N=x+3;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=x,l-=x,_=0,g=3+(d&7),d>>>=3,l-=3}else{for(N=x+7;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=x,l-=x,_=0,g=11+(d&127),d>>>=7,l-=7}if(n.have+g>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=dn;break}for(;g--;)n.lens[n.have++]=_}}if(n.mode===dn)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=dn;break}if(n.lenbits=9,j={bits:n.lenbits},R=pp(dM,n.lens,0,n.nlen,n.lencode,0,n.work,j),n.lenbits=j.bits,R){e.msg="invalid literal/lengths set",n.mode=dn;break}if(n.distbits=6,n.distcode=n.distdyn,j={bits:n.distbits},R=pp(uM,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,j),n.distbits=j.bits,R){e.msg="invalid distances set",n.mode=dn;break}if(n.mode=um,t===dm)break e;case um:n.mode=hm;case hm:if(o>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,n.hold=d,n.bits=l,CH(e,f),s=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,o=e.avail_in,d=n.hold,l=n.bits,n.mode===Vs&&(n.back=-1);break}for(n.back=0;v=n.lencode[d&(1<<n.lenbits)-1],x=v>>>24,w=v>>>16&255,C=v&65535,!(x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(w&&(w&240)===0){for(S=x,T=w,M=C;v=n.lencode[M+((d&(1<<S+T)-1)>>S)],x=v>>>24,w=v>>>16&255,C=v&65535,!(S+x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=S,l-=S,n.back+=S}if(d>>>=x,l-=x,n.back+=x,n.length=C,w===0){n.mode=Jw;break}if(w&32){n.back=-1,n.mode=Vs;break}if(w&64){e.msg="invalid literal/length code",n.mode=dn;break}n.extra=w&15,n.mode=qw;case qw:if(n.extra){for(N=n.extra;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Zw;case Zw:for(;v=n.distcode[d&(1<<n.distbits)-1],x=v>>>24,w=v>>>16&255,C=v&65535,!(x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if((w&240)===0){for(S=x,T=w,M=C;v=n.distcode[M+((d&(1<<S+T)-1)>>S)],x=v>>>24,w=v>>>16&255,C=v&65535,!(S+x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=S,l-=S,n.back+=S}if(d>>>=x,l-=x,n.back+=x,w&64){e.msg="invalid distance code",n.mode=dn;break}n.offset=C,n.extra=w&15,n.mode=Kw;case Kw:if(n.extra){for(N=n.extra;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=dn;break}n.mode=Qw;case Qw:if(c===0)break e;if(g=f-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=dn;break}g>n.wnext?(g-=n.wnext,U=n.wsize-g):U=n.wnext-g,g>n.length&&(g=n.length),y=n.window}else y=i,U=s-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do i[s++]=y[U++];while(--g);n.length===0&&(n.mode=hm);break;case Jw:if(c===0)break e;i[s++]=n.length,c--,n.mode=hm;break;case bb:if(n.wrap){for(;l<32;){if(o===0)break e;o--,d|=r[a++]<<l,l+=8}if(f-=c,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?rr(n.check,i,f,s-f):Bp(n.check,i,f,s-f)),f=c,(n.flags?d:nE(d))!==n.check){e.msg="incorrect data check",n.mode=dn;break}d=0,l=0}n.mode=eE;case eE:if(n.wrap&&n.flags){for(;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(d!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=dn;break}d=0,l=0}n.mode=tE;case tE:R=LH;break e;case dn:R=hM;break e;case mM:return fM;case jH:default:return Gi}return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,n.hold=d,n.bits=l,(n.wsize||f!==e.avail_out&&n.mode<dn&&(n.mode<bb||t!==Rw))&&vM(e,e.output,e.next_out,f-e.avail_out),h-=e.avail_in,f-=e.avail_out,e.total_in+=h,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?rr(n.check,i,f,e.next_out-f):Bp(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Vs?128:0)+(n.mode===um||n.mode===Ub?256:0),(h===0&&f===0||t===Rw)&&R===Qc&&(R=DH),R},WH=e=>{if(!e||!e.state)return Gi;let t=e.state;return t.window&&(t.window=null),e.state=null,Qc},XH=(e,t)=>{if(!e||!e.state)return Gi;const n=e.state;return(n.wrap&2)===0?Gi:(n.head=t,t.done=!1,Qc)},VH=(e,t)=>{const n=t.length;let r,i,a;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==Ng)?Gi:r.mode===Ng&&(i=1,i=Bp(i,t,n,0),i!==r.check)?hM:(a=vM(e,t,n,n),a?(r.mode=mM,fM):(r.havedict=1,Qc))};var YH=UM,GH=bM,qH=gM,ZH=$H,KH=yM,QH=HH,JH=WH,eW=XH,tW=VH,nW="pako inflate (from Nodeca project)",no={inflateReset:YH,inflateReset2:GH,inflateResetKeep:qH,inflateInit:ZH,inflateInit2:KH,inflate:QH,inflateEnd:JH,inflateGetHeader:eW,inflateSetDictionary:tW,inflateInfo:nW};function rW(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var iW=rW;const xM=Object.prototype.toString,{Z_NO_FLUSH:aW,Z_FINISH:sW,Z_OK:Hp,Z_STREAM_END:xb,Z_NEED_DICT:wb,Z_STREAM_ERROR:oW,Z_DATA_ERROR:iE,Z_MEM_ERROR:lW}=J2;function iU(e){this.options=nU.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new lM,this.strm.avail_out=0;let n=no.inflateInit2(this.strm,t.windowBits);if(n!==Hp)throw new Error(qc[n]);if(this.header=new iW,no.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=zp.string2buf(t.dictionary):xM.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=no.inflateSetDictionary(this.strm,t.dictionary),n!==Hp)))throw new Error(qc[n])}iU.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,s,o;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?sW:aW,xM.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=no.inflate(n,s),a===wb&&i&&(a=no.inflateSetDictionary(n,i),a===Hp?a=no.inflate(n,s):a===iE&&(a=wb));n.avail_in>0&&a===xb&&n.state.wrap>0&&e[n.next_in]!==0;)no.inflateReset(n),a=no.inflate(n,s);switch(a){case oW:case iE:case wb:case lW:return this.onEnd(a),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||a===xb))if(this.options.to==="string"){let c=zp.utf8border(n.output,n.next_out),d=n.next_out-c,l=zp.buf2string(n.output,c);n.next_out=d,n.avail_out=r-d,d&&n.output.set(n.output.subarray(c,c+d),0),this.onData(l)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Hp&&o===0)){if(a===xb)return a=no.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};iU.prototype.onData=function(e){this.chunks.push(e)};iU.prototype.onEnd=function(e){e===Hp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nU.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function cW(e,t){const n=new iU(t);if(n.push(e),n.err)throw n.msg||qc[n.err];return n.result}var dW=cW,uW={inflate:dW};const{deflate:hW}=wH,{inflate:fW}=uW;var pW=hW,mW=fW;const gW="#ffffff",UW="#000000",bW=["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],yW=["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],vW=["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],xW=["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],wW=["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],EW=["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],CW=["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],SW=["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],_W=["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],kW=["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],TW=["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],MW=["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],IW=["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"],or={white:gW,black:UW,gray:bW,red:yW,pink:vW,grape:xW,violet:wW,indigo:EW,blue:CW,cyan:SW,teal:_W,green:kW,lime:TW,yellow:MW,orange:IW};let H8=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var Eb,aE;function AW(){if(aE)return Eb;aE=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,c=typeof xl=="object"&&xl&&xl.Object===Object&&xl,d=typeof self=="object"&&self&&self.Object===Object&&self,l=c||d||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,U=Math.min,y=function(){return l.Date.now()};function v(M,_,R){var P,j,N,F,B,G,W=0,X=!1,$=!1,Y=!0;if(typeof M!="function")throw new TypeError(e);_=T(_)||0,w(R)&&(X=!!R.leading,$="maxWait"in R,N=$?g(T(R.maxWait)||0,_):N,Y="trailing"in R?!!R.trailing:Y);function H(ye){var je=P,Le=j;return P=j=void 0,W=ye,F=M.apply(Le,je),F}function Z(ye){return W=ye,B=setTimeout(ce,_),X?H(ye):F}function V(ye){var je=ye-G,Le=ye-W,de=_-je;return $?U(de,N-Le):de}function te(ye){var je=ye-G,Le=ye-W;return G===void 0||je>=_||je<0||$&&Le>=N}function ce(){var ye=y();if(te(ye))return be(ye);B=setTimeout(ce,V(ye))}function be(ye){return B=void 0,Y&&P?H(ye):(P=j=void 0,F)}function fe(){B!==void 0&&clearTimeout(B),W=0,P=G=j=B=void 0}function Se(){return B===void 0?F:be(y())}function Ue(){var ye=y(),je=te(ye);if(P=arguments,j=this,G=ye,je){if(B===void 0)return Z(G);if($)return B=setTimeout(ce,_),H(G)}return B===void 0&&(B=setTimeout(ce,_)),F}return Ue.cancel=fe,Ue.flush=Se,Ue}function x(M,_,R){var P=!0,j=!0;if(typeof M!="function")throw new TypeError(e);return w(R)&&(P="leading"in R?!!R.leading:P,j="trailing"in R?!!R.trailing:j),v(M,_,{leading:P,maxWait:_,trailing:j})}function w(M){var _=typeof M;return!!M&&(_=="object"||_=="function")}function C(M){return!!M&&typeof M=="object"}function S(M){return typeof M=="symbol"||C(M)&&f.call(M)==n}function T(M){if(typeof M=="number")return M;if(S(M))return t;if(w(M)){var _=typeof M.valueOf=="function"?M.valueOf():M;M=w(_)?_+"":_}if(typeof M!="string")return M===0?M:+M;M=M.replace(r,"");var R=a.test(M);return R||s.test(M)?o(M.slice(2),R?2:8):i.test(M)?t:+M}return Eb=x,Eb}var LW=AW();const _1=ta(LW);var Km={exports:{}},RW=Km.exports,sE;function DW(){return sE||(sE=1,function(e,t){(function(n,r){e.exports=r()})(RW,function(){var n=function(){this._listeners={}};n.prototype.addEventListener=function(d,l){this._listeners[d]=this._listeners[d]||[],this._listeners[d].indexOf(l)<0&&this._listeners[d].push(l)},n.prototype.removeEventListener=function(d,l){if(this._listeners[d]){var h=this._listeners[d].indexOf(l);h>=0&&this._listeners[d].splice(h,1)}},n.prototype.dispatchEvent=function(d){if(this._listeners[d.type]&&this._listeners[d.type].length)for(var l=this._listeners[d.type].slice(),h=0,f=l.length;h<f;++h)l[h].call(this,d)};var r=function(d){return typeof d.constructor=="function"&&d.constructor.name==="GeneratorFunction"},i=function(d){return{next:function(){var l=d();return l?{value:l}:{done:!0}}}},a=function(d){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:d})}}},s=function(d,l){var h=typeof d;if(h==="object"){if(typeof d.next=="function")return d;if(typeof d.then=="function")return a(d)}return h==="function"?r(d)?d():i(d):a(l.resolve(d))},o=function(d,l,h){this.target=d,this.type=l,this.data=h},c=function(d,l,h){if(n.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=h||{},this._options.promise=this._options.promise||Promise,this._iterator=s(d,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return c.prototype=new n,c.prototype.constructor=c,c.prototype.concurrency=function(d){return typeof d<"u"&&(this._concurrency=d,this.active()&&this._proceed()),this._concurrency},c.prototype.size=function(){return this._size},c.prototype.active=function(){return!!this._promise},c.prototype.promise=function(){return this._promise},c.prototype.start=function(){var d=this,l=this._options.promise;return this._promise=new l(function(h,f){d._callbacks={reject:f,resolve:h},d._proceed()}),this._promise},c.prototype._fireEvent=function(d,l){this.dispatchEvent(new o(this,d,l))},c.prototype._settle=function(d){d?this._callbacks.reject(d):this._callbacks.resolve(),this._promise=null,this._callbacks=null},c.prototype._onPooledPromiseFulfilled=function(d,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:d,result:l}),this._proceed())},c.prototype._onPooledPromiseRejected=function(d,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:d,error:l}),this._settle(l||new Error("Unknown error")))},c.prototype._trackPromise=function(d){var l=this;d.then(function(h){l._onPooledPromiseFulfilled(d,h)},function(h){l._onPooledPromiseRejected(d,h)}).catch(function(h){l._settle(new Error("Promise processing failed: "+h))})},c.prototype._proceed=function(){if(!this._done){for(var d={done:!1};this._size<this._concurrency&&!(d=this._iterator.next()).done;)this._size++,this._trackPromise(d.value);this._done=d===null||!!d.done}this._done&&this._size===0&&this._settle()},c.PromisePoolEvent=o,c.PromisePool=c,c})}(Km)),Km.exports}var jW=DW();const PW=ta(jW);function Zy(e,t,n){if(e&&e.length){const[r,i]=t,a=Math.PI/180*n,s=Math.cos(a),o=Math.sin(a);for(const c of e){const[d,l]=c;c[0]=(d-r)*s-(l-i)*o+r,c[1]=(d-r)*o+(l-i)*s+i}}}function NW(e,t,n){const r=[];e.forEach(i=>r.push(...i)),Zy(r,t,n)}function OW(e,t){return e[0]===t[0]&&e[1]===t[1]}function FW(e,t,n,r=1){const i=n,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,o=[0,0];if(i)for(const d of s)Zy(d,o,i);const c=BW(s,a,r);if(i){for(const d of s)Zy(d,o,-i);NW(c,o,-i)}return c}function BW(e,t,n){const r=[];for(const d of e){const l=[...d];OW(l[0],l[l.length-1])||l.push([l[0][0],l[0][1]]),l.length>2&&r.push(l)}const i=[];t=Math.max(t,.1);const a=[];for(const d of r)for(let l=0;l<d.length-1;l++){const h=d[l],f=d[l+1];if(h[1]!==f[1]){const g=Math.min(h[1],f[1]);a.push({ymin:g,ymax:Math.max(h[1],f[1]),x:g===h[1]?h[0]:f[0],islope:(f[0]-h[0])/(f[1]-h[1])})}}if(a.sort((d,l)=>d.ymin<l.ymin?-1:d.ymin>l.ymin?1:d.x<l.x?-1:d.x>l.x?1:d.ymax===l.ymax?0:(d.ymax-l.ymax)/Math.abs(d.ymax-l.ymax)),!a.length)return i;let s=[],o=a[0].ymin,c=0;for(;s.length||a.length;){if(a.length){let d=-1;for(let h=0;h<a.length&&!(a[h].ymin>o);h++)d=h;a.splice(0,d+1).forEach(h=>{s.push({s:o,edge:h})})}if(s=s.filter(d=>!(d.edge.ymax<=o)),s.sort((d,l)=>d.edge.x===l.edge.x?0:(d.edge.x-l.edge.x)/Math.abs(d.edge.x-l.edge.x)),(n!==1||c%t===0)&&s.length>1)for(let d=0;d<s.length;d=d+2){const l=d+1;if(l>=s.length)break;const h=s[d].edge,f=s[l].edge;i.push([[Math.round(h.x),o],[Math.round(f.x),o]])}o+=n,s.forEach(d=>{d.edge.x=d.edge.x+n*d.edge.islope}),c++}return i}function k1(e,t){var n;const r=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=t.strokeWidth*4),i=Math.max(i,.1);let a=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(a=i),FW(e,i,r,a||1)}class W8{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=k1(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const i of t)r.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],n));return r}}function aU(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class $W extends W8{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=n.strokeWidth*4),r=Math.max(r,.1);const i=Object.assign({},n,{hachureGap:r}),a=k1(t,i),s=Math.PI/180*n.hachureAngle,o=[],c=r*.5*Math.cos(s),d=r*.5*Math.sin(s);for(const[h,f]of a)aU([h,f])&&o.push([[h[0]-c,h[1]+d],[...f]],[[h[0]+c,h[1]-d],[...f]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class zW extends W8{fillPolygons(t,n){const r=this._fillPolygons(t,n),i=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),a=this._fillPolygons(t,i);return r.ops=r.ops.concat(a.ops),r}}class HW{constructor(t){this.helper=t}fillPolygons(t,n){n=Object.assign({},n,{hachureAngle:0});const r=k1(t,n);return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let i=n.hachureGap;i<0&&(i=n.strokeWidth*4),i=Math.max(i,.1);let a=n.fillWeight;a<0&&(a=n.strokeWidth/2);const s=i/4;for(const o of t){const c=aU(o),d=c/i,l=Math.ceil(d)-1,h=c-l*i,f=(o[0][0]+o[1][0])/2-i/4,g=Math.min(o[0][1],o[1][1]);for(let U=0;U<l;U++){const y=g+h+U*i,v=f-s+Math.random()*2*s,x=y-s+Math.random()*2*s,w=this.helper.ellipse(v,x,a,a,n);r.push(...w.ops)}}return{type:"fillSketch",ops:r}}}class WW{constructor(t){this.helper=t}fillPolygons(t,n){const r=k1(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,i=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,a=[];return t.forEach(s=>{const o=aU(s),c=Math.floor(o/(r+i)),d=(o+i-c*(r+i))/2;let l=s[0],h=s[1];l[0]>h[0]&&(l=s[1],h=s[0]);const f=Math.atan((h[1]-l[1])/(h[0]-l[0]));for(let g=0;g<c;g++){const U=g*(r+i),y=U+r,v=[l[0]+U*Math.cos(f)+d*Math.cos(f),l[1]+U*Math.sin(f)+d*Math.sin(f)],x=[l[0]+y*Math.cos(f)+d*Math.cos(f),l[1]+y*Math.sin(f)+d*Math.sin(f)];a.push(...this.helper.doubleLineOps(v[0],v[1],x[0],x[1],n))}}),a}}class XW{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,i=n.zigzagOffset<0?r:n.zigzagOffset;n=Object.assign({},n,{hachureGap:r+i});const a=k1(t,n);return{type:"fillSketch",ops:this.zigzagLines(a,i,n)}}zigzagLines(t,n,r){const i=[];return t.forEach(a=>{const s=aU(a),o=Math.round(s/(2*n));let c=a[0],d=a[1];c[0]>d[0]&&(c=a[1],d=a[0]);const l=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let h=0;h<o;h++){const f=h*2*n,g=(h+1)*2*n,U=Math.sqrt(2*Math.pow(n,2)),y=[c[0]+f*Math.cos(l),c[1]+f*Math.sin(l)],v=[c[0]+g*Math.cos(l),c[1]+g*Math.sin(l)],x=[y[0]+U*Math.cos(l+Math.PI/4),y[1]+U*Math.sin(l+Math.PI/4)];i.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r),...this.helper.doubleLineOps(x[0],x[1],v[0],v[1],r))}}),i}}const Qr={};function VW(e,t){let n=e.fillStyle||"hachure";if(!Qr[n])switch(n){case"zigzag":Qr[n]||(Qr[n]=new $W(t));break;case"cross-hatch":Qr[n]||(Qr[n]=new zW(t));break;case"dots":Qr[n]||(Qr[n]=new HW(t));break;case"dashed":Qr[n]||(Qr[n]=new WW(t));break;case"zigzag-line":Qr[n]||(Qr[n]=new XW(t));break;case"hachure":default:n="hachure",Qr[n]||(Qr[n]=new W8(t));break}return Qr[n]}function YW(){return Math.floor(Math.random()*2**31)}class wM{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const GW=0,Ky=1,EM=2,fm={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function qW(e){const t=new Array;for(;e!=="";)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:GW,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:Ky,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:EM,text:""},t}function Cb(e,t){return e.type===t}function X8(e){const t=[],n=qW(e);let r="BOD",i=0,a=n[i];for(;!Cb(a,EM);){let s=0;const o=[];if(r==="BOD")if(a.text==="M"||a.text==="m")i++,s=fm[a.text],r=a.text;else return X8("M0,0"+e);else Cb(a,Ky)?s=fm[r]:(i++,s=fm[a.text],r=a.text);if(i+s<n.length){for(let c=i;c<i+s;c++){const d=n[c];if(Cb(d,Ky))o[o.length]=+d.text;else throw new Error("Param not a number: "+r+","+d.text)}if(typeof fm[r]=="number"){const c={key:r,data:o};t.push(c),i+=s,a=n[i],r==="M"&&(r="L"),r==="m"&&(r="l")}else throw new Error("Bad segment: "+r)}else throw new Error("Path data ended short")}return t}function CM(e){let t=0,n=0,r=0,i=0;const a=[];for(const{key:s,data:o}of e)switch(s){case"M":a.push({key:"M",data:[...o]}),[t,n]=o,[r,i]=o;break;case"m":t+=o[0],n+=o[1],a.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":a.push({key:"L",data:[...o]}),[t,n]=o;break;case"l":t+=o[0],n+=o[1],a.push({key:"L",data:[t,n]});break;case"C":a.push({key:"C",data:[...o]}),t=o[4],n=o[5];break;case"c":{const c=o.map((d,l)=>l%2?d+n:d+t);a.push({key:"C",data:c}),t=c[4],n=c[5];break}case"Q":a.push({key:"Q",data:[...o]}),t=o[2],n=o[3];break;case"q":{const c=o.map((d,l)=>l%2?d+n:d+t);a.push({key:"Q",data:c}),t=c[2],n=c[3];break}case"A":a.push({key:"A",data:[...o]}),t=o[5],n=o[6];break;case"a":t+=o[5],n+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],t,n]});break;case"H":a.push({key:"H",data:[...o]}),t=o[0];break;case"h":t+=o[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...o]}),n=o[0];break;case"v":n+=o[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...o]}),t=o[2],n=o[3];break;case"s":{const c=o.map((d,l)=>l%2?d+n:d+t);a.push({key:"S",data:c}),t=c[2],n=c[3];break}case"T":a.push({key:"T",data:[...o]}),t=o[0],n=o[1];break;case"t":t+=o[0],n+=o[1],a.push({key:"T",data:[t,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=r,n=i;break}return a}function SM(e){const t=[];let n="",r=0,i=0,a=0,s=0,o=0,c=0;for(const{key:d,data:l}of e){switch(d){case"M":t.push({key:"M",data:[...l]}),[r,i]=l,[a,s]=l;break;case"C":t.push({key:"C",data:[...l]}),r=l[4],i=l[5],o=l[2],c=l[3];break;case"L":t.push({key:"L",data:[...l]}),[r,i]=l;break;case"H":r=l[0],t.push({key:"L",data:[r,i]});break;case"V":i=l[0],t.push({key:"L",data:[r,i]});break;case"S":{let h=0,f=0;n==="C"||n==="S"?(h=r+(r-o),f=i+(i-c)):(h=r,f=i),t.push({key:"C",data:[h,f,...l]}),o=l[0],c=l[1],r=l[2],i=l[3];break}case"T":{const[h,f]=l;let g=0,U=0;n==="Q"||n==="T"?(g=r+(r-o),U=i+(i-c)):(g=r,U=i);const y=r+2*(g-r)/3,v=i+2*(U-i)/3,x=h+2*(g-h)/3,w=f+2*(U-f)/3;t.push({key:"C",data:[y,v,x,w,h,f]}),o=g,c=U,r=h,i=f;break}case"Q":{const[h,f,g,U]=l,y=r+2*(h-r)/3,v=i+2*(f-i)/3,x=g+2*(h-g)/3,w=U+2*(f-U)/3;t.push({key:"C",data:[y,v,x,w,g,U]}),o=h,c=f,r=g,i=U;break}case"A":{const h=Math.abs(l[0]),f=Math.abs(l[1]),g=l[2],U=l[3],y=l[4],v=l[5],x=l[6];h===0||f===0?(t.push({key:"C",data:[r,i,v,x,v,x]}),r=v,i=x):(r!==v||i!==x)&&(_M(r,i,v,x,h,f,g,U,y).forEach(function(C){t.push({key:"C",data:C})}),r=v,i=x);break}case"Z":t.push({key:"Z",data:[]}),r=a,i=s;break}n=d}return t}function ZW(e){return Math.PI*e/180}function wf(e,t,n){const r=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return[r,i]}function _M(e,t,n,r,i,a,s,o,c,d){const l=ZW(s);let h=[],f=0,g=0,U=0,y=0;if(d)[f,g,U,y]=d;else{[e,t]=wf(e,t,-l),[n,r]=wf(n,r,-l);const F=(e-n)/2,B=(t-r)/2;let G=F*F/(i*i)+B*B/(a*a);G>1&&(G=Math.sqrt(G),i=G*i,a=G*a);const W=o===c?-1:1,X=i*i,$=a*a,Y=X*$-X*B*B-$*F*F,H=X*B*B+$*F*F,Z=W*Math.sqrt(Math.abs(Y/H));U=Z*i*B/a+(e+n)/2,y=Z*-a*F/i+(t+r)/2,f=Math.asin(parseFloat(((t-y)/a).toFixed(9))),g=Math.asin(parseFloat(((r-y)/a).toFixed(9))),e<U&&(f=Math.PI-f),n<U&&(g=Math.PI-g),f<0&&(f=Math.PI*2+f),g<0&&(g=Math.PI*2+g),c&&f>g&&(f=f-Math.PI*2),!c&&g>f&&(g=g-Math.PI*2)}let v=g-f;if(Math.abs(v)>Math.PI*120/180){const F=g,B=n,G=r;c&&g>f?g=f+Math.PI*120/180*1:g=f+Math.PI*120/180*-1,n=U+i*Math.cos(g),r=y+a*Math.sin(g),h=_M(n,r,B,G,i,a,s,0,c,[g,F,U,y])}v=g-f;const x=Math.cos(f),w=Math.sin(f),C=Math.cos(g),S=Math.sin(g),T=Math.tan(v/4),M=4/3*i*T,_=4/3*a*T,R=[e,t],P=[e+M*w,t-_*x],j=[n+M*S,r-_*C],N=[n,r];if(P[0]=2*R[0]-P[0],P[1]=2*R[1]-P[1],d)return[P,j,N].concat(h);{h=[P,j,N].concat(h);const F=[];for(let B=0;B<h.length;B+=3){const G=wf(h[B][0],h[B][1],l),W=wf(h[B+1][0],h[B+1][1],l),X=wf(h[B+2][0],h[B+2][1],l);F.push([G[0],G[1],W[0],W[1],X[0],X[1]])}return F}}const KW={randOffset:nX,randOffsetWithRange:rX,ellipse:eX,doubleLineOps:iX};function kM(e,t,n,r,i){return{type:"path",ops:mo(e,t,n,r,i)}}function Qm(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let a=0;a<r-1;a++)i.push(...mo(e[a][0],e[a][1],e[a+1][0],e[a+1][1],n));return t&&i.push(...mo(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}else if(r===2)return kM(e[0][0],e[0][1],e[1][0],e[1][1],n);return{type:"path",ops:[]}}function QW(e,t){return Qm(e,!0,t)}function JW(e,t,n,r,i){const a=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];return QW(a,i)}function oE(e,t){let n=uE(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){const r=uE(e,1.5*(1+t.roughness*.22),aX(t));n=n.concat(r)}return{type:"path",ops:n}}function eX(e,t,n,r,i){const a=TM(n,r,i);return Qy(e,t,i,a).opset}function TM(e,t,n){const r=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=Math.PI*2/i;let s=Math.abs(e/2),o=Math.abs(t/2);const c=1-n.curveFitting;return s+=nt(s*c,n),o+=nt(o*c,n),{increment:a,rx:s,ry:o}}function Qy(e,t,n,r){const[i,a]=hE(r.increment,e,t,r.rx,r.ry,1,r.increment*Og(.1,Og(.4,1,n),n),n);let s=Fg(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[o]=hE(r.increment,e,t,r.rx,r.ry,1.5,0,n),c=Fg(o,null,n);s=s.concat(c)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function lE(e,t,n,r,i,a,s,o,c){const d=e,l=t;let h=Math.abs(n/2),f=Math.abs(r/2);h+=nt(h*.01,c),f+=nt(f*.01,c);let g=i,U=a;for(;g<0;)g+=Math.PI*2,U+=Math.PI*2;U-g>Math.PI*2&&(g=0,U=Math.PI*2);const y=Math.PI*2/c.curveStepCount,v=Math.min(y/2,(U-g)/2),x=fE(v,d,l,h,f,g,U,1,c);if(!c.disableMultiStroke){const w=fE(v,d,l,h,f,g,U,1.5,c);x.push(...w)}return s&&(o?x.push(...mo(d,l,d+h*Math.cos(g),l+f*Math.sin(g),c),...mo(d,l,d+h*Math.cos(U),l+f*Math.sin(U),c)):x.push({op:"lineTo",data:[d,l]},{op:"lineTo",data:[d+h*Math.cos(g),l+f*Math.sin(g)]})),{type:"path",ops:x}}function cE(e,t){const n=SM(CM(X8(e))),r=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of n)switch(s){case"M":{a=[o[0],o[1]],i=[o[0],o[1]];break}case"L":r.push(...mo(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case"C":{const[c,d,l,h,f,g]=o;r.push(...sX(c,d,l,h,f,g,a,t)),a=[f,g];break}case"Z":r.push(...mo(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]];break}return{type:"path",ops:r}}function Sb(e,t){const n=[];for(const r of e)if(r.length){const i=t.maxRandomnessOffset||0,a=r.length;if(a>2){n.push({op:"move",data:[r[0][0]+nt(i,t),r[0][1]+nt(i,t)]});for(let s=1;s<a;s++)n.push({op:"lineTo",data:[r[s][0]+nt(i,t),r[s][1]+nt(i,t)]})}}return{type:"fillPath",ops:n}}function hu(e,t){return VW(t,KW).fillPolygons(e,t)}function tX(e,t,n,r,i,a,s){const o=e,c=t;let d=Math.abs(n/2),l=Math.abs(r/2);d+=nt(d*.01,s),l+=nt(l*.01,s);let h=i,f=a;for(;h<0;)h+=Math.PI*2,f+=Math.PI*2;f-h>Math.PI*2&&(h=0,f=Math.PI*2);const g=(f-h)/s.curveStepCount,U=[];for(let y=h;y<=f;y=y+g)U.push([o+d*Math.cos(y),c+l*Math.sin(y)]);return U.push([o+d*Math.cos(f),c+l*Math.sin(f)]),U.push([o,c]),hu([U],s)}function nX(e,t){return nt(e,t)}function rX(e,t,n){return Og(e,t,n)}function iX(e,t,n,r,i){return mo(e,t,n,r,i,!0)}function aX(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function MM(e){return e.randomizer||(e.randomizer=new wM(e.seed||0)),e.randomizer.next()}function Og(e,t,n,r=1){return n.roughness*r*(MM(n)*(t-e)+e)}function nt(e,t,n=1){return Og(-e,e,t,n)}function mo(e,t,n,r,i,a=!1){const s=a?i.disableMultiStrokeFill:i.disableMultiStroke,o=dE(e,t,n,r,i,!0,!1);if(s)return o;const c=dE(e,t,n,r,i,!0,!0);return o.concat(c)}function dE(e,t,n,r,i,a,s){const o=Math.pow(e-n,2)+Math.pow(t-r,2),c=Math.sqrt(o);let d=1;c<200?d=1:c>500?d=.4:d=-.0016668*c+1.233334;let l=i.maxRandomnessOffset||0;l*l*100>o&&(l=c/10);const h=l/2,f=.2+MM(i)*.2;let g=i.bowing*i.maxRandomnessOffset*(r-t)/200,U=i.bowing*i.maxRandomnessOffset*(e-n)/200;g=nt(g,i,d),U=nt(U,i,d);const y=[],v=()=>nt(h,i,d),x=()=>nt(l,i,d),w=i.preserveVertices;return s?y.push({op:"move",data:[e+(w?0:v()),t+(w?0:v())]}):y.push({op:"move",data:[e+(w?0:nt(l,i,d)),t+(w?0:nt(l,i,d))]}),s?y.push({op:"bcurveTo",data:[g+e+(n-e)*f+v(),U+t+(r-t)*f+v(),g+e+2*(n-e)*f+v(),U+t+2*(r-t)*f+v(),n+(w?0:v()),r+(w?0:v())]}):y.push({op:"bcurveTo",data:[g+e+(n-e)*f+x(),U+t+(r-t)*f+x(),g+e+2*(n-e)*f+x(),U+t+2*(r-t)*f+x(),n+(w?0:x()),r+(w?0:x())]}),y}function uE(e,t,n){const r=[];r.push([e[0][0]+nt(t,n),e[0][1]+nt(t,n)]),r.push([e[0][0]+nt(t,n),e[0][1]+nt(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+nt(t,n),e[i][1]+nt(t,n)]),i===e.length-1&&r.push([e[i][0]+nt(t,n),e[i][1]+nt(t,n)]);return Fg(r,null,n)}function Fg(e,t,n){const r=e.length,i=[];if(r>3){const a=[],s=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let o=1;o+2<r;o++){const c=e[o];a[0]=[c[0],c[1]],a[1]=[c[0]+(s*e[o+1][0]-s*e[o-1][0])/6,c[1]+(s*e[o+1][1]-s*e[o-1][1])/6],a[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],a[3]=[e[o+1][0],e[o+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else r===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...mo(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function hE(e,t,n,r,i,a,s,o){const c=o.roughness===0,d=[],l=[];if(c){e=e/4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let h=0;h<=Math.PI*2;h=h+e){const f=[t+r*Math.cos(h),n+i*Math.sin(h)];d.push(f),l.push(f)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const h=nt(.5,o)-Math.PI/2;l.push([nt(a,o)+t+.9*r*Math.cos(h-e),nt(a,o)+n+.9*i*Math.sin(h-e)]);const f=Math.PI*2+h-.01;for(let g=h;g<f;g=g+e){const U=[nt(a,o)+t+r*Math.cos(g),nt(a,o)+n+i*Math.sin(g)];d.push(U),l.push(U)}l.push([nt(a,o)+t+r*Math.cos(h+Math.PI*2+s*.5),nt(a,o)+n+i*Math.sin(h+Math.PI*2+s*.5)]),l.push([nt(a,o)+t+.98*r*Math.cos(h+s),nt(a,o)+n+.98*i*Math.sin(h+s)]),l.push([nt(a,o)+t+.9*r*Math.cos(h+s*.5),nt(a,o)+n+.9*i*Math.sin(h+s*.5)])}return[l,d]}function fE(e,t,n,r,i,a,s,o,c){const d=a+nt(.1,c),l=[];l.push([nt(o,c)+t+.9*r*Math.cos(d-e),nt(o,c)+n+.9*i*Math.sin(d-e)]);for(let h=d;h<=s;h=h+e)l.push([nt(o,c)+t+r*Math.cos(h),nt(o,c)+n+i*Math.sin(h)]);return l.push([t+r*Math.cos(s),n+i*Math.sin(s)]),l.push([t+r*Math.cos(s),n+i*Math.sin(s)]),Fg(l,null,c)}function sX(e,t,n,r,i,a,s,o){const c=[],d=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let l=[0,0];const h=o.disableMultiStroke?1:2,f=o.preserveVertices;for(let g=0;g<h;g++)g===0?c.push({op:"move",data:[s[0],s[1]]}):c.push({op:"move",data:[s[0]+(f?0:nt(d[0],o)),s[1]+(f?0:nt(d[0],o))]}),l=f?[i,a]:[i+nt(d[g],o),a+nt(d[g],o)],c.push({op:"bcurveTo",data:[e+nt(d[g],o),t+nt(d[g],o),n+nt(d[g],o),r+nt(d[g],o),l[0],l[1]]});return c}function Ef(e){return[...e]}function oX(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(n===3)r.push(Ef(e[0]),Ef(e[1]),Ef(e[2]),Ef(e[2]));else{const i=[];i.push(e[0],e[0]);for(let o=1;o<e.length;o++)i.push(e[o]),o===e.length-1&&i.push(e[o]);const a=[],s=1-t;r.push(Ef(i[0]));for(let o=1;o+2<i.length;o++){const c=i[o];a[0]=[c[0],c[1]],a[1]=[c[0]+(s*i[o+1][0]-s*i[o-1][0])/6,c[1]+(s*i[o+1][1]-s*i[o-1][1])/6],a[2]=[i[o+1][0]+(s*i[o][0]-s*i[o+2][0])/6,i[o+1][1]+(s*i[o][1]-s*i[o+2][1])/6],a[3]=[i[o+1][0],i[o+1][1]],r.push(a[1],a[2],a[3])}}return r}function lX(e,t){return Math.sqrt(Jm(e,t))}function Jm(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function cX(e,t,n){const r=Jm(t,n);if(r===0)return Jm(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Jm(e,yc(t,n,i))}function yc(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function dX(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];let s=3*r[0]-2*n[0]-a[0];s*=s;let o=3*r[1]-2*n[1]-a[1];o*=o;let c=3*i[0]-2*a[0]-n[0];c*=c;let d=3*i[1]-2*a[1]-n[1];return d*=d,s<c&&(s=c),o<d&&(o=d),s+o}function Jy(e,t,n,r){const i=r||[];if(dX(e,t)<n){const a=e[t+0];i.length?lX(i[i.length-1],a)>1&&i.push(a):i.push(a),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],c=e[t+2],d=e[t+3],l=yc(s,o,.5),h=yc(o,c,.5),f=yc(c,d,.5),g=yc(l,h,.5),U=yc(h,f,.5),y=yc(g,U,.5);Jy([s,l,g,y],0,n,i),Jy([y,U,f,d],0,n,i)}return i}function e3(e,t,n,r,i){const a=i||[],s=e[t],o=e[n-1];let c=0,d=1;for(let l=t+1;l<n-1;++l){const h=cX(e[l],s,o);h>c&&(c=h,d=l)}return Math.sqrt(c)>r?(e3(e,t,d+1,r,a),e3(e,d,n,r,a)):(a.length||a.push(s),a.push(o)),a}function uX(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let a=0;a<i;a++){const s=a*3;Jy(e,s,t,r)}return n&&n>0?e3(r,0,r.length,n):r}function hX(e,t){return Math.sqrt(eg(e,t))}function eg(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function fX(e,t,n){const r=eg(t,n);if(r===0)return eg(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),eg(e,vc(t,n,i))}function vc(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function pX(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];let s=3*r[0]-2*n[0]-a[0];s*=s;let o=3*r[1]-2*n[1]-a[1];o*=o;let c=3*i[0]-2*a[0]-n[0];c*=c;let d=3*i[1]-2*a[1]-n[1];return d*=d,s<c&&(s=c),o<d&&(o=d),s+o}function t3(e,t,n,r){const i=r||[];if(pX(e,t)<n){const a=e[t+0];i.length?hX(i[i.length-1],a)>1&&i.push(a):i.push(a),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],c=e[t+2],d=e[t+3],l=vc(s,o,.5),h=vc(o,c,.5),f=vc(c,d,.5),g=vc(l,h,.5),U=vc(h,f,.5),y=vc(g,U,.5);t3([s,l,g,y],0,n,i),t3([y,U,f,d],0,n,i)}return i}function mX(e,t){return n3(e,0,e.length,t)}function n3(e,t,n,r,i){const a=i||[],s=e[t],o=e[n-1];let c=0,d=1;for(let l=t+1;l<n-1;++l){const h=fX(e[l],s,o);h>c&&(c=h,d=l)}return Math.sqrt(c)>r?(n3(e,t,d+1,r,a),n3(e,d,n,r,a)):(a.length||a.push(s),a.push(o)),a}function gX(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let a=0;a<i;a++){const s=a*3;t3(e,s,t,r)}return r}function UX(e,t,n){const r=X8(e),i=SM(CM(r)),a=[];let s=[],o=[0,0],c=[];const d=()=>{c.length>=4&&s.push(...gX(c,t)),c=[]},l=()=>{d(),s.length&&(a.push(s),s=[])};for(const{key:f,data:g}of i)switch(f){case"M":l(),o=[g[0],g[1]],s.push(o);break;case"L":d(),s.push([g[0],g[1]]);break;case"C":if(!c.length){const U=s.length?s[s.length-1]:o;c.push([U[0],U[1]])}c.push([g[0],g[1]]),c.push([g[2],g[3]]),c.push([g[4],g[5]]);break;case"Z":d(),s.push([o[0],o[1]]);break}if(l(),!n)return a;const h=[];for(const f of a){const g=mX(f,n);g.length&&h.push(g)}return h}const gi="none";class Wp{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return YW()}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,i,a){const s=this._o(a);return this._d("line",[kM(t,n,r,i,s)],s)}rectangle(t,n,r,i,a){const s=this._o(a),o=[],c=JW(t,n,r,i,s);if(s.fill){const d=[[t,n],[t+r,n],[t+r,n+i],[t,n+i]];s.fillStyle==="solid"?o.push(Sb([d],s)):o.push(hu([d],s))}return s.stroke!==gi&&o.push(c),this._d("rectangle",o,s)}ellipse(t,n,r,i,a){const s=this._o(a),o=[],c=TM(r,i,s),d=Qy(t,n,s,c);if(s.fill)if(s.fillStyle==="solid"){const l=Qy(t,n,s,c).opset;l.type="fillPath",o.push(l)}else o.push(hu([d.estimatedPoints],s));return s.stroke!==gi&&o.push(d.opset),this._d("ellipse",o,s)}circle(t,n,r,i){const a=this.ellipse(t,n,r,r,i);return a.shape="circle",a}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Qm(t,!1,r)],r)}arc(t,n,r,i,a,s,o=!1,c){const d=this._o(c),l=[],h=lE(t,n,r,i,a,s,o,!0,d);if(o&&d.fill)if(d.fillStyle==="solid"){const f=Object.assign({},d);f.disableMultiStroke=!0;const g=lE(t,n,r,i,a,s,!0,!1,f);g.type="fillPath",l.push(g)}else l.push(tX(t,n,r,i,a,s,d));return d.stroke!==gi&&l.push(h),this._d("arc",l,d)}curve(t,n){const r=this._o(n),i=[],a=oE(t,r);if(r.fill&&r.fill!==gi&&t.length>=3)if(r.fillStyle==="solid"){const s=oE(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=oX(t),o=uX(s,10,(1+r.roughness)/2);i.push(hu([o],r))}return r.stroke!==gi&&i.push(a),this._d("curve",i,r)}polygon(t,n){const r=this._o(n),i=[],a=Qm(t,!0,r);return r.fill&&(r.fillStyle==="solid"?i.push(Sb([t],r)):i.push(hu([t],r))),r.stroke!==gi&&i.push(a),this._d("polygon",i,r)}path(t,n){const r=this._o(n),i=[];if(!t)return this._d("path",i,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=r.fill&&r.fill!=="transparent"&&r.fill!==gi,s=r.stroke!==gi,o=!!(r.simplification&&r.simplification<1),c=o?4-4*(r.simplification||1):(1+r.roughness)/2,d=UX(t,1,c),l=cE(t,r);if(a)if(r.fillStyle==="solid")if(d.length===1){const h=cE(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(Sb(d,r));else i.push(hu(d,r));return s&&(o?d.forEach(h=>{i.push(Qm(h,!1,r))}):i.push(l)),this._d("path",i,r)}opsToPath(t,n){let r="";for(const i of t.ops){const a=typeof n=="number"&&n>=0?i.data.map(s=>+s.toFixed(n)):i.data;switch(i.op){case"move":r+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":r+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":r+=`L${a[0]} ${a[1]} `;break}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,i=[];for(const a of n){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:gi};break;case"fillPath":s={d:this.opsToPath(a),stroke:gi,strokeWidth:0,fill:r.fill||gi};break;case"fillSketch":s=this.fillSketch(a,r);break}s&&i.push(s)}return i}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||gi,strokeWidth:r,fill:gi}}_mergedShape(t){return t.filter((n,r)=>r===0?!0:n.op!=="move")}}class bX{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Wp(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const s of n)switch(s.type){case"path":i.save(),i.strokeStyle=r.stroke==="none"?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=r.fill||"";const o=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,r);break}}fillSketch(t,n,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=i,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,i="nonzero"){t.beginPath();for(const a of n.ops){const s=typeof r=="number"&&r>=0?a.data.map(o=>+o.toFixed(r)):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1]);break}}n.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,i,a){const s=this.gen.line(t,n,r,i,a);return this.draw(s),s}rectangle(t,n,r,i,a){const s=this.gen.rectangle(t,n,r,i,a);return this.draw(s),s}ellipse(t,n,r,i,a){const s=this.gen.ellipse(t,n,r,i,a);return this.draw(s),s}circle(t,n,r,i){const a=this.gen.circle(t,n,r,i);return this.draw(a),a}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,i,a,s,o=!1,c){const d=this.gen.arc(t,n,r,i,a,s,o,c);return this.draw(d),d}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}}const pm="http://www.w3.org/2000/svg";class yX{constructor(t,n){this.svg=t,this.gen=new Wp(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(pm,"g"),s=t.options.fixedDecimalPlaceDigits;for(const o of n){let c=null;switch(o.type){case"path":{c=i.createElementNS(pm,"path"),c.setAttribute("d",this.opsToPath(o,s)),c.setAttribute("stroke",r.stroke),c.setAttribute("stroke-width",r.strokeWidth+""),c.setAttribute("fill","none"),r.strokeLineDash&&c.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break}case"fillPath":{c=i.createElementNS(pm,"path"),c.setAttribute("d",this.opsToPath(o,s)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",r.fill||""),(t.shape==="curve"||t.shape==="polygon")&&c.setAttribute("fill-rule","evenodd");break}case"fillSketch":{c=this.fillSketch(i,o,r);break}}c&&a.appendChild(c)}return a}fillSketch(t,n,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2);const a=t.createElementNS(pm,"path");return a.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),a.setAttribute("stroke",r.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),r.fillLineDash&&a.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,i,a){const s=this.gen.line(t,n,r,i,a);return this.draw(s)}rectangle(t,n,r,i,a){const s=this.gen.rectangle(t,n,r,i,a);return this.draw(s)}ellipse(t,n,r,i,a){const s=this.gen.ellipse(t,n,r,i,a);return this.draw(s)}circle(t,n,r,i){const a=this.gen.circle(t,n,r,i);return this.draw(a)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,i,a,s,o=!1,c){const d=this.gen.arc(t,n,r,i,a,s,o,c);return this.draw(d)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}const Wl={canvas(e,t){return new bX(e,t)},svg(e,t){return new yX(e,t)},generator(e){return new Wp(e)},newSeed(){return Wp.newSeed()}};function pE(e,t,n,r=i=>i){return e*r(.5-t*(.5-n))}function vX(e){return[-e[0],-e[1]]}function Ua(e,t){return[e[0]+t[0],e[1]+t[1]]}function Fi(e,t){return[e[0]-t[0],e[1]-t[1]]}function pa(e,t){return[e[0]*t,e[1]*t]}function xX(e,t){return[e[0]/t,e[1]/t]}function Cf(e){return[e[1],-e[0]]}function mE(e,t){return e[0]*t[0]+e[1]*t[1]}function wX(e,t){return e[0]===t[0]&&e[1]===t[1]}function EX(e){return Math.hypot(e[0],e[1])}function CX(e){return e[0]*e[0]+e[1]*e[1]}function gE(e,t){return CX(Fi(e,t))}function IM(e){return xX(e,EX(e))}function SX(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Sf(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=e[0]-t[0],s=e[1]-t[1],o=a*i-s*r,c=a*r+s*i;return[o+t[0],c+t[1]]}function r3(e,t,n){return Ua(e,pa(Fi(t,e),n))}function UE(e,t,n){return Ua(e,pa(t,n))}var{min:Qd,PI:_X}=Math,bE=.275,_f=_X+1e-4;function kX(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:a=!0,easing:s=$=>$,start:o={},end:c={},last:d=!1}=t,{cap:l=!0,easing:h=$=>$*(2-$)}=o,{cap:f=!0,easing:g=$=>--$*$*$+1}=c;if(e.length===0||n<=0)return[];let U=e[e.length-1].runningLength,y=o.taper===!1?0:o.taper===!0?Math.max(n,U):o.taper,v=c.taper===!1?0:c.taper===!0?Math.max(n,U):c.taper,x=Math.pow(n*r,2),w=[],C=[],S=e.slice(0,10).reduce(($,Y)=>{let H=Y.pressure;if(a){let Z=Qd(1,Y.distance/n),V=Qd(1,1-Z);H=Qd(1,$+(V-$)*(Z*bE))}return($+H)/2},e[0].pressure),T=pE(n,i,e[e.length-1].pressure,s),M,_=e[0].vector,R=e[0].point,P=R,j=R,N=P,F=!1;for(let $=0;$<e.length;$++){let{pressure:Y}=e[$],{point:H,vector:Z,distance:V,runningLength:te}=e[$];if($<e.length-1&&U-te<3)continue;if(i){if(a){let Le=Qd(1,V/n),de=Qd(1,1-Le);Y=Qd(1,S+(de-S)*(Le*bE))}T=pE(n,i,Y,s)}else T=n/2;M===void 0&&(M=T);let ce=te<y?h(te/y):1,be=U-te<v?g((U-te)/v):1;T=Math.max(.01,T*Math.min(ce,be));let fe=($<e.length-1?e[$+1]:e[$]).vector,Se=$<e.length-1?mE(Z,fe):1,Ue=mE(Z,_)<0&&!F,ye=Se!==null&&Se<0;if(Ue||ye){let Le=pa(Cf(_),T);for(let de=1/13,Te=0;Te<=1;Te+=de)j=Sf(Fi(H,Le),H,_f*Te),w.push(j),N=Sf(Ua(H,Le),H,_f*-Te),C.push(N);R=j,P=N,ye&&(F=!0);continue}if(F=!1,$===e.length-1){let Le=pa(Cf(Z),T);w.push(Fi(H,Le)),C.push(Ua(H,Le));continue}let je=pa(Cf(r3(fe,Z,Se)),T);j=Fi(H,je),($<=1||gE(R,j)>x)&&(w.push(j),R=j),N=Ua(H,je),($<=1||gE(P,N)>x)&&(C.push(N),P=N),S=Y,_=Z}let B=e[0].point.slice(0,2),G=e.length>1?e[e.length-1].point.slice(0,2):Ua(e[0].point,[1,1]),W=[],X=[];if(e.length===1){if(!(y||v)||d){let $=UE(B,IM(Cf(Fi(B,G))),-(M||T)),Y=[];for(let H=1/13,Z=H;Z<=1;Z+=H)Y.push(Sf($,B,_f*2*Z));return Y}}else{if(!(y||v&&e.length===1))if(l)for(let Y=1/13,H=Y;H<=1;H+=Y){let Z=Sf(C[0],B,_f*H);W.push(Z)}else{let Y=Fi(w[0],C[0]),H=pa(Y,.5),Z=pa(Y,.51);W.push(Fi(B,H),Fi(B,Z),Ua(B,Z),Ua(B,H))}let $=Cf(vX(e[e.length-1].vector));if(v||y&&e.length===1)X.push(G);else if(f){let Y=UE(G,$,T);for(let H=1/29,Z=H;Z<1;Z+=H)X.push(Sf(Y,G,_f*3*Z))}else X.push(Ua(G,pa($,T)),Ua(G,pa($,T*.99)),Fi(G,pa($,T*.99)),Fi(G,pa($,T)))}return w.concat(X,C.reverse(),W)}function TX(e,t={}){var n;let{streamline:r=.5,size:i=16,last:a=!1}=t;if(e.length===0)return[];let s=.15+(1-r)*.85,o=Array.isArray(e[0])?e:e.map(({x:g,y:U,pressure:y=.5})=>[g,U,y]);if(o.length===2){let g=o[1];o=o.slice(0,-1);for(let U=1;U<5;U++)o.push(r3(o[0],g,U/4))}o.length===1&&(o=[...o,[...Ua(o[0],[1,1]),...o[0].slice(2)]]);let c=[{point:[o[0][0],o[0][1]],pressure:o[0][2]>=0?o[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,l=0,h=c[0],f=o.length-1;for(let g=1;g<o.length;g++){let U=a&&g===f?o[g].slice(0,2):r3(h.point,o[g],s);if(wX(h.point,U))continue;let y=SX(U,h.point);if(l+=y,g<f&&!d){if(l<i)continue;d=!0}h={point:U,pressure:o[g][2]>=0?o[g][2]:.5,vector:IM(Fi(h.point,U)),distance:y,runningLength:l},c.push(h)}return c[0].vector=((n=c[1])==null?void 0:n.vector)||[0,0],c}function MX(e,t={}){return kX(TX(e,t),t)}function AM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=AM(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function De(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=AM(t))&&(r&&(r+=" "),r+=n);return r}function IX(e,t){return Math.sqrt(tg(e,t))}function tg(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function AX(e,t,n){const r=tg(t,n);if(r===0)return tg(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),tg(e,xc(t,n,i))}function xc(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function LX(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];let s=3*r[0]-2*n[0]-a[0];s*=s;let o=3*r[1]-2*n[1]-a[1];o*=o;let c=3*i[0]-2*a[0]-n[0];c*=c;let d=3*i[1]-2*a[1]-n[1];return d*=d,s<c&&(s=c),o<d&&(o=d),s+o}function i3(e,t,n,r){const i=r||[];if(LX(e,t)<n){const a=e[t+0];i.length?IX(i[i.length-1],a)>1&&i.push(a):i.push(a),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],c=e[t+2],d=e[t+3],l=xc(s,o,.5),h=xc(o,c,.5),f=xc(c,d,.5),g=xc(l,h,.5),U=xc(h,f,.5),y=xc(g,U,.5);i3([s,l,g,y],0,n,i),i3([y,U,f,d],0,n,i)}return i}function RX(e,t){return Bg(e,0,e.length,t)}function Bg(e,t,n,r,i){const a=i||[],s=e[t],o=e[n-1];let c=0,d=1;for(let l=t+1;l<n-1;++l){const h=AX(e[l],s,o);h>c&&(c=h,d=l)}return Math.sqrt(c)>r?(Bg(e,t,d+1,r,a),Bg(e,d,n,r,a)):(a.length||a.push(s),a.push(o)),a}function DX(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let a=0;a<i;a++){const s=a*3;i3(e,s,t,r)}return Bg(r,0,r.length,n)}var kf={},yE;function jX(){if(yE)return kf;yE=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.sanitizeUrl=void 0;var e=/^([^\w]*)(javascript|data|vbscript)/im,t=/&#(\w+)(^\w|;)?/g,n=/&(newline|tab);/gi,r=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,i=/^.+(:|:)/gim,a=[".","/"];function s(d){return a.indexOf(d[0])>-1}function o(d){return d.replace(t,function(l,h){return String.fromCharCode(h)})}function c(d){var l=o(d||"").replace(n,"").replace(r,"").trim();if(!l)return"about:blank";if(s(l))return l;var h=l.match(i);if(!h)return l;var f=h[0];return e.test(f)?"about:blank":l}return kf.sanitizeUrl=c,kf}var LM=jX();const RM="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function mu(e,t,n){const r=n[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===r||t&&t.slice(-1)===r)throw new Error("trailing zero");if(t){let s=0;for(;(e[s]||r)===t[s];)s++;if(s>0)return t.slice(0,s)+mu(e.slice(s),t.slice(s),n)}const i=e?n.indexOf(e[0]):0,a=t!=null?n.indexOf(t[0]):n.length;if(a-i>1){const s=Math.round(.5*(i+a));return n[s]}else return t&&t.length>1?t.slice(0,1):n[i]+mu(e.slice(1),null,n)}function DM(e){if(e.length!==jM(e[0]))throw new Error("invalid integer part of order key: "+e)}function jM(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function Zf(e){const t=jM(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function vE(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const n=Zf(e);if(e.slice(n.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function xE(e,t){DM(e);const[n,...r]=e.split("");let i=!0;for(let a=r.length-1;i&&a>=0;a--){const s=t.indexOf(r[a])+1;s===t.length?r[a]=t[0]:(r[a]=t[s],i=!1)}if(i){if(n==="Z")return"a"+t[0];if(n==="z")return null;const a=String.fromCharCode(n.charCodeAt(0)+1);return a>"a"?r.push(t[0]):r.pop(),a+r.join("")}else return n+r.join("")}function PX(e,t){DM(e);const[n,...r]=e.split("");let i=!0;for(let a=r.length-1;i&&a>=0;a--){const s=t.indexOf(r[a])-1;s===-1?r[a]=t.slice(-1):(r[a]=t[s],i=!1)}if(i){if(n==="a")return"Z"+t.slice(-1);if(n==="A")return null;const a=String.fromCharCode(n.charCodeAt(0)-1);return a<"Z"?r.push(t.slice(-1)):r.pop(),a+r.join("")}else return n+r.join("")}function Jd(e,t,n=RM){if(e!=null&&vE(e,n),t!=null&&vE(t,n),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+n[0];const c=Zf(t),d=t.slice(c.length);if(c==="A"+n[0].repeat(26))return c+mu("",d,n);if(c<t)return c;const l=PX(c,n);if(l==null)throw new Error("cannot decrement any more");return l}if(t==null){const c=Zf(e),d=e.slice(c.length),l=xE(c,n);return l??c+mu(d,null,n)}const r=Zf(e),i=e.slice(r.length),a=Zf(t),s=t.slice(a.length);if(r===a)return r+mu(i,s,n);const o=xE(r,n);if(o==null)throw new Error("cannot increment any more");return o<t?o:r+mu(i,null,n)}function a3(e,t,n,r=RM){if(n===0)return[];if(n===1)return[Jd(e,t,r)];if(t==null){let s=Jd(e,t,r);const o=[s];for(let c=0;c<n-1;c++)s=Jd(s,t,r),o.push(s);return o}if(e==null){let s=Jd(e,t,r);const o=[s];for(let c=0;c<n-1;c++)s=Jd(e,s,r),o.push(s);return o.reverse(),o}const i=Math.floor(n/2),a=Jd(e,t,r);return[...a3(e,a,i,r),a,...a3(a,t,n-i-1,r)]}const md=(()=>{if(typeof self>"u")return!1;if(!("top"in self&&self!==top)){if("showOpenFilePicker"in self)return"showOpenFilePicker"}return!1})(),NX=md?ge(()=>import("./file-open-002ab408-DIuFHtCF.js"),[],import.meta.url):ge(()=>import("./file-open-7c801643-684qeFg4.js"),[],import.meta.url);async function OX(...e){return(await NX).default(...e)}md?ge(()=>import("./directory-open-4ed118d0-BzWybGaI.js"),[],import.meta.url):ge(()=>import("./directory-open-01563666-DWU9wJ6I.js"),[],import.meta.url);const FX=md?ge(()=>import("./file-save-745eba88-Bb9F9Kg7.js"),[],import.meta.url):ge(()=>import("./file-save-3189631c-x92wctJd.js"),[],import.meta.url);async function BX(...e){return(await FX).default(...e)}var $X=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),zX=5,fu=5,HX=4,Kf=4,Qf=1,ua=[0,2,4,6,8],ha=(e,t)=>t.map(n=>or[e][n]),pt={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:ha("gray",ua),red:ha("red",ua),pink:ha("pink",ua),grape:ha("grape",ua),violet:ha("violet",ua),blue:ha("blue",ua),cyan:ha("cyan",ua),teal:ha("teal",ua),green:ha("green",ua),yellow:ha("yellow",ua),orange:ha("orange",ua),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},PM=$X(pt,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),NM=[pt.black,pt.red[Kf],pt.green[Kf],pt.blue[Kf],pt.yellow[Kf]],OM=[pt.transparent,pt.red[Qf],pt.green[Qf],pt.blue[Qf],pt.yellow[Qf]],FM=[pt.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],WX={transparent:pt.transparent,white:pt.white,gray:pt.gray,black:pt.black,bronze:pt.bronze,...PM},XX={transparent:pt.transparent,white:pt.white,gray:pt.gray,black:pt.black,bronze:pt.bronze,...PM},VX=e=>[pt.cyan[e],pt.blue[e],pt.violet[e],pt.grape[e],pt.pink[e],pt.green[e],pt.teal[e],pt.yellow[e],pt.orange[e],pt.red[e]],YX=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`,gs=/Mac|iPod|iPhone|iPad/.test(navigator.platform),BM=/^Win/.test(navigator.platform),GX=/\b(android)\b/i.test(navigator.userAgent),Xp="netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,qX=navigator.userAgent.indexOf("Chrome")!==-1,ZX=!qX&&navigator.userAgent.indexOf("Safari")!==-1,$M=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,KX=()=>{var e,t;return((t=(e=navigator.brave)==null?void 0:e.isBrave)==null?void 0:t.name)==="isBrave"},s3=typeof window<"u"&&"ResizeObserver"in window,QX="Excalidraw",JX=36,wc=10,ng=8,eV=5,wE=1,tV=30,jl=Math.PI/12,nV="red",Ot={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},hl={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},eu={enabled:"all",disabled:"none"},mm={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},si={TEST:"test"},Bu={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper"},gu="Xiaolai",Vp="Segoe UI Emoji",fn={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},Uu={[gu]:100,[Vp]:1e3},zM=e=>{switch(e){case fn.Excalifont:return[gu,Vp];default:return[Vp]}},yt={LIGHT:"light",DARK:"dark"},pn={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},V8=1,Mo=20,Xl=fn.Excalifont,T1="left",$g="top",Jc=2,zg=2*Jc,rV=1e-5,iV=2*zg-rV,gm="#ffffff",aV="#1e1e1e",sV="#a2f1a6",Hg=20,HM=5,$u={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Be={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json","excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...$u},oV=[Be.text,Be.html,...Object.values($u)],_b={png:"png",svg:"svg",clipboard:"clipboard"},Vi={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Y8=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,lV=500,cV=300,dV=500,uV=100,sU=.1,G8=.1,q8=30,hV=300,Z8="invert(93%) hue-rotate(180deg)",EE={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0}},fV=730,pV=1e3,mV=500,gV=1229,Tf=2,K8=[1,2,3],bh=10,UV=1440,CE=4*1024*1024,kt="http://www.w3.org/2000/svg",oU={excalidraw:2,excalidrawLibrary:2},Fn=5,bV=.7,yV=11,yi={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},Yp={LEFT:"left",CENTER:"center",RIGHT:"right"},vV=20,kb=.25,xV=32,Bn={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},WM={artist:1,cartoonist:2},Tb={thin:1,bold:2,extraBold:4},vn={strokeColor:pt.black,backgroundColor:pt.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:WM.artist,opacity:100,locked:!1},Wg="library",Mu="search",ka={name:"default",defaultTab:Wg},XM=new Set(["iframe","embeddable","image"]),Yn={selection:"selection",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",text:"text",image:"image",eraser:"eraser",frame:"frame",magicframe:"magicframe",laser:"laser"},mp={MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},VM="Untitled",bu={generalStats:1,elementProperties:2},Bi=1,ir={sharp:"sharp",round:"round",elbow:"elbow"},YM=.3,Xg="element",wV=Symbol.for("__test__originalId__"),EV=(e=>(e.ACTIVE="active",e.AWAY="away",e.IDLE="idle",e))(EV||{}),CV=K8.includes(devicePixelRatio)?devicePixelRatio:1,Us=()=>({showWelcomeScreen:!1,theme:yt.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:vn.backgroundColor,currentItemEndArrowhead:"arrow",currentItemFillStyle:vn.fillStyle,currentItemFontFamily:Xl,currentItemFontSize:Mo,currentItemOpacity:vn.opacity,currentItemRoughness:vn.roughness,currentItemStartArrowhead:null,currentItemStrokeColor:vn.strokeColor,currentItemRoundness:"round",currentItemArrowType:ir.round,currentItemStrokeStyle:vn.strokeStyle,currentItemStrokeWidth:vn.strokeWidth,currentItemTextAlign:T1,currentHoveredFontFamily:null,cursorButton:"up",activeEmbeddable:null,newElement:null,editingTextElement:null,editingGroupId:null,editingLinearElement:null,activeTool:{type:"selection",customType:null,locked:vn.locked,lastActiveTool:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:CV,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:Hg,gridStep:HM,gridModeEnabled:!1,isBindingEnabled:!0,defaultSidebarDockedPreference:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:null,contextMenu:null,openMenu:null,openPopup:null,openSidebar:null,openDialog:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},hoveredElementIds:{},selectedGroupIds:{},selectedElementsAreBeingDragged:!1,selectionElement:null,shouldCacheIgnoreZoom:!1,stats:{open:!1,panels:bu.generalStats|bu.elementProperties},startBoundElement:null,suggestedBindings:[],frameRendering:{enabled:!0,clip:!0,name:!0,outline:!0},frameToHighlight:null,editingFrame:null,elementsToHighlight:null,toast:null,viewBackgroundColor:pt.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElementId:null,showHyperlinkPopup:!1,selectedLinearElement:null,snapLines:[],originSnapOffset:{x:0,y:0},objectsSnapModeEnabled:!1,userToFollow:null,followedBy:new Set,isCropping:!1,croppingElementId:null,searchMatches:[]}),SV=(e=>e)({showWelcomeScreen:{browser:!0,export:!1,server:!1},theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemRoundness:{browser:!0,export:!1,server:!1},currentItemArrowType:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},currentHoveredFontFamily:{browser:!1,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},activeEmbeddable:{browser:!1,export:!1,server:!1},newElement:{browser:!1,export:!1,server:!1},editingTextElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},gridStep:{browser:!0,export:!0,server:!0},gridModeEnabled:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},defaultSidebarDockedPreference:{browser:!0,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},contextMenu:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},openSidebar:{browser:!0,export:!1,server:!1},openDialog:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},hoveredElementIds:{browser:!1,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectedElementsAreBeingDragged:{browser:!1,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},stats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},frameRendering:{browser:!1,export:!1,server:!1},frameToHighlight:{browser:!1,export:!1,server:!1},editingFrame:{browser:!1,export:!1,server:!1},elementsToHighlight:{browser:!1,export:!1,server:!1},toast:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElementId:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1},selectedLinearElement:{browser:!0,export:!1,server:!1},snapLines:{browser:!1,export:!1,server:!1},originSnapOffset:{browser:!1,export:!1,server:!1},objectsSnapModeEnabled:{browser:!0,export:!1,server:!1},userToFollow:{browser:!1,export:!1,server:!1},followedBy:{browser:!1,export:!1,server:!1},isCropping:{browser:!1,export:!1,server:!1},croppingElementId:{browser:!1,export:!1,server:!1},searchMatches:{browser:!1,export:!1,server:!1}}),_V=(e,t)=>{var r;let n={};for(let i of Object.keys(e))if((r=SV[i])!=null&&r[t]){let a=e[i];n[i]=a}return n},GM=e=>_V(e,"export"),ts=({activeTool:e})=>e.type==="eraser",zu=({activeTool:e})=>e.type==="hand",mt=(e,t,n)=>Math.min(Math.max(e,t),n),hs=(e,t,n="round")=>{let r=Math.pow(10,t);return Math[n]((e+Number.EPSILON)*r)/r},kV=(e,t,n="round")=>{let r=1/t;return Math[n](e*r)/r},Um=(e,t)=>(e+t)/2,gp=e=>typeof e=="number"&&Number.isFinite(e),SE=(e,t,n=1e-4)=>Math.abs(e-t)<n,Vg=e=>e<0?e+2*Math.PI:e>=2*Math.PI?e-2*Math.PI:e;function Bc(e){return e*Math.PI/180}function M1(e){return e*180/Math.PI}function TV(e){return Math.abs(Math.sin(2*e))<1e-4}function hr(e,t,n=0,r=0){return[e-n,t-r]}function Fe(e,t=[0,0]){return hr(e[0]-t[0],e[1]-t[1])}function Vn(e,t){return e[0]*t[1]-t[0]*e[1]}function _E(e,t){return e[0]*t[0]+e[1]*t[1]}function Cl(e,t){return[e[0]+t[0],e[1]+t[1]]}function Yg(e,t){return[e[0]-t[0],e[1]-t[1]]}function wn(e,t){return hr(e[0]*t,e[1]*t)}function MV(e){return e[0]*e[0]+e[1]*e[1]}function IV(e){return Math.sqrt(MV(e))}var _r=e=>{let t=IV(e);return t===0?hr(0,0):hr(e[0]/t,e[1]/t)};function A(e,t){return[e,t]}function Q8(e){return e.length===2?A(e[0],e[1]):void 0}function gt(e,t=A(0,0)){return A(t[0]+e[0],t[1]+e[1])}function AV(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&!isNaN(e[0])&&typeof e[1]=="number"&&!isNaN(e[1])}function La(e,t){let n=Math.abs;return n(e[0]-t[0])<1e-4&&n(e[1]-t[1])<1e-4}function oe([e,t],[n,r],i){return A((e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r)}function Gg(e,t=[0,0]){return A(e[0]+t[0],e[1]+t[1])}function I1(e,t){return A((e[0]+t[0])/2,(e[1]+t[1])/2)}function Rt(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function Gp(e,t){let n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}var Qs=(e,t,n)=>Gg(t,wn(Fe(e,t),n)),qM=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]);function o3(e,t){return[e,t]}function LV(e,t){let n=e[1][1]-e[0][1],r=e[0][0]-e[1][0],i=t[1][1]-t[0][1],a=t[0][0]-t[1][0],s=n*a-i*r;if(s!==0){let o=n*e[0][0]+r*e[0][1],c=i*t[0][0]+a*t[0][1];return A((o*a-c*r)/s,(n*c-i*o)/s)}return null}function He(e,t){return[e,t]}var ed=(e,t,n=1e-4)=>{let r=J8(e,t);return r===0?!0:r<n},J8=(e,t)=>{let[n,r]=e,[[i,a],[s,o]]=t,c=n-i,d=r-a,l=s-i,h=o-a,f=c*l+d*h,g=l*l+h*h,U=-1;g!==0&&(U=f/g);let y,v;U<0?(y=i,v=a):U>1?(y=s,v=o):(y=i+U*l,v=a+U*h);let x=n-y,w=r-v;return Math.sqrt(x*x+w*w)};function qp(e,t){let n=LV(o3(e[0],e[1]),o3(t[0],t[1]));return!n||!ed(n,t)||!ed(n,e)?null:n}function l3(e,t){return[e,t]}function RV(e,t){return[He(e[0],A(e[1][0],e[0][1])),He(A(e[1][0],e[0][1]),e[1]),He(e[1],A(e[0][0],e[1][1])),He(A(e[0][0],e[1][1]),e[0])].map(n=>qp(t,n)).filter(n=>!!n)}function so(e,t,n,r){return[e,t,n,r]}function kE(e,t,n,r=1e-6){return[(e(t+r,n)-e(t-r,n))/(2*r),(e(t,n+r)-e(t,n-r))/(2*r)]}function DV(e,t,n,r=.001,i=10){let a=1/0,s=0;for(;a>=r;){if(s>=i)return null;let o=e(t,n),c=[kE((y,v)=>e(y,v)[0],t,n),kE((y,v)=>e(y,v)[1],t,n)],d=[[-o[0]],[-o[1]]],l=c[0][0]*c[1][1]-c[0][1]*c[1][0];if(l===0)return null;let h=[[c[1][1]/l,-c[0][1]/l],[-c[1][0]/l,c[0][0]/l]],f=[[h[0][0]*d[0][0]+h[0][1]*d[1][0]],[h[1][0]*d[0][0]+h[1][1]*d[1][0]]];t=t+f[0][0],n=n+f[1][0];let[g,U]=e(t,n);a=Math.max(Math.abs(g),Math.abs(U)),s+=1}return[t,n]}var Up=(e,t)=>A((1-t)**3*e[0][0]+3*(1-t)**2*t*e[1][0]+3*(1-t)*t**2*e[2][0]+t**3*e[3][0],(1-t)**3*e[0][1]+3*(1-t)**2*t*e[1][1]+3*(1-t)*t**2*e[2][1]+t**3*e[3][1]);function ZM(e,t){let n=PV(e);if(RV(l3(A(n[0],n[1]),A(n[2],n[3])),t).length===0)return[];let r=o=>A(t[0][0]+o*(t[1][0]-t[0][0]),t[0][1]+o*(t[1][1]-t[0][1])),i=[[.5,0],[.2,0],[.8,0]],a=([o,c])=>{let d=DV((f,g)=>{let U=Up(e,f),y=r(g);return[U[0]-y[0],U[1]-y[1]]},o,c);if(!d)return null;let[l,h]=d;return l<0||l>1||h<0||h>1?null:Up(e,l)},s=a(i[0]);return s?[s]:(s=a(i[1]),s?[s]:(s=a(i[2]),s?[s]:[]))}function jV(e,t,n=.001){let r=(c,d,l,h=n)=>{let f=c,g=d,U;for(;g-f>h;)U=(g+f)/2,l(U-h)<l(U+h)?g=U:f=U;return U},i=0;for(let c=1/0,d=0;d<30;d++){let l=Rt(t,Up(e,d/30));l<c&&(c=l,i=d)}let a=Math.max((i-1)/30,0),s=Math.min((i+1)/30,1),o=r(a,s,c=>Rt(t,Up(e,c)));return o?Up(e,o):null}function KM(e,t){let n=jV(e,t);return n?Rt(t,n):0}function PV(e){let[t,n,r,i]=e,a=[t[0],n[0],r[0],i[0]],s=[t[1],n[1],r[1],i[1]];return[Math.min(...a),Math.min(...s),Math.max(...a),Math.max(...s)]}function TE(...e){return QM(e)}function qg(e){return QM(e)}var ME=(e,t)=>{let n=e[0],r=e[1],i=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){let o=t[a][0],c=t[a][1],d=t[s][0],l=t[s][1];(c>r&&l<=r||c<=r&&l>r)&&n<(d-o)*(r-c)/(l-c)+o&&(i=!i)}return i},NV=(e,t,n=1e-4)=>{let r=!1;for(let i=0,a=t.length-1;i<a;i++)if(ed(e,He(t[i],t[i+1]),n)){r=!0;break}return r};function QM(e){return OV(e)?e:[...e,e[0]]}function OV(e){return La(e[0],e[e.length-1])}function wr(e,t){return qi([e,t])}var Zg=([e,t],[n,r])=>e<=n?t>=n:e>=n?r>=e:!1,Kg=([e,t],[n,r])=>{let i=Math.max(e,n),a=Math.min(t,r);return i<=a?qi([i,a]):null},bm=(e,[t,n])=>e>=t&&e<=n;function tu([e,t,n],r){let i=(l,h,f)=>(l[0]-f[0])*(h[1]-f[1])-(h[0]-f[0])*(l[1]-f[1]),a=i(r,e,t),s=i(r,t,n),o=i(r,n,e),c=a<0||s<0||o<0,d=a>0||s>0||o>0;return!(c&&d)}var IE=()=>{let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),i=`${e.getHours()}`.padStart(2,"0"),a=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${i}${a}`},bp=e=>e.charAt(0).toUpperCase()+e.slice(1),FV=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),c3=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,BV=e=>c3(e)||e instanceof Element&&!!e.closest("label, button"),_c=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"),Hu=({fontFamily:e})=>{for(let[t,n]of Object.entries(fn))if(n===e)return`${t}${zM(n).map(r=>`, ${r}`).join("")}`;return Vp},$t=({fontSize:e,fontFamily:t})=>`${e}px ${Hu({fontFamily:t})}`,Wu=(e,t)=>{let n=0,r=null,i=(...a)=>{r=a,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...a)},t)};return i.flush=()=>{if(clearTimeout(n),r){let a=r;r=null,e(...a)}},i.cancel=()=>{r=null,clearTimeout(n)},i},lU=(e,t)=>{let n=null,r=null,i=null,a=o=>{n=window.requestAnimationFrame(()=>{n=null,e(...o),r=null,i&&(r=i,i=null,a(r))})},s=(...o)=>{if(dt.MODE==="test"){e(...o);return}r=o,n===null?a(r):t!=null&&t.trailing&&(i=o)};return s.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),r&&(e(...i||r),r=i=null)},s.cancel=()=>{r=i=null,n!==null&&(cancelAnimationFrame(n),n=null)},s},$c=e=>1-Math.pow(1-e,4),AE=(e,t,n)=>(t-e)*$c(n)+e,$V=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:i,onStart:a,onEnd:s,onCancel:o})=>{let c=!1,d=0,l;function h(f){if(c)return;l===void 0&&(l=f,a==null||a());let g=Math.min(f-l,r),U=$c(g/r),y={};if(Object.keys(e).forEach(v=>{let x=v,w=(t[x]-e[x])*U+e[x];y[x]=w}),n(y),g<r){let v=g/r,x={};Object.keys(e).forEach(w=>{let C=w,S=e[C],T=t[C],M;M=i?i(S,T,v,C):AE(S,T,v),M==null&&(M=AE(S,T,v)),x[C]=M}),n(x),d=window.requestAnimationFrame(h)}else n(t),s==null||s()}return d=window.requestAnimationFrame(h),()=>{o==null||o(),c=!0,window.cancelAnimationFrame(d)}},zV=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i},Er=(e,t)=>Math.abs(e-t),Ln=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked},ue=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),gs?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),qt=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:s})=>{let o=(e-r)/n.value-a,c=(t-i)/n.value-s;return{x:o,y:c}},xa=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:s})=>{let o=(e+a)*n.value+r,c=(t+s)*n.value+i;return{x:o,y:c}},ym=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),HV="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--",WV="֑-߿יִ-﷽ﹰ-ﻼ",XV=new RegExp(`^[^${HV}]*[${WV}]`),JM=e=>XV.test(e),wa=e=>{let[t,n]=e;return{x:t,y:n}},eI=e=>{if((e==null?void 0:e.name)==="AbortError"){console.warn(e);return}throw e},tI=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},kc=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},Ea=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===pt.transparent},Mb=e=>e.fillStyle!=="solid"||Ea(e.backgroundColor),VV=()=>{let e,t,n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},YV=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},GV=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},qV=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),yh=()=>go()?1:Date.now(),Qe=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),ZV=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Ys=(e,t)=>e.reduce((n,r)=>(n[t?t(r):String(r)]=r,n),{}),KV=e=>e.reduce((t,n,r)=>{let i={...n,prev:null,next:null};if(r!==0){let a=t[r-1];if(i.prev=a,a.next=i,r===e.length-1){let s=t[0];i.next=s,s.prev=i}}return t.push(i),t},[]),go=()=>dt.MODE==="test",nI=()=>dt.MODE==="development",QV=()=>typeof process<"u"&&!0,rI=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),rg=(e,t)=>{let n=!1;for(let r in t){let i=t[r];if(typeof i<"u"){if(e[r]===i&&(typeof i!="object"||i===null))continue;n=!0}}return n?{...e,...t}:e},JV=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},A1=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,d3=e=>{let t=e==null?void 0:e.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},LE=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,pr=(e,t,n,r=!1)=>{let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let s of n)if(!(e[s]===t[s]||LE(e[s],t[s])))return r&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),!1;return!0}return i.every(s=>{let o=n==null?void 0:n[s],c=o?o(e[s],t[s]):e[s]===t[s]||LE(e[s],t[s]);return!c&&r&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),c})},cU=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(r){if(e==null||e(r),!n||!(r!=null&&r.defaultPrevented))return t==null?void 0:t(r)},td=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Tr(e,t){if(!e)throw new Error(t)}var eY=e=>{let t,n,r=function(i){let a=Object.entries(i);if(t){let o=!0;for(let[c,d]of a)if(t.get(c)!==d){o=!1;break}if(o)return n}let s=e(i);return t=new Map(a),n=s,s};return r.clear=()=>{t=void 0,n=void 0},r},iI=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),co=e=>JSON.parse(JSON.stringify(e)),Mf=(e,t)=>pr(e,t)?e:t;function un(e,t,n,r){var i;return e?((i=e==null?void 0:e.addEventListener)==null||i.call(e,t,n,r),()=>{var a;(a=e==null?void 0:e.removeEventListener)==null||a.call(e,t,n,r)}):()=>{}}function tY(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],i=e[1],a=e[2],s=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${i[0].toFixed(2)},${i[1].toFixed(2)} ${Um(i[0],a[0]).toFixed(2)},${Um(i[1],a[1]).toFixed(2)} T`;for(let o=2,c=n-1;o<c;o++)r=e[o],i=e[o+1],s+=`${Um(r[0],i[0]).toFixed(2)},${Um(r[1],i[1]).toFixed(2)} `;return t&&(s+="Z"),s}var aI=e=>e.replace(/\r?\n|\r/g,`
|
|
48
|
+
`),qi=e=>e,Xu=async(e,...t)=>new Promise(n=>{n(e(...t))}),nY=(...e)=>Math.max(...e.map(t=>t?1:0))>0,RE=class{constructor(e,t){z(this,"pool"),z(this,"entries",{}),this.pool=new PW(e,t)}all(){let e=t=>{if(t.data.result){let[n,r]=t.data.result;this.entries[n]=r}};return this.pool.addEventListener("fulfilled",e),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",e)}),Object.values(this.entries)))}},ig=e=>e.replace(/"/g,"""),DE=e=>Array.isArray(e)?e:[e],zi=e=>!!e&&e.type==="image"&&!!e.fileId,Lt=e=>!!e&&e.type==="image",ti=e=>!!e&&e.type==="embeddable",Ul=e=>!!e&&e.type==="iframe",Hi=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),ke=e=>e!=null&&e.type==="text",sI=e=>e!=null&&e.type==="frame",ag=e=>e!=null&&e.type==="magicframe",Ke=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),Zi=e=>e!=null&&rY(e.type),rY=e=>e==="freedraw",rt=e=>e!=null&&e7(e.type),ht=e=>e!=null&&e.type==="arrow",Ie=e=>ht(e)&&e.elbowed,e7=e=>e==="arrow"||e==="line",ls=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&oI(e.type),oI=e=>e==="arrow",Ra=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),iY=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),zc=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||ht(e)),lI=e=>{let t=e==null?void 0:e.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return td(t,null),!1}},dU=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",Ki=e=>{var t;return zc(e)&&!!((t=e.boundElements)!=null&&t.some(({type:n})=>n==="text"))},tn=e=>e!==null&&"containerId"in e&&e.containerId!==null&&ke(e),vh=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",cI=e=>e==="line"||e==="arrow"||e==="diamond",aY=(e,t)=>!!((e===Bn.ADAPTIVE_RADIUS||e===Bn.LEGACY)&&vh(t.type)||e===Bn.PROPORTIONAL_RADIUS&&cI(t.type)),sY=e=>cI(e.type)?{type:Bn.PROPORTIONAL_RADIUS}:vh(e.type)?{type:Bn.ADAPTIVE_RADIUS}:null,Qg=e=>Object.hasOwn(e,"fixedPoint")&&e.fixedPoint!=null,Mr=(e,t,n)=>{let r=e.split(`
|
|
49
|
+
`).map(s=>s||" ").join(`
|
|
50
|
+
`),i=parseFloat(t),a=dY(r,i,n);return{width:r7(r,t),height:a}},dI="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),uI=(e,t)=>{let n=uY(e);return n===0?Mr(dI.split("").join(`
|
|
51
|
+
`),e,t).width+Fn*2:n+Fn*2},t7=(e,t)=>Mr("",e,t).width+Fn*2,oY=()=>r7(dI,$t({fontSize:Mo,fontFamily:Xl}))>0,Vu=e=>aI(e).replace(/\t/g," "),n7=e=>Vu(e).split(`
|
|
52
|
+
`),lY=e=>{let t=n7(e.text).length;return e.height/t/e.fontSize},L1=(e,t)=>e*t,hI=(e,t)=>L1(e,t)+Fn*2,Ib,cY=class{constructor(){z(this,"canvas"),this.canvas=document.createElement("canvas")}getLineWidth(e,t){let n=this.canvas.getContext("2d");n.font=t;let r=n.measureText(e).width;return go()?r*10:r}},nd=(e,t)=>(Ib||(Ib=new cY),Ib.getLineWidth(e,t)),r7=(e,t)=>{let n=n7(e),r=0;return n.forEach(i=>{r=Math.max(r,nd(i,t))}),r},dY=(e,t,n)=>{let r=n7(e).length;return L1(t,n)*r},R1=(()=>{let e={};return{calculate:(t,n)=>{let r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){let i=nd(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t],clearCache:t=>{e[t]=[]}}})(),uY=e=>{let t=R1.getCache(e);if(!t)return 0;let n=t.filter(r=>r!==void 0);return Math.max(...n)},Ab,vm,Lb,hY=e=>(Ab||(Ab=Pt.class(...Object.values(Js))),Ab.test(e)),fY=()=>{if(!vm)try{vm=mY()}catch{vm=pY()}return vm},i7=()=>(Lb||(Lb=gY()),Lb),Ni={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},Js={CHAR:new RegExp("\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄","u"),OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},mc={FLAG:new RegExp("\\p{RI}\\p{RI}","u"),JOINER:new RegExp("(?:\\p{Emoji_Modifier}|\\uFE0F\\u20E3?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?","u"),ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},pY=()=>Pt.or(i7(),Mn.On(Ni.HYPHEN,Ni.WHITESPACE,Js.CHAR)),mY=()=>Pt.or(i7(),Mn.Before(Ni.WHITESPACE).Build(),Mn.After(Ni.WHITESPACE,Ni.HYPHEN).Build(),Mn.Before(Js.CHAR,Js.CURRENCY).NotPrecededBy(Ni.OPENING,Js.OPENING).Build(),Mn.After(Js.CHAR).NotFollowedBy(Ni.HYPHEN,Ni.CLOSING,Js.CLOSING).Build(),Mn.BeforeMany(Js.OPENING).NotPrecededBy(Ni.OPENING).Build(),Mn.AfterMany(Js.CLOSING).NotFollowedBy(Ni.CLOSING).Build(),Mn.AfterMany(Ni.CLOSING).FollowedBy(Ni.OPENING).Build()),gY=()=>Pt.group(Pt.or(mc.FLAG,Pt.and(mc.MOST,mc.JOINER,Pt.build(`(?:${mc.ZWJ.source}(?:${mc.FLAG.source}|${mc.ANY.source}${mc.JOINER.source}))*`)))),Pt={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>Pt.build(Pt.join(...e)),or:(...e)=>Pt.build(e.map(t=>t.source).join("|")),group:(...e)=>Pt.build(`(${Pt.join(...e)})`),class:(...e)=>Pt.build(`[${Pt.join(...e)}]`)},Mn={On:(...e)=>{let t=Pt.join(...e);return Pt.build(`([${t}])`)},Before:(...e)=>{let t=Pt.join(...e),n=()=>Pt.build(`(?=[${t}])`);return Mn.Chain(n)},After:(...e)=>{let t=Pt.join(...e),n=()=>Pt.build(`(?<=[${t}])`);return Mn.Chain(n)},BeforeMany:(...e)=>{let t=Pt.join(...e),n=()=>Pt.build(`(?<![${t}])(?=[${t}])`);return Mn.Chain(n)},AfterMany:(...e)=>{let t=Pt.join(...e),n=()=>Pt.build(`(?<=[${t}])(?![${t}])`);return Mn.Chain(n)},NotBefore:(...e)=>{let t=Pt.join(...e),n=()=>Pt.build(`(?![${t}])`);return Mn.Chain(n)},NotAfter:(...e)=>{let t=Pt.join(...e),n=()=>Pt.build(`(?<![${t}])`);return Mn.Chain(n)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),r=Mn.After(...t).Build(),i=()=>Pt.and(r,n);return Mn.Chain(i)},FollowedBy:(...t)=>{let n=e(),r=Mn.Before(...t).Build(),i=()=>Pt.and(n,r);return Mn.Chain(i)},NotPrecededBy:(...t)=>{let n=e(),r=Mn.NotAfter(...t).Build(),i=()=>Pt.and(r,n);return Mn.Chain(i)},NotFollowedBy:(...t)=>{let n=e(),r=Mn.NotBefore(...t).Build(),i=()=>Pt.and(n,r);return Mn.Chain(i)}})},UY=e=>{let t=fY();return e.normalize("NFC").split(t).filter(Boolean)},gd=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return e;let r=[],i=e.split(`
|
|
53
|
+
`);for(let a of i){if(nd(a,t)<=n){r.push(a);continue}let s=bY(a,t,n);r.push(...s)}return r.join(`
|
|
54
|
+
`)},bY=(e,t,n)=>{let r=[],i=UY(e)[Symbol.iterator](),a="",s=0,o=i.next();for(;!o.done;){let c=o.value,d=a+c,l=xY(c)?s+R1.calculate(c,t):nd(d,t);if(/\s/.test(c)||l<=n){a=d,s=l,o=i.next();continue}if(a)r.push(a.trimEnd()),a="",s=0;else{let h=yY(c,t,n),f=h[h.length-1]??"",g=h.slice(0,-1);r.push(...g),a=f,s=nd(f,t),o=i.next()}}if(a){let c=vY(a,t,n);r.push(c)}return r},yY=(e,t,n)=>{if(i7().test(e))return[e];wY(e);let r=[],i=Array.from(e),a="",s=0;for(let o of i){let c=R1.calculate(o,t),d=s+c;if(d<=n){a=a+o,s=d;continue}a&&r.push(a),a=o,s=c}return a&&r.push(a),r},vY=(e,t,n)=>{if(!(nd(e,t)>n))return e;let[,r,i]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],a=nd(r,t);for(let s of Array.from(i)){let o=R1.calculate(s,t),c=a+o;if(c>n)break;r=r+s,a=c}return r},xY=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,wY=e=>{if((dt.MODE===si.TEST||dt.DEV)&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")},jr=class{};z(jr,"rg",new Wp),z(jr,"cache",new WeakMap),z(jr,"get",e=>jr.cache.get(e)),z(jr,"set",(e,t)=>jr.cache.set(e,t)),z(jr,"delete",e=>jr.cache.delete(e)),z(jr,"destroy",()=>{jr.cache=new WeakMap}),z(jr,"generateElementShape",(e,t)=>{let n=t!=null&&t.isExporting?void 0:jr.get(e);if(n!==void 0)return n;y3.delete(e);let r=Mee(e,jr.rg,t||{isExporting:!1,canvasBackgroundColor:pt.white,embedsValidationStatus:null});return jr.cache.set(e,r),r});var gn=jr,ya=e=>"var(--icon-fill-color)",fI=e=>e===yt.LIGHT?or.white:"#1e1e1e",ne=(e,t=512)=>{let{width:n=512,height:r=n,mirror:i,style:a,...s}=typeof t=="number"?{width:t}:t;return m.jsx("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${r}`,className:De({"rtl-mirror":i}),style:a,...s,children:typeof e=="string"?m.jsx("path",{fill:"currentColor",d:e}):e})},_e={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},at={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("rect",{x:3,y:8,width:18,height:4,rx:1}),m.jsx("line",{x1:12,y1:8,x2:12,y2:21}),m.jsx("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),m.jsx("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),_e);var a7=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),m.jsx("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),m.jsx("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),m.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),m.jsx("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),_e),EY=ne(m.jsxs("svg",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),m.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),_e),CY=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"1"}),m.jsx("circle",{cx:"12",cy:"19",r:"1"}),m.jsx("circle",{cx:"12",cy:"5",r:"1"})]}),_e),SY=ne(m.jsxs("svg",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),m.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),m.jsx("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),_e),uU=ne(m.jsxs("g",{children:[m.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:m.jsx("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),m.jsx("g",{mask:"url(#UnlockedIcon)",children:m.jsx("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),at),s7=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),m.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),m.jsx("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),at),_Y=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),m.jsx("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),kY=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),m.jsx("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),TY=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),m.jsx("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"});ne(m.jsx("g",{fill:"currentColor",children:m.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"});var MY=ne(m.jsxs("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),m.jsx("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),IY=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),_e),AY=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),_e),LY=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"9"})]}),_e),RY=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),m.jsx("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),m.jsx("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),_e),DY=ne(m.jsx("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),at),jY=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),m.jsx("path",{d:"M16 7h4"}),m.jsx("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),_e),Zp=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),m.jsx("path",{d:"m11.25 5.417 3.333 3.333"})]}),at),pI=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),m.jsx("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),m.jsx("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),m.jsx("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),m.jsx("polyline",{points:"5 20 11 4 13 4 20 20"})]}),_e),PY=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M12.5 6.667h.01"}),m.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),m.jsx("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),m.jsx("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),at),NY=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),m.jsx("path",{d:"M18 13.3l-6.3 -6.3"})]}),_e),jE=ne(m.jsx("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),at),PE=ne(m.jsx("path",{d:"M5 10h10",strokeWidth:"1.25"}),at),OY=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M21 21l-6 -6"}),m.jsx("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),m.jsx("path",{d:"M3 4v4h4"})]}),_e),rd=ne(m.jsx("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),at),FY=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("polyline",{points:"12 16 18 10 12 4"}),m.jsx("polyline",{points:"8 4 2 10 8 16"})]}),at),u3=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),m.jsx("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),at),h3=ne(m.jsx("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),at),f3=ne(m.jsx("g",{stroke:"currentColor",strokeLinejoin:"round",children:m.jsx("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...at,strokeWidth:1.5}),mI=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),m.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),m.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),_e),hU=ne(m.jsx("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),at),o7=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"9"}),m.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),m.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),_e),BY=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"9"}),m.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),m.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),_e),NE=ne(m.jsx("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),at),gI=ne(m.jsx("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),at),$Y=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),m.jsx("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),at),zY=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),m.jsx("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),_e),HY=ne(m.jsx("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),p3=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),m.jsx("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),at),WY=ne("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),XY=ne("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),l7=ne(m.jsx("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),at);ne("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512});var VY=ne("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),Rb=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),m.jsx("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),m.jsx("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),_e),UI=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15 8h.01"}),m.jsx("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),m.jsx("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),m.jsx("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),m.jsx("path",{d:"M19 16v6"}),m.jsx("path",{d:"M22 19l-3 3l-3 -3"})]}),_e),YY=ne("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512});ne("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});ne("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});var GY=ne("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z");ne("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z");var OE=ne(m.jsx("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),at),FE=ne(m.jsx("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),at),qY=ne("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0});ne(m.jsx("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),at);ne("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z");ne("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24});ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),m.jsx("path",{d:"M12 14v-11"}),m.jsx("path",{d:"M9 6l3 -3l3 3"})]}),_e);ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),m.jsx("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64});ne(m.jsx("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024});var bI=m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 10l0 10"}),m.jsx("path",{d:"M12 10l4 4"}),m.jsx("path",{d:"M12 10l-4 4"}),m.jsx("path",{d:"M4 4l16 0"})]}),yI=m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 5l0 14"}),m.jsx("path",{d:"M16 9l-4 -4"}),m.jsx("path",{d:"M8 9l4 -4"})]}),BE=ne(yI,_e),$E=ne(yI,{..._e,style:{transform:"rotate(180deg)"}}),zE=ne(bI,_e),HE=ne(bI,{..._e,style:{transform:"rotate(180deg)"}}),WE=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),XE=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),VE=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),YE=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),ZY=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),KY=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),GE=ne(m.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),m.jsx("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),at),qE=ne(m.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),m.jsx("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),at),vI=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"9",cy:"7",r:"4"}),m.jsx("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),m.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),m.jsx("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),_e);ne("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z");ne("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z");var xh=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M15 5 5 15M5 5l10 10"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at);ne("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0});ne("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24});ne("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512});var ZE=xe.memo(({theme:e})=>ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M25 26H111V111H25",fill:ya()}),m.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:ya(),strokeWidth:"2"}),m.jsx("path",{d:"M100 100H160V160H100",fill:ya()}),m.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:ya(),strokeWidth:"2"}),m.jsxs("g",{fill:fI(e),stroke:ya(),strokeWidth:"6",children:[m.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),m.jsx("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),KE=xe.memo(({theme:e})=>ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M25 26H111V111H25",fill:ya()}),m.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:ya(),strokeWidth:"2"}),m.jsx("path",{d:"M100 100H160V160H100",fill:ya()}),m.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:ya(),strokeWidth:"2"}),m.jsxs("g",{fill:fI(e),stroke:ya(),strokeWidth:"6",children:[m.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),m.jsx("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),m.jsx("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),m.jsx("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),QY=ne(m.jsx("g",{strokeWidth:1.25,children:m.jsx("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),at),JY=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:m.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),m.jsx("g",{mask:"url(#FillHachureIcon)",children:m.jsx("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),at),eG=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",children:[m.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:m.jsx("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("g",{mask:"url(#FillCrossHatchIcon)",children:m.jsx("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),tG=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...at,fill:"currentColor"}),xI=ne(m.jsx(m.Fragment,{children:m.jsx("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),at),nG=ne(m.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),at),rG=ne(m.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),at);xe.memo(({theme:e})=>ne(m.jsx("path",{d:"M6 10H34",stroke:ya(),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20}));var iG=ne(m.jsxs("g",{strokeWidth:"2",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 12h2"}),m.jsx("path",{d:"M17 12h2"}),m.jsx("path",{d:"M11 12h2"})]}),_e),aG=ne(m.jsxs("g",{strokeWidth:"2",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 12v.01"}),m.jsx("path",{d:"M8 12v.01"}),m.jsx("path",{d:"M12 12v.01"}),m.jsx("path",{d:"M16 12v.01"}),m.jsx("path",{d:"M20 12v.01"})]}),_e),sG=ne(m.jsx("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),at),oG=ne(m.jsx("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),at),lG=ne(m.jsx("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),at),cG=ne(m.jsxs("svg",{strokeWidth:"1.5",children:[m.jsx("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),m.jsx("path",{d:"M13.3333 3.33331V3.34331"}),m.jsx("path",{d:"M16.6667 3.33331V3.34331"}),m.jsx("path",{d:"M16.6667 6.66669V6.67669"}),m.jsx("path",{d:"M16.6667 10V10.01"}),m.jsx("path",{d:"M3.33334 13.3333V13.3433"}),m.jsx("path",{d:"M16.6667 13.3333V13.3433"}),m.jsx("path",{d:"M3.33334 16.6667V16.6767"}),m.jsx("path",{d:"M6.66666 16.6667V16.6767"}),m.jsx("path",{d:"M10 16.6667V16.6767"}),m.jsx("path",{d:"M13.3333 16.6667V16.6767"}),m.jsx("path",{d:"M16.6667 16.6667V16.6767"})]}),at),dG=ne(m.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),m.jsx("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),m.jsx("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),m.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),m.jsx("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),m.jsx("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),m.jsx("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),m.jsx("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),m.jsx("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),m.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),m.jsx("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),m.jsx("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),_e),uG=ne(m.jsxs("g",{stroke:"currentColor",opacity:.3,strokeWidth:2,children:[m.jsx("path",{d:"M12 12l9 0"}),m.jsx("path",{d:"M3 9l6 6"}),m.jsx("path",{d:"M3 15l6 -6"})]}),_e),hG=xe.memo(({flip:e=!1})=>ne(m.jsxs("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[m.jsx("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),m.jsx("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),fG=xe.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[m.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),m.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),pG=xe.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[m.jsx("path",{d:"M26 10L6 10"}),m.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),mG=xe.memo(({flip:e=!1})=>ne(m.jsx("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:m.jsx("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),gG=xe.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[m.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),m.jsx("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),UG=xe.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[m.jsx("path",{d:"M6,9.5H27"}),m.jsx("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),bG=xe.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[m.jsx("path",{d:"M6,9.5H20"}),m.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),yG=xe.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[m.jsx("path",{d:"M6,9.5H20"}),m.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),vG=xe.memo(({flip:e=!1})=>ne(m.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:m.jsx("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),xG=xe.memo(({flip:e=!1})=>ne(m.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:m.jsx("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),wG=xe.memo(({flip:e=!1})=>ne(m.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:m.jsx("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),EG=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),CG=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),SG=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),_G=ne(m.jsx(m.Fragment,{children:m.jsx("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),at),fU=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 7v-2h13v2"}),m.jsx("path",{d:"M10 5v14"}),m.jsx("path",{d:"M12 19h-4"}),m.jsx("path",{d:"M15 13v-1h6v1"}),m.jsx("path",{d:"M18 12v7"}),m.jsx("path",{d:"M17 19h2"})]}),_e),kG=ne(m.jsx(m.Fragment,{children:m.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 12h10"}),m.jsx("path",{d:"M7 5v14"}),m.jsx("path",{d:"M17 5v14"}),m.jsx("path",{d:"M15 19h4"}),m.jsx("path",{d:"M15 5h4"}),m.jsx("path",{d:"M5 19h4"}),m.jsx("path",{d:"M5 5h4"})]})}),_e),Jg=ne(m.jsx(m.Fragment,{children:m.jsx("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),at),m3=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),at),TG=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),m.jsx("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),m.jsx("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),_e),MG=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),m.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),m.jsx("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),_e),IG=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),m.jsx("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),m.jsx("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),_e),AG=xe.memo(({theme:e})=>ne(m.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),m.jsx("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),_e)),LG=xe.memo(({theme:e})=>ne(m.jsxs("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),m.jsx("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),_e)),RG=xe.memo(({theme:e})=>ne(m.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),m.jsx("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),m.jsx("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),_e)),wI=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M21 19h-18l9 -15"}),m.jsx("path",{d:"M20.615 15.171h.015"}),m.jsx("path",{d:"M19.515 11.771h.015"}),m.jsx("path",{d:"M17.715 8.671h.015"}),m.jsx("path",{d:"M15.415 5.971h.015"})]}),_e),DG=ne(m.jsx("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512});ne(m.jsx("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"}));var EI=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),m.jsx("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),m.jsx("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),m.jsx("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),_e),QE=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),m.jsx("path",{d:"M7 11l5 5l5 -5"}),m.jsx("path",{d:"M12 4l0 12"})]}),_e),c7=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),m.jsx("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),_e),jG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),m.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),m.jsx("path",{d:"M9.15 14.85l8.85 -10.85"}),m.jsx("path",{d:"M6 4l8.85 10.85"})]}),_e),PG=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),m.jsx("path",{d:"M12 17l0 .01"}),m.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),_e);ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 4v16l13 -8z"})]}),_e);ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),_e);var NG=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 12l5 5l10 -10"})]}),_e),OG=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),m.jsx("path",{d:"M12 9v4"}),m.jsx("path",{d:"M12 17h.01"})]}),_e),FG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M11 7l6 6"}),m.jsx("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),_e),BG=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 3l-4 7h8z"}),m.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),m.jsx("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),_e),CI=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 7l16 0"}),m.jsx("path",{d:"M4 17l16 0"}),m.jsx("path",{d:"M7 4l0 16"}),m.jsx("path",{d:"M17 4l0 16"})]}),_e),SI=ne(m.jsx("path",{fill:"currentColor",d:"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z"})),sg=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M4.16602 10H15.8327"}),m.jsx("path",{d:"M12.5 13.3333L15.8333 10"}),m.jsx("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),at),_I=ne(m.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[m.jsx("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),m.jsx("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),kI=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),m.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),m.jsx("path",{d:"M15 6l3 3"}),m.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),m.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),_e);ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),m.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),m.jsx("path",{d:"M15 6l3 3"}),m.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),m.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),_e);ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),m.jsx("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),m.jsx("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),m.jsx("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),m.jsx("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),m.jsx("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),_e);var $G=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),m.jsx("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),m.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),m.jsx("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),_e),d7=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),m.jsx("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),_e),zG=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),m.jsx("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),m.jsx("path",{d:"M3 3l18 18"})]}),_e);ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),m.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),m.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),m.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),m.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),m.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),_e);var HG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),m.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),m.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),m.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),m.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),m.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),_e),id=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),m.jsx("path",{d:"M21 21l-6 -6"})]}),_e),WG=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),m.jsx("path",{d:"M12 7v5l3 3"}),m.jsx("path",{d:"M19 16l-2 3h4l-2 3"})]}),_e),XG=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),m.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),m.jsx("path",{d:"M8 21l8 0"}),m.jsx("path",{d:"M12 17l0 4"})]}),_e),VG=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 3l18 18"}),m.jsx("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),m.jsx("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),m.jsx("path",{d:"M8 21l8 0"}),m.jsx("path",{d:"M12 17l0 4"})]}),_e),TI=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),_e),YG=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),m.jsx("path",{d:"M12 20v.01"}),m.jsx("path",{d:"M16 20v.01"}),m.jsx("path",{d:"M8 20v.01"}),m.jsx("path",{d:"M4 20v.01"}),m.jsx("path",{d:"M4 16v.01"}),m.jsx("path",{d:"M4 12v.01"}),m.jsx("path",{d:"M4 8v.01"}),m.jsx("path",{d:"M4 4v.01"}),m.jsx("path",{d:"M8 4v.01"}),m.jsx("path",{d:"M12 4v.01"}),m.jsx("path",{d:"M16 4v.01"}),m.jsx("path",{d:"M20 4v.01"}),m.jsx("path",{d:"M20 8v.01"}),m.jsx("path",{d:"M20 12v.01"}),m.jsx("path",{d:"M20 16v.01"}),m.jsx("path",{d:"M20 20v.01"})]}),_e),GG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 3v18"}),m.jsx("path",{d:"M19 21v-18"}),m.jsx("path",{d:"M5 7h14"}),m.jsx("path",{d:"M5 15h14"}),m.jsx("path",{d:"M8 13v4"}),m.jsx("path",{d:"M11 13v4"}),m.jsx("path",{d:"M16 13v4"}),m.jsx("path",{d:"M14 5v4"}),m.jsx("path",{d:"M11 5v4"}),m.jsx("path",{d:"M8 5v4"}),m.jsx("path",{d:"M3 21h18"})]}),_e),qG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 12l18 0"}),m.jsx("path",{d:"M7 16l10 0l-10 5l0 -5"}),m.jsx("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),_e),ZG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 3l0 18"}),m.jsx("path",{d:"M16 7l0 10l5 0l-5 -10"}),m.jsx("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),_e),MI=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),m.jsx("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),m.jsx("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),_e),u7=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),m.jsx("path",{d:"M22 22l-3 -3"}),m.jsx("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),m.jsx("path",{d:"M3 11v-1"}),m.jsx("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),m.jsx("path",{d:"M10 3h1"}),m.jsx("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),_e),KG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),m.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),m.jsx("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),m.jsx("path",{d:"M10 15l2 6l2 -6"}),m.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),_e),QG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),m.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),m.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),m.jsx("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),m.jsx("path",{d:"M11 21v-6l3 6v-6"})]}),_e),JG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),m.jsx("path",{d:"M4 8l5 0"}),m.jsx("path",{d:"M15 8l4 0"})]}),_e),eq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),m.jsx("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),m.jsx("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),m.jsx("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),m.jsx("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),_e),tq=ne(m.jsxs("g",{stroke:"currentColor",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{..._e,strokeWidth:1.5});ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),m.jsx("path",{d:"M21 12h-13l3 -3"}),m.jsx("path",{d:"M11 15l-3 -3"})]}),_e);var nq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),m.jsx("path",{d:"M10 9l5 3l-5 3z"})]}),_e),rq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 6h18"}),m.jsx("path",{d:"M3 12h18"}),m.jsx("path",{d:"M3 18h18"}),m.jsx("path",{d:"M6 3v18"}),m.jsx("path",{d:"M12 3v18"}),m.jsx("path",{d:"M18 3v18"})]}),_e),iq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),m.jsx("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),m.jsx("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),_e),aq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 18l12 -12"}),m.jsx("path",{d:"M18 10v-4h-4"})]}),_e),sq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),m.jsx("path",{d:"M18 4l3 3l-3 3"})]}),_e),oq=ne(m.jsxs("g",{children:[m.jsx("path",{d:"M16,12L20,9L16,6"}),m.jsx("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),_e),II=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 9l6 6l6 -6"})]}),_e),lq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 15l6 -6l6 6"})]}),_e),cq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 15l6 -6l6 6"})]}),_e),JE=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),m.jsx("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),_e),AI=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M5 7l0 10"}),m.jsx("path",{d:"M7 5l10 0"}),m.jsx("path",{d:"M7 19l10 0"}),m.jsx("path",{d:"M19 7l0 10"})]}),_e),e2={[fn.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:Zp},[fn.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.35},icon:Jg},[fn["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15},icon:kG},[fn["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25},icon:m3},[fn.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:Zp,deprecated:!0},[fn.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},icon:Jg,deprecated:!0,local:!0},[fn.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},icon:m3,deprecated:!0},[fn["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},serverSide:!0},[Uu.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.15},fallback:!0},[Uu["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Tc={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},h7="local:",dq=class extends Error{constructor(e="Couldn't export canvas.",t="CANVAS_ERROR"){super(),this.name=t,this.message=e}},pU=class extends DOMException{constructor(e="Request Aborted"){super(e,"AbortError")}},Dc=class extends Error{constructor(e="Image Scene Data Error",t="IMAGE_SCENE_DATA_ERROR"){super(e),z(this,"code"),this.name="EncodingError",this.code=t}},uq=class extends Error{constructor(){super(...arguments),z(this,"code","ELEMENT_HAS_INVALID_INDEX")}},LI=class extends Error{constructor(e="Worker URL is not defined!",t="WORKER_URL_NOT_DEFINED"){super(e),z(this,"code"),this.name="WorkerUrlNotDefinedError",this.code=t}},RI=class extends Error{constructor(e="Worker has to be in a separate chunk!",t="WORKER_IN_THE_MAIN_CHUNK"){super(e),z(this,"code"),this.name="WorkerInTheMainChunkError",this.code=t}},eC=class extends Error{constructor(e){super(e),this.name="ExcalidrawError"}},hq=class{constructor(e){z(this,"instance"),z(this,"debounceTerminate"),this.instance=new Worker(e,{type:"module"})}},fq=class DI{constructor(t,n){z(this,"idleWorkers",new Set),z(this,"workerUrl"),z(this,"workerTTL"),this.workerUrl=t,this.workerTTL=n.ttl||1e3}static create(t,n={}){if(!t)throw new LI;if(!import.meta.url||t.toString()===import.meta.url)throw new RI;return new DI(t,n)}async postMessage(t,n){let r,i=Array.from(this.idleWorkers).shift();return i?(this.idleWorkers.delete(i),r=i):r=await this.createWorker(),new Promise((a,s)=>{r.instance.onmessage=this.onMessageHandler(r,a),r.instance.onerror=this.onErrorHandler(r,s),r.instance.postMessage(t,n),r.debounceTerminate(()=>s(new Error(`Active worker did not respond for ${this.workerTTL}ms!`)))})}async clear(){for(let t of this.idleWorkers)t.debounceTerminate.cancel(),t.instance.terminate();this.idleWorkers.clear()}async createWorker(){let t=new hq(this.workerUrl);return t.debounceTerminate=Wu(n=>{t.instance.terminate(),this.idleWorkers.has(t)?(this.idleWorkers.delete(t),console.debug("Job finished! Idle worker has been released from the pool.")):n?n():console.error("Worker has been terminated!")},this.workerTTL),t}onMessageHandler(t,n){return r=>{t.debounceTerminate(),this.idleWorkers.add(t),n(r.data)}}onErrorHandler(t,n){return r=>{t.debounceTerminate(()=>n(r)),t.debounceTerminate.flush(),this.clear()}}},tC=typeof Worker<"u",pq=async(e,t)=>{let{Commands:n,subsetToBase64:r,toBase64:i}=await gq();return tC?Xu(async()=>{try{let a=await Uq(),s=e.slice(0),o=await a.postMessage({command:n.Subset,arrayBuffer:s,codePoints:t},{transfer:[s]});return i(o)}catch(a){return tC=!1,QV()&&(a instanceof LI||a instanceof RI)||console.error("Failed to use workers for subsetting, falling back to the main thread.",a),r(e,t)}}):r(e,t)},Db=null,jb=null,mq=async()=>(Db||(Db=ge(()=>import("./subset-worker.chunk.js"),__vite__mapDeps([0,1]),import.meta.url)),Db),gq=async()=>(jb||(jb=ge(()=>import("./subset-shared.chunk.js"),[],import.meta.url)),jb),Pb=null,Uq=()=>(Pb||(Pb=Xu(async()=>{let{WorkerUrl:e}=await mq();return fq.create(e)})),Pb),jI=class og{constructor(t,n,r){z(this,"urls"),z(this,"fontFace"),this.urls=og.createUrls(n);let i=this.urls.map(a=>`url(${a}) ${og.getFormat(a)}`).join(", ");this.fontFace=new FontFace(t,i,{display:"swap",style:"normal",weight:"400",...r})}toCSS(t){if(!this.getUnicodeRangeRegex().test(t))return;let n=Array.from(t).map(r=>r.codePointAt(0));return this.getContent(n).then(r=>`@font-face { font-family: ${this.fontFace.family}; src: url(${r}); }`)}async getContent(t){let n=0,r=[];for(;n<this.urls.length;){let i=this.urls[n];try{let a=await this.fetchFont(i);return await pq(a,t)}catch(a){r.push(`"${i.toString()}" returned error "${a}"`)}n++}return console.error(`Failed to fetch font family "${this.fontFace.family}"`,JSON.stringify(r,void 0,2)),this.urls.length?this.urls[this.urls.length-1].toString():""}fetchFont(t){return Xu(async()=>{let n=await fetch(t,{cache:"force-cache",headers:{Accept:"font/woff2"}});if(!n.ok){let r=t instanceof URL?t.toString():"dataurl";throw new Error(`Failed to fetch "${r}": ${n.statusText}`)}return await n.arrayBuffer()})}getUnicodeRangeRegex(){let t=this.fontFace.unicodeRange.split(/,\s*/).map(n=>{let[r,i]=n.replace("U+","").split("-");return i?`\\u{${r}}-\\u{${i}}`:`\\u{${r}}`}).join("");return new RegExp(`[${t}]`,"u")}static createUrls(t){if(t.startsWith("data"))return[t];if(t.startsWith(h7))return[];if(t.startsWith("http"))return[new URL(t)];let n=t.replace(/^\/+/,""),r=[];if(typeof window.EXCALIDRAW_ASSET_PATH=="string"){let i=this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);r.push(new URL(n,i))}else Array.isArray(window.EXCALIDRAW_ASSET_PATH)&&window.EXCALIDRAW_ASSET_PATH.forEach(i=>{let a=this.normalizeBaseUrl(i);r.push(new URL(n,a))});return r.push(new URL(n,og.ASSETS_FALLBACK_URL)),r}static getFormat(t){if(!(t instanceof URL))return"";try{let n=new URL(t).pathname.split(".");return n.length===1?"":`format('${n.pop()}')`}catch{return""}}static normalizeBaseUrl(t){var r;let n=t;return/^\.?\//.test(n)&&(n=new URL(n.replace(/^\.?\/+/,""),(r=window==null?void 0:window.location)==null?void 0:r.origin).toString()),n=`${n.replace(/\/+$/,"")}/`,n}};z(jI,"ASSETS_FALLBACK_URL",`https://esm.sh/${`${dt.PKG_NAME}@${dt.PKG_VERSION}`}/dist/prod/`);var bq=jI,yq="./fonts/Cascadia/CascadiaCode-Regular.woff2",vq=[{uri:yq}],xq="./fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2",wq="./fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2",Eq="./fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2",Cq="./fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2",Sq=[{uri:xq,descriptors:{unicodeRange:"U+20-7e,U+a1-a6,U+a8,U+ab-ac,U+af-b1,U+b4,U+b8,U+bb-bc,U+bf-cf,U+d1-d7,U+d9-de,U+e0-ef,U+f1-f7,U+f9-ff,U+131,U+152-153,U+2c6,U+2da,U+2dc,U+2013-2014,U+2018-201a,U+201c-201d,U+2020-2022,U+2026,U+2039-203a,U+2044,U+20ac,U+2191,U+2193,U+2212"}},{uri:wq,descriptors:{unicodeRange:"U+100-10f,U+112-125,U+128-130,U+134-137,U+139-13c,U+141-148,U+14c-151,U+154-161,U+164-165,U+168-17f,U+1bf,U+1f7,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+a75b"}},{uri:Eq,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+315,U+2190,U+2192,U+2200,U+2203-2204,U+2264-2265,U+f6c3"}},{uri:Cq,descriptors:{unicodeRange:"U+3bb"}}],_q=[{uri:h7}],kq="./fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2",Tq="./fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2",Mq="./fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2",Iq="./fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2",Aq="./fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2",Lq="./fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2",Rq="./fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2",Dq=[{uri:kq,descriptors:{unicodeRange:"U+20-7e,U+a0-a3,U+a5-a6,U+a8-ab,U+ad-b1,U+b4,U+b6-b8,U+ba-ff,U+131,U+152-153,U+2bc,U+2c6,U+2da,U+2dc,U+304,U+308,U+2013-2014,U+2018-201a,U+201c-201e,U+2020,U+2022,U+2024-2026,U+2030,U+2039-203a,U+20ac,U+2122,U+2212"}},{uri:Tq,descriptors:{unicodeRange:"U+100-130,U+132-137,U+139-149,U+14c-151,U+154-17e,U+192,U+1fc-1ff,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+2113"}},{uri:Mq,descriptors:{unicodeRange:"U+400-45f,U+490-491,U+2116"}},{uri:Iq,descriptors:{unicodeRange:"U+37e,U+384-38a,U+38c,U+38e-393,U+395-3a1,U+3a3-3a8,U+3aa-3cf,U+3d7"}},{uri:Aq,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+302,U+306-307,U+30a-30c,U+326-328,U+212e,U+2211,U+fb01-fb02"}},{uri:Lq,descriptors:{unicodeRange:"U+462-463,U+472-475,U+4d8-4d9,U+4e2-4e3,U+4e6-4e9,U+4ee-4ef"}},{uri:Rq,descriptors:{unicodeRange:"U+300-301,U+303"}}],jq=[{uri:h7}],Pq="./fonts/Liberation/LiberationSans-Regular.woff2",Nq=[{uri:Pq}],Oq="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2",Fq="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2",Bq=[{uri:Fq,descriptors:{unicodeRange:Tc.LATIN_EXT}},{uri:Oq,descriptors:{unicodeRange:Tc.LATIN}}],$q="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2",zq="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2",Hq="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2",Wq="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2",Xq="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2",Vq=[{uri:Wq,descriptors:{unicodeRange:Tc.CYRILIC_EXT,weight:"500"}},{uri:Hq,descriptors:{unicodeRange:Tc.CYRILIC,weight:"500"}},{uri:Xq,descriptors:{unicodeRange:Tc.VIETNAMESE,weight:"500"}},{uri:zq,descriptors:{unicodeRange:Tc.LATIN_EXT,weight:"500"}},{uri:$q,descriptors:{unicodeRange:Tc.LATIN,weight:"500"}}],Yq="./fonts/Virgil/Virgil-Regular.woff2",Gq=[{uri:Yq}],qq="./fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2",Zq="./fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2",Kq="./fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2",Qq="./fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2",Jq="./fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2",eZ="./fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2",tZ="./fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2",nZ="./fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2",rZ="./fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2",iZ="./fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2",aZ="./fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2",sZ="./fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2",oZ="./fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2",lZ="./fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2",cZ="./fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2",dZ="./fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2",uZ="./fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2",hZ="./fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2",fZ="./fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2",pZ="./fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2",mZ="./fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2",gZ="./fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2",UZ="./fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2",bZ="./fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2",yZ="./fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2",vZ="./fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2",xZ="./fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2",wZ="./fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2",EZ="./fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2",CZ="./fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2",SZ="./fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2",_Z="./fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2",kZ="./fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2",TZ="./fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2",MZ="./fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2",IZ="./fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2",AZ="./fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2",LZ="./fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2",RZ="./fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2",DZ="./fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2",jZ="./fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2",PZ="./fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2",NZ="./fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2",OZ="./fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2",FZ="./fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2",BZ="./fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2",$Z="./fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2",zZ="./fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2",HZ="./fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2",WZ="./fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2",XZ="./fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2",VZ="./fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2",YZ="./fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2",GZ="./fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2",qZ="./fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2",ZZ="./fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2",KZ="./fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2",QZ="./fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2",JZ="./fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2",eK="./fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2",tK="./fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2",nK="./fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2",rK="./fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2",iK="./fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2",aK="./fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2",sK="./fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2",oK="./fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2",lK="./fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2",cK="./fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2",dK="./fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2",uK="./fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2",hK="./fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2",fK="./fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2",pK="./fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2",mK="./fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2",gK="./fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2",UK="./fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2",bK="./fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2",yK="./fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2",vK="./fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2",xK="./fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2",wK="./fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2",EK="./fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2",CK="./fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2",SK="./fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2",_K="./fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2",kK="./fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2",TK="./fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2",MK="./fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2",IK="./fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2",AK="./fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2",LK="./fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2",RK="./fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2",DK="./fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2",jK="./fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2",PK="./fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2",NK="./fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2",OK="./fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2",FK="./fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2",BK="./fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2",$K="./fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2",zK="./fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2",HK="./fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2",WK="./fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2",XK="./fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2",VK="./fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2",YK="./fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2",GK="./fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2",qK="./fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2",ZK="./fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2",KK="./fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2",QK="./fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2",JK="./fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2",eQ="./fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2",tQ="./fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2",nQ="./fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2",rQ="./fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2",iQ="./fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2",aQ="./fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2",sQ="./fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2",oQ="./fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2",lQ="./fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2",cQ="./fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2",dQ="./fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2",uQ="./fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2",hQ="./fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2",fQ="./fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2",pQ="./fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2",mQ="./fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2",gQ="./fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2",UQ="./fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2",bQ="./fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2",yQ="./fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2",vQ="./fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2",xQ="./fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2",wQ="./fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2",EQ="./fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2",CQ="./fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2",SQ="./fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2",_Q="./fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2",kQ="./fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2",TQ="./fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2",MQ="./fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2",IQ="./fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2",AQ="./fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2",LQ="./fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2",RQ="./fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2",DQ="./fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2",jQ="./fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2",PQ="./fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2",NQ="./fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2",OQ="./fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2",FQ="./fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2",BQ="./fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2",$Q="./fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2",zQ="./fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2",HQ="./fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2",WQ="./fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2",XQ="./fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2",VQ="./fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2",YQ="./fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2",GQ="./fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2",qQ="./fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2",ZQ="./fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2",KQ="./fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2",QQ="./fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2",JQ="./fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2",eJ="./fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2",tJ="./fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2",nJ="./fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2",rJ="./fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2",iJ="./fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2",aJ="./fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2",sJ="./fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2",oJ="./fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2",lJ="./fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2",cJ="./fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2",dJ="./fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2",uJ="./fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2",hJ="./fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2",fJ="./fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2",pJ="./fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2",mJ="./fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2",gJ="./fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2",UJ="./fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2",bJ="./fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2",yJ="./fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2",vJ="./fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2",xJ="./fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2",wJ="./fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2",EJ="./fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2",CJ="./fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2",SJ="./fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2",_J="./fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2",kJ="./fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2",TJ="./fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2",MJ="./fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2",IJ="./fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2",AJ="./fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2",LJ="./fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2",RJ="./fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2",DJ="./fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2",jJ="./fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2",PJ="./fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2",NJ="./fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2",OJ="./fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2",FJ="./fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2",BJ="./fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2",$J="./fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2",zJ=[{uri:qq,descriptors:{unicodeRange:"U+f9b8-fa6d,U+fe32,U+fe45-fe4f,U+ff02-ff0b,U+ff0d-ff1e,U+ff20-ff2a"}},{uri:Zq,descriptors:{unicodeRange:"U+20dd-20de,U+25ef,U+ff2b-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd7,U+ffda-ffdc,U+ffe0-ffe6,U+ffe8-ffee"}},{uri:Kq,descriptors:{unicodeRange:"U+d7eb-d7fb,U+f900-f9b7"}},{uri:Qq,descriptors:{unicodeRange:"U+d6f2-d7a3,U+d7b0-d7c6,U+d7cb-d7ea"}},{uri:Jq,descriptors:{unicodeRange:"U+d609-d6f1"}},{uri:eZ,descriptors:{unicodeRange:"U+d520-d608"}},{uri:tZ,descriptors:{unicodeRange:"U+d437-d51f"}},{uri:nZ,descriptors:{unicodeRange:"U+d34e-d436"}},{uri:rZ,descriptors:{unicodeRange:"U+d265-d34d"}},{uri:iZ,descriptors:{unicodeRange:"U+d17c-d264"}},{uri:aZ,descriptors:{unicodeRange:"U+d093-d17b"}},{uri:sZ,descriptors:{unicodeRange:"U+cfaa-d092"}},{uri:oZ,descriptors:{unicodeRange:"U+cec1-cfa9"}},{uri:lZ,descriptors:{unicodeRange:"U+cdd8-cec0"}},{uri:cZ,descriptors:{unicodeRange:"U+ccf1-cdd7"}},{uri:dZ,descriptors:{unicodeRange:"U+cc08-ccf0"}},{uri:uZ,descriptors:{unicodeRange:"U+cb43-cc07"}},{uri:hZ,descriptors:{unicodeRange:"U+ca83-cb42"}},{uri:fZ,descriptors:{unicodeRange:"U+c9a1-ca82"}},{uri:pZ,descriptors:{unicodeRange:"U+c8b8-c9a0"}},{uri:mZ,descriptors:{unicodeRange:"U+c7cf-c8b7"}},{uri:gZ,descriptors:{unicodeRange:"U+c6e6-c7ce"}},{uri:UZ,descriptors:{unicodeRange:"U+c5fd-c6e5"}},{uri:bZ,descriptors:{unicodeRange:"U+c514-c5fc"}},{uri:yZ,descriptors:{unicodeRange:"U+c42b-c513"}},{uri:vZ,descriptors:{unicodeRange:"U+c341-c34e,U+c350-c42a"}},{uri:xZ,descriptors:{unicodeRange:"U+c258-c340"}},{uri:wZ,descriptors:{unicodeRange:"U+c16f-c257"}},{uri:EZ,descriptors:{unicodeRange:"U+c086-c16e"}},{uri:CZ,descriptors:{unicodeRange:"U+bf9d-c085"}},{uri:SZ,descriptors:{unicodeRange:"U+beb4-bf9c"}},{uri:_Z,descriptors:{unicodeRange:"U+bdcb-beb3"}},{uri:kZ,descriptors:{unicodeRange:"U+bce2-bdca"}},{uri:TZ,descriptors:{unicodeRange:"U+bbf9-bce1"}},{uri:MZ,descriptors:{unicodeRange:"U+bb10-bbf8"}},{uri:IZ,descriptors:{unicodeRange:"U+ba27-bb0f"}},{uri:AZ,descriptors:{unicodeRange:"U+b93e-ba26"}},{uri:LZ,descriptors:{unicodeRange:"U+b855-b93d"}},{uri:RZ,descriptors:{unicodeRange:"U+b76c-b854"}},{uri:DZ,descriptors:{unicodeRange:"U+b683-b76b"}},{uri:jZ,descriptors:{unicodeRange:"U+b59a-b682"}},{uri:PZ,descriptors:{unicodeRange:"U+b4b1-b599"}},{uri:NZ,descriptors:{unicodeRange:"U+11fb-11ff,U+b3cd-b4b0"}},{uri:OZ,descriptors:{unicodeRange:"U+11e6-11fa,U+b2f9-b3cc"}},{uri:FZ,descriptors:{unicodeRange:"U+11d1-11e5,U+b225-b2f8"}},{uri:BZ,descriptors:{unicodeRange:"U+11bc-11d0,U+b151-b224"}},{uri:$Z,descriptors:{unicodeRange:"U+11a7-11bb,U+b07d-b150"}},{uri:zZ,descriptors:{unicodeRange:"U+1191-11a6,U+afaa-b07c"}},{uri:HZ,descriptors:{unicodeRange:"U+117c-1190,U+aed6-afa9"}},{uri:WZ,descriptors:{unicodeRange:"U+1167-117b,U+ae02-aed5"}},{uri:XZ,descriptors:{unicodeRange:"U+1152-115e,U+1160-1166,U+ad2d-ae01"}},{uri:VZ,descriptors:{unicodeRange:"U+113d-1151,U+ac59-ad2c"}},{uri:YZ,descriptors:{unicodeRange:"U+1100-113c,U+9f95-9f98,U+9f9c-9f9e,U+9fa1-9fce,U+9fd0,U+a960-a97c,U+ac00-ac58"}},{uri:GZ,descriptors:{unicodeRange:"U+9771-9772,U+9775,U+9777-977b,U+977d-9784,U+9786-978a,U+978c,U+978e-9790,U+9793,U+9795-9797,U+9799-979f,U+97a1-97a2,U+97a4-97aa,U+97ac,U+97ae,U+97b0-97b1,U+97b3,U+97b5-97e5,U+97e8,U+97ee-97f2,U+97f4,U+97f7-982d"}},{uri:qZ,descriptors:{unicodeRange:"U+9491,U+9496,U+9498,U+94c7,U+94cf,U+94d3-94d4,U+94da,U+94e6,U+94fb,U+951c,U+9520,U+9527,U+9533,U+953d,U+9543,U+9548,U+954b,U+9555,U+955a,U+9560,U+956e,U+9574-9575,U+9577-957e,U+9580-95e7,U+95ec,U+95ff,U+9607,U+9613,U+9618,U+961b,U+961e,U+9620,U+9623-9629,U+962b-962d,U+962f-9630,U+9637-963a,U+963e,U+9641,U+9643,U+964a,U+964e-964f,U+9651-9653,U+9656-965a,U+965c-965e,U+9660,U+9663,U+9665-9666,U+966b,U+966d-9671,U+9673,U+9678-9684,U+9687,U+9689-968a,U+968c,U+968e,U+9691-9693"}},{uri:ZZ,descriptors:{unicodeRange:"U+923c-9273,U+9275-928d,U+928f-92ad,U+92af-92c7,U+92c9-92ee"}},{uri:KZ,descriptors:{unicodeRange:"U+9159,U+915b-915c,U+915f-9160,U+9166-9168,U+916b,U+916d,U+9173,U+917a-917c,U+9180-9184,U+9186,U+9188,U+918a,U+918e-918f,U+9193-9199,U+919c-91a1,U+91a4-91a9,U+91ab-91ac,U+91b0-91b3,U+91b6-91b9,U+91bb-91c6,U+91c8,U+91cb,U+91d0,U+91d2-91db,U+91dd-923b"}},{uri:QZ,descriptors:{unicodeRange:"U+902b-902c,U+9030-9034,U+9037,U+9039-903a,U+903d,U+903f-9040,U+9043,U+9045-9046,U+9048-904c,U+904e,U+9054-9056,U+9059-905a,U+905c-9061,U+9064,U+9066-9067,U+9069-906c,U+906f-9073,U+9076-907c,U+907e,U+9081,U+9084-9087,U+9089-908a,U+908c-9090,U+9092,U+9094,U+9096,U+9098,U+909a,U+909c,U+909e-90a0,U+90a4-90a5,U+90a7-90a9,U+90ab,U+90ad,U+90b2,U+90b7,U+90bc-90bd,U+90bf-90c0,U+90c2-90c3,U+90c6,U+90c8-90c9,U+90cb-90cd,U+90d2,U+90d4-90d6,U+90d8-90da,U+90de-90e0,U+90e3-90e5,U+90e9-90ea,U+90ec,U+90ee,U+90f0-90f3,U+90f5-90f7,U+90f9-90fc,U+90ff-9101,U+9103,U+9105-9118,U+911a-911d,U+911f-9121,U+9124-912e,U+9130,U+9132-9138,U+913a-9142,U+9144-9145,U+9147-9148,U+9151,U+9153-9156,U+9158"}},{uri:JZ,descriptors:{unicodeRange:"U+8f03-8f65,U+8f6a,U+8f80,U+8f8c,U+8f92,U+8f9d,U+8fa0-8fa2,U+8fa4-8fa7,U+8faa,U+8fac-8faf,U+8fb2-8fb5,U+8fb7-8fb8,U+8fba-8fbc,U+8fbf-8fc0,U+8fc3,U+8fc6,U+8fc9-8fcd,U+8fcf,U+8fd2,U+8fd6-8fd7,U+8fda,U+8fe0-8fe1,U+8fe3,U+8fe7,U+8fec,U+8fef,U+8ff1-8ff2,U+8ff4-8ff6,U+8ffa-8ffc,U+8ffe-8fff,U+9007-9008,U+900c,U+900e,U+9013,U+9015,U+9018-9019,U+901c,U+9023-9025,U+9027-902a"}},{uri:eK,descriptors:{unicodeRange:"U+8d03-8d1c,U+8d20,U+8d51-8d52,U+8d57,U+8d5f,U+8d65,U+8d68-8d6a,U+8d6c,U+8d6e-8d6f,U+8d71-8d72,U+8d78-8d80,U+8d82-8d83,U+8d86-8d89,U+8d8c-8d90,U+8d92-8d93,U+8d95-8d9e,U+8da0-8da2,U+8da4-8db0,U+8db2,U+8db6-8db7,U+8db9,U+8dbb,U+8dbd,U+8dc0-8dc2,U+8dc5,U+8dc7-8dca,U+8dcd,U+8dd0,U+8dd2-8dd5,U+8dd8-8dd9,U+8ddc,U+8de0-8de2,U+8de5-8de7,U+8de9,U+8ded-8dee,U+8df0-8df2,U+8df4,U+8df6,U+8dfc,U+8dfe-8e04,U+8e06-8e08,U+8e0b,U+8e0d-8e0e,U+8e10-8e13,U+8e15-8e1c,U+8e20-8e21,U+8e24-8e28,U+8e2b,U+8e2d,U+8e30,U+8e32-8e34,U+8e36-8e38,U+8e3b-8e3c,U+8e3e-8e3f,U+8e43,U+8e45-8e46"}},{uri:tK,descriptors:{unicodeRange:"U+8bea,U+8c09,U+8c1e,U+8c38-8c40,U+8c42-8c45,U+8c48,U+8c4a-8c4b,U+8c4d-8c54,U+8c56-8c59,U+8c5b-8c60,U+8c63-8c69,U+8c6c-8c72,U+8c74-8c77,U+8c7b-8c81,U+8c83-8c84,U+8c86-8c88,U+8c8b,U+8c8d-8c93,U+8c95-8c97,U+8c99-8d02"}},{uri:nK,descriptors:{unicodeRange:"U+8a64-8a78,U+8a7a-8a88,U+8a8b-8a92,U+8a94-8b06,U+8b08-8b1b"}},{uri:rK,descriptors:{unicodeRange:"U+8987-89c0,U+89c3,U+89cd,U+89d3-89d5,U+89d7-89d9,U+89db,U+89dd,U+89df-89e2,U+89e4,U+89e7-89ea,U+89ec-89ee,U+89f0-89f2,U+89f4-89ff,U+8a01-8a06,U+8a08-8a3d,U+8a3f-8a47,U+8a49-8a63"}},{uri:iK,descriptors:{unicodeRange:"U+87e3-87e4,U+87e6-87e9,U+87eb-87ed,U+87ef-87f8,U+87fa-87fd,U+87ff-8802,U+8804-8809,U+880b-8812,U+8814,U+8817-881a,U+881c-8820,U+8823-8831,U+8833-8838,U+883a-883b,U+883d-883f,U+8841-8843,U+8846-884b,U+884e-8853,U+8855-8856,U+8858,U+885a-8860,U+8866-8867,U+886a,U+886d,U+886f,U+8871,U+8873-8876,U+8878-887c,U+8880,U+8883,U+8886-8887,U+8889-888a,U+888c,U+888e-8891,U+8893-8895,U+8897-889b,U+889d-88a1,U+88a3,U+88a5-88aa,U+88ac,U+88ae-88b0,U+88b2-88b6,U+88b8-88bb"}},{uri:aK,descriptors:{unicodeRange:"U+86e7-86e8,U+86ea-86ec,U+86ef,U+86f5-86f7,U+86fa-86fd,U+86ff,U+8701,U+8704-8706,U+870b-870c,U+870e-8711,U+8714,U+8716,U+8719,U+871b,U+871d,U+871f-8720,U+8724,U+8726-8728,U+872a-872d,U+872f-8730,U+8732-8733,U+8735-8736,U+8738-873a,U+873c-873d,U+8740-8746,U+874a-874b,U+874d,U+874f-8752,U+8754-8756,U+8758,U+875a-875f,U+8761-8762,U+8766-876d,U+876f,U+8771-8773,U+8775,U+8777-877a,U+877f-8781,U+8784,U+8786-8787,U+8789-878a,U+878c,U+878e-8792,U+8794-8796,U+8798-879e,U+87a0-87a7,U+87a9-87aa,U+87ae,U+87b0-87b2,U+87b4,U+87b6-87b9,U+87bb-87bc,U+87be-87bf,U+87c1-87c5,U+87c7-87c9,U+87cc-87d0,U+87d4-87da,U+87dc-87df,U+87e1-87e2"}},{uri:sK,descriptors:{unicodeRange:"U+8604,U+8606-8610,U+8612-8615,U+8617-8626,U+8628,U+862a-8637,U+8639-863b,U+863d-864c,U+8652-8653,U+8655-8659,U+865b-865d,U+865f-8661,U+8663-866a,U+866d,U+866f-8670,U+8672-8678,U+8683-8689,U+868e-8692,U+8694,U+8696-869b,U+869e-86a2,U+86a5-86a6,U+86ab,U+86ad-86ae,U+86b2-86b3,U+86b7-86b9,U+86bb-86bf,U+86c1-86c3,U+86c5,U+86c8,U+86cc-86cd,U+86d2-86d3,U+86d5-86d7,U+86da,U+86dc-86dd,U+86e0-86e3,U+86e5-86e6"}},{uri:oK,descriptors:{unicodeRange:"U+8456,U+8458,U+845d-8460,U+8462,U+8464-8468,U+846a,U+846e-8470,U+8472,U+8474,U+8477,U+8479,U+847b-8481,U+8483-8486,U+848a,U+848d,U+848f-8496,U+8498,U+849a-849b,U+849d-84a0,U+84a2-84ae,U+84b0-84b1,U+84b3,U+84b5-84b7,U+84bb-84bc,U+84be,U+84c0,U+84c2-84c3,U+84c5-84c8,U+84cb-84cc,U+84ce-84cf,U+84d2,U+84d4-84d5,U+84d7-84dc,U+84de,U+84e1-84e2,U+84e4,U+84e7-84eb,U+84ed-84ef,U+84f1-84fb,U+84fd-84fe,U+8500-850b,U+850d-8510,U+8512,U+8514-8516,U+8518-8519,U+851b-851e,U+8520,U+8522-852a,U+852d-8536,U+853e-8542,U+8544-8547,U+854b-854f"}},{uri:lK,descriptors:{unicodeRange:"U+82c2-82c3,U+82c5-82c6,U+82c9,U+82d0,U+82d6,U+82d9-82da,U+82dd,U+82e2,U+82e7-82ea,U+82ec-82ee,U+82f0,U+82f2-82f3,U+82f5-82f6,U+82f8,U+82fa,U+82fc-8300,U+830a-830b,U+830d,U+8310,U+8312-8313,U+8316,U+8318-8319,U+831d-8326,U+8329-832a,U+832e,U+8330,U+8332,U+8337,U+833b,U+833d-833f,U+8341-8342,U+8344-8345,U+8348,U+834a-834e,U+8353,U+8355-8359,U+835d,U+8362,U+8370-8376,U+8379-837a,U+837e-8384,U+8387-8388,U+838a-838d,U+838f-8391,U+8394-8397,U+8399-839a,U+839d,U+839f,U+83a1-83a7,U+83ac-83af,U+83b5,U+83bb,U+83be-83bf,U+83c2-83c4,U+83c6,U+83c8-83c9,U+83cb,U+83cd-83ce,U+83d0-83d3,U+83d5,U+83d7,U+83d9-83db,U+83de,U+83e2-83e4,U+83e6-83e8,U+83eb-83ef,U+83f3-83f7,U+83fa-83fc,U+83fe-8400,U+8402,U+8405,U+8407-840a,U+8410,U+8412-8417,U+8419-841b,U+841e-8423,U+8429-8430,U+8432-8437,U+8439-843b,U+843e-8445,U+8447-8450,U+8452-8455"}},{uri:cK,descriptors:{unicodeRange:"U+81a4-81a5,U+81a7,U+81a9,U+81ab-81b2,U+81b4-81b9,U+81bc-81bf,U+81c4-81c5,U+81c7-81c9,U+81cb,U+81cd-81e2,U+81e4-81e6,U+81e8-81e9,U+81eb,U+81ee-81f2,U+81f5-81fa,U+81fd,U+81ff,U+8203,U+8207-820b,U+820e-820f,U+8211,U+8213,U+8215-821a,U+821d,U+8220,U+8224-8227,U+8229,U+822e,U+8232,U+823a,U+823c-823d,U+823f-8243,U+8245-8246,U+8248,U+824a,U+824c-824e,U+8250-8257,U+8259,U+825b-825e,U+8260-8267,U+8269-826d,U+8271,U+8275-8278,U+827b-827c,U+8280-8281,U+8283,U+8285-8287,U+8289,U+828c,U+8290,U+8293-8296,U+829a-829b,U+829e,U+82a0,U+82a2-82a3,U+82a7,U+82b2,U+82b5-82b6,U+82ba-82bc,U+82bf-82c0"}},{uri:dK,descriptors:{unicodeRange:"U+8059,U+805b-8068,U+806b-8070,U+8072-807e,U+8081-8082,U+8085,U+8088,U+808a,U+808d-8092,U+8094-8095,U+8097,U+8099,U+809e,U+80a3,U+80a6-80a8,U+80ac,U+80b0,U+80b3,U+80b5-80b6,U+80b8-80b9,U+80bb,U+80c5,U+80c7-80cb,U+80cf-80d5,U+80d8,U+80df-80e0,U+80e2-80e3,U+80e6,U+80ee,U+80f5,U+80f7,U+80f9,U+80fb,U+80fe-8101,U+8103-8105,U+8107-8108,U+810b-810c,U+8115,U+8117,U+8119,U+811b-811d,U+811f-812b,U+812d-812e,U+8130,U+8133-8135,U+8137,U+8139-813d,U+813f-8145,U+8147,U+8149,U+814d-814f,U+8152,U+8156-8158,U+815b-815f,U+8161-8164,U+8166,U+8168,U+816a-816c,U+816f,U+8172-8173,U+8175-8178,U+8181,U+8183-8187,U+8189,U+818b-818e,U+8190,U+8192-8197,U+8199-819a,U+819e-81a2"}},{uri:uK,descriptors:{unicodeRange:"U+7f3c-7f41,U+7f43,U+7f46-7f4f,U+7f52-7f53,U+7f56,U+7f59,U+7f5b-7f5e,U+7f60,U+7f63-7f67,U+7f6b-7f6d,U+7f6f-7f70,U+7f73,U+7f75-7f78,U+7f7a-7f7d,U+7f7f-7f80,U+7f82-7f89,U+7f8b,U+7f8d,U+7f8f-7f93,U+7f95-7f99,U+7f9b-7f9c,U+7fa0,U+7fa2-7fa3,U+7fa5-7fa6,U+7fa8-7fae,U+7fb1,U+7fb3-7fb7,U+7fba-7fbb,U+7fbe,U+7fc0,U+7fc2-7fc4,U+7fc6-7fc9,U+7fcb,U+7fcd,U+7fcf-7fd3,U+7fd6-7fd7,U+7fd9-7fde,U+7fe2-7fe4,U+7fe7-7fe8,U+7fea-7fed,U+7fef,U+7ff2,U+7ff4-7ffa,U+7ffd-7fff,U+8002,U+8007-800a,U+800e-800f,U+8011,U+8013,U+801a-801b,U+801d-801f,U+8021,U+8023-8024,U+802b-8030,U+8032,U+8034,U+8039-803a,U+803c,U+803e,U+8040-8041,U+8044-8045,U+8047-8049,U+804e-8051,U+8053,U+8055-8057"}},{uri:hK,descriptors:{unicodeRange:"U+7cd8,U+7cda-7cdb,U+7cdd-7cde,U+7ce1-7ce7,U+7ce9-7cee,U+7cf0-7cf7,U+7cf9-7cfa,U+7cfc-7d09,U+7d0b-7d1f,U+7d21,U+7d23-7d26,U+7d28-7d2a,U+7d2c-7d2e,U+7d30-7d6d,U+7d6f-7d76,U+7d78-7d94"}},{uri:fK,descriptors:{unicodeRange:"U+7afe,U+7b00-7b02,U+7b05,U+7b07,U+7b09,U+7b0c-7b0e,U+7b10,U+7b12-7b13,U+7b16-7b18,U+7b1a,U+7b1c-7b1d,U+7b1f,U+7b21-7b23,U+7b27,U+7b29,U+7b2d,U+7b2f-7b30,U+7b32,U+7b34-7b37,U+7b39,U+7b3b,U+7b3d,U+7b3f-7b44,U+7b46,U+7b48,U+7b4a,U+7b4d-7b4e,U+7b53,U+7b55,U+7b57,U+7b59,U+7b5c,U+7b5e-7b5f,U+7b61,U+7b63-7b6d,U+7b6f-7b70,U+7b73-7b74,U+7b76,U+7b78,U+7b7a,U+7b7c-7b7d,U+7b7f,U+7b81-7b84,U+7b86-7b8c,U+7b8e-7b8f,U+7b91-7b93,U+7b96,U+7b98-7b9b,U+7b9e-7ba0,U+7ba3-7ba5,U+7bae-7bb0,U+7bb2-7bb3,U+7bb5-7bb7,U+7bb9-7bc0,U+7bc2-7bc5,U+7bc8-7bcb,U+7bcd-7bd0,U+7bd2,U+7bd4-7bd8,U+7bdb-7bdc,U+7bde-7be0,U+7be2-7be4,U+7be7-7be9,U+7beb-7bed,U+7bef-7bf0,U+7bf2-7bf6,U+7bf8-7bfb,U+7bfd,U+7bff-7c06,U+7c08-7c0a,U+7c0d-7c0e,U+7c10-7c13"}},{uri:pK,descriptors:{unicodeRange:"U+7a10-7a13,U+7a15-7a16,U+7a18-7a19,U+7a1b-7a1d,U+7a1f,U+7a21-7a22,U+7a24-7a32,U+7a34-7a36,U+7a38,U+7a3a,U+7a3e,U+7a40-7a45,U+7a47-7a50,U+7a52-7a56,U+7a58-7a6f,U+7a71-7a73,U+7a75,U+7a7b-7a7e,U+7a82,U+7a85,U+7a87,U+7a89-7a8c,U+7a8e-7a90,U+7a93-7a94,U+7a99-7a9b,U+7a9e,U+7aa1-7aa4,U+7aa7,U+7aa9-7aab,U+7aae-7ab2,U+7ab4-7abe,U+7ac0-7aca,U+7acc-7ad5,U+7ad7-7ad8,U+7ada-7add,U+7ae1-7ae2,U+7ae4,U+7ae7-7aec,U+7aee,U+7af0-7af8,U+7afb-7afc"}},{uri:mK,descriptors:{unicodeRange:"U+790d-7912,U+7914-791d,U+791f-7923,U+7925-7933,U+7935-7939,U+793d,U+793f,U+7942-7945,U+7947,U+794a-7952,U+7954-7955,U+7958-7959,U+7961,U+7963-7964,U+7966,U+7969-796c,U+796e,U+7970-7976,U+7979,U+797b-797f,U+7982-7983,U+7986-7989,U+798b-798e,U+7990-7999,U+799b-79a6,U+79a8-79b2,U+79b4-79b8,U+79bc,U+79bf,U+79c2,U+79c4-79c5,U+79c7-79c8,U+79ca,U+79cc,U+79ce-79d0,U+79d3-79d4,U+79d6-79d7,U+79d9-79de,U+79e0-79e2,U+79e5,U+79e8,U+79ea,U+79ec,U+79ee,U+79f1-79f7,U+79f9-79fa,U+79fc,U+79fe-79ff,U+7a01,U+7a04-7a05,U+7a07-7a0a,U+7a0c,U+7a0f"}},{uri:gK,descriptors:{unicodeRange:"U+77d8-77da,U+77dd-77e1,U+77e4,U+77e6,U+77e8,U+77ea,U+77ef-77f2,U+77f4-77f5,U+77f7,U+77f9-77fc,U+7803-7808,U+780a-780b,U+780e-7810,U+7813,U+7815,U+7819,U+781b,U+781e,U+7820-7822,U+7824,U+7828,U+782a-782b,U+782e-782f,U+7831-7833,U+7835-7836,U+783d,U+783f,U+7841-7844,U+7846,U+7848-784b,U+784d,U+784f,U+7851,U+7853-7854,U+7858-785c,U+785e-7869,U+786f-7876,U+7878-787b,U+787d-7886,U+7888,U+788a-788b,U+788f-7890,U+7892,U+7894-7896,U+7899,U+789d-789e,U+78a0,U+78a2,U+78a4,U+78a6,U+78a8-78af,U+78b5-78b8,U+78ba-78bd,U+78bf-78c0,U+78c2-78c4,U+78c6-78c8,U+78cc-78cf,U+78d1-78d3,U+78d6-78d8,U+78da-78e7,U+78e9-78eb,U+78ed-78f1,U+78f3,U+78f5-78f6,U+78f8-78f9,U+78fb-7900,U+7902-7904,U+7906-790c"}},{uri:UK,descriptors:{unicodeRange:"U+76af-76b0,U+76b3,U+76b5-76be,U+76c0-76c1,U+76c3-76c4,U+76c7,U+76c9,U+76cb-76cc,U+76d3,U+76d5,U+76d9-76da,U+76dc-76de,U+76e0-76e4,U+76e6-76ed,U+76f0,U+76f3,U+76f5-76f7,U+76fa-76fb,U+76fd,U+76ff-7703,U+7705-7706,U+770a,U+770c,U+770e-7718,U+771b-771e,U+7721,U+7723-7725,U+7727,U+772a-772c,U+772e,U+7730-7734,U+7739,U+773b,U+773d-773f,U+7742,U+7744-7746,U+7748-774f,U+7752-7759,U+775c-7760,U+7764,U+7767,U+7769-776a,U+776d-7778,U+777a-777c,U+7781-7783,U+7786-778b,U+778f-7790,U+7793-779e,U+77a1,U+77a3-77a4,U+77a6,U+77a8,U+77ab,U+77ad-77af,U+77b1-77b2,U+77b4,U+77b6-77ba,U+77bc,U+77be,U+77c0-77cc,U+77ce-77d6"}},{uri:bK,descriptors:{unicodeRange:"U+7589-758a,U+758c-758e,U+7590,U+7593,U+7595,U+7598,U+759b-759c,U+759e,U+75a2,U+75a6-75aa,U+75ad,U+75b6-75b7,U+75ba-75bb,U+75bf-75c1,U+75c6,U+75cb-75cc,U+75ce-75d1,U+75d3,U+75d7,U+75d9-75da,U+75dc-75dd,U+75df-75e1,U+75e5,U+75e9,U+75ec-75ef,U+75f2-75f3,U+75f5-75f8,U+75fa-75fb,U+75fd-75fe,U+7602,U+7604,U+7606-7609,U+760b,U+760d-760f,U+7611-7614,U+7616,U+761a,U+761c-761e,U+7621,U+7623,U+7627-7628,U+762c,U+762e-762f,U+7631-7632,U+7636-7637,U+7639-763b,U+763d,U+7641-7642,U+7644-764b,U+764e-7653,U+7655,U+7657-765b,U+765d,U+765f-7662,U+7664-766a,U+766c-766e,U+7670-7677,U+7679-767a,U+767c,U+767f-7681,U+7683,U+7685,U+7689-768a,U+768c-768d,U+768f-7690,U+7692,U+7694-7695,U+7697-7698,U+769a-76a3,U+76a5-76ad"}},{uri:yK,descriptors:{unicodeRange:"U+7492-749b,U+749d,U+749f-74a6,U+74aa-74b9,U+74bb-74d1,U+74d3-74db,U+74dd,U+74df,U+74e1,U+74e5,U+74e7-74ed,U+74f0-74f3,U+74f5,U+74f8-74fe,U+7500-7503,U+7505-750c,U+750e,U+7510,U+7512,U+7514-7517,U+751b,U+751d-751e,U+7520-7524,U+7526-7527,U+752a,U+752e,U+7534,U+7536,U+7539,U+753c-753d,U+753f,U+7541-7544,U+7546-7547,U+7549-754a,U+754d,U+7550-7553,U+7555-7558,U+755d-7564,U+7567-7569,U+756b-7571,U+7573,U+7575-7577,U+757a-757e,U+7580-7582,U+7584-7585,U+7587-7588"}},{uri:vK,descriptors:{unicodeRange:"U+7372-737d,U+737f-7383,U+7385-7386,U+7388,U+738a,U+738c-738d,U+738f-7390,U+7392-7395,U+7397-739a,U+739c-739e,U+73a0-73a1,U+73a3-73a8,U+73aa,U+73ac-73ad,U+73b1,U+73b4-73b6,U+73b8-73b9,U+73bc-73bf,U+73c1,U+73c3-73c7,U+73cb-73cc,U+73ce,U+73d2-73d8,U+73da-73dd,U+73df,U+73e1-73e4,U+73e6,U+73e8,U+73ea-73ec,U+73ee-73f1,U+73f3-7402,U+7404,U+7407-7408,U+740b-740e,U+7411-7419,U+741c-7421,U+7423-7424,U+7427,U+7429,U+742b,U+742d,U+742f,U+7431-7432,U+7437-743b,U+743d-7440,U+7442-7454,U+7456,U+7458,U+745d,U+7460-746c,U+746e-746f,U+7471-7475,U+7478-747d,U+747f,U+7482,U+7484-7486,U+7488-748a,U+748c-748d,U+748f,U+7491"}},{uri:xK,descriptors:{unicodeRange:"U+7054-705d,U+705f-706a,U+706e,U+7071-7074,U+7077,U+7079-707b,U+707d,U+7081-7084,U+7086-7088,U+708b-708d,U+708f-7091,U+7093,U+7097-7098,U+709a-709b,U+709e-70aa,U+70b0,U+70b2,U+70b4-70b6,U+70ba,U+70be-70bf,U+70c4-70c7,U+70c9,U+70cb-70d7,U+70da,U+70dc-70de,U+70e0-70e3,U+70e5,U+70ea,U+70ee,U+70f0-70f6,U+70f8,U+70fa-70fc,U+70fe-7108,U+710b-710f,U+7111-7112,U+7114,U+7117,U+711b-7125,U+7127-712e,U+7132-7135,U+7137-7144,U+7146-7149,U+714b,U+714d,U+714f-715b,U+715d,U+715f-7163,U+7165,U+7169-716d,U+716f-7171,U+7174-7177"}},{uri:wK,descriptors:{unicodeRange:"U+722e-722f,U+7232-7234,U+723a,U+723c,U+723e,U+7240-7246,U+7249-724b,U+724e-7251,U+7253-7255,U+7257-7258,U+725a,U+725c,U+725e,U+7260,U+7263-7265,U+7268,U+726a-726d,U+7270-7271,U+7273-7274,U+7276-7278,U+727b-727d,U+7282-7283,U+7285-7289,U+728c,U+728e,U+7290-7291,U+7293-729e,U+72a0-72ab,U+72ae,U+72b1-72b3,U+72b5,U+72ba-72c0,U+72c5-72c7,U+72c9-72cc,U+72cf,U+72d1,U+72d3-72d6,U+72d8,U+72da-72dd,U+72df,U+72e2-72e7,U+72ea-72eb,U+72f5-72f6,U+72f9,U+72fd-7300,U+7302,U+7304-7309,U+730b-730d,U+730f-7312,U+7314,U+7318-731a,U+731f-7320,U+7323-7324,U+7326-7328,U+732d,U+732f-7330,U+7332-7333,U+7335-7336,U+733a-733d,U+7340-734c,U+734e-734f,U+7351,U+7353-7356,U+7358-735f,U+7361-736b,U+736e,U+7370-7371"}},{uri:EK,descriptors:{unicodeRange:"U+6ec5-6ec6,U+6ec8-6eca,U+6ecc-6ece,U+6ed0,U+6ed2,U+6ed6,U+6ed8-6ed9,U+6edb-6edd,U+6ee3,U+6ee7,U+6eea-6ef3,U+6ef5-6ef8,U+6efa-6f01,U+6f03-6f05,U+6f07-6f08,U+6f0a-6f0e,U+6f10-6f12,U+6f16-6f1f,U+6f21-6f23,U+6f25-6f28,U+6f2c,U+6f2e,U+6f30,U+6f32,U+6f34-6f35,U+6f37-6f3d,U+6f3f-6f45,U+6f48-6f4a,U+6f4c,U+6f4e-6f57,U+6f59-6f5b,U+6f5d,U+6f5f-6f61,U+6f63-6f65,U+6f67-6f6c,U+6f6f-6f71,U+6f73,U+6f75-6f77,U+6f79,U+6f7b,U+6f7d-6f83,U+6f85-6f87,U+6f8a-6f8b,U+6f8f-6f9b,U+6f9d-6fa0,U+6fa2-6fa6,U+6fa8-6fb1"}},{uri:CK,descriptors:{unicodeRange:"U+6d73,U+6d75-6d76,U+6d79-6d7b,U+6d7d-6d81,U+6d83-6d84,U+6d86-6d87,U+6d8a-6d8b,U+6d8d,U+6d8f-6d90,U+6d92,U+6d96-6d9a,U+6d9c,U+6da2,U+6da5,U+6dac-6dad,U+6db0-6db1,U+6db3-6db4,U+6db6-6db7,U+6db9-6dbe,U+6dc1-6dc3,U+6dc8-6dca,U+6dcd-6dd0,U+6dd2-6dd5,U+6dd7,U+6dda-6ddc,U+6ddf,U+6de2-6de3,U+6de5,U+6de7-6dea,U+6ded,U+6def-6df0,U+6df2,U+6df4-6df6,U+6df8,U+6dfa,U+6dfd-6e04,U+6e06-6e09,U+6e0b,U+6e0f,U+6e12-6e13,U+6e15,U+6e18-6e19,U+6e1b-6e1c,U+6e1e-6e1f,U+6e22,U+6e26-6e28,U+6e2a,U+6e2c,U+6e2e,U+6e30-6e31,U+6e33,U+6e35-6e37,U+6e39,U+6e3b-6e42,U+6e45-6e4c,U+6e4f-6e52,U+6e55,U+6e57,U+6e59-6e5a,U+6e5c-6e5e,U+6e60-6e6a,U+6e6c-6e6d,U+6e6f-6e7d,U+6e80-6e82,U+6e84,U+6e87-6e88,U+6e8a-6e8e,U+6e91-6e97,U+6e99-6e9b,U+6e9d-6e9e,U+6ea0-6ea1,U+6ea3-6ea4,U+6ea6,U+6ea8-6ea9,U+6eab-6eae,U+6eb0,U+6eb3,U+6eb5,U+6eb8-6eb9,U+6ebc,U+6ebe-6ec0,U+6ec3-6ec4"}},{uri:SK,descriptors:{unicodeRange:"U+6bbb-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bca,U+6bcc,U+6bce,U+6bd0-6bd1,U+6bd8,U+6bda,U+6bdc-6be0,U+6be2-6be9,U+6bec-6bee,U+6bf0-6bf2,U+6bf4,U+6bf6-6bf8,U+6bfa-6bfc,U+6bfe-6c04,U+6c08-6c0c,U+6c0e,U+6c12,U+6c17,U+6c1c-6c1e,U+6c20,U+6c23,U+6c25,U+6c2b-6c2d,U+6c31,U+6c33,U+6c36-6c37,U+6c39-6c3c,U+6c3e-6c3f,U+6c43-6c45,U+6c48,U+6c4b-6c4f,U+6c51-6c53,U+6c56,U+6c58-6c5a,U+6c62-6c63,U+6c65-6c67,U+6c6b-6c6f,U+6c71,U+6c73,U+6c75,U+6c77-6c78,U+6c7a-6c7c,U+6c7f-6c80,U+6c84,U+6c87,U+6c8a-6c8b,U+6c8d-6c8e,U+6c91-6c92,U+6c95-6c98,U+6c9a,U+6c9c-6c9e,U+6ca0,U+6ca2,U+6ca8,U+6cac,U+6caf-6cb0,U+6cb4-6cb7,U+6cba,U+6cc0-6cc3,U+6cc6-6cc8,U+6ccb,U+6ccd-6ccf,U+6cd1-6cd2,U+6cd8-6cda,U+6cdc-6cdd,U+6cdf,U+6ce4,U+6ce6-6ce7,U+6ce9,U+6cec-6ced,U+6cf2,U+6cf4,U+6cf9,U+6cff-6d00,U+6d02-6d03,U+6d05-6d06,U+6d08-6d0a,U+6d0d,U+6d0f-6d11,U+6d13-6d16,U+6d18,U+6d1c-6d1d,U+6d1f-6d24,U+6d26,U+6d28-6d29,U+6d2c-6d2d,U+6d2f-6d30,U+6d34,U+6d36-6d38,U+6d3a,U+6d3f-6d40,U+6d42,U+6d44,U+6d49,U+6d4c,U+6d50,U+6d55-6d58,U+6d5b,U+6d5d,U+6d5f,U+6d61-6d62,U+6d64-6d65,U+6d67-6d68,U+6d6b-6d6d,U+6d70-6d72"}},{uri:_K,descriptors:{unicodeRange:"U+6967-696a,U+696c-696d,U+696f-6970,U+6972-6976,U+697a-697b,U+697d-697f,U+6981,U+6983,U+6985,U+698a-698c,U+698e-6993,U+6996-6997,U+6999-699a,U+699d-69a6,U+69a9-69aa,U+69ac,U+69ae-69b0,U+69b2-69b3,U+69b5-69b6,U+69b8-69ba,U+69bc-69c0,U+69c2-69c9,U+69cb,U+69cd,U+69cf,U+69d1-69d3,U+69d5-69da,U+69dc-69de,U+69e1-69ec,U+69ee-69f1,U+69f3-69fc,U+69fe,U+6a00-6a09,U+6a0b-6a16,U+6a19-6a1e,U+6a20,U+6a22-6a27,U+6a29,U+6a2b-6a2e,U+6a30,U+6a32-6a34,U+6a36-6a3c,U+6a3f-6a43,U+6a45-6a46,U+6a48-6a4a"}},{uri:kK,descriptors:{unicodeRange:"U+6830-6831,U+6834-6836,U+683a-683b,U+683f,U+6847,U+684b,U+684d,U+684f,U+6852,U+6856-685f,U+686a,U+686c-6873,U+6875,U+6878-6880,U+6882,U+6884,U+6887-688e,U+6890-6892,U+6894-6896,U+6898-68a1,U+68a3-68a5,U+68a9-68ac,U+68ae,U+68b1-68b2,U+68b4,U+68b6-68bf,U+68c1,U+68c3-68c8,U+68ca,U+68cc,U+68ce-68d1,U+68d3-68d4,U+68d6-68d7,U+68d9,U+68db-68df,U+68e1-68e2,U+68e4-68ed,U+68ef,U+68f2-68f4,U+68f6-68f8,U+68fb,U+68fd-6900,U+6902-6904,U+6906-690a,U+690c,U+690f,U+6911,U+6913-691e,U+6921-6923,U+6925-692c,U+692e-692f,U+6931-6933,U+6935-6938,U+693a-693c,U+693e,U+6940-6941,U+6943-6953,U+6955-6956,U+6958-6959,U+695b-695c,U+695f,U+6961-6962,U+6964-6965"}},{uri:TK,descriptors:{unicodeRange:"U+66b8,U+66ba-66bd,U+66bf-66d8,U+66da,U+66de-66e5,U+66e7-66e8,U+66ea-66ef,U+66f1,U+66f5-66f6,U+66f8,U+66fa-66fb,U+66fd,U+6701-6707,U+670c,U+670e-670f,U+6711-6713,U+6716,U+6718-671a,U+671c,U+671e,U+6720-6725,U+6727,U+6729,U+672e,U+6730,U+6732-6733,U+6736-6739,U+673b-673c,U+673e-673f,U+6741,U+6744-6745,U+6747,U+674a-674b,U+674d,U+6752,U+6754-6755,U+6757-675b,U+675d,U+6762-6764,U+6766-6767,U+676b-676c,U+676e,U+6771,U+6774,U+6776,U+6778-677b,U+677d,U+6780,U+6782-6783,U+6785-6786,U+6788,U+678a,U+678c-678f,U+6791-6794,U+6796,U+6799,U+679b,U+679f-67a1,U+67a4,U+67a6,U+67a9,U+67ac,U+67ae,U+67b1-67b2,U+67b4,U+67b9-67c0,U+67c2,U+67c5-67ce,U+67d5-67d7,U+67db,U+67df,U+67e1,U+67e3-67e4,U+67e6-67e8,U+67ea-67eb,U+67ed-67ee,U+67f2,U+67f5-67fc,U+67fe,U+6801-6804,U+6806,U+680d,U+6810,U+6812,U+6814-6815,U+6818-681c,U+681e-6820,U+6822-6828,U+682b-682f"}},{uri:MK,descriptors:{unicodeRange:"U+6569-656a,U+656d-656f,U+6571,U+6573,U+6575-6576,U+6578-6586,U+6588-658a,U+658d-658f,U+6592,U+6594-6596,U+6598,U+659a,U+659d-659e,U+65a0,U+65a2-65a3,U+65a6,U+65a8,U+65aa,U+65ac,U+65ae,U+65b1-65b8,U+65ba-65bb,U+65be-65c0,U+65c2,U+65c7-65ca,U+65cd,U+65d0-65d1,U+65d3-65d5,U+65d8-65df,U+65e1,U+65e3-65e4,U+65ea-65eb,U+65f2-65f5,U+65f8-65f9,U+65fb-65ff,U+6601,U+6604-6605,U+6607-6609,U+660b,U+660d,U+6610-6612,U+6616-6618,U+661a-661c,U+661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630,U+6632-6633,U+6637-663b,U+663d,U+663f-6640,U+6642,U+6644-664a,U+664d-664e,U+6650-6651,U+6658-6659,U+665b-665e,U+6660,U+6662-6663,U+6665,U+6667,U+6669-666d,U+6671-6673,U+6675,U+6678-6679,U+667b-667d,U+667f-6681,U+6683,U+6685-6686,U+6688-668b,U+668d-6690,U+6692-6695,U+6698-669c,U+669e-66a6,U+66a9-66ad,U+66af-66b3,U+66b5-66b7"}},{uri:IK,descriptors:{unicodeRange:"U+5f30,U+5f32-5f38,U+5f3b,U+5f3d-5f3f,U+5f41-5f4f,U+5f51,U+5f54,U+5f59-5f5c,U+5f5e-5f60,U+5f63,U+5f65,U+5f67-5f68,U+5f6b,U+5f6e-5f6f,U+5f72,U+5f74-5f76,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f83,U+5f86,U+5f8d-5f8f,U+5f91,U+5f93-5f94,U+5f96,U+5f9a-5f9b,U+5f9d-5fa0,U+5fa2-5fa7,U+5fa9,U+5fab-5fac,U+5faf-5fb4,U+5fb6,U+5fb8-5fbb,U+5fbe-5fc2,U+5fc7-5fc8,U+5fca-5fcb,U+5fce,U+5fd3-5fd5,U+5fda-5fdc,U+5fde-5fdf,U+5fe2-5fe3,U+5fe5-5fe6,U+5fe8-5fe9,U+5fec,U+5fef-5ff0,U+5ff2-5ff4,U+5ff6-5ff7,U+5ff9-5ffa,U+5ffc,U+6007-6009,U+600b-600c,U+6010-6011,U+6013,U+6017-6018,U+601a,U+601e-601f,U+6022-6024,U+602c-602e,U+6030-6034,U+6036-603a,U+603d-603e,U+6040,U+6044-604a,U+604c,U+604e-604f,U+6051,U+6053-6054,U+6056-6058,U+605b-605c,U+605e-6061,U+6065-6066,U+606e,U+6071-6072,U+6074-6075,U+6077,U+607e,U+6080-6082,U+6085-6088,U+608a-608b,U+608e-6091,U+6093,U+6095,U+6097-6099,U+609c,U+609e,U+60a1-60a2,U+60a4-60a5,U+60a7,U+60a9-60aa,U+60ae,U+60b0,U+60b3,U+60b5-60b7,U+60b9-60ba,U+60bd-60c4,U+60c7-60c9,U+60cc"}},{uri:AK,descriptors:{unicodeRange:"U+635a-635d,U+6360,U+6364-6366,U+6368,U+636a-636c,U+636f-6370,U+6372-6375,U+6378-6379,U+637c-637f,U+6381,U+6383-6386,U+638b,U+638d,U+6391,U+6393-6395,U+6397,U+6399-639f,U+63a1,U+63a4,U+63a6,U+63ab,U+63af,U+63b1-63b2,U+63b5-63b6,U+63b9,U+63bb,U+63bd,U+63bf-63c3,U+63c5,U+63c7-63c8,U+63ca-63cc,U+63d1,U+63d3-63d5,U+63d7-63dd,U+63df,U+63e2,U+63e4-63e8,U+63eb-63ec,U+63ee-63f1,U+63f3,U+63f5,U+63f7,U+63f9-63fc,U+63fe,U+6403-6404,U+6406-640a,U+640d-640e,U+6411-6412,U+6415-641a,U+641d,U+641f,U+6422-6425,U+6427-6429,U+642b,U+642e-6433,U+6435-6439,U+643b-643c,U+643e,U+6440,U+6442-6443,U+6449,U+644b-6451,U+6453,U+6455-6457,U+6459-645d,U+645f-6466,U+6468,U+646a-646c,U+646e-6477,U+647b-6481,U+6483,U+6486,U+6488-648f"}},{uri:LK,descriptors:{unicodeRange:"U+61c5-61c7,U+61c9,U+61cc-61d0,U+61d3,U+61d5-61e5,U+61e7-61f4,U+61f6-61fe,U+6200-6205,U+6207,U+6209,U+6213-6214,U+6219,U+621c-621e,U+6220,U+6223,U+6226-6229,U+622b,U+622d,U+622f-6232,U+6235-6236,U+6238-623c,U+6242,U+6244-6246,U+624a,U+624f-6250,U+6255-6257,U+6259-625a,U+625c-6262,U+6264-6265,U+6268,U+6271-6272,U+6274-6275,U+6277-6278,U+627a-627b,U+627d,U+6281-6283,U+6285-6288,U+628b-6290,U+6294,U+6299,U+629c-629e,U+62a3,U+62a6-62a7,U+62a9-62aa,U+62ad-62b0,U+62b2-62b4,U+62b6-62b8,U+62ba,U+62be,U+62c0-62c1,U+62c3,U+62cb,U+62cf,U+62d1,U+62d5,U+62dd-62de,U+62e0-62e1,U+62e4,U+62ea-62eb,U+62f0,U+62f2,U+62f5,U+62f8-62fb,U+6300,U+6303-6306,U+630a-630d,U+630f-6310,U+6312-6315,U+6317-6319,U+631c,U+6326-6327,U+6329,U+632c-632e,U+6330-6331,U+6333-6338,U+633b-633c,U+633e-6341,U+6344,U+6347-6348,U+634a,U+6351-6354,U+6356-6359"}},{uri:RK,descriptors:{unicodeRange:"U+5dd0-5dda,U+5ddc,U+5ddf-5de0,U+5de3-5de4,U+5dea,U+5dec-5ded,U+5df0,U+5df5-5df6,U+5df8-5dfc,U+5dff-5e00,U+5e04,U+5e07,U+5e09-5e0b,U+5e0d-5e0e,U+5e12-5e13,U+5e17,U+5e1e-5e25,U+5e28-5e2c,U+5e2f-5e30,U+5e32-5e36,U+5e39-5e3a,U+5e3e-5e41,U+5e43,U+5e46-5e4b,U+5e4d-5e53,U+5e56-5e5a,U+5e5c-5e5d,U+5e5f-5e60,U+5e63-5e71,U+5e75,U+5e77,U+5e79,U+5e7e,U+5e81-5e83,U+5e85,U+5e88-5e89,U+5e8c-5e8e,U+5e92,U+5e98,U+5e9b,U+5e9d,U+5ea1-5ea4,U+5ea8-5eac,U+5eae-5eb2,U+5eb4,U+5eba-5ebd,U+5ebf-5ec8,U+5ecb-5ed0,U+5ed4-5ed5,U+5ed7-5eda,U+5edc-5ee7,U+5ee9,U+5eeb-5ef3,U+5ef5,U+5ef8-5ef9,U+5efb-5efd,U+5f05-5f07,U+5f09,U+5f0c-5f0e,U+5f10,U+5f12,U+5f14,U+5f16,U+5f19-5f1a,U+5f1c-5f1e,U+5f21-5f24,U+5f28,U+5f2b-5f2c,U+5f2e"}},{uri:DK,descriptors:{unicodeRange:"U+60cd-60d0,U+60d2-60d4,U+60d6-60d7,U+60d9,U+60db,U+60de,U+60e1-60e5,U+60ea,U+60f1-60f2,U+60f5,U+60f7-60f8,U+60fb-60ff,U+6102-6105,U+6107,U+610a-610c,U+6110-6114,U+6116-6119,U+611b-611e,U+6121-6122,U+6125,U+6128-612a,U+612c-613e,U+6140-6147,U+6149,U+614b,U+614d,U+614f-6150,U+6152-6154,U+6156-615c,U+615e-6161,U+6163-6166,U+6169-616f,U+6171-6174,U+6176,U+6178-618a,U+618c-618d,U+618f-6193,U+6195-619c,U+619e-61a6,U+61aa-61ab,U+61ad-61b6,U+61b8-61bd,U+61bf-61c1,U+61c3-61c4"}},{uri:jK,descriptors:{unicodeRange:"U+5cf4-5cfa,U+5cfc-5d01,U+5d04-5d05,U+5d08-5d0d,U+5d0f-5d13,U+5d15,U+5d17-5d1a,U+5d1c-5d1d,U+5d1f-5d23,U+5d25,U+5d28,U+5d2a-5d2c,U+5d2f-5d33,U+5d35-5d3c,U+5d3f-5d46,U+5d48-5d49,U+5d4d-5d57,U+5d59-5d5a,U+5d5c,U+5d5e-5d68,U+5d6a,U+5d6d-5d6e,U+5d70-5d73,U+5d75-5d81,U+5d83-5d98,U+5d9a-5d9c,U+5d9e-5db6,U+5db8-5dc4,U+5dc6-5dcc,U+5dce-5dcf"}},{uri:PK,descriptors:{unicodeRange:"U+5b52,U+5b56,U+5b5e,U+5b60-5b61,U+5b67-5b68,U+5b6b,U+5b6d-5b6f,U+5b72,U+5b74,U+5b76-5b79,U+5b7b-5b7c,U+5b7e-5b7f,U+5b82,U+5b86,U+5b8a,U+5b8d-5b8e,U+5b90-5b92,U+5b94,U+5b96,U+5b9f,U+5ba7-5ba9,U+5bac-5baf,U+5bb1-5bb2,U+5bb7,U+5bba-5bbc,U+5bc0-5bc1,U+5bc3,U+5bc8-5bcb,U+5bcd-5bcf,U+5bd1,U+5bd4-5bdc,U+5be0,U+5be2-5be3,U+5be6-5be7,U+5be9-5bed,U+5bef,U+5bf1-5bf7,U+5bfd-5bfe,U+5c00,U+5c02-5c03,U+5c05,U+5c07-5c08,U+5c0b-5c0e,U+5c10,U+5c12-5c13,U+5c17,U+5c19,U+5c1b,U+5c1e-5c21,U+5c23,U+5c26,U+5c28-5c2b,U+5c2d-5c30,U+5c32-5c33,U+5c35-5c37,U+5c43-5c44,U+5c46-5c47,U+5c4c-5c4d,U+5c52-5c54,U+5c56-5c58,U+5c5a-5c5d,U+5c5f,U+5c62,U+5c64,U+5c67-5c6d,U+5c70,U+5c72-5c78,U+5c7b-5c7e,U+5c80,U+5c83-5c87,U+5c89-5c8b,U+5c8e-5c8f,U+5c92-5c93,U+5c95,U+5c9d-5ca1,U+5ca4-5ca8,U+5caa,U+5cae-5cb0,U+5cb2,U+5cb4,U+5cb6,U+5cb9-5cbc,U+5cbe,U+5cc0,U+5cc2-5cc3,U+5cc5-5cca,U+5ccc-5cd1,U+5cd3-5cd8,U+5cda-5ce0,U+5ce2-5ce3,U+5ce7,U+5ce9,U+5ceb-5cec,U+5cee-5cef,U+5cf1-5cf3"}},{uri:NK,descriptors:{unicodeRange:"U+593b,U+593d-5940,U+5943,U+5945-5946,U+594a,U+594c-594d,U+5950,U+5952-5953,U+5959,U+595b-595f,U+5961,U+5963-5964,U+5966-5972,U+5975,U+5977,U+597a-597c,U+597e-5980,U+5985,U+5989,U+598b-598c,U+598e-5991,U+5994-5995,U+5998,U+599a-599d,U+599f-59a2,U+59a6-59a7,U+59ac-59ad,U+59b0-59b1,U+59b3-59b8,U+59ba,U+59bc-59bd,U+59bf-59c5,U+59c7-59c9,U+59cc-59cf,U+59d5-59d6,U+59d9,U+59db,U+59de-59e2,U+59e4,U+59e6-59e7,U+59e9-59eb,U+59ed-59f8,U+59fa,U+59fc-59fe,U+5a00,U+5a02,U+5a0a-5a0b,U+5a0d-5a10,U+5a12,U+5a14-5a17,U+5a19-5a1b,U+5a1d-5a1e,U+5a21-5a22,U+5a24,U+5a26-5a28,U+5a2a-5a30,U+5a33,U+5a35,U+5a37-5a3b,U+5a3d-5a3f,U+5a41-5a45,U+5a47-5a48,U+5a4b-5a54,U+5a56-5a59,U+5a5b-5a61,U+5a63-5a66,U+5a68-5a69,U+5a6b-5a73,U+5a78-5a79,U+5a7b-5a7e,U+5a80-5a90"}},{uri:OK,descriptors:{unicodeRange:"U+5a91,U+5a93-5a99,U+5a9c-5aa9,U+5aab-5ab1,U+5ab4,U+5ab6-5ab7,U+5ab9-5abd,U+5abf-5ac0,U+5ac3-5ac8,U+5aca-5acb,U+5acd-5ad1,U+5ad3,U+5ad5,U+5ad7,U+5ad9-5adb,U+5add-5adf,U+5ae2,U+5ae4-5ae5,U+5ae7-5ae8,U+5aea,U+5aec-5af0,U+5af2-5b08,U+5b0a-5b15,U+5b18-5b31,U+5b33,U+5b35-5b36,U+5b38-5b3f,U+5b41-5b4f"}},{uri:FK,descriptors:{unicodeRange:"U+5843,U+5845-584b,U+584e-5850,U+5852-5853,U+5855-5857,U+5859-585d,U+585f-5864,U+5866-586a,U+586d-587d,U+587f,U+5882,U+5884,U+5886-5888,U+588a-5891,U+5894-5898,U+589b-589d,U+58a0-58a7,U+58aa-58bb,U+58bd-58c0,U+58c2-58c4,U+58c6-58d0,U+58d2-58d4,U+58d6-58e3,U+58e5-58ea,U+58ed,U+58ef,U+58f1-58f2,U+58f4-58f5,U+58f7-58f8,U+58fa-5901,U+5903,U+5905-5906,U+5908-590c,U+590e,U+5910-5913,U+5917-5918,U+591b,U+591d-591e,U+5920-5923,U+5926,U+5928,U+592c,U+5930,U+5932-5933,U+5935-5936"}},{uri:BK,descriptors:{unicodeRange:"U+56d0-56d3,U+56d5-56d6,U+56d8-56d9,U+56dc,U+56e3,U+56e5-56ea,U+56ec,U+56ee-56ef,U+56f2-56f3,U+56f6-56f8,U+56fb-56fc,U+5700-5702,U+5705,U+5707,U+570b-571b,U+571d-571e,U+5720-5722,U+5724-5727,U+572b,U+5731-5732,U+5734-5738,U+573c-573d,U+573f,U+5741,U+5743-5746,U+5748-5749,U+574b,U+5752-5756,U+5758-5759,U+5762-5763,U+5765,U+5767,U+576c,U+576e,U+5770-5772,U+5774-5775,U+5778-577a,U+577d-5781,U+5787-578a,U+578d-5791,U+5794-579a,U+579c-579f,U+57a5,U+57a8,U+57aa,U+57ac,U+57af-57b1,U+57b3,U+57b5-57b7,U+57b9-57c1,U+57c4-57ca,U+57cc-57cd,U+57d0-57d1,U+57d3,U+57d6-57d7,U+57db-57dc,U+57de,U+57e1-57e3,U+57e5-57ec,U+57ee,U+57f0-57f3,U+57f5-57f7,U+57fb-57fc,U+57fe-57ff,U+5801,U+5803-5805,U+5808-580a,U+580c,U+580e-5810,U+5812-5814,U+5816-5818,U+581a-581d,U+581f,U+5822-5823,U+5825-5829,U+582b-582f,U+5831-5834,U+5836-5842"}},{uri:$K,descriptors:{unicodeRange:"U+55f9-55fc,U+55ff,U+5602-5607,U+560a-560b,U+560d,U+5610-5617,U+5619-561a,U+561c-561d,U+5620-5622,U+5625-5626,U+5628-562b,U+562e-5630,U+5633,U+5635,U+5637-5638,U+563a,U+563c-563e,U+5640-564b,U+564f-5653,U+5655-5656,U+565a-565b,U+565d-5661,U+5663,U+5665-5667,U+566d-5670,U+5672-5675,U+5677-567a,U+567d-5684,U+5687-568d,U+5690-5692,U+5694-56a2,U+56a4-56ae,U+56b0-56b6,U+56b8-56bb,U+56bd-56c9,U+56cb-56cf"}},{uri:zK,descriptors:{unicodeRange:"U+5286-5287,U+5289-528f,U+5291-5292,U+5294-529a,U+529c,U+52a4-52a7,U+52ae-52b0,U+52b4-52bd,U+52c0-52c2,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cf,U+52d1,U+52d3-52d5,U+52d7,U+52d9-52de,U+52e0-52e3,U+52e5-52ef,U+52f1-52f8,U+52fb-52fd,U+5301-5304,U+5307,U+5309-530c,U+530e,U+5311-5314,U+5318,U+531b-531c,U+531e-531f,U+5322,U+5324-5325,U+5327-5329,U+532b-532d,U+532f-5338,U+533c-533d,U+5340,U+5342,U+5344,U+5346,U+534b-534d,U+5350,U+5354,U+5358-5359,U+535b,U+535d,U+5365,U+5368,U+536a,U+536c-536d,U+5372,U+5376,U+5379,U+537b-537e,U+5380-5381,U+5383,U+5387-5388,U+538a,U+538e-5394,U+5396-5397,U+5399,U+539b-539c,U+539e,U+53a0-53a1,U+53a4,U+53a7,U+53aa-53ad,U+53af-53b5,U+53b7-53ba,U+53bc-53be,U+53c0,U+53c3-53c7,U+53ce-53d0,U+53d2-53d3,U+53d5,U+53da,U+53dc-53de,U+53e1-53e2,U+53e7,U+53f4,U+53fa,U+53fe-5400,U+5402,U+5405,U+5407,U+540b,U+5414,U+5418-541a,U+541c,U+5422,U+5424-5425,U+542a,U+5430,U+5433,U+5436-5437,U+543a"}},{uri:HK,descriptors:{unicodeRange:"U+5101-5105,U+5108-510a,U+510c-5111,U+5113-5120,U+5122-513e,U+5142,U+5147,U+514a,U+514c,U+514e-5150,U+5152-5153,U+5157-5159,U+515b,U+515d-5161,U+5163-5164,U+5166-5167,U+5169-516a,U+516f,U+5172,U+517a,U+517e-517f,U+5183-5184,U+5186-5187,U+518a-518b,U+518e-5191,U+5193-5194,U+5198,U+519a,U+519d-519f,U+51a1,U+51a3,U+51a6-51aa,U+51ad-51ae,U+51b4,U+51b8-51ba,U+51be-51bf,U+51c1-51c3,U+51c5,U+51c8,U+51ca,U+51cd-51ce,U+51d0,U+51d2-51da,U+51dc,U+51de-51df,U+51e2-51e3,U+51e5-51ea,U+51ec,U+51ee,U+51f1-51f2,U+51f4,U+51f7,U+51fe,U+5204-5205,U+5209,U+520b-520c,U+520f-5210,U+5213-5215,U+521c,U+521e-521f,U+5221-5223,U+5225-5227,U+522a,U+522c,U+522f,U+5231-5232,U+5234-5235,U+523c,U+523e,U+5244-5249,U+524b,U+524e-524f,U+5252-5253,U+5255,U+5257-525b,U+525d,U+525f-5260,U+5262-5264,U+5266,U+5268,U+526b-526e,U+5270-5271,U+5273-527c,U+527e,U+5280,U+5283-5285"}},{uri:WK,descriptors:{unicodeRange:"U+543d,U+543f,U+5441-5442,U+5444-5445,U+5447,U+5449,U+544c-544f,U+5451,U+545a,U+545d-5461,U+5463,U+5465,U+5467,U+5469-5470,U+5474,U+5479-547a,U+547e-547f,U+5481,U+5483,U+5485,U+5487-548a,U+548d,U+5491,U+5493,U+5497-5498,U+549c,U+549e-54a2,U+54a5,U+54ae,U+54b0,U+54b2,U+54b5-54b7,U+54b9-54ba,U+54bc,U+54be,U+54c3,U+54c5,U+54ca-54cb,U+54d6,U+54d8,U+54db,U+54e0-54e4,U+54eb-54ec,U+54ef-54f1,U+54f4-54f9,U+54fb,U+54fe,U+5500,U+5502-5505,U+5508,U+550a-550e,U+5512-5513,U+5515-551a,U+551c-551f,U+5521,U+5525-5526,U+5528-5529,U+552b,U+552d,U+5532,U+5534-5536,U+5538-553b,U+553d,U+5540,U+5542,U+5545,U+5547-5548,U+554b-554f,U+5551-5554,U+5557-555b,U+555d-5560,U+5562-5563,U+5568-5569,U+556b,U+556f-5574,U+5579-557a,U+557d,U+557f,U+5585-5586,U+558c-558e,U+5590,U+5592-5593,U+5595-5597,U+559a-559b,U+559e,U+55a0-55a6,U+55a8-55b0,U+55b2,U+55b4,U+55b6,U+55b8,U+55ba,U+55bc,U+55bf-55c3,U+55c6-55c8,U+55ca-55cb,U+55ce-55d0,U+55d5,U+55d7-55db,U+55de,U+55e0,U+55e2,U+55e7,U+55e9,U+55ed-55ee,U+55f0-55f1,U+55f4,U+55f6,U+55f8"}},{uri:XK,descriptors:{unicodeRange:"U+4fe0,U+4fe2,U+4fe4-4fe5,U+4fe7,U+4feb-4fec,U+4ff0,U+4ff2,U+4ff4-4ff7,U+4ff9,U+4ffb-4ffd,U+4fff-500b,U+500e,U+5010-5011,U+5013,U+5015-5017,U+501b,U+501d-501e,U+5020,U+5022-5024,U+5027,U+502b,U+502f-5039,U+503b,U+503d,U+503f-5042,U+5044-5046,U+5049-504b,U+504d,U+5050-5054,U+5056-5059,U+505b,U+505d-5064,U+5066-506b,U+506d-5075,U+5078-507a,U+507c-507d,U+5081-5084,U+5086-5087,U+5089-508c,U+508e-50a2,U+50a4,U+50a6,U+50aa-50ab,U+50ad-50b1,U+50b3-50b9,U+50bc-50ce,U+50d0-50d5,U+50d7-50d9,U+50db-50e5,U+50e8-50eb,U+50ef-50f2,U+50f4,U+50f6-50fa,U+50fc-5100"}},{uri:VK,descriptors:{unicodeRange:"U+49d5-4a77"}},{uri:YK,descriptors:{unicodeRange:"U+4dac-4dad,U+4daf-4db5,U+4e02,U+4e04-4e06,U+4e0f,U+4e12,U+4e17,U+4e1f-4e21,U+4e23,U+4e26,U+4e29,U+4e2e-4e2f,U+4e31,U+4e33,U+4e35,U+4e37,U+4e3c,U+4e40-4e42,U+4e44,U+4e46,U+4e4a,U+4e51,U+4e55,U+4e57,U+4e5a-4e5b,U+4e62-4e65,U+4e67-4e68,U+4e6a-4e6f,U+4e72,U+4e74-4e7d,U+4e7f-4e85,U+4e87,U+4e8a,U+4e90,U+4e96-4e97,U+4e99,U+4e9c-4e9e,U+4ea3,U+4eaa,U+4eaf-4eb1,U+4eb4,U+4eb6-4eb9,U+4ebc-4ebe,U+4ec8,U+4ecc,U+4ecf-4ed0,U+4ed2,U+4eda-4edc,U+4ee0,U+4ee2,U+4ee6-4ee7,U+4ee9,U+4eed-4eef,U+4ef1,U+4ef4,U+4ef8-4efa,U+4efc,U+4efe,U+4f00,U+4f02-4f08,U+4f0b-4f0c,U+4f12-4f16,U+4f1c-4f1d,U+4f21,U+4f23,U+4f28-4f29,U+4f2c-4f2e,U+4f31,U+4f33,U+4f35,U+4f37,U+4f39,U+4f3b,U+4f3e-4f42,U+4f44-4f45,U+4f47-4f4c,U+4f52,U+4f54,U+4f56,U+4f61-4f62,U+4f66,U+4f68,U+4f6a-4f6b,U+4f6d-4f6e,U+4f71-4f72,U+4f75,U+4f77-4f7a,U+4f7d,U+4f80-4f82,U+4f85-4f87,U+4f8a,U+4f8c,U+4f8e,U+4f90,U+4f92-4f93,U+4f95-4f96,U+4f98-4f9a,U+4f9c,U+4f9e-4f9f,U+4fa1-4fa2,U+4fa4,U+4fab,U+4fad,U+4fb0-4fb4,U+4fb6-4fbe,U+4fc0-4fc2,U+4fc6-4fc9,U+4fcb-4fcd,U+4fd2-4fd6,U+4fd9,U+4fdb"}},{uri:GK,descriptors:{unicodeRange:"U+4933-49d4"}},{uri:qK,descriptors:{unicodeRange:"U+487a-4932"}},{uri:ZK,descriptors:{unicodeRange:"U+47d2-4879,U+2ce7c,U+2ce88,U+2ce93"}},{uri:KK,descriptors:{unicodeRange:"U+4756-47d1,U+2ca02,U+2ca0e,U+2ca7d,U+2caa9,U+2cb29,U+2cb2e,U+2cb31,U+2cb38-2cb39,U+2cb3f,U+2cb41,U+2cb4e,U+2cb5a,U+2cb64,U+2cb69,U+2cb6c,U+2cb6f,U+2cb76,U+2cb78,U+2cb7c,U+2cbb1,U+2cbbf-2cbc0,U+2cbce,U+2cc5f,U+2ccf5-2ccf6,U+2ccfd,U+2ccff,U+2cd02-2cd03,U+2cd0a,U+2cd8b,U+2cd8d,U+2cd8f-2cd90,U+2cd9f-2cda0,U+2cda8,U+2cdad-2cdae,U+2cdd5,U+2ce18,U+2ce1a,U+2ce23,U+2ce26,U+2ce2a"}},{uri:QK,descriptors:{unicodeRange:"U+46c3-4755,U+2c488,U+2c494,U+2c497,U+2c542,U+2c613,U+2c618,U+2c621,U+2c629,U+2c62b-2c62d,U+2c62f,U+2c642,U+2c64a-2c64b,U+2c72c,U+2c72f,U+2c79f,U+2c7c1,U+2c7fd,U+2c8d9,U+2c8de,U+2c8e1,U+2c8f3,U+2c907,U+2c90a,U+2c91d"}},{uri:JK,descriptors:{unicodeRange:"U+4629-46c2,U+2bdf7,U+2be29,U+2c029-2c02a,U+2c0a9,U+2c0ca,U+2c1d5,U+2c1d9,U+2c1f9,U+2c27c,U+2c288,U+2c2a4,U+2c317,U+2c35b,U+2c361,U+2c364"}},{uri:eQ,descriptors:{unicodeRange:"U+458e-4628,U+2b7a9,U+2b7c5,U+2b7e6,U+2b7f9,U+2b806,U+2b80a,U+2b81c,U+2b8b8,U+2bac7,U+2bb5f,U+2bb62,U+2bb7c,U+2bb83,U+2bc1b,U+2bd77,U+2bd87"}},{uri:tQ,descriptors:{unicodeRange:"U+4449-4511,U+2afa2,U+2b127-2b128,U+2b137-2b138,U+2b1ed"}},{uri:nQ,descriptors:{unicodeRange:"U+439b-4448,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a7dd,U+2a8fb,U+2a917,U+2aa30,U+2aa36,U+2aa58"}},{uri:rQ,descriptors:{unicodeRange:"U+4275-430d,U+298c6,U+29a72,U+29d98,U+29ddb,U+29e15,U+29e3d,U+29e49"}},{uri:iQ,descriptors:{unicodeRange:"U+4132-41de,U+28bef,U+28c47,U+28c4f,U+28c51,U+28c54,U+28d10,U+28d71,U+28dfb,U+28e1f,U+28e36,U+28e89,U+28e99,U+28eeb,U+28f32,U+28ff8,U+292a0"}},{uri:aQ,descriptors:{unicodeRange:"U+41df-4274,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750"}},{uri:sQ,descriptors:{unicodeRange:"U+408e-4131,U+285c8-285c9,U+28678,U+28695,U+286d7,U+286fa,U+287e0,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28b49,U+28bc1"}},{uri:oQ,descriptors:{unicodeRange:"U+3e83-3f2f,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752"}},{uri:lQ,descriptors:{unicodeRange:"U+3f30-3fdb,U+27985,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27cb8,U+27da0,U+27e10"}},{uri:cQ,descriptors:{unicodeRange:"U+3fdc-408d,U+27fb7,U+27ff9,U+2808a,U+280bb,U+2815d,U+28277,U+28282,U+282e2,U+282f3,U+283cd,U+28408,U+2840c,U+28455,U+28468,U+2856b"}},{uri:dQ,descriptors:{unicodeRange:"U+3dd2-3e82,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26b5c,U+26c21,U+26c29,U+26c73,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d"}},{uri:uQ,descriptors:{unicodeRange:"U+3d34-3dd1,U+2648d,U+26676,U+2667e,U+266b0,U+2671d,U+2677c,U+267cc,U+268dd,U+268ea,U+26951,U+2696f,U+269dd,U+269fa,U+26a1e"}},{uri:hQ,descriptors:{unicodeRange:"U+3c76-3d33,U+25d0a,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed7-25ed8,U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26221,U+26270,U+26286,U+2634c,U+26402"}},{uri:fQ,descriptors:{unicodeRange:"U+3bda-3c75,U+25771,U+257a9,U+257b4,U+259c4,U+259d4,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c14,U+25c4b,U+25c64"}},{uri:pQ,descriptors:{unicodeRange:"U+3b25-3bd9,U+2504a,U+25055,U+25122,U+2512b,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+25532,U+25562,U+255a7-255a8"}},{uri:mQ,descriptors:{unicodeRange:"U+3a6b-3b24,U+24896,U+249db,U+24a4d,U+24a7d,U+24ac9,U+24b56,U+24b6f,U+24c16,U+24d14,U+24dea,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24eaa"}},{uri:gQ,descriptors:{unicodeRange:"U+39a9-3a6a,U+24096,U+24103,U+241ac,U+241c6,U+241fe,U+243bc,U+243f8,U+244d3,U+24629,U+246a5,U+247f1"}},{uri:UQ,descriptors:{unicodeRange:"U+38e3-39a8,U+23a98,U+23c7f,U+23c97-23c98,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23e23,U+23f7e"}},{uri:bQ,descriptors:{unicodeRange:"U+3760-382a,U+22ab8,U+22b43,U+22b46,U+22b4f-22b50,U+22ba6,U+22bca,U+22c1d,U+22c24,U+22c55,U+22d4c,U+22de1"}},{uri:yQ,descriptors:{unicodeRange:"U+382b-38e2,U+231b6,U+231c3-231c4,U+231f5,U+23350,U+23372,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+235cb,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237ff,U+23824,U+2383d"}},{uri:vQ,descriptors:{unicodeRange:"U+3698-375f,U+22218,U+2231e,U+223ad,U+224dc,U+226f3,U+2285b,U+228ab,U+2298f"}},{uri:xQ,descriptors:{unicodeRange:"U+35e6-3697,U+21c56,U+21cde,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b"}},{uri:wQ,descriptors:{unicodeRange:"U+3444-350e,U+20ad3,U+20b1d,U+20b9f,U+20c41,U+20cbf,U+20cd0,U+20d45,U+20de1,U+20e64,U+20e6d,U+20e95,U+20e9d,U+20ea2,U+20f5f,U+210c1,U+21201,U+2123d,U+21255,U+21274,U+2127b"}},{uri:EQ,descriptors:{unicodeRange:"U+350f-35e5,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+2139a,U+213c4,U+21413,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3"}},{uri:CQ,descriptors:{unicodeRange:"U+336d-3443,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+20547,U+205d6,U+20628,U+20676,U+2074f,U+20779,U+20807,U+2083a,U+20895,U+208b9,U+2097c,U+2099d"}},{uri:SQ,descriptors:{unicodeRange:"U+328b-336c,U+2000b,U+20089,U+200a2,U+200a4,U+20164,U+201a2,U+20213"}},{uri:_Q,descriptors:{unicodeRange:"U+3192-31ba,U+31c0-31e3,U+31f0-321e,U+3220-328a,U+1f250-1f251"}},{uri:kQ,descriptors:{unicodeRange:"U+2f74-2fd5,U+3000,U+3003-3007,U+3012-3013,U+3018-301c,U+3020-3029,U+302f-303f,U+3041-3096,U+3099-30a1"}},{uri:TQ,descriptors:{unicodeRange:"U+30a2-30ff,U+3105-312f,U+3131-318e,U+3190-3191"}},{uri:MQ,descriptors:{unicodeRange:"U+4e36,U+4ea0,U+4f74,U+4f91,U+4f94,U+4fc5,U+507e,U+50ed,U+5182,U+51f5,U+525e,U+5282,U+52f9,U+5326,U+537a,U+53a3,U+5423,U+5459,U+54b4,U+54d9,U+55c9,U+57f4,U+580b,U+5902,U+5925,U+5a08,U+5ab5,U+5b84,U+5be4,U+5c22,U+5cb5,U+5cbd,U+5d3e,U+5e31,U+5e5e,U+5e80,U+5ee8,U+5f82,U+5fc9,U+5fed,U+600a,U+605d,U+609b,U+609d,U+60dd,U+6243,U+6322,U+63ce,U+640c,U+643f,U+6445,U+64d7,U+6534,U+6549,U+656b,U+6603,U+674c,U+680a,U+6864,U+69d4,U+6a65,U+6c2a,U+6c46,U+6c5c,U+6d0e,U+6d48,U+6e2b,U+6eb2,U+6eb7,U+6f89,U+706c,U+70b1,U+7113,U+71d4,U+727f,U+72f3,U+7303,U+7321,U+736c,U+736f,U+74a9,U+74de,U+750d,U+7513,U+7592,U+75c4,U+7605,U+760a,U+761b,U+7625,U+762d,U+7643,U+7707,U+7747,U+77b5,U+7839,U+784e,U+78a5,U+7924,U+793b,U+798a,U+7a03,U+7a06,U+7a78,U+7a80,U+7aad,U+7ba8,U+7be5,U+7cc8,U+7ec1,U+7f0b,U+7f0f,U+7f12,U+7f68,U+7f9d,U+8025,U+809c,U+80ad,U+80b7,U+80e8,U+811e,U+8204,U+8223,U+822d,U+823b,U+824b,U+825a,U+827d,U+827f,U+828f,U+82c8,U+8307,U+831b,U+8347,U+837d,U+839b,U+83a9,U+83f9,U+84b9,U+8579,U+864d,U+867f,U+86b0,U+86d1,U+86d8,U+86f2,U+8764,U+8770,U+8788,U+8797,U+87ac-87ad,U+87b5,U+881b,U+8844,U+88bc,U+88fc,U+8930,U+89cf,U+89d6,U+8ba0,U+8bd4,U+8c02,U+8c2b,U+8c85,U+8e23,U+8f81-8f82,U+8fd5,U+90b6,U+90db,U+914e,U+9164,U+91ad,U+943e,U+94b7-94b8,U+94eb,U+950d,U+9514,U+9516,U+9518,U+9529,U+9538,U+953f,U+954e,U+955f,U+95fc,U+9667,U+96b3,U+9792,U+97b2,U+98a1,U+9969,U+9987,U+9998,U+9a80,U+9a92,U+9a96,U+9adf,U+9cb4,U+9cbd,U+9cd0,U+9cd4,U+9e31,U+9e3a,U+9e71,U+9ee5,U+9eea,U+9ef9,U+9fa0"}},{uri:IQ,descriptors:{unicodeRange:"U+4e0c,U+4e28,U+4e3f,U+4ec2,U+502e,U+50ba,U+5155,U+5181,U+522d,U+5281,U+5290,U+5369,U+53b6,U+54d5,U+54dc,U+54ff,U+552a,U+553c,U+5588,U+55b5,U+5686,U+570a,U+5776,U+5786,U+57a4,U+5820,U+5865,U+58bc,U+5b32,U+5b65,U+5c1c,U+5c66,U+5c6e,U+5c8d,U+5ddb,U+5f2a,U+5f50,U+5f61,U+6067,U+614a,U+615d,U+619d,U+61d4,U+620b,U+6224-6225,U+6343,U+63ad,U+63f2,U+640b,U+6420,U+6434,U+6496,U+64d0,U+6509,U+652e,U+67a8,U+6833,U+6844,U+684a,U+6920,U+6957,U+6971,U+6a8e,U+6a91,U+6aa0,U+6b43,U+6bea,U+6bf5,U+6c15,U+6cd0,U+6ee0,U+6f24,U+6f2d,U+70c0,U+721d,U+728b,U+72c3,U+72e8,U+730a,U+7338-7339,U+734d,U+746d,U+752f,U+754e,U+770d,U+7735,U+778d,U+77a2,U+77e7,U+7857,U+786d,U+78c9,U+78f2,U+791e,U+7953,U+7b58,U+7b9d,U+7bda,U+7cd7,U+7f32-7f33,U+8022,U+8028-8029,U+8035,U+804d,U+8080,U+80c2,U+80e9,U+80ec,U+80f2,U+810e,U+8221,U+8274,U+82b0,U+82e0,U+83b0,U+8487-8488,U+848e,U+84cd,U+84d0,U+8539,U+857a,U+85a8,U+85b7,U+867c,U+871e,U+8723,U+877e,U+878b,U+8793,U+8803,U+88d2,U+8966,U+89cc,U+89eb,U+8b26,U+8c8a,U+8c98,U+8d33,U+8d47,U+8d55,U+8dbc,U+8e40,U+8e94,U+8f77,U+8f79,U+9058,U+91a2,U+91b5,U+928e,U+9494,U+94b6,U+94de,U+94f4,U+94f9,U+950a,U+950e,U+951e,U+952b,U+953c,U+953e,U+9544,U+9561,U+9564,U+9569,U+95f6,U+9603,U+960d,U+963d,U+9674,U+9794,U+97ab,U+98a5,U+9a9f,U+9ab1,U+9ad1,U+9b0f,U+9b2f,U+9c92,U+9c95,U+9cba,U+9cbc,U+9cc6,U+9ccb,U+9cd8,U+9e32,U+9e38,U+9e5b,U+9e7e,U+9eb4,U+9efb-9efc,U+9f3d"}},{uri:AQ,descriptors:{unicodeRange:"U+2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f73,U+ffffd"}},{uri:LQ,descriptors:{unicodeRange:"U+4e69,U+4f1b,U+4f67,U+4f7e,U+4fdc,U+50e6,U+5196,U+5202,U+5233,U+523f,U+52a2,U+536e,U+5476,U+54ad,U+54cf,U+5537,U+561e,U+56dd,U+56df,U+5709,U+572c,U+57cf,U+57f8,U+580d,U+5881,U+589a,U+5941,U+59b2,U+5c25,U+5d24,U+5d74,U+5e42,U+5e8b,U+5eb3,U+5ed2,U+5fad,U+6003,U+603c,U+6083,U+6100,U+6126,U+6206,U+62ca,U+638e,U+63b4,U+6426,U+646d,U+6535,U+65c4,U+66db,U+6715,U+6769,U+6798,U+67c3,U+6861,U+698d,U+69ca,U+69ed,U+69f2,U+69ff,U+6a18,U+6b39,U+6bb3,U+6c0d,U+6cb2,U+6cd6,U+6cf7,U+6cfa,U+6d33,U+6e16,U+6e53-6e54,U+6ebb,U+6fb6,U+709d,U+72ad,U+72f7,U+72fb,U+7313,U+739f,U+74ba,U+754b,U+755b,U+758b,U+75ac,U+75d6,U+7617,U+7635,U+7640,U+76a4,U+76b2,U+775a,U+77bd,U+781f,U+79b3,U+7b2b,U+7b31,U+7b3e,U+7b6e,U+7b9c,U+7c0b,U+7c9e,U+7cc1,U+7ce8,U+7ea5,U+7f21,U+7f27,U+7f74,U+7fb0,U+8031,U+8071,U+80ea,U+8114,U+8160,U+81a6,U+81c1,U+829f,U+82a4,U+82fb,U+831a,U+8333,U+836c,U+83b6,U+83f8,U+8411,U+841c,U+8489,U+848c,U+85a4,U+8627,U+8629,U+866e,U+86b5,U+872e,U+8731,U+877b,U+877d,U+87ea,U+8813,U+8816,U+8864,U+88ce,U+88e5,U+897b,U+89cb,U+89f3,U+8bfc,U+8c35,U+8d46,U+8d4d,U+8dba,U+8e3a,U+8f75,U+8f7e,U+8fd3,U+9161,U+9179,U+917e,U+91a3,U+94ac,U+94d7,U+94e5,U+952a,U+952c,U+9545,U+9565,U+9568,U+956a,U+961d,U+96e0,U+972a,U+9730,U+989f,U+98e7,U+990d,U+9967,U+9993,U+9aa3,U+9ac0,U+9ae1,U+9aeb,U+9af9,U+9c86,U+9c8b,U+9ca0-9ca1,U+9ca3,U+9ce2,U+9e48,U+9e6a,U+9e87,U+9ee2,U+9ee9,U+9f17,U+9f19,U+9f2c,U+9f80"}},{uri:RQ,descriptors:{unicodeRange:"U+4ef3,U+50d6,U+50ec,U+51ab,U+51b1,U+52d6,U+54a9,U+54da,U+55be,U+55cd,U+564d,U+572f,U+574c,U+576b,U+57d8,U+57fd,U+5844,U+59d2,U+5ae0,U+5b16,U+5b37,U+5b5b,U+5b80,U+5d1e,U+5d6b,U+5efe,U+5f11,U+5f56,U+5f58,U+5f73,U+5f8c,U+5fc4,U+5fe4,U+602b,U+6106,U+610d,U+63de,U+63f8,U+641b,U+64e4,U+6634,U+676a,U+67b5,U+681d,U+6883,U+69b1,U+69e0,U+6b37,U+6b9b,U+6d7c,U+6ed7,U+6f36,U+6f72,U+6f8c,U+7035,U+7039,U+7173,U+7178,U+7228,U+728f,U+72b4,U+72ef,U+72f4,U+7331,U+7481,U+74e0,U+7540,U+75c3,U+75e6,U+763c,U+764d,U+76cd,U+7704,U+7743,U+7780,U+7847,U+786a,U+78b9,U+7962,U+7a02,U+7aac,U+7ab3,U+7b0a,U+7b4c,U+7b7b,U+7bfc,U+7c0f,U+7c16,U+7c40,U+7ca2,U+7cc7,U+7cf8,U+7d77,U+7e3b,U+7ea1,U+7ea9,U+7ef2,U+7f02,U+7f07,U+7f0c,U+7f23,U+7f2f,U+7fbc,U+8016,U+8020,U+812c,U+8136,U+8182,U+822f,U+8233,U+825f,U+8268,U+8284,U+8288,U+8291,U+8308,U+8311,U+835b,U+836d,U+83dd,U+8406,U+840f,U+845c,U+84b4,U+84e3,U+850c,U+855e,U+863c,U+86ba,U+86c4,U+86de,U+86f1,U+873e,U+87bd,U+87db,U+880a,U+883c,U+887f,U+88f0,U+890a,U+892b,U+895e,U+89ef,U+8a48,U+8bdc,U+8c18,U+8c33,U+8c94,U+8db1,U+8dcf,U+8dd6,U+8de3,U+8e6f,U+8e90,U+8f7a,U+8fb6,U+902d,U+90be,U+91af,U+936a,U+948b,U+94d8,U+9513,U+953a,U+956c,U+963c,U+9654,U+966c,U+9688,U+97b4,U+996b,U+9a75,U+9a7a,U+9aba,U+9aed,U+9b08,U+9b43,U+9c8e,U+9c94,U+9c9a,U+9e2b,U+9e36,U+9e4b,U+9e4e,U+9e55,U+9e63,U+9e68-9e69,U+9ebd,U+9ec9,U+9f0d,U+9f37,U+9f51"}},{uri:DQ,descriptors:{unicodeRange:"U+50a7,U+5240,U+5261,U+52ac,U+531a,U+5363,U+5432,U+5452,U+5456,U+5472,U+5478,U+553f,U+5575,U+5581,U+55cc,U+55fe,U+5601,U+572e,U+57d2,U+57ef,U+581e,U+5924,U+5981,U+5997,U+59a3,U+5aaa,U+5ab8,U+5b34,U+5d5d,U+5def,U+5e11,U+5e91,U+5ed1,U+5ef4,U+5f40,U+600d,U+6019,U+601b,U+605a,U+6092,U+60ab,U+6217,U+623d,U+6369,U+65d2,U+6661,U+670a,U+6753,U+67a7,U+6855,U+68f9,U+6939,U+696e,U+6980,U+6a7c,U+6aab,U+6b82,U+6bf3,U+6bf9,U+6c05,U+6c19-6c1a,U+6ca9,U+6cf6,U+6d1a,U+6dab,U+6f74,U+7085,U+7198,U+71b5,U+7256,U+725d,U+727e,U+72fa,U+7322,U+738e,U+73e5,U+750f,U+755a,U+7594,U+75b3,U+760c,U+7615,U+7630,U+763f,U+77ec,U+7817,U+78a1,U+78d9,U+7905,U+7b2a,U+7b2e,U+7b62,U+7b85,U+7bcc,U+7bea,U+7c26,U+7c74,U+7c9c-7c9d,U+7e47,U+7e9b,U+7e9f,U+7ee0,U+7ee8,U+7ef1,U+7f01,U+7f11,U+7f17,U+7f36,U+7f7e,U+7fee,U+802a,U+80cd,U+8112,U+8169,U+8234,U+8279,U+8298,U+82ca,U+82d8,U+82e1,U+83c0,U+83d4,U+83df,U+8401,U+8451,U+845a,U+8476,U+8478,U+84ba,U+84bd,U+84e0,U+851f,U+8548,U+8556,U+8585,U+868d,U+86e9,U+86f4,U+86f8,U+8765,U+8785,U+87ab,U+87ee,U+8832,U+8872,U+88b7,U+88e2-88e3,U+89da,U+8bce,U+8bd3,U+8bd6,U+8bf9,U+8c16,U+8c73,U+8d5c,U+8dde,U+8f6d,U+8f94,U+8fe8,U+9011,U+915e,U+9185,U+918c,U+94ab,U+94d1,U+94f3,U+9515,U+951d,U+9558,U+9567,U+96ce,U+96e9,U+9785,U+9878,U+987c,U+9883,U+98d1,U+9954,U+9963,U+9a93,U+9ac1,U+9acc,U+9b1f,U+9b49,U+9b4d,U+9b51,U+9ca7,U+9cae,U+9cce,U+9cd3,U+9e37,U+9e39,U+9e41,U+9e46,U+9f22,U+9f2f,U+9f39,U+9f85"}},{uri:jQ,descriptors:{unicodeRange:"U+4e5c,U+4edf,U+4f25,U+4f32,U+4f5e,U+4f76,U+4faa,U+4fe6,U+5028,U+5048,U+5250,U+535f,U+538d,U+53c1,U+5412,U+5443,U+54d4,U+54dd,U+5541,U+5550,U+5577,U+55dd,U+55f3,U+560f,U+562c,U+5657-5658,U+5664,U+56af,U+575c,U+577c,U+57b2,U+57da,U+5800,U+5a62,U+5aeb,U+5c3b,U+5ca3,U+5d26,U+5d9d,U+5f01,U+5fb5,U+5fdd,U+5ff8,U+6029,U+6041,U+6079,U+60b1,U+6222,U+629f,U+6332,U+63bc,U+63e0,U+6485,U+65ab,U+65c3,U+65c6,U+668c,U+669d,U+66be,U+67fd,U+6800,U+68fc,U+690b,U+6924,U+6978,U+69a7,U+6a3e,U+6a50,U+6a5b,U+6a97,U+6b24,U+6b8d,U+6baa,U+6c10,U+6c54,U+6ceb,U+6d04,U+6d4d,U+6eb1,U+6ebd,U+7110,U+71b3,U+71f9,U+7230,U+728d,U+7292,U+72b8,U+72d2,U+7360,U+73a2,U+7511,U+75a0,U+75c8,U+779f,U+7826,U+7877,U+7a39,U+7aa8,U+7ae6,U+7b04,U+7b0f,U+7baa,U+7bac,U+7c1f,U+7ccd,U+7ecb,U+7ed4,U+7ed7,U+7efb,U+7f0d,U+7f5f,U+7faf,U+7fd5,U+7fe5,U+8027,U+80bc,U+80dd,U+80fc,U+8132,U+815a,U+8167,U+816d,U+81ca,U+8228,U+82a1,U+82a9,U+82ab,U+82cc,U+8351,U+8368,U+83b8,U+83d8,U+83ea,U+83f0,U+8497,U+84c1,U+858f,U+85ff,U+867b,U+86a8-86a9,U+870a,U+8722,U+876e,U+877c,U+87e5,U+8888,U+88df,U+8919,U+8bcc,U+8bdf,U+8be8,U+8bee,U+8c20,U+8c2f,U+8d36,U+8df8,U+8e05,U+8e2f,U+8f9a,U+9021,U+908b,U+90b4,U+90ba,U+90d0,U+90eb,U+90fe,U+91aa,U+933e,U+9486-9487,U+948d,U+9490,U+94ad,U+94bd,U+94d6,U+94d9,U+9507,U+9546,U+955e,U+956b,U+95e9,U+9604,U+960b,U+9612,U+9615,U+9617,U+96b9,U+989a-989b,U+989e,U+9a78,U+9a7d,U+9aa0,U+9aa2,U+9ac2,U+9b23,U+9b3b,U+9c82,U+9cca,U+9cd9,U+9e28,U+9e5a,U+9e5e,U+9e6c,U+9efe,U+9f0b"}},{uri:PQ,descriptors:{unicodeRange:"U+4e47,U+4e8d,U+4f65,U+4f89,U+50ee,U+520e,U+5416,U+5454,U+54bb,U+54c2,U+54d3,U+54de,U+5591,U+55e5,U+560c,U+566b,U+5769,U+578c,U+5793,U+57e4,U+5889,U+593c,U+59ab,U+5ad4,U+5ad8,U+5af1,U+5b53,U+5ba5,U+5c59,U+5c63,U+5d5b,U+5e0f,U+5e14,U+5edb,U+5fbc,U+6004,U+60ad,U+610e,U+61b7,U+624c,U+634c,U+647a,U+64ba,U+65f0,U+6600,U+66f7,U+67e2,U+67f0,U+680c,U+686b,U+6874,U+691f,U+6989,U+6a17,U+6b81,U+6b84,U+6c06-6c07,U+6c3d,U+6d07,U+6d27,U+6d2b,U+6d91,U+6e6b,U+6e8f,U+6fde,U+70bb,U+723b,U+726e,U+72b0,U+72ce,U+72f2,U+7301,U+731e,U+737e,U+7477,U+748e,U+74ff,U+7633,U+7654,U+771a,U+7726,U+7765,U+7768,U+781c,U+7829,U+78d4,U+7913,U+7957,U+79d5,U+79eb,U+7a70,U+7a86,U+7b25,U+7b38,U+7b47,U+7b72,U+7ba6-7ba7,U+7dae,U+7ee1,U+7efe,U+7f26,U+7f31,U+7f35,U+801c,U+8043,U+809f,U+80ab,U+80d7,U+8118,U+8188,U+81cc,U+823e,U+8244,U+824f,U+82b4,U+82c1,U+82e4,U+82f4,U+8306,U+833a,U+835c,U+839c,U+83b3,U+83bc,U+846d,U+867a,U+868b,U+8734,U+87ca,U+886e,U+887e,U+88a2,U+88c9,U+8921,U+8bb5,U+8bf3,U+8c04,U+8c17,U+8c1d,U+8c25,U+8c36,U+8c55,U+8c78,U+8d3d,U+8d40,U+8d59,U+8d67,U+8d91,U+8dbf,U+8deb-8dec,U+8dfd,U+8e14,U+8e41,U+8f8e,U+900b,U+9044,U+9062,U+90cf,U+9123,U+9146,U+9162,U+9172,U+918d,U+9190,U+92c8,U+93ca,U+948c,U+94aa,U+94b2,U+94c8,U+94ca,U+94d5,U+94df,U+94e9-94ea,U+94f7,U+94fc-94fd,U+951b,U+954f,U+9554,U+9559,U+9566,U+9571-9572,U+95f1,U+9608,U+960f,U+97af,U+988f,U+98d5,U+992e,U+9955,U+9ab0,U+9b32,U+9c90,U+9c9e,U+9ca5,U+9ca9,U+9cad,U+9cb1,U+9cc3,U+9e47,U+9ee7,U+9f87"}},{uri:NQ,descriptors:{unicodeRange:"U+4e93,U+4ec4,U+4ef5,U+4f27,U+4f7b,U+4fe3,U+5080,U+5121,U+51eb,U+5208,U+52f0,U+53f5,U+5453,U+5466,U+54a6,U+54bf,U+54d0,U+5533,U+5549,U+5556,U+556d,U+558f,U+55f2,U+55f5,U+5627,U+567b,U+56d4,U+571c,U+5739,U+57b4,U+5807,U+58c5,U+59a4,U+59af,U+59d8,U+5a09,U+5a0c,U+5a4a,U+5ad2,U+5b6c,U+5ca2,U+5cac,U+5d03,U+5d6c,U+5db7,U+5ebe,U+5f2d,U+5fea,U+6042,U+6120,U+6175,U+6221,U+623e,U+6339,U+638a,U+643d,U+64b8,U+64e2,U+66e9,U+67b3,U+67c1,U+67d2,U+6832,U+6877,U+68f0,U+6934,U+6966,U+6987,U+6998,U+69c1,U+69ce,U+6a3d,U+6a84,U+6aa9,U+6b87,U+6bd6,U+6c16,U+6c18,U+6cd4,U+6cee,U+6de0,U+6e0c,U+6ecf,U+6f4b,U+70b7,U+7168,U+72d9,U+7352,U+73b3,U+73d0,U+7441,U+74d2,U+75a5,U+75e7-75e8,U+7610,U+7619,U+765e,U+772d,U+7812,U+782c,U+784c,U+7850,U+7856,U+789b,U+78f4,U+7a51,U+7b15,U+7b1e,U+7b24,U+7b5a,U+7bb8,U+7bc1,U+7bd9,U+7ed0,U+7ee6,U+7efa,U+7f1b,U+7f1f,U+7f22,U+7f45,U+7f71,U+7fa7,U+7fbf,U+7ff3,U+8052,U+80b1,U+80db,U+80f4,U+81bb,U+81ec,U+8202,U+8210,U+8249,U+828a,U+828e,U+82e3,U+8315,U+8369,U+8378,U+83a8,U+83aa,U+83b4,U+83e1,U+84fc,U+8538,U+853b,U+859c,U+85ae,U+86b4,U+86c9,U+86cf,U+8725,U+879f,U+87b3,U+887d,U+88fe,U+8a8a,U+8ba7,U+8c07,U+8c14,U+8c30,U+8c47,U+8db5,U+8dd7,U+8e1f,U+8e69,U+8e70,U+8e85,U+8f78,U+8f87,U+8f8b,U+8f8f,U+90c4,U+9143,U+917d,U+948f,U+94cd,U+94d2,U+94ef,U+954a,U+9609-960a,U+96d2,U+9708,U+9765,U+97ea,U+9880,U+98a7,U+996c,U+9980,U+9991,U+9a88,U+9ab6,U+9afb,U+9b47,U+9c87,U+9c9b,U+9cb5,U+9cc7,U+9e2c,U+9e42,U+9e58,U+9ecd,U+9ecf,U+9f8a,U+9f8c"}},{uri:OQ,descriptors:{unicodeRange:"U+4ebb,U+4edd,U+4fa9,U+502c,U+50a5,U+51c7,U+51fc,U+523d,U+5241,U+530f,U+5464,U+549d,U+54a3,U+5514,U+5527,U+555c,U+556e,U+5576,U+55b1,U+55b9,U+55eb,U+5624,U+564c,U+5671,U+5685,U+568f,U+56d7,U+56e1,U+57a1,U+57d9,U+5942,U+5a67,U+5c50,U+5c7a,U+5c98,U+5d06,U+5d27,U+5d6f,U+5df3,U+5dfd,U+5e19,U+5ea0,U+5eb9,U+5eea,U+5ffe,U+600f,U+606b,U+6215,U+622c,U+6266,U+62bb,U+62bf,U+6308,U+6387,U+63b8,U+63c4,U+63c6,U+63f6,U+6441,U+6555,U+659b,U+6677,U+66a7,U+6775,U+678b,U+679e,U+6840,U+6849,U+6860,U+68c2,U+6910,U+6a28,U+6a2f,U+6a79,U+6b92-6b93,U+6bc2,U+6bfd,U+6c29,U+6c32,U+6c86,U+6cc5,U+6d0c,U+6d60,U+6da0,U+6ddd,U+6e86,U+6ed3,U+6edf,U+6fb9,U+6fd1,U+6fef,U+7023,U+7080,U+70ca,U+712f,U+7145,U+7284,U+732c,U+73c8,U+73d9,U+740a,U+7457,U+7596,U+759d,U+75a3,U+75d8,U+75e3-75e4,U+75ff,U+7622,U+7688,U+76b4,U+76e5,U+7818,U+7887,U+789a,U+78b2,U+7b08,U+7b33,U+7c2a,U+7ccc,U+7ea8,U+7ec0,U+7fe6,U+8012,U+8084,U+8093,U+80e4,U+80ef,U+8297,U+82a8,U+82be,U+8331,U+8366,U+83c5,U+83fd,U+8473,U+84a1,U+84ca,U+84d1,U+857b,U+85c1,U+85d3,U+8605,U+8662,U+86aa,U+86b1,U+86d4,U+86ed,U+86f3,U+8709,U+8748,U+874c,U+8763,U+89c7,U+89de,U+89e5,U+8a3e,U+8ba6,U+8c00,U+8c21,U+8c49,U+8c7a,U+8d30,U+8df9,U+8e51,U+8e59,U+8f6b,U+8f73,U+8ff3,U+9016,U+9026,U+902f,U+9099,U+909b,U+90c7,U+914a,U+91ae,U+91ba,U+9495,U+94a3,U+94af,U+94ba,U+94bf,U+94cc,U+94e1,U+94f0,U+9531,U+955d,U+95f3,U+9697,U+96bc,U+975b,U+977c,U+98a2,U+998a,U+9994-9995,U+9a9b,U+9ab7,U+9ac5,U+9c91,U+9ccf,U+9cd5,U+9e29,U+9edc,U+9edf,U+9f83,U+9f88-9f89"}},{uri:FQ,descriptors:{unicodeRange:"U+4ee8,U+4f22,U+4f43,U+4f57,U+4f5d,U+4f6f,U+4ff8,U+502d,U+507b,U+5345,U+53df,U+53fb,U+544b,U+5482,U+54a7,U+54cc,U+550f,U+5544,U+5555,U+5594,U+55e8,U+55ec,U+55ef,U+564e,U+56f9,U+5704,U+576d,U+5785,U+57ad,U+5914,U+5958,U+599e,U+59aa,U+59be,U+5a06,U+5abe,U+5ae1,U+5b40,U+5bee,U+5cbf,U+5cc4,U+5ccb,U+5d47,U+603f,U+6078,U+607d,U+607f,U+608c,U+609a,U+60fa,U+61ff,U+621b,U+622e,U+626a,U+6371,U+63ae,U+63cd,U+63d6,U+6410,U+6414,U+6421,U+6448,U+64d8,U+6710,U+6748,U+6772,U+680e,U+6954,U+69ab,U+6c68,U+6c8f,U+6ca4,U+6d2e,U+6e4e,U+6e98,U+6fe0,U+7094,U+70e9,U+7116,U+7119,U+723f,U+73c9,U+74e4,U+753e,U+7548,U+75bd,U+75cd,U+7618,U+7634,U+76c5,U+76f1,U+7708,U+7719,U+777e,U+7791,U+77b3,U+7823,U+7827,U+7830,U+7889,U+7893,U+7949,U+795c,U+79e3,U+7a14,U+7a88,U+7a95,U+7aa0,U+7afd,U+7b90,U+7bd1,U+7bfe,U+7da6,U+7ec2,U+7eef,U+7f03-7f04,U+7f08,U+7f58,U+7f61,U+7f9f,U+8174,U+8200,U+828d,U+82c4,U+82d5,U+82dc,U+82f7,U+832d,U+835a,U+840b,U+8438,U+852b,U+869d,U+86ac,U+86d0,U+86f0,U+8782,U+87a8,U+87d1-87d2,U+87e0,U+8839,U+8913,U+891b,U+8934,U+8941,U+89ca,U+89ce,U+8a07,U+8ba3,U+8bc5,U+8bcb,U+8bdb,U+8c11,U+8c15,U+8c29,U+8c32,U+8dc4,U+8dce,U+8ddb,U+8dfa,U+8e09,U+8e1d,U+8e39,U+8e42,U+8e49,U+8e4b,U+8e8f,U+8f71-8f72,U+9004,U+9036,U+9097,U+90dc,U+90e2,U+90e6,U+90ef,U+9104,U+919a,U+91b4,U+938f,U+9497,U+950f,U+9557,U+9562-9563,U+9573,U+9606,U+9649,U+972d,U+973e,U+97a3,U+97eb,U+988c,U+9894,U+98a6,U+9974,U+9977,U+997d,U+9a90,U+9a9d,U+9aef,U+9ca2,U+9ccd,U+9cdf,U+9e20,U+9e4c,U+9e6b,U+9f3e"}},{uri:BQ,descriptors:{unicodeRange:"U+4ede,U+4ee1,U+4eeb,U+4fda,U+4ffe,U+5025,U+506c,U+50f3,U+5106,U+520d,U+525c,U+52ad,U+530d,U+5310,U+539d,U+53a9,U+53fc,U+5421,U+5477,U+54e7,U+551b,U+5530,U+557e,U+5599,U+55c4,U+55d1,U+55d4,U+55df,U+55e4,U+55ea,U+5623,U+562d,U+5654,U+56eb,U+56f5,U+57a7,U+57d5,U+57dd,U+584d,U+5880,U+58ec,U+59dd,U+5a32,U+5a55,U+5a75,U+5b51,U+5b71,U+5b73,U+5cd2,U+5ce4,U+5e5b,U+5e96,U+5fd2,U+607b,U+61d1,U+634b,U+636d,U+63b3,U+63ff,U+64c0,U+661d,U+6657,U+66dc,U+67a5,U+6841,U+6867,U+6901,U+699b,U+6a47,U+6b46,U+6c21,U+6c24,U+6c35,U+6c4a,U+6c94,U+6ca3,U+6d39,U+6d63,U+6d6f,U+6d94,U+705e,U+71e7,U+726f,U+72cd,U+72de,U+72f0,U+7325,U+7350,U+7391,U+741a,U+757f,U+7583,U+75b1,U+75b4,U+75b8,U+75c2,U+75f1,U+766f,U+7699,U+7751,U+789c,U+7a17,U+7be6,U+7cb2,U+7ea3,U+7eb0,U+7ebe,U+7eeb,U+7f25,U+7f2c,U+7fb8,U+8026,U+8037,U+8153,U+8171,U+8191,U+8214,U+821b,U+8222,U+826e,U+82eb,U+830c,U+8314,U+8334,U+83d6,U+8418,U+843c,U+84ff,U+8564,U+8572,U+8616,U+866c,U+8693,U+86a3,U+86a7,U+86af,U+86b6,U+86c6,U+86ca,U+8708,U+870d,U+8759,U+8760,U+87af,U+87c6,U+8869,U+88c6,U+89d0,U+8b07,U+8baa-8bab,U+8bc2,U+8be4,U+8bf0,U+8c2a,U+8c62,U+8c89,U+8d49,U+8d6d,U+8d84,U+8d94,U+8db8,U+8dc6,U+8e2e,U+8e3d,U+8e47,U+8e7f,U+9005,U+9051,U+907d,U+9082,U+9088,U+90b0,U+90d3,U+9150,U+949c,U+94a4,U+94b9,U+94cb,U+94e0,U+9509,U+9512,U+951f,U+9534,U+9552-9553,U+965f,U+96b0,U+9791,U+9889,U+9990,U+9a9c,U+9aa7,U+9c88,U+9cb2-9cb3,U+9cb6-9cb7,U+9cc5,U+9cdc,U+9e22,U+9e2a,U+9e57,U+9e67,U+9e73,U+9e82,U+9eb8,U+9ee0,U+9f9b"}},{uri:$Q,descriptors:{unicodeRange:"U+4eb5,U+4f09,U+4f5a,U+4f8f,U+4fce,U+4fdf,U+4fea,U+4ff3,U+500c,U+500f,U+504e,U+5088,U+52be,U+5420,U+5457,U+5499,U+549b,U+54c6,U+54d2,U+558b,U+559f,U+55bd,U+55d6,U+565c,U+567c,U+568e,U+5768,U+577b,U+57a9,U+57ed,U+59f9,U+5a11,U+5a40,U+5ae6,U+5b6a,U+5b93,U+5bb8,U+5c15,U+5c99,U+5c9c,U+5cc1,U+5d2e,U+5d4b,U+5d99,U+5e54,U+5e61,U+5fcf-5fd1,U+6002,U+6006,U+6014,U+60af,U+60c6,U+60da,U+60f4,U+621f,U+62c8,U+631b,U+631e,U+63e9,U+64b5,U+655d,U+6619,U+6635,U+6641,U+67ad,U+67b0,U+67b7,U+67e9,U+684e,U+688f,U+695d,U+696b,U+69b7,U+6a58,U+6c26,U+6d35,U+6d43,U+6d9e,U+6dd9,U+6dec,U+6e11,U+6e6e,U+6e9f,U+6ec2,U+6ee2,U+6ef9,U+6f09,U+6f66,U+6f8d,U+6fc2,U+6fc9,U+729f,U+72c8,U+73de,U+7430,U+7566,U+7579,U+75c9,U+75e2,U+75fc,U+762a,U+7638,U+7678,U+76c2,U+76f9,U+778c,U+77cd,U+77dc,U+7800,U+781d,U+782d,U+783b-783c,U+78a3,U+78ec,U+7980,U+7a23,U+7b95,U+7bdd,U+7c0c,U+7c41,U+7c91,U+7cb3,U+7cc5,U+7ecc,U+7f19,U+7fca,U+8006,U+8069,U+807f,U+80bd,U+80ed,U+814b,U+8198,U+82cb,U+82d2,U+834f,U+8360,U+847a,U+84d6,U+84e5,U+8537,U+85d0,U+8671,U+86a4,U+86ce,U+86f9,U+8703,U+8707,U+8737,U+873b,U+8815,U+8936,U+8bc3,U+8bcf,U+8bd2,U+8bd8,U+8be9,U+8c0c,U+8c0f,U+8c4c,U+8d45,U+8d5d,U+8d73,U+8e31,U+8e6d,U+8e76,U+8fe4,U+9041,U+90d7,U+9169,U+92ae,U+94a1,U+94c4,U+94c9,U+94db,U+94e7,U+9503,U+9506,U+9517,U+9528,U+9537,U+9542,U+9549,U+95fe,U+9616,U+961a,U+96c9,U+96f3,U+9701,U+970e,U+9739,U+9753,U+9798,U+98d2-98d3,U+98d9-98da,U+9968,U+996f,U+9984,U+9997,U+9acb,U+9b03,U+9c85,U+9ca8,U+9cab,U+9e49,U+9e51,U+9e66,U+9f10"}},{uri:zQ,descriptors:{unicodeRange:"U+4e15,U+4e1e,U+4e2b,U+4eb3,U+4ec9,U+4f0e,U+4f64,U+501c,U+50a9,U+510b,U+51a2,U+51bc,U+527d,U+52d0,U+53fd,U+5429,U+542e,U+5486,U+54af,U+5506,U+5511,U+5522,U+552c,U+556c,U+55b3,U+55d2,U+55e6,U+55fd,U+561f,U+5639,U+5659,U+5662,U+5693,U+572a,U+5892,U+598a,U+5992,U+59a9,U+5a20,U+5ae3,U+5b17,U+5b7d,U+5d34,U+5d3d,U+5d4a,U+5d82,U+5e1a-5e1b,U+5ea5,U+5f0b,U+5f77,U+5fd6,U+5fff,U+6026,U+6035,U+6063,U+60b4,U+60bb,U+60ee,U+612b,U+6194,U+61ca,U+61e6,U+61f5,U+620a,U+6248,U+62a1,U+62d7,U+6376,U+637b,U+652b,U+65bc,U+65cc,U+65ce,U+65d6,U+664c,U+665f,U+6666,U+6684,U+66b9,U+6773,U+6777,U+6787,U+67de,U+6845,U+693d,U+6994,U+6a35,U+6d54,U+6d5c,U+6d8e,U+6dd6,U+6eb4,U+6f2a,U+6f78,U+704f,U+70ec,U+7118,U+714a,U+7172,U+71b9,U+724d,U+728a,U+7337,U+733e,U+7396,U+73b7,U+73cf,U+7428,U+742c,U+742e,U+74ee,U+74f4,U+7525,U+753a,U+7572,U+75d4,U+765c,U+768e,U+7762,U+777d,U+77fd,U+7825,U+7837,U+78b4,U+795f,U+79ed,U+7a1e,U+7b06,U+7b20,U+7ba9,U+7bab,U+7c7c,U+7cbd,U+7cdc,U+7ec9,U+7ef6,U+7f30,U+7f42,U+7f44,U+7f54,U+7f94,U+8004,U+800b,U+8019,U+809b,U+80ae,U+80c4,U+80f1,U+8146,U+816e,U+817c,U+81c0,U+81fc,U+81fe,U+822b,U+830f,U+832f,U+8340,U+8365,U+8385,U+8392,U+83a0,U+8424,U+84af,U+869c,U+8713,U+8717-8718,U+87c0,U+87cb,U+87fe,U+8821,U+8902,U+89d1,U+8bb9,U+8c12,U+8d32,U+8d53,U+8df7,U+8e7c,U+8f7c,U+8f95,U+8fab,U+9052,U+905b,U+9095,U+909d,U+90c5,U+911e,U+9122,U+916a,U+919b,U+948e,U+9492,U+949a,U+94b5,U+94bc,U+94c6,U+94f1,U+9502,U+9511,U+9536,U+956f-9570,U+9602,U+9621,U+9631,U+998b,U+99a5,U+9a81,U+9a9e,U+9ebe,U+9f8b"}},{uri:HQ,descriptors:{unicodeRange:"U+4f2b,U+4f3d,U+4fac,U+5043,U+5055,U+5140,U+5156,U+51cb,U+5243,U+531d,U+536f,U+53a5,U+53ae,U+53f1,U+541d,U+5431,U+547b,U+5492,U+5494,U+54a4,U+54aa,U+54ce,U+54fd,U+5509,U+5520,U+553e,U+557b,U+55c5,U+55e1,U+55f7,U+5608,U+5636,U+563b,U+5773,U+57a0,U+5811,U+587e,U+58d5,U+59e3,U+5a29,U+5a6a,U+5a76,U+5a7a,U+5ac9,U+5b62,U+5b95,U+5c49,U+5c8c,U+5cab,U+5cb7,U+5d02,U+5d58,U+5e44,U+5e7a,U+5eff,U+5f29,U+5f89,U+5f9c,U+5fa8,U+6005,U+6043,U+60b8,U+60d8,U+60ec,U+60f0,U+6115,U+618e,U+630e,U+637a,U+6390,U+63ac,U+63b0,U+64de,U+6525,U+6538,U+65ee-65ef,U+6631,U+6636,U+6654,U+677c,U+67b8,U+67d8,U+683e,U+6886,U+68b5,U+692d,U+6963,U+6979,U+6988,U+6b59,U+6b9a,U+6c69,U+6c74,U+6cae,U+6ce0,U+6cef,U+6d95,U+6dc5,U+6dde,U+6de6,U+6dfc,U+6ea7,U+6f15,U+6f29,U+7096,U+70c3,U+7131,U+715c,U+7166,U+7266,U+7317,U+731d,U+7329,U+73e9,U+7425,U+7455,U+7490,U+74ef,U+7519,U+75b5,U+75b9,U+75de,U+7656,U+7663,U+7691,U+7729,U+77fe,U+783e,U+787c,U+795a,U+7a79,U+7abf,U+7b3a,U+7b4f,U+7b60,U+7b75,U+7b8d,U+7bb4,U+7bd3,U+7be1,U+7cbc,U+7edb,U+7f1c,U+7f8c,U+7fb2,U+7fb9,U+7fce,U+7ff1,U+810d,U+81c6,U+82a5,U+82aa,U+82de,U+8317,U+8343,U+835e,U+8364,U+836a,U+853a,U+8543,U+854a,U+8559,U+8568,U+85b0,U+85b9,U+864f,U+86e4,U+8715,U+8845,U+8884,U+88e8,U+88f1,U+8983,U+8be1,U+8c1f,U+8c27,U+8c5a,U+8c82,U+8d58,U+8dbe,U+8f98,U+9035,U+9074,U+90a1,U+9149,U+9157,U+93d6,U+949d,U+94c2,U+94e3-94e4,U+95eb,U+95f0,U+9611,U+9619,U+9642,U+968d,U+9706,U+970f,U+97ed,U+988a,U+9893,U+98e8,U+9a77,U+9a87,U+9aa1,U+9abc,U+9cdd,U+9e2f,U+9e33,U+9e44,U+9e5c,U+9e9d,U+9edd"}},{uri:WQ,descriptors:{unicodeRange:"U+4f58,U+4f6c,U+4f70,U+4fd0,U+5014,U+51bd,U+524c,U+5315,U+5323,U+535e,U+540f,U+542d,U+545b,U+548e,U+549a,U+54ab,U+54fc,U+5567,U+556a,U+5600,U+5618,U+563f,U+5669,U+56f1,U+56ff,U+573b,U+574d,U+579b,U+57b8,U+57c2,U+586c,U+58f9,U+595a,U+598d,U+5993,U+5996,U+59d7,U+5b7a,U+5ba6,U+5c4e,U+5c96,U+5ce5,U+5eb6,U+5f08,U+5f99,U+602f,U+6059,U+606c,U+607a,U+60ed,U+61a9,U+620c,U+6249,U+62a8,U+62c4,U+62ed,U+62fd,U+6342,U+6345,U+6396,U+63a3,U+6402,U+6413,U+642a,U+6487,U+64a9,U+64ac,U+64ae,U+64b7,U+659f,U+65a1,U+667e,U+66f3,U+67e0,U+69db,U+69df,U+6aac,U+6b86,U+6c50,U+6c5e,U+6c76,U+6c85,U+6c8c,U+6cde,U+6d19,U+6d52,U+6da7,U+6db8,U+6e1a,U+6e25,U+6e4d,U+6e5f,U+6ec1,U+6f31,U+6f7a,U+6fa7,U+6fe1,U+701b,U+70ab,U+70f7,U+717d,U+71a8,U+7252,U+72c4,U+72e1,U+7315,U+736d,U+73ae,U+73c0,U+73c2,U+740f,U+75a4,U+7600-7601,U+768b,U+76bf,U+76d4,U+7728,U+772f,U+776c,U+77a0,U+77b0,U+77f8,U+783a,U+78d0,U+78fa,U+7977,U+7a37,U+7a92,U+7afa,U+7b71,U+7b94,U+7cef,U+7f28,U+7fe1,U+808b,U+80e5,U+80eb,U+8110,U+8113,U+812f,U+814c,U+81c3,U+8235,U+82d4,U+8309,U+83c1,U+8431,U+8469,U+84bf,U+84d3,U+84df,U+84e6,U+8511,U+8638,U+86c0,U+86db,U+86fe,U+8757,U+8822,U+8882,U+8885,U+8892,U+88f3,U+892a,U+8ba5,U+8bd9,U+8be0,U+8be7,U+8bfd,U+8c1a,U+8d4a,U+8d4e,U+8d66,U+8dda,U+8e0c,U+8e52,U+8e74,U+8e87,U+8f76,U+8fc2,U+8fe6,U+900d,U+9068,U+90ac,U+90b3,U+90b8,U+90e7,U+9119,U+9131,U+915a,U+916e,U+94b4,U+94d0,U+94e2,U+94ec,U+94ff,U+9522,U+9535,U+9556,U+965b,U+96f9,U+9774,U+9981,U+998d,U+998f,U+9a6e,U+9a7f,U+9a8a,U+9b13,U+9c9f,U+9e3e,U+9e43,U+9e6d,U+9e8b,U+9e92,U+9edb,U+9eef"}},{uri:XQ,descriptors:{unicodeRange:"U+4e10,U+4e56,U+4e98,U+4ec3,U+4f3a,U+4f5f,U+4f88,U+4f97,U+4fa5,U+4fe8,U+504c,U+5197,U+52fa,U+5364,U+53e8,U+5406,U+543c,U+545c,U+5471,U+5480,U+5495,U+54b3,U+54df,U+54e6,U+54ee,U+557c,U+5583,U+55dc,U+55e3,U+566c,U+592f,U+5944,U+5983,U+59ca,U+59e5,U+5a13,U+5a7f,U+5b09,U+5bd0,U+5e4c,U+5eb5,U+5f1b,U+5f3c,U+608d,U+60cb,U+61a7,U+61ac,U+61cb,U+6233,U+62a0,U+62e7,U+62ee,U+62f4,U+62f7,U+634e,U+6382,U+63c9,U+63ea,U+6400,U+645e,U+6482,U+6556,U+6593,U+6615,U+664f,U+66e6,U+672d,U+675e,U+67da,U+6805,U+6808,U+6868,U+68a2,U+695e,U+69ad,U+6a80,U+6a90,U+6b83,U+6be1,U+6c30,U+6cad,U+6cb1,U+6cf1,U+6d31,U+6d93,U+6dae,U+6dbf,U+6dc6-6dc7,U+6e0d,U+6e32,U+6e3a,U+6e85,U+6eba,U+6f3e,U+6f5e,U+6f7c,U+6fee,U+71ee,U+722a,U+72b7,U+72e9,U+73ba,U+73d1,U+7409,U+7435-7436,U+7459-745a,U+747e,U+7487,U+74e2,U+7504,U+752c-752d,U+7599,U+759f,U+75a1,U+75ca,U+75f0,U+761f,U+7629,U+777f,U+7785,U+77a5,U+77bf,U+78d5,U+7934,U+7940,U+79a7,U+7b19,U+7c38,U+7c95,U+7cb1,U+7ce0,U+7eca,U+7ef7,U+7f2b,U+7f81,U+7fcc,U+8046,U+8148,U+8165,U+819b,U+81ba,U+828b,U+82ae,U+82b7,U+82d3,U+8301,U+830e,U+831c,U+8338,U+837c,U+8393,U+8398,U+83ba,U+83e0,U+83e9,U+853c,U+8654,U+86df,U+8712,U+873f,U+874e,U+8783,U+8859,U+88a4,U+8925,U+8bb7,U+8bff,U+8c19,U+8c1b,U+8c24,U+8c2c,U+8d61,U+8db4,U+8e6c,U+8f8a,U+8fe5,U+8ff8,U+901e,U+90f4,U+912f,U+9163,U+9170,U+91dc,U+949b,U+94a8,U+94b3,U+94c0,U+94e8,U+9525,U+9530,U+9539,U+954c-954d,U+9550,U+955b,U+962a,U+9685,U+96cc,U+9776,U+988d,U+9975,U+9985,U+9a6f,U+9aa5,U+9ab8,U+9c7f,U+9ca4,U+9cb8,U+9e25,U+9e35,U+9e4a"}},{uri:VQ,descriptors:{unicodeRange:"U+4ea2,U+4ea5,U+4f36,U+4f84,U+4f8d,U+501a,U+5029,U+516e,U+51a5,U+51c4,U+51f8,U+5201,U+527f,U+5321,U+5352,U+5366,U+53e9,U+54c7,U+5632,U+5676,U+56b7,U+56bc,U+56da,U+56e4,U+5703,U+5729,U+5742,U+57a2-57a3,U+5815,U+58d1,U+5919,U+592d,U+5955,U+5a05,U+5a25,U+5a34,U+5b70,U+5b75,U+5bdd,U+5bf0,U+5c41,U+5c79,U+5c91,U+5c94,U+5ce6,U+5ced,U+5d69,U+5dc5,U+5e16,U+5e27,U+5f27,U+5f95,U+5ffb,U+6020,U+604d,U+6055,U+60e6,U+60eb,U+6123,U+618b,U+61a8,U+620d,U+62c7,U+62ce,U+62d9,U+631f,U+634d,U+6452,U+6479,U+64ce,U+64d2,U+655b,U+660a,U+6726,U+67c4,U+6809,U+6853,U+68e3,U+68f1,U+68fa,U+693f,U+6942,U+6995,U+69a8,U+69b4,U+6a71,U+6b89,U+6bcb,U+6bd3,U+6bd9,U+6c40,U+6cf8,U+6cfe,U+6d85,U+6da3,U+6daa,U+6e0e,U+6e43-6e44,U+6f88,U+7078,U+7099,U+70bd,U+70d9,U+70fd,U+7109,U+7184,U+7239,U+733f,U+73f2,U+748b,U+749c,U+749e,U+759a,U+75d2,U+75eb,U+7620,U+766b,U+7693,U+76cf,U+7738,U+773a,U+776b,U+778e,U+77aa,U+7852,U+78be,U+7948,U+795b,U+7960,U+796f,U+79ba,U+7a20,U+7a96,U+7aa5,U+7b03,U+7b28,U+7b50,U+7b77,U+7bc6,U+7bf1,U+7c27,U+7d0a,U+7ead,U+7ec5,U+7ee2,U+7ef0,U+7efd,U+7f0e,U+7f2e,U+7f79,U+7f9a,U+8098,U+80da,U+80e7,U+80f0,U+80f3,U+80fa,U+818a,U+81e7,U+8237-8238,U+8299,U+82b8,U+82ce,U+837b,U+83bd,U+83cf,U+8426,U+8475,U+85c9,U+85d5,U+85dc,U+85e9,U+871a,U+8747,U+8749,U+888d,U+8910,U+891a,U+8bb4,U+8be3,U+8bec,U+8bf2,U+8c06,U+8c0d,U+8d31,U+8d48,U+8de4,U+8e1e,U+8e4a,U+8e66,U+8f84,U+8f97,U+9083,U+90e1,U+9165,U+91c9,U+94b0,U+94f5,U+9504,U+9532,U+956d,U+95f5,U+95fa,U+9668,U+9698,U+96bd,U+9704,U+9773,U+9890,U+996a,U+997a,U+9a74,U+9a8b,U+9cc4,U+9ccc"}},{uri:YQ,descriptors:{unicodeRange:"U+4ea8,U+4f1e,U+4f51,U+4f63,U+4f7c,U+4f83,U+4fa0,U+4fd1,U+4ffa,U+5018,U+5026,U+508d,U+50bb,U+50f5,U+50fb,U+5162,U+5319,U+5320,U+538c,U+5413,U+541f,U+5475,U+54bd,U+54d1,U+5589,U+5598,U+575f,U+57ae,U+57e0,U+5937,U+5974,U+5978,U+59ae,U+5a1f,U+5a49,U+5ab3,U+5b99,U+5b9b,U+5ba0,U+5be1,U+5be5,U+5c09,U+5c27,U+5de2,U+5e9a,U+5f26,U+5f8a,U+5f98,U+6021,U+606d,U+60bc,U+60d5,U+60e7,U+611a,U+614c,U+6254,U+626f,U+6292,U+6296,U+62b9,U+62e2,U+631a,U+631d,U+6320,U+6346,U+63ba,U+6467,U+64bc,U+658b,U+663c,U+6643,U+6652,U+6656,U+6687,U+66d9,U+66dd,U+66f0,U+673d,U+67ab,U+6816-6817,U+68a7,U+68ad,U+68cd,U+68e0,U+6986,U+69fd,U+6b47,U+6bd7,U+6c1f,U+6c2e-6c2f,U+6cbe,U+6de4,U+6e1d,U+6e83,U+6e9c,U+6ed4-6ed5,U+6f4d,U+70f9,U+7130,U+716e,U+718f,U+71ac,U+71e5,U+72fc,U+731c,U+7334,U+73ca,U+7422,U+7426,U+745f,U+7470,U+75af,U+75f4,U+762b,U+763e,U+7696,U+7737,U+7741,U+77a7,U+77bb,U+77ee,U+785d,U+788c,U+78ca,U+7901,U+796d,U+7985,U+79fd,U+7a3c,U+7a57,U+7a74,U+7b5b,U+7caa,U+7cb9,U+7cd5,U+7eac,U+7eb6,U+7ed1,U+7ee5,U+7f20,U+7f2a,U+7f38,U+7f69,U+7fa1,U+8018,U+8038,U+803f,U+804b,U+80a2,U+80be,U+80d6,U+817a,U+81fb,U+820c,U+82ad,U+82af,U+82bd,U+8327,U+8354,U+835f,U+8367,U+836b,U+840c,U+841d,U+8471,U+849c,U+84b2,U+84c9,U+8517,U+851a,U+8549,U+8681,U+8721,U+8776,U+88d9,U+88f9,U+89c5,U+8c1c,U+8c34,U+8d81,U+8d9f,U+8e0a,U+8e72,U+8eb2,U+8fed,U+901b,U+902e,U+906e,U+9091,U+90aa,U+90af,U+915d,U+9171,U+946b,U+9489,U+9499,U+94a5,U+9508,U+9524,U+952d,U+9551,U+9576,U+95f7,U+9600,U+96b6,U+96c0,U+9756,U+97f6,U+98a0,U+98a4,U+997f,U+9a73,U+9a86,U+9ad3,U+9e3d,U+9ed4"}},{uri:GQ,descriptors:{unicodeRange:"U+4e4d,U+4e5e,U+4ec7,U+4ed5,U+50da,U+50e7,U+515c,U+51a4,U+51ff,U+5203,U+5254,U+5300,U+533e,U+5375,U+53ee,U+5435,U+543b,U+5455,U+548b,U+548f,U+54d7,U+54fa,U+5578,U+5587,U+55a7,U+560e,U+5760,U+576f,U+5777,U+5830,U+58a9,U+5962,U+59e8,U+5a07,U+5a23,U+5a3c,U+5b5a,U+5bb5,U+5bc5,U+5bde,U+5c7f,U+5cb1,U+5ce8,U+5cea,U+5d29,U+5d4c,U+5e18,U+5f57,U+5f5d,U+5f87,U+5ff1,U+6016,U+601c,U+6064,U+6177,U+61d2,U+625b,U+62e3,U+62f1,U+634f,U+63a0,U+6401,U+6405,U+6495,U+64c2,U+6512,U+6577,U+6590,U+65a7,U+65a9,U+65f7,U+6627,U+6655,U+6714,U+6795,U+67d1,U+67ff,U+68b3,U+68d5,U+68d8,U+6930,U+6960,U+6977,U+69bb,U+69d0,U+6a31,U+6b7c,U+6bb4,U+6c22,U+6c72,U+6c79,U+6c7e,U+6c81,U+6c93,U+6ca5,U+6cbc,U+6ce3,U+6cfb,U+6d3c,U+6da9,U+6df3,U+6e2d,U+6eaf,U+6ec7,U+6f13,U+6f33,U+6f62,U+6fa1,U+7011,U+707c,U+708a,U+70c1,U+70d8,U+70eb,U+711a,U+7194,U+7281,U+7316,U+7357,U+7384,U+7405,U+742a,U+745b,U+7574,U+7578,U+75ea,U+7682,U+7792,U+77d7,U+77e9,U+77eb,U+77f6,U+780c,U+78c5,U+7941,U+79e4,U+7a1a,U+7a9c,U+7ad6,U+7b5d,U+7bf7,U+7c07,U+7c3f,U+7c9f,U+7ca5,U+7cdf,U+7e82,U+7eab,U+7ece,U+7eda,U+7f09,U+7f15,U+7f9e,U+7fdf,U+7fe9,U+803b,U+803d,U+80aa,U+80b4,U+813e,U+8155,U+817b,U+819d,U+821c,U+82b9,U+82df,U+82ef,U+8304,U+83b9,U+8446,U+853d,U+85af,U+85fb,U+8650,U+865e,U+86d9,U+86ee,U+8700,U+8862,U+889c,U+88d4,U+88f8,U+895f,U+8a79,U+8bb3,U+8bb6,U+8bc0,U+8beb,U+8bf5,U+8c23,U+8c79,U+8d1e,U+8dcb,U+8e29,U+8e44,U+8e81,U+8eac,U+8eaf,U+8f8d,U+9050,U+90f8,U+914b,U+948a,U+94be,U+94ee,U+950c,U+9540,U+962e,U+9647,U+9661,U+9699,U+96cf,U+9716,U+9761,U+97a0,U+97e7,U+9a7c,U+9a8f,U+9ae6,U+9cd6,U+9e26"}},{uri:qQ,descriptors:{unicodeRange:"U+4fa3,U+4fae,U+4fd8,U+4fef,U+50a3,U+5189,U+5195,U+51db,U+51f3,U+51f9,U+5220,U+5228,U+5288,U+52ff,U+532e,U+533f,U+5351,U+53db,U+53ed,U+5450,U+5484,U+5490,U+54c9,U+54e9,U+5501,U+5507,U+5543,U+55d3,U+56a3,U+575e,U+589f,U+5984,U+59ec,U+5a04,U+5a36,U+5a77,U+5a9a-5a9b,U+5ab2,U+5ac2,U+5ad6,U+5bc7,U+5c2c,U+5c34,U+5c51,U+5cd9,U+5d0e,U+5deb,U+5e3c,U+5e87,U+5ed3,U+5f13,U+5f64,U+5fe1,U+606a,U+6096,U+60df,U+60f6,U+60f9,U+6151,U+620e,U+6241,U+6252,U+6273,U+627c,U+6289,U+62c2,U+62cc,U+62ef,U+6361,U+6363,U+63b7,U+63e3,U+6518,U+66ae,U+6756,U+6789,U+6813,U+6829,U+6862,U+6866,U+6893,U+6897,U+690e,U+6984,U+69cc,U+6a1f,U+6a44,U+6a59,U+6ba1,U+6c13,U+6c90,U+6ca6,U+6cbd,U+6ccc,U+6cd3,U+6cd7,U+6d4a,U+6d4f,U+6d5a,U+6d9f,U+6da1,U+6dcc,U+6ea5,U+6ee4,U+6ee6,U+6f2f,U+6f8e,U+701a,U+7095,U+709c,U+70af,U+70db,U+70e8,U+714e,U+715e,U+71a0,U+71ce,U+7235,U+7280,U+72d0,U+72f8,U+73ab,U+7410,U+745c,U+7480,U+74a7-74a8,U+74e3,U+75ae,U+75f9,U+76b1,U+76ce,U+7736,U+77e2-77e3,U+781a,U+789f,U+797a,U+79be,U+79c3,U+79c6,U+79f8,U+7a8d,U+7a98,U+7aa6,U+7aff,U+7b1b,U+7cd9,U+7d6e,U+7ede,U+7eee,U+7f00,U+7f24,U+7f2d,U+7fd8,U+800d,U+8116,U+8151,U+81b3,U+8205,U+82c7,U+82db,U+832c,U+8335,U+8339,U+8386,U+846b,U+8587,U+8611,U+8682,U+868a,U+868c,U+8774,U+88d8,U+88f4,U+8912,U+8b6c,U+8bbd,U+8c0e,U+8c41,U+8d26,U+8d3b-8d3c,U+8d50,U+8dea,U+8e35,U+8f99,U+8fe2,U+8fe9,U+9017,U+914c,U+916f,U+9175-9176,U+918b,U+94a0,U+94ae,U+94ce,U+94f2,U+951a,U+952f,U+9541,U+9640,U+9672,U+968b,U+96cd,U+96ef,U+9713,U+97ec,U+9885,U+9992,U+9a6d,U+9a79,U+9a85,U+9cbb,U+9cd7,U+9cde,U+9e93,U+9f9f"}},{uri:ZQ,descriptors:{unicodeRange:"U+4e11,U+4ed7,U+4fcf,U+4fe9,U+4fed,U+50ac,U+50b2,U+5112,U+5180,U+5188,U+51f6,U+522e,U+5265,U+52cb,U+52df,U+5349,U+5367,U+5378,U+537f,U+5395,U+5398,U+53d4,U+543e,U+5440,U+5446,U+54b8,U+5565-5566,U+5580,U+55bb,U+56ca,U+572d,U+573e,U+574e,U+5782-5784,U+58f3,U+5938-5939,U+5948,U+594e,U+5a1c,U+5a74,U+5ae9,U+5b55,U+5b5c,U+5bb0,U+5bd3,U+5bf8,U+5c3f,U+5d14,U+5d2d,U+5df7,U+5dfe,U+5e05-5e06,U+5e1c,U+5e62,U+5e7b,U+5e7d,U+5ed6,U+5f2f,U+5f66,U+5f6c,U+5fa1,U+604b,U+609f,U+60a6,U+60e8,U+6101,U+6124,U+6127,U+6148,U+61be,U+6247,U+62d8,U+62da,U+633d,U+635e,U+6367,U+6380,U+638f,U+63a9,U+63fd,U+641c,U+64e6,U+655e,U+6572,U+6591,U+65a5,U+6691,U+6735,U+67a2-67a3,U+67ef,U+680b,U+6876,U+6905,U+6a0a,U+6a61,U+6b79,U+6bb7,U+6bbf,U+6c41,U+6c55,U+6c83,U+6c9b,U+6ca7,U+6cfc,U+6d46,U+6d51,U+6d74,U+6d9d,U+6daf,U+6dc0,U+6deb,U+6e17,U+6e24,U+6e89,U+6ea2,U+6ef4,U+6f6d,U+707f,U+70b3,U+70e4,U+70ef,U+710a,U+722c,U+725f,U+7261,U+72ee,U+72f1,U+730e,U+732b,U+7433,U+7538,U+75bc,U+7624,U+7709,U+7750,U+7779,U+7802,U+7898,U+78a7,U+78b1,U+78cb,U+78f7,U+7984,U+7a83,U+7aed,U+7b3c,U+7b4b,U+7c92,U+7c98,U+7ca4,U+7eb9,U+7ee3,U+7ef3,U+7ef5,U+7f05,U+7f55,U+7f62,U+7fc1,U+7fd4,U+7fe0,U+8042,U+806a,U+80a0,U+80a4,U+80c3,U+8102,U+8106,U+814a,U+8154,U+8247,U+8258,U+82cd,U+8328,U+832b,U+8389,U+83ca,U+845b,U+846c,U+84b8,U+8574,U+859b,U+8680,U+8695,U+86c7,U+8702,U+886c,U+8896,U+88b1,U+88e4,U+8bc8,U+8c10,U+8c26,U+8c28,U+8c2d,U+8d4c,U+8d63,U+8f67,U+8f74,U+8fc4,U+9006,U+9063,U+90a2,U+90b1,U+90c1,U+9177,U+9189,U+9493,U+949e,U+94fe,U+9610,U+961c,U+96a7,U+96fe,U+978d,U+97f5,U+9888,U+997c,U+9a84,U+9b3c,U+9b44-9b45,U+9b54,U+9e64,U+9f0e,U+9f9a"}},{uri:KQ,descriptors:{unicodeRange:"U+4e19,U+4e38,U+4e53,U+4e7e,U+4e9f,U+4ec6,U+4f50,U+4fde,U+502a,U+5154,U+517d,U+51d1,U+51f0,U+5239,U+5256,U+52c9,U+52fe,U+5308,U+532a,U+535c,U+5384,U+53a2,U+53a8,U+53c9,U+53e0,U+5496,U+54ac,U+54c0,U+54c4,U+54e8,U+5561,U+5582,U+561b,U+5631,U+566a,U+5764,U+576a,U+5792,U+57ab,U+584c,U+5885,U+58f6,U+59a8,U+5acc,U+5bc2,U+5c38-5c39,U+5c60,U+5c6f,U+5c82,U+5c90,U+5d16,U+5dcd,U+5e37,U+5e90,U+5eb8,U+5f6a,U+5fcc,U+6012,U+6068,U+6073,U+607c,U+6094,U+6109,U+621a,U+626e,U+6284,U+62d0,U+62e6,U+62fe,U+6321,U+6328,U+632b,U+6349,U+6454,U+65ed,U+660f,U+6674,U+66a8,U+6749,U+674f,U+6760,U+67af,U+6850,U+6854,U+6869,U+68a8,U+68d2,U+68f5,U+6912,U+6b49,U+6b6a,U+6bef,U+6c28,U+6c5d,U+6c82,U+6cab,U+6cb8,U+6cc4,U+6cf5,U+6d47,U+6d78,U+6da4,U+6dc4,U+6dcb,U+6df9,U+6e0a,U+6e23,U+6e5b,U+6eb6,U+6f06,U+6f47,U+6f84,U+6f9c,U+6fd2,U+7076,U+70ac,U+7199,U+723d,U+72ac,U+72ed,U+7476,U+7529,U+752b,U+754f,U+7554,U+75d5,U+7626,U+76ef,U+7720,U+7766,U+7784,U+77ac,U+780d,U+7838,U+7845,U+786b,U+78b3,U+7978,U+79b9,U+79c9,U+79e7,U+7a3d,U+7a84,U+7a9f,U+7b0b,U+7b52,U+7c7d,U+7f1a,U+7fc5,U+7ff0,U+804a,U+8086-8087,U+808c,U+809a,U+80ba,U+810a,U+8180,U+818f,U+81c2,U+81ed,U+8231,U+8292,U+829c,U+82a6,U+82d1,U+8346,U+838e,U+839e,U+83c7,U+83f1,U+8403,U+840e,U+8513,U+857e,U+85e4,U+867e,U+871c,U+87ba,U+87f9,U+884d,U+8944,U+8a93,U+8c05,U+8d2c,U+8d2e,U+8d42-8d43,U+8dfb,U+8e22,U+8eba,U+8f69,U+8f9c,U+8fa3,U+8fa8,U+8fb1,U+900a,U+9038,U+903b,U+9042,U+904f,U+90b5,U+90dd,U+9102,U+9187,U+94a7,U+94c5,U+9523,U+95f8,U+95fd,U+960e,U+964b-964c,U+96c1,U+9709,U+971c,U+97ad,U+9882,U+9965,U+9976,U+9988,U+99a8,U+9a82,U+9a9a,U+9b41,U+9c8d,U+9e45,U+9e70,U+9e9f,U+9f3b,U+9f7f"}},{uri:QQ,descriptors:{unicodeRange:"U+4e08,U+4e18,U+4e1b,U+4e22,U+4e27,U+4e32,U+4e52,U+4e73,U+4ead,U+4ed4,U+4ed9,U+4ef0,U+4fa6,U+5076,U+5179,U+51bb,U+51c9,U+51ef,U+51fd,U+524a,U+526a,U+529d,U+52ab,U+5306,U+5339,U+53d9,U+540a,U+5410,U+541e,U+5439,U+54b1,U+54ed,U+5564,U+558a,U+55b7,U+5634,U+574a,U+5751,U+57a6,U+57cb,U+57d4,U+5824,U+582a,U+5835,U+5858,U+5893,U+58e4,U+5951,U+5986,U+59da,U+59fb,U+59ff,U+5a03,U+5a46,U+5ac1,U+5b5d,U+5bfa,U+5c18,U+5c3a,U+5c48,U+5c4f,U+5c61,U+5cb3,U+5d1b,U+5e15,U+5e3d,U+5e99,U+5e9e,U+5eca,U+5f0a,U+5f17-5f18,U+5f25,U+5f7c,U+5fcd,U+6028,U+60a0,U+60ac,U+60d1,U+614e,U+6155,U+6168,U+61c8,U+6208,U+6212,U+6251,U+629a-629b,U+62ab-62ac,U+62fc,U+6323,U+632a,U+63d2,U+643a,U+6491-6492,U+649e,U+64b0,U+64c5,U+659c,U+6614,U+662d,U+6664,U+6670,U+6676,U+6746,U+67cf,U+67d4,U+682a,U+6843,U+6846,U+68da,U+6b3a,U+6b67,U+6c27,U+6c5b,U+6c64,U+6c70,U+6caa,U+6cca,U+6ce1,U+6d12,U+6d45,U+6dd1,U+6dd8,U+6e34,U+6e7f,U+6ee5,U+6f02,U+7092,U+70c2,U+70e6,U+7115,U+7237,U+7272,U+727a,U+72c2,U+739b,U+73b2,U+743c,U+751c,U+758f,U+75b2,U+7686,U+76c6,U+76d2,U+76fc,U+775b,U+77a9,U+7816,U+788e,U+7897,U+78b0,U+79bd,U+7a0d,U+7a91,U+7a9d,U+7ae3,U+7bad,U+7cca,U+7d2b,U+7eb1,U+7f06,U+7f14,U+7f1d,U+7f50,U+7ffc,U+8036,U+80bf,U+80c1,U+80ce,U+80f8,U+8109,U+810f,U+8170,U+8179,U+819c,U+821f,U+8230,U+8236,U+8273,U+829d,U+82f9,U+8305,U+8350,U+83b2,U+83cc,U+8404,U+840d,U+8427,U+8482,U+8679,U+8854,U+886b,U+8bbc,U+8be6,U+8c31,U+8c6b,U+8d4b,U+8dcc,U+8e2a,U+8e48,U+8f90,U+8fb0,U+9022,U+903c,U+903e,U+9065,U+916c,U+917f,U+94a9,U+94c3,U+94dd,U+94ed,U+9510,U+953b,U+96c7,U+970d,U+9738,U+9877,U+987d,U+989c,U+98d8,U+9a70,U+9a91,U+9aa4,U+9b42,U+9b4f,U+9e2d,U+9e3f,U+9e7f,U+9f20"}},{uri:JQ,descriptors:{unicodeRange:"U+4e59,U+4ed3,U+4f0f,U+4f38,U+4f69,U+4fa7,U+4faf,U+4ff1,U+5077,U+5085,U+5144,U+5151,U+51af,U+51b6,U+51cc,U+523a,U+5251,U+5269,U+5272,U+52d8,U+5353,U+5389,U+53f9,U+5401,U+5415,U+541b,U+54f2,U+5524,U+554a,U+559d,U+5609,U+5740,U+575d,U+5806,U+5821,U+586b,U+5915,U+594f,U+5960,U+5999,U+59a5,U+59b9,U+59c6,U+59d1,U+59dc,U+5b5f,U+5b64,U+5b87,U+5bb4,U+5bbf,U+5c16,U+5c1d,U+5c3e,U+5c9a,U+5ca9,U+5cad,U+5cfb,U+5de1,U+5de7,U+5de9,U+5ef7,U+5f04,U+5f70,U+5f79,U+5fc6,U+602a,U+6050,U+6052,U+6070,U+6084,U+60b2,U+60dc,U+60e9,U+6167,U+6170,U+61c2,U+6270,U+6291,U+62b1,U+62bc,U+62dc,U+62df,U+62f3,U+6324,U+633a,U+6377,U+6398,U+63cf,U+640f,U+642c-642d,U+6458,U+6478,U+6500,U+654c,U+6566,U+658c,U+65c1,U+65cb,U+65e8,U+65ec,U+6696-6697,U+6734,U+679a,U+679d,U+67dc,U+67f3-67f4,U+680f,U+683d,U+684c,U+68af,U+699c,U+6bc1,U+6c0f,U+6c1b,U+6c57,U+6c6a,U+6d3d,U+6d6e,U+6d82,U+6db5,U+6dee,U+6e58,U+6eaa,U+6ecb,U+6ede,U+6ee9,U+6f0f,U+6f20,U+6f58,U+704c,U+7070,U+70b8,U+718a,U+7238,U+7262,U+7275,U+72b9,U+72d7,U+72e0,U+741b,U+7434,U+7483,U+74f6-74f7,U+75ab,U+764c,U+7761,U+7855,U+7891,U+78c1,U+79d2,U+7a00,U+7a3b,U+7c97,U+7ea4,U+7eb2,U+7ed2,U+7eea,U+7ef8,U+7f18,U+7fbd,U+8000,U+8010,U+8096,U+809d,U+80a9,U+817f,U+81e3,U+8206,U+8212,U+82ac,U+8302,U+8361,U+8377,U+83f2,U+8461,U+848b,U+84ec,U+8521,U+85aa,U+8870,U+8877,U+8881,U+888b,U+88ad,U+88c2,U+8986,U+8bd1,U+8bf1,U+8d24,U+8d2a,U+8d3e-8d3f,U+8d41,U+8d56,U+8d64,U+8d6b,U+8e0f,U+8f70,U+8f85,U+8f88,U+8fa9,U+9003,U+901d,U+90b9,U+90ce,U+94a6,U+94f8,U+9505,U+95ea,U+95ef,U+95f2,U+95f9,U+9601,U+9605,U+9634,U+966a,U+9677,U+9690,U+9694,U+96d5,U+971e,U+9896-9897,U+9972,U+9a71,U+9a76,U+9a7e,U+9e1f,U+9e23"}},{uri:eJ,descriptors:{unicodeRange:"U+4e01,U+4e43,U+4ea6,U+4ef2,U+4eff,U+4f26,U+4f2a,U+4f2f,U+4f5b,U+4fa8,U+4fca,U+4fd7,U+5021,U+504f,U+5141,U+51c0,U+51dd,U+51e4,U+51ed,U+5200,U+5237,U+5427,U+5448,U+54a8,U+5706,U+5708,U+5723,U+575b,U+57c3,U+5899,U+58a8,U+58c1,U+5976,U+5988,U+59bb,U+59d0,U+59d3,U+5a18,U+5a31,U+5a92,U+5b54,U+5b85,U+5baa-5bab,U+5bc4,U+5bd2,U+5be8,U+5bff,U+5c65,U+5d07,U+5e1d,U+5e78,U+5e7c,U+5f03,U+5f1f,U+5f39,U+5f6d,U+5f92,U+5faa,U+5fbd,U+5fe7,U+5ffd,U+60a8,U+60ef,U+6108,U+6162,U+622a,U+6234,U+626b,U+626d,U+62c6,U+62d2,U+62d4,U+62d6,U+62e8,U+6316,U+6355,U+63ed,U+6447,U+64a4,U+65f1,U+6606,U+6628,U+664b,U+6668,U+6682,U+66f9,U+66fc,U+66ff,U+6717,U+6740,U+676d,U+67aa,U+67ec,U+67f1,U+6842,U+6851,U+695a,U+6982,U+6a2a,U+6b20,U+6b23,U+6b32,U+6b96,U+6bc5,U+6beb,U+6c60,U+6c9f,U+6cea,U+6cf3,U+6d1e,U+6d53,U+6d66,U+6d69,U+6d8c,U+6d9b,U+6db2,U+6de1,U+6dfb,U+6e14,U+6ed1,U+6eda,U+6ee8,U+6f2b,U+706d,U+7089,U+708e,U+70ad-70ae,U+70e7,U+7126,U+714c,U+71c3,U+71d5,U+7206,U+7259,U+731b,U+73a9,U+73bb,U+74dc,U+7532,U+7545,U+755c,U+75c7,U+7687,U+76d7,U+76f2,U+788d,U+78e8,U+79e6,U+79e9,U+7a3f,U+7a46,U+7a97,U+7af9,U+7bee,U+7c4d,U+7c89,U+7cd6,U+7eb5,U+7ebd,U+7ed8,U+8017,U+8033,U+80c0,U+80de,U+80f6,U+8138,U+817e,U+81a8,U+820d,U+827e,U+82b3,U+82d7,U+83b1,U+84c4,U+84dd,U+8584,U+864e,U+865a,U+866b,U+86cb,U+88d5,U+89e6,U+8bca,U+8bde,U+8bfa,U+8c0a,U+8c37,U+8c46,U+8c6a,U+8c8c,U+8d1d,U+8d29,U+8d4f,U+8d54,U+8d5a,U+8d60,U+8d62,U+8f7f,U+8f96,U+8f9e-8f9f,U+8fc1,U+8fdf,U+8fea,U+8ff7,U+9012,U+906d,U+9075,U+90a6,U+90bb,U+90ca,U+9178,U+9192,U+91ca,U+94bb,U+94dc,U+94fa,U+9501,U+950b,U+9521,U+955c,U+963b,U+9655,U+9675-9676,U+9887,U+9891,U+9971,U+9a97,U+9ece,U+9ed8"}},{uri:tJ,descriptors:{unicodeRange:"U+4e1d,U+4e39,U+4e4c,U+4e4f,U+4e54,U+4e58,U+4e95,U+4ea1,U+4eab,U+4eae,U+4ec1,U+4f10,U+4f19,U+4f30,U+4f34,U+4fb5,U+503e,U+518c,U+5192,U+51a0,U+51ac,U+51b0,U+51e1,U+5211,U+5242,U+52a3,U+52b2,U+52c3,U+52c7,U+52d2,U+52e4,U+5377,U+539a,U+53a6,U+53e5,U+5417,U+5510,U+552f,U+5531,U+574f-5750,U+5761,U+5851,U+5854,U+58ee,U+593a,U+5949,U+5954,U+5a5a,U+5b8b,U+5bbd,U+5c04,U+5c0a,U+5c4b,U+5ce1,U+5cf0,U+5e10,U+5e8a,U+5e9f,U+5ec9,U+5f31,U+5f84,U+5fd8-5fd9,U+5fe0,U+6015,U+6062,U+6069,U+6076,U+6089,U+60a3,U+60ca,U+620f,U+624e,U+6263,U+6298,U+62a2,U+62bd,U+6311,U+6350,U+6389,U+638c,U+63f4,U+6446,U+644a,U+6469,U+64cd,U+654f,U+6562,U+656c,U+65d7,U+65e6,U+65fa,U+660c,U+6653,U+66b4,U+670b,U+672b,U+676f-6770,U+6881,U+6885,U+68a6,U+68cb,U+68ee,U+6b8a,U+6c88-6c89,U+6cc9,U+6ce5,U+6d01,U+6d17,U+6d1b,U+6d59,U+6d6a,U+6da8,U+6df7,U+6e10,U+6e20-6e21,U+6f5c,U+706f,U+70bc,U+719f,U+7267,U+732a,U+73cd,U+7518,U+756a,U+7586,U+7591,U+75db,U+76c8,U+76d0,U+76d6,U+76d8,U+76df,U+76fe,U+77db,U+7801,U+786c,U+795d,U+7965,U+79cb,U+7a77,U+7a7f,U+7aef,U+7b11,U+7bb1,U+7bc7,U+7ea0,U+7eaf,U+7ed5,U+7edc,U+7f13,U+7f29,U+7f34,U+7f8a,U+7ffb,U+8015,U+8058,U+805a,U+8083,U+80af,U+80c6,U+80cc,U+811a,U+8150,U+82e5,U+8336,U+8352,U+83ab,U+8428,U+8463,U+852c,U+8861,U+89c8,U+8bcd,U+8bd7,U+8bda,U+8be2,U+8bef,U+8bf8,U+8c0b,U+8c13,U+8d34,U+8d3a,U+8d74,U+8d76,U+8da3,U+8dd1,U+8ddd,U+8ddf,U+8df3,U+8f68,U+8f6f,U+8f7d,U+8f91,U+8f9b,U+8fbd,U+8fc8,U+8fd4,U+8feb,U+8ff9,U+900f,U+9057,U+907f-9080,U+90d1,U+90ed,U+91ce,U+9519,U+9526,U+95ed,U+9614,U+9635,U+9644,U+9686,U+96c5,U+96ea,U+9707,U+9732,U+9759,U+978b,U+9876,U+9881,U+9910,U+996e,U+9970,U+9c81,U+9e21,U+9ebb,U+9f84"}},{uri:nJ,descriptors:{unicodeRange:"U+4e3d,U+4e4e,U+4e71,U+4e8f,U+4ed8,U+4eea,U+4f0a,U+4f0d,U+4f11,U+4f1f,U+4f24,U+4f3c,U+4f73,U+4fc4,U+500d,U+5012,U+501f,U+503a,U+505c,U+507f,U+50a8,U+514d,U+5178,U+517c,U+51b2,U+51b7,U+520a,U+5238,U+523b,U+52b1,U+535a,U+5371,U+5385,U+53eb-53ec,U+53f3,U+53f6,U+5409,U+542b,U+542f,U+5434,U+5462,U+5473,U+547c,U+54c8,U+54ea,U+56fa,U+5733,U+5757,U+5766,U+5802,U+585e,U+590f,U+591c,U+591f,U+5947,U+594b,U+5987,U+5a01,U+5b59,U+5b63,U+5b88,U+5b97,U+5b9c,U+5bbe,U+5bfb,U+5c01,U+5c1a,U+5c24,U+5c3c,U+5c97,U+5c9b,U+5cb8,U+5de6,U+5e01,U+5e2e,U+5e45,U+5e55,U+5e84,U+5ef6,U+5f02,U+5f52,U+5f69,U+5f7b,U+5f90,U+5fae,U+6000,U+600e,U+6025,U+60e0,U+6276,U+6297,U+62b5,U+62cd,U+62d3,U+62e5,U+62e9,U+62ff,U+6302,U+632f,U+63e1,U+6444,U+64ad,U+653b,U+6551,U+6563,U+65a4,U+65e7,U+6620,U+667a,U+66f2,U+671d,U+6731,U+6742,U+675f,U+6768,U+677e-677f,U+6790,U+67b6,U+67d3,U+6863,U+68b0,U+68c9,U+690d,U+6b8b,U+6bcd,U+6bd2,U+6bd5,U+6c38,U+6c61,U+6cbf,U+6cdb,U+6cf0,U+6d2a,U+6d89,U+6da6,U+6f6e,U+6fb3,U+7075,U+707e,U+70df,U+7164,U+7236,U+725b,U+7389,U+73e0,U+745e,U+74e6,U+751a,U+7537,U+75be,U+76ae,U+76db,U+793c,U+7956,U+7981,U+79d8,U+79df,U+79fb,U+7adf,U+7ae5,U+7b14,U+7b26,U+7b54,U+7b79,U+7d2f,U+7eb8,U+7eba,U+7ec6,U+7ee9,U+7eff,U+7f5a,U+7f6a,U+7f72,U+8089,U+80a5,U+80e1,U+8111,U+8131,U+821e,U+822c,U+8270,U+8499,U+8651,U+867d,U+8840,U+8857,U+8863,U+88c1,U+89c9,U+89d2,U+8a89,U+8bed,U+8bfe,U+8c01,U+8c22,U+8d21,U+8d25,U+8d2f,U+8d5e,U+8d75,U+8d8b,U+8dc3,U+8de8,U+8df5,U+8f6e,U+8f86,U+8f89,U+8fc5,U+8ff0,U+8ffd,U+9014,U+904d,U+90ae,U+9274,U+949f,U+952e,U+969c,U+96c4,U+96e8,U+96f6-96f7,U+97e9,U+987f,U+996d,U+9a7b,U+9aa8,U+9c7c,U+9c9c,U+9e4f,U+9f13,U+9f50"}},{uri:rJ,descriptors:{unicodeRange:"U+4e13,U+4e16,U+4e1c,U+4e24,U+4e3e,U+4e49,U+4e61,U+4e66,U+4e89,U+4e8c,U+4e94,U+4e9b,U+4ea4,U+4eac,U+4ebf,U+4eca,U+4ef6-4ef7,U+4efb,U+4f18,U+4f20,U+4f46,U+4f7f,U+4fe1,U+503c,U+505a,U+5146,U+5148,U+515a,U+5171,U+5177,U+519b,U+51b3,U+51c6,U+51e0,U+5212,U+521b,U+522b,U+529e,U+52bf,U+534e-534f,U+5355,U+5357,U+5382,U+539f,U+53bb,U+53bf,U+53c2,U+53c8,U+53ca,U+53d6-53d8,U+53e3,U+53ea,U+53f0,U+540d,U+5411,U+56db,U+56de,U+56e0,U+56e2,U+578b,U+57ce,U+57fa,U+589e,U+5904,U+5934,U+5982,U+5b89,U+5b8c,U+5bfc,U+5c06,U+5c11,U+5c40,U+5c71,U+5e38,U+5e72,U+5e76,U+5e7f,U+5e94,U+5e9c,U+5f0f,U+5f15,U+5f20,U+5f3a,U+5f62,U+5f88,U+5fc5,U+5fd7,U+5feb,U+601d,U+6027,U+60c5,U+60f3,U+610f,U+6216,U+6218,U+624b,U+624d,U+6279,U+628a,U+6295,U+6301,U+6307,U+636e,U+63a5,U+63a8,U+652f,U+6536,U+653e,U+6548,U+6559,U+6570,U+65bd,U+65e0,U+6602,U+660e,U+6613,U+66f4,U+6700,U+670d,U+671f,U+672f,U+6743,U+674e,U+6751,U+6761,U+6784,U+6797,U+679c,U+67e5,U+6807,U+6837,U+683c,U+6b21,U+6b63-6b65,U+6bcf,U+6bd4,U+6c42,U+6c5f,U+6ca1,U+6cbb,U+6d3b,U+6d41,U+6d88,U+6df1,U+70b9,U+7136,U+7269,U+7279,U+7531,U+754c,U+767e,U+76ca,U+76f8,U+770b,U+7740,U+7814,U+79ef,U+7a0b,U+7a0e,U+7a76,U+7b80,U+7cbe,U+7cfb,U+7e41,U+7ea7,U+7ec4,U+7ec7,U+7ed3,U+7ed9,U+7edf,U+7f8e,U+8001,U+804c,U+8054,U+80b2,U+81f3,U+8425,U+8868,U+88ab,U+897f,U+89c1-89c2,U+89c4,U+89c6,U+89e3,U+8ba1,U+8ba4,U+8bae,U+8bb0,U+8bba,U+8bc1,U+8c03,U+8d28,U+8d39,U+8def,U+8f66,U+8f6c,U+8fd0-8fd1,U+9020,U+9053,U+90a3,U+90fd,U+91cc,U+9500,U+9547,U+95e8,U+95f4,U+961f,U+9645,U+9662,U+96be,U+96c6,U+9700,U+9769,U+97e6,U+9875,U+9879,U+9886,U+9898,U+98ce,U+9996,U+2b5af,U+2cc56,U+2e9f5,U+30edd-30ede"}},{uri:iJ,descriptors:{unicodeRange:"U+4e03,U+4e30,U+4e34,U+4e45,U+4e60,U+4e70,U+4e88,U+4e91-4e92,U+4ea9,U+4eb2,U+4ec0,U+4ecb,U+4ecd,U+4ee4,U+4fee,U+5019,U+5047,U+50cf,U+5145,U+516d,U+5170,U+5175,U+5199,U+51cf,U+51fb,U+521a,U+5224,U+5267,U+52aa,U+5347-5348,U+534a,U+5356,U+5361,U+536b,U+5370,U+538b,U+53e4,U+53e6,U+5403,U+5426,U+5428,U+542c,U+5438,U+5668,U+56ed,U+56f4,U+56fe,U+57df,U+592a,U+5957,U+5b69,U+5b81,U+5b8f,U+5b98,U+5b9d,U+5ba1,U+5ba4,U+5bb3,U+5bc6,U+5bdf,U+5c3d,U+5c5e,U+5c81,U+5ddd,U+5de8,U+5dee,U+5e0c,U+5e86,U+5e8f,U+5e93,U+5e95,U+5e97,U+5ea7,U+5ead,U+5eb7,U+5f55,U+5f81,U+5f85,U+5ff5,U+6001,U+613f,U+6258,U+6267,U+6269,U+626c,U+627e,U+62db,U+62ec,U+6325,U+635f,U+6362,U+6388,U+6392,U+63a2,U+63a7,U+63aa,U+641e,U+6545,U+6597,U+65e2,U+65e9,U+661f,U+665a,U+666e-666f,U+66fe,U+6728,U+67d0,U+6811,U+6838,U+6865,U+697c,U+6b22,U+6b27,U+6b4c,U+6b62,U+6b66,U+6b7b,U+6bdb,U+6c47,U+6c49,U+6c7d,U+6c99,U+6cfd,U+6d0b,U+6d25,U+6d32,U+6d3e,U+6d4b,U+6e29,U+6e56,U+6e7e,U+6f14,U+6fc0,U+706b,U+70c8,U+7247,U+72af,U+72b6,U+72ec,U+732e,U+73ed,U+7403,U+7533,U+753b,U+7559,U+7565,U+7597,U+767b,U+773c,U+7763,U+77ed,U+77ff,U+7968,U+798f,U+79bb,U+79c0-79c1,U+7ad9,U+7ae0,U+7b51,U+7b7e,U+7cae,U+7d22,U+7ea2,U+7eb3,U+7eb7,U+7ec3,U+7ec8,U+7ecd,U+7edd,U+7efc,U+7f16,U+7f3a,U+7f51,U+7f57,U+7f6e,U+80dc,U+822a,U+8239,U+826f,U+82cf,U+82e6,U+8349,U+8363,U+83dc,U+8457,U+85cf,U+878d,U+8865,U+8a00,U+8b66,U+8ba2,U+8ba8,U+8bad,U+8bb2,U+8bc9,U+8bd5,U+8bfb,U+8d2b,U+8d35,U+8d37,U+8f7b,U+8f93,U+8fce,U+8fdd,U+9000-9002,U+9010,U+9047,U+9093,U+9152,U+9488,U+94a2,U+9633,U+9636,U+963f,U+9646,U+9648,U+964d,U+9664,U+9669,U+9760,U+97f3,U+987a,U+987e,U+9884,U+98de,U+9986,U+9ed1"}},{uri:aJ,descriptors:{unicodeRange:"U+4e14,U+4e25,U+4e48,U+4e50,U+4e5d,U+4e9a,U+4ec5,U+4efd,U+4f17,U+4f4e-4f4f,U+4f55,U+4f59,U+4f60,U+4f8b,U+4f9b,U+4f9d,U+4fbf,U+4fc3,U+5065,U+513f,U+5149,U+514b,U+516b,U+5174,U+517b,U+518d,U+51b5,U+5207,U+5217-5219,U+521d,U+526f,U+529f,U+52a9,U+52b3,U+5305,U+533b,U+5343,U+5360,U+5373-5374,U+5386,U+53cb-53cd,U+53f2,U+53f7,U+544a,U+5468,U+547d,U+54cd,U+552e,U+5584,U+56f0,U+571f,U+5747,U+575a,U+57f9,U+5883,U+58eb,U+58f0,U+5907,U+590d,U+592e,U+5931,U+5956,U+5965,U+5973,U+5979,U+59cb,U+5b57-5b58,U+5b83,U+5ba2-5ba3,U+5bb9,U+5bcc,U+5c42,U+5c45,U+5c4a,U+5dde,U+5df1,U+5df4,U+5e03,U+5e08,U+5e26,U+5e2d,U+5f71,U+5f80,U+5f8b,U+5fb7,U+606f,U+611f,U+6237,U+623f,U+6253,U+627f,U+6293,U+62a4,U+62c5,U+62c9,U+6309,U+6574,U+6599,U+65ad,U+65af,U+65c5,U+65cf,U+6625,U+663e,U+671b,U+672a,U+6750,U+6781,U+6821,U+6839,U+6848,U+68c0,U+6a21,U+6b3e,U+6bb5,U+6c14,U+6cb3,U+6cb9,U+6ce8,U+6e05,U+6e2f,U+6e38,U+6e90,U+6ee1,U+70ed,U+7167,U+7231,U+7248,U+724c,U+7387,U+738b,U+73af,U+7530,U+75c5,U+767d,U+76d1,U+76f4,U+771f,U+77e5,U+77f3,U+7834,U+7840,U+786e,U+793a,U+795e,U+79f0,U+7a33,U+7a7a,U+7a81,U+7ade,U+7b56,U+7b97,U+7c73,U+7c7b,U+7d20,U+7d27,U+7ea6,U+7eaa,U+7ebf,U+7ee7,U+7eed,U+7ef4,U+7fa4,U+8003,U+80a1,U+81f4,U+8272,U+827a,U+8282,U+82b1,U+82f1,U+8303,U+836f,U+83b7,U+843d,U+88c5,U+8ba9,U+8baf,U+8bb8,U+8bbf,U+8bc4,U+8bc6,U+8bdd,U+8be5,U+8bf7,U+8c08,U+8c61,U+8d1f,U+8d22-8d23,U+8d27,U+8d2d,U+8d38,U+8d5b,U+8d70,U+8d85,U+8d8a,U+8db3,U+8eab,U+8f83,U+8fb9,U+8fdc,U+8fde,U+9009,U+901f,U+914d,U+91c7,U+94b1,U+94c1,U+94f6,U+95fb,U+9632,U+9650,U+968f,U+9752,U+975e,U+987b,U+989d,U+98df,U+9999,U+9a6c,U+9a8c,U+9ec4,U+9feb-9fec"}},{uri:sJ,descriptors:{unicodeRange:"U+98fb-990c,U+990e-990f,U+9911-992d,U+992f-9953,U+9956-9962,U+9964,U+9966,U+9973,U+9978-9979,U+997b,U+997e,U+9982-9983,U+9989,U+998c,U+998e,U+999a-99a4,U+99a6-99a7,U+99a9-99c8"}},{uri:oJ,descriptors:{unicodeRange:"U+8e4c-8e50,U+8e53-8e58,U+8e5a-8e65,U+8e67-8e68,U+8e6a-8e6b,U+8e6e,U+8e71,U+8e73,U+8e75,U+8e77-8e7b,U+8e7d-8e7e,U+8e80,U+8e82-8e84,U+8e86,U+8e88-8e8e,U+8e91-8e93,U+8e95-8e9b,U+8e9d,U+8e9f-8eaa,U+8ead-8eae,U+8eb0-8eb1,U+8eb3-8eb9,U+8ebb-8ecd,U+8ecf-8f02"}},{uri:lJ,descriptors:{unicodeRange:"U+2e3a,U+3001-3002,U+3008-3011,U+3014-3017,U+301d-301f,U+4dae,U+4e00,U+4e07,U+4e09-4e0b,U+4e0d-4e0e,U+4e1a,U+4e2a,U+4e2d,U+4e3a-4e3b,U+4e4b,U+4e5f,U+4e86,U+4e8b,U+4e8e,U+4ea7,U+4eba,U+4ece,U+4ed1,U+4ed6,U+4ee3,U+4ee5,U+4eec,U+4f01,U+4f1a,U+4f4d,U+4f53,U+4f5c,U+4fdd,U+5143,U+5165,U+5168,U+516c,U+5173,U+5176,U+5185,U+519c,U+51fa,U+5206,U+5229,U+5230,U+5236,U+524d,U+529b,U+52a0-52a1,U+52a8,U+5316-5317,U+533a,U+5341,U+5362,U+53d1,U+53ef,U+53f8,U+5404,U+5408,U+540c,U+540e,U+5458,U+548c,U+54c1,U+54e5,U+5546,U+559c,U+56fd,U+5728,U+5730,U+573a,U+5916,U+591a,U+5927,U+5929,U+592b,U+597d,U+59d4,U+5b50,U+5b66,U+5b9a,U+5b9e,U+5bb6,U+5bf9,U+5c0f,U+5c14,U+5c31,U+5c55,U+5de5,U+5df2,U+5e02,U+5e73-5e74,U+5ea6,U+5efa,U+5f00,U+5f53,U+5f97,U+5fc3,U+603b,U+6210-6211,U+6240,U+6280,U+62a5,U+63d0,U+6539,U+653f,U+6587,U+65b0,U+65b9,U+65e5,U+65f6,U+662f,U+6708-6709,U+672c,U+673a,U+675c,U+6765,U+6c11,U+6c34,U+6cd5,U+6ce2,U+6d4e,U+6d77,U+73b0,U+7406,U+751f,U+7528,U+7535,U+7684,U+76ee,U+793e,U+79cd,U+79d1,U+7acb,U+7b2c,U+7b49,U+7ba1,U+7ecf,U+8005,U+800c,U+80fd,U+81ea,U+884c,U+8981,U+8bbe,U+8bf4,U+8d44,U+8d77,U+8fbe,U+8fc7,U+8fd8-8fd9,U+8fdb,U+901a,U+90e8,U+91cd,U+91cf,U+91d1,U+9485,U+957f,U+95ee,U+9762,U+9ad8,U+9ea6,U+9f99,U+9fcf,U+9fd4,U+9fed,U+fe10-fe19,U+fe30-fe31,U+fe33-fe44,U+ff01,U+ff0c,U+ff1f,U+2b4e7,U+2b7f7,U+2b7fc,U+2cb2d,U+2cb3b,U+2cb4a,U+2cb5b,U+2cb73"}},{uri:cJ,descriptors:{unicodeRange:"U+6490,U+6493-6494,U+6497-6498,U+649a-649d,U+649f-64a3,U+64a5-64a8,U+64aa-64ab,U+64af,U+64b1-64b4,U+64b6,U+64b9,U+64bb,U+64bd-64bf,U+64c1,U+64c3-64c4,U+64c6-64cc,U+64cf,U+64d1,U+64d3-64d6,U+64d9-64dd,U+64df-64e1,U+64e3,U+64e5,U+64e7-64ff,U+6501-6508,U+650a-6511,U+6513-6517,U+6519-6524,U+6526-652a,U+652c-652d,U+6530-6533,U+6537,U+653a,U+653c-653d,U+6540-6544,U+6546-6547,U+654a-654b,U+654d-654e,U+6550,U+6552-6554,U+6557-6558,U+655a,U+655c,U+655f-6561,U+6564-6565,U+6567-6568"}},{uri:dJ,descriptors:{unicodeRange:"U+9695-9696,U+969a-969b,U+969d-96a6,U+96a8-96af,U+96b1-96b2,U+96b4-96b5,U+96b7-96b8,U+96ba-96bb,U+96bf,U+96c2-96c3,U+96c8,U+96ca-96cb,U+96d0-96d1,U+96d3-96d4,U+96d6-96df,U+96e1-96e7,U+96eb-96ee,U+96f0-96f2,U+96f4-96f5,U+96f8,U+96fa-96fd,U+96ff,U+9702-9703,U+9705,U+970a-970c,U+9710-9712,U+9714-9715,U+9717-971b,U+971d,U+971f-9729,U+972b-972c,U+972e-972f,U+9731,U+9733-9737,U+973a-973d,U+973f-9751,U+9754-9755,U+9757-9758,U+975a,U+975c-975d,U+975f,U+9763-9764,U+9766-9768,U+976a-9770"}},{uri:uJ,descriptors:{unicodeRange:"U+6af0-6b1f,U+6b25-6b26,U+6b28-6b31,U+6b33-6b36,U+6b38,U+6b3b-6b3d,U+6b3f-6b42,U+6b44-6b45,U+6b48,U+6b4a-6b4b,U+6b4d-6b58,U+6b5a-6b61,U+6b68-6b69,U+6b6b-6b78,U+6b7a,U+6b7d-6b80,U+6b85,U+6b88,U+6b8c,U+6b8e-6b91,U+6b94-6b95,U+6b97-6b99,U+6b9c-6ba0,U+6ba2-6ba9,U+6bab-6bb2,U+6bb6,U+6bb8-6bba"}},{uri:hJ,descriptors:{unicodeRange:"U+430e-439a,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29f7e,U+29f83,U+29f8c,U+29fce,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a38c"}},{uri:fJ,descriptors:{unicodeRange:"U+92ef-933d,U+933f-9369,U+936b-9388"}},{uri:pJ,descriptors:{unicodeRange:"U+4512-458d,U+2b300,U+2b363,U+2b36f,U+2b372,U+2b37d,U+2b404,U+2b410,U+2b413,U+2b461,U+2b4ef,U+2b4f6,U+2b4f9,U+2b50d-2b50e,U+2b536,U+2b5ae,U+2b5b3,U+2b5e7,U+2b5f4,U+2b61c-2b61d,U+2b626-2b628,U+2b62a,U+2b62c,U+2b695-2b696,U+2b6ad,U+2b6ed"}},{uri:mJ,descriptors:{unicodeRange:"U+88bd-88c0,U+88c3-88c4,U+88c7-88c8,U+88ca-88cd,U+88cf-88d1,U+88d3,U+88d6-88d7,U+88da-88de,U+88e0-88e1,U+88e6-88e7,U+88e9-88ef,U+88f2,U+88f5-88f7,U+88fa-88fb,U+88fd,U+88ff-8901,U+8903-8909,U+890b-890f,U+8911,U+8914-8918,U+891c-8920,U+8922-8924,U+8926-8929,U+892c-892f,U+8931-8933,U+8935,U+8937-8940,U+8942-8943,U+8945-895d,U+8960-8965,U+8967-897a,U+897c-897e,U+8980,U+8982,U+8984-8985"}},{uri:gJ,descriptors:{unicodeRange:"U+4b0b-4ba0"}},{uri:UJ,descriptors:{unicodeRange:"U+7179,U+717b-717c,U+717e-7183,U+7185-7189,U+718b-718e,U+7190-7193,U+7195-7197,U+719a-719e,U+71a1-71a7,U+71a9-71ab,U+71ad-71b2,U+71b4,U+71b6-71b8,U+71ba-71c2,U+71c4-71cd,U+71cf-71d3,U+71d6-71df,U+71e1-71e4,U+71e6,U+71e8-71ed,U+71ef-71f8,U+71fa-7205,U+7207-721c,U+721e-7227,U+7229,U+722b,U+722d"}},{uri:bJ,descriptors:{unicodeRange:"U+982e-9874,U+988b,U+988e,U+9892,U+9895,U+9899,U+98a3,U+98a8-98cd,U+98cf-98d0,U+98d4,U+98d6-98d7,U+98db-98dd,U+98e0-98e6,U+98e9-98fa"}},{uri:yJ,descriptors:{unicodeRange:"U+7c14-7c15,U+7c17-7c1e,U+7c20-7c25,U+7c28-7c29,U+7c2b-7c37,U+7c39-7c3e,U+7c42-7c4c,U+7c4e-7c72,U+7c75-7c7a,U+7c7e-7c88,U+7c8a-7c90,U+7c93-7c94,U+7c96,U+7c99-7c9b,U+7ca0-7ca1,U+7ca3,U+7ca6-7ca9,U+7cab-7cad,U+7caf-7cb0,U+7cb4-7cb8,U+7cba-7cbb,U+7cbf-7cc0,U+7cc2-7cc4,U+7cc6,U+7cc9,U+7ccb,U+7cce-7cd4"}},{uri:vJ,descriptors:{unicodeRange:"U+7d95-7da5,U+7da7-7dad,U+7daf-7e2a"}},{uri:xJ,descriptors:{unicodeRange:"U+4a78-4b0a"}},{uri:wJ,descriptors:{unicodeRange:"U+9b30-9b31,U+9b33-9b3a,U+9b3d-9b40,U+9b46,U+9b4a-9b4c,U+9b4e,U+9b50,U+9b52-9b53,U+9b55-9bcf"}},{uri:EJ,descriptors:{unicodeRange:"U+6a4b-6a4f,U+6a51-6a57,U+6a5a,U+6a5c-6a60,U+6a62-6a64,U+6a66-6a70,U+6a72-6a78,U+6a7a-6a7b,U+6a7d-6a7f,U+6a81-6a83,U+6a85-6a8d,U+6a8f,U+6a92-6a96,U+6a98-6a9f,U+6aa1-6aa8,U+6aaa,U+6aad-6aef"}},{uri:CJ,descriptors:{unicodeRange:"U+99c9-9a53"}},{uri:SJ,descriptors:{unicodeRange:"U+8550-8555,U+8557-8558,U+855a-855d,U+855f-8563,U+8565-8567,U+8569-8571,U+8573,U+8575-8578,U+857c-857d,U+857f-8583,U+8586,U+8588-858e,U+8590-859a,U+859d-85a3,U+85a5-85a7,U+85a9,U+85ab-85ad,U+85b1-85b6,U+85b8,U+85ba-85c0,U+85c2-85c8,U+85ca-85ce,U+85d1-85d2,U+85d4,U+85d6-85db,U+85dd-85e3,U+85e5-85e8,U+85ea-85fa,U+85fc-85fe,U+8600-8603"}},{uri:_J,descriptors:{unicodeRange:"U+6fb2,U+6fb4-6fb5,U+6fb7-6fb8,U+6fba-6fbf,U+6fc1,U+6fc3-6fc8,U+6fca-6fd0,U+6fd3-6fdd,U+6fdf,U+6fe2-6fed,U+6ff0-7010,U+7012-7019,U+701c-7022,U+7024-7034,U+7036-7038,U+703a-704b,U+704d-704e,U+7050-7053"}},{uri:kJ,descriptors:{unicodeRange:"U+4ba1-4c2c"}},{uri:TJ,descriptors:{unicodeRange:"U+9a54-9a6b,U+9a72,U+9a83,U+9a89,U+9a8d-9a8e,U+9a94-9a95,U+9a99,U+9aa6,U+9aa9-9aaf,U+9ab2-9ab5,U+9ab9,U+9abb,U+9abd-9abf,U+9ac3-9ac4,U+9ac6-9aca,U+9acd-9ad0,U+9ad2,U+9ad4-9ad7,U+9ad9-9ade,U+9ae0,U+9ae2-9ae5,U+9ae7-9aea,U+9aec,U+9aee,U+9af0-9af8,U+9afa,U+9afc-9b02,U+9b04-9b07,U+9b09-9b0e,U+9b10-9b12,U+9b14-9b1e,U+9b20-9b22,U+9b24-9b2e"}},{uri:MJ,descriptors:{unicodeRange:"U+9d1a-9da1"}},{uri:IJ,descriptors:{unicodeRange:"U+9e13-9e1e,U+9e24,U+9e27,U+9e2e,U+9e30,U+9e34,U+9e3b-9e3c,U+9e40,U+9e4d,U+9e50,U+9e52-9e54,U+9e56,U+9e59,U+9e5d,U+9e5f-9e62,U+9e65,U+9e6e-9e6f,U+9e72,U+9e74-9e7d,U+9e80-9e81,U+9e83-9e86,U+9e89-9e8a,U+9e8c-9e91,U+9e94-9e9c,U+9e9e,U+9ea0-9ea5,U+9ea7-9eb3,U+9eb5-9eb7,U+9eb9-9eba,U+9ebc,U+9ebf-9ec3,U+9ec5-9ec8,U+9eca-9ecc,U+9ed0,U+9ed2-9ed3,U+9ed5-9ed7,U+9ed9-9eda,U+9ede,U+9ee1,U+9ee3-9ee4,U+9ee6,U+9ee8,U+9eeb-9eee,U+9ef0-9ef8"}},{uri:AJ,descriptors:{unicodeRange:"U+8b1c-8b25,U+8b27-8b65,U+8b67-8b6b,U+8b6d-8b9f,U+8bac,U+8bb1,U+8bbb,U+8bc7,U+8bd0"}},{uri:LJ,descriptors:{unicodeRange:"U+4cad-4d2f"}},{uri:RJ,descriptors:{unicodeRange:"U+9c4b-9c7b,U+9c7d-9c7e,U+9c80,U+9c83-9c84,U+9c89-9c8a,U+9c8c,U+9c8f,U+9c93,U+9c96-9c99,U+9c9d,U+9caa,U+9cac,U+9caf,U+9cb9,U+9cbe-9cc2,U+9cc8-9cc9,U+9cd1-9cd2,U+9cda-9cdb,U+9ce0-9ce1,U+9ce3-9d19"}},{uri:DJ,descriptors:{unicodeRange:"U+9389-938e,U+9390-93c9,U+93cb-93d5,U+93d7-9410"}},{uri:jJ,descriptors:{unicodeRange:"U+20a0-20b5,U+20b9-20ba,U+20bc-20bd,U+4e2c,U+5107,U+5216,U+5293,U+54f3,U+5523,U+5819,U+5adc,U+5c88,U+5e3b,U+5fee,U+62f6,U+63be,U+6484,U+6499,U+67d9,U+67dd,U+6d5e,U+6f46,U+717a,U+71e0,U+72c1,U+73e7,U+75b0,U+7603,U+7722,U+7809,U+7811,U+7946,U+7967,U+799a,U+7b45,U+7ba2,U+8014,U+80d9,U+8159,U+817d,U+81a3,U+81aa,U+8201,U+833c,U+836e,U+83e5,U+8459,U+84f0,U+8729,U+8753,U+87d3,U+89dc,U+8bf6,U+8c2e,U+8e2c,U+8e9c,U+8e9e,U+8ece,U+8fee,U+9139,U+914f,U+9174,U+9191,U+960c,U+9622,U+9a98,U+9b48,U+9ca6,U+9cb0,U+9da2-9e12,U+9e88,U+9f44,U+9f86"}},{uri:PJ,descriptors:{unicodeRange:"U+9bd0-9c4a"}},{uri:NJ,descriptors:{unicodeRange:"U+4c2d-4cac"}},{uri:OJ,descriptors:{unicodeRange:"U+4d30-4dab"}},{uri:FJ,descriptors:{unicodeRange:"U+9411-943d,U+943f-946a,U+946c-9484"}},{uri:BJ,descriptors:{unicodeRange:"U+9efa,U+9efd,U+9eff-9f0a,U+9f0c,U+9f0f,U+9f11-9f12,U+9f14-9f16,U+9f18,U+9f1a-9f1f,U+9f21,U+9f23-9f2b,U+9f2d-9f2e,U+9f30-9f36,U+9f38,U+9f3a,U+9f3c,U+9f3f-9f43,U+9f45-9f4f,U+9f52-9f7e,U+9f81-9f82,U+9f8d-9f94"}},{uri:$J,descriptors:{unicodeRange:"U+7e2b-7e3a,U+7e3c-7e40,U+7e42-7e46,U+7e48-7e81,U+7e83-7e9a,U+7e9c-7e9e,U+7eae,U+7eb4,U+7ebb-7ebc,U+7ed6,U+7ee4,U+7eec,U+7ef9,U+7f0a,U+7f10,U+7f1e,U+7f37,U+7f39,U+7f3b"}}],fl=class Ht{constructor(t){z(this,"scene"),z(this,"getSceneFamilies",()=>Ht.getUniqueFamilies(this.scene.getNonDeletedElements())),z(this,"onLoaded",n=>{let r=!0;for(let s of n){let o=`${s.family}-${s.style}-${s.weight}-${s.unicodeRange}`;Ht.loadedFontsCache.has(o)||(Ht.loadedFontsCache.add(o),r=!1)}if(r)return;let i=!1,a=this.scene.getNonDeletedElementsMap();for(let s of this.scene.getNonDeletedElements())if(ke(s)){i=!0,gn.delete(s),R1.clearCache($t(s));let o=lr(s,a);o&&gn.delete(o)}i&&this.scene.triggerUpdate()}),z(this,"loadSceneFonts",async()=>{let n=this.getSceneFamilies(),r=Ht.getCharsPerFamily(this.scene.getNonDeletedElements());return Ht.loadFontFaces(n,r)}),this.scene=t}static get registered(){return Ht._registered?Ht._initialized||(Ht._registered=new Map([...Ht.init().entries(),...Ht._registered.entries()])):Ht._registered=Ht.init(),Ht._registered}get registered(){return Ht.registered}static async generateFontFaceDeclarations(t){let n=Ht.getUniqueFamilies(t),r=Ht.getCharsPerFamily(t),i=n.find(c=>zM(c).includes(gu));if(i){let c=Ht.getCharacters(r,i);if(hY(c)){let d=Uu[gu];r[d]=new Set(c),n.unshift(Uu[gu])}}let a=Ht.fontFacesStylesGenerator(n,r),s=3,o=await new RE(a,s).all();return Array.from(new Set(o))}static async loadFontFaces(t,n){for(let{fontFaces:a,metadata:s}of Ht.registered.values())if(!s.local)for(let{fontFace:o}of a)window.document.fonts.has(o)||window.document.fonts.add(o);let r=Ht.fontFacesLoader(t,n),i=10;return(await new RE(r,i).all()).flat().filter(Boolean)}static*fontFacesLoader(t,n){for(let[r,i]of t.entries()){let a=$t({fontFamily:i,fontSize:16}),s=Ht.getCharacters(n,i);window.document.fonts.check(a,s)||(yield Xu(async()=>{var o;try{let c=await window.document.fonts.load(a,s);return[r,c]}catch(c){console.error(`Failed to load font "${a}" from urls "${(o=Ht.registered.get(i))==null?void 0:o.fontFaces.map(d=>d.urls)}"`,c)}}))}}static*fontFacesStylesGenerator(t,n){for(let[r,i]of t.entries()){let{fontFaces:a,metadata:s}=Ht.registered.get(i)??{};if(!Array.isArray(a)){console.error(`Couldn't find registered fonts for font-family "${i}"`,Ht.registered);continue}if(!(s!=null&&s.local))for(let[o,c]of a.entries())yield Xu(async()=>{try{let d=Ht.getCharacters(n,i),l=await c.toCSS(d);return l?[r*1e4+o,l]:void 0}catch(d){console.error(`Couldn't transform font-face to css for family "${c.fontFace.family}"`,d)}})}}static register(t,n,...r){let i=fn[t]??Uu[t];return this.registered.get(i)||this.registered.set(i,{metadata:n,fontFaces:r.map(({uri:a,descriptors:s})=>new bq(t,a,s))}),this.registered}static init(){let t={registered:new Map},n=(r,...i)=>{let a=fn[r]??Uu[r],s=e2[a]??e2[fn.Excalifont];Ht.register.call(t,r,s,...i)};return n("Cascadia",...vq),n("Comic Shanns",...Sq),n("Excalifont",...Dq),n("Helvetica",...jq),n("Liberation Sans",...Nq),n("Lilita One",...Bq),n("Nunito",...Vq),n("Virgil",...Gq),n(gu,...zJ),n(Vp,..._q),Ht._initialized=!0,t.registered}static getUniqueFamilies(t){return Array.from(t.reduce((n,r)=>(ke(r)&&n.add(r.fontFamily),n),new Set))}static getCharsPerFamily(t){let n={};for(let r of t)if(ke(r))for(let i of r.originalText)n[r.fontFamily]||(n[r.fontFamily]=new Set),n[r.fontFamily].add(i);return n}static getCharacters(t,n){return t[n]?Array.from(t[n]).join(""):""}static getAllFamilies(){return Array.from(Ht.registered.keys())}};z(fl,"loadedFontsCache",new Set),z(fl,"_registered"),z(fl,"_initialized",!1),z(fl,"loadElementsFonts",async e=>{let t=fl.getUniqueFamilies(e),n=fl.getCharsPerFamily(e);return fl.loadFontFaces(t,n)});var uo=fl,PI=(e,t,n)=>{var c;let{unitsPerEm:r,ascender:i,descender:a}=((c=uo.registered.get(e))==null?void 0:c.metadata.metrics)||e2[fn.Virgil].metrics,s=t/r,o=(n-s*i+s*a)/2;return s*i+o},ad=e=>{var n;let{lineHeight:t}=((n=uo.registered.get(e))==null?void 0:n.metadata.metrics)||e2[fn.Excalifont].metrics;return t},NI=e=>{let{angle:t,width:n,height:r,x:i,y:a}=e,s=i+n/2,o=a+r/2,c=A(s,o),d;return e.type==="diamond"?d=TE(oe(A(s,a),c,t),oe(A(i+n,o),c,t),oe(A(s,a+r),c,t),oe(A(i,o),c,t)):d=TE(oe(A(i,a),c,t),oe(A(i+n,a),c,t),oe(A(i+n,a+r),c,t),oe(A(i,a+r),c,t)),{type:"polygon",data:d}},HJ=(e,t,n=10)=>{let[r,i,a,s,o,c]=it(e,t,!0);r-=n,a+=n,i-=n,s+=n;let d=A(o,c),l=oe(A(r,i),d,e.angle),h=oe(A(a,i),d,e.angle),f=oe(A(r,s),d,e.angle),g=oe(A(a,s),d,e.angle);return{type:"polygon",data:[l,h,g,f]}},WJ=e=>{let{width:t,height:n,angle:r,x:i,y:a}=e;return{type:"ellipse",data:{center:A(i+t/2,a+n/2),angle:r,halfWidth:t/2,halfHeight:n/2}}},Vl=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},XJ=(e,t=A(0,0),n,r)=>{let i=c=>oe(A(c[0]+t[0],c[1]+t[1]),r,n),a=Vl(e),s=[],o=A(0,0);for(let c of a){if(c.op==="move"){let d=Q8(c.data);Tr(d!=null,"Ops data is not a point"),o=i(d)}if(c.op==="bcurveTo"){let d=i(A(c.data[0],c.data[1])),l=i(A(c.data[2],c.data[3])),h=i(A(c.data[4],c.data[5]));s.push(so(o,d,l,h)),o=h}}return{type:"polycurve",data:s}},VJ=e=>{let t=e[0],n=[];for(let r=1;r<e.length;r++){let i=e[r];n.push(He(t,i)),t=i}return n},YJ=(e,t,n=!1)=>{let r=a=>oe(gt(Cl(Fe(a),hr(e.x,e.y))),t,e.angle),i=VJ(e.points.map(a=>r(a)));return n?{type:"polygon",data:qg(i.flat())}:{type:"polyline",data:i}},GJ=(e,t,n=A(0,0),r,i)=>{let a=l=>oe(A(l[0]+n[0],l[1]+n[1]),i,r);if(e.roundness===null)return{type:"polygon",data:qg(e.points.map(l=>a(l)))};let s=Vl(t),o=[],c=!1;for(let l of s)l.op==="move"?(c=!c,c&&o.push(A(l.data[0],l.data[1]))):l.op==="bcurveTo"?c&&(o.push(A(l.data[0],l.data[1])),o.push(A(l.data[2],l.data[3])),o.push(A(l.data[4],l.data[5]))):l.op==="lineTo"&&c&&o.push(A(l.data[0],l.data[1]));let d=DX(o,10,5).map(l=>a(l));return{type:"polygon",data:qg(d)}},qJ=(e,t)=>{let{angle:n,halfWidth:r,halfHeight:i,center:a}=t,s=r,o=i,c=Cl(Fe(e),wn(Fe(a),-1)),[d,l]=oe(gt(c),A(0,0),-n),h=Math.abs(d),f=Math.abs(l),g=.707,U=.707;for(let x=0;x<3;x++){let w=s*g,C=o*U,S=(s*s-o*o)*g**3/s,T=(o*o-s*s)*U**3/o,M=w-S,_=C-T,R=h-S,P=f-T,j=Math.hypot(_,M),N=Math.hypot(P,R);g=Math.min(1,Math.max(0,(R*j/N+S)/s)),U=Math.min(1,Math.max(0,(P*j/N+T)/o));let F=Math.hypot(U,g);g/=F,U/=F}let[y,v]=[s*g*Math.sign(d),o*U*Math.sign(l)];return Rt(A(d,l),A(y,v))},ZJ=(e,t,n=1e-4)=>qJ(e,t)<=n,KJ=(e,t)=>{let{center:n,angle:r,halfWidth:i,halfHeight:a}=t,s=Cl(Fe(e),wn(Fe(n),-1)),[o,c]=oe(gt(s),A(0,0),-r);return o/i*(o/i)+c/a*(c/a)<=1},g3=(e,t,n=0)=>{switch(t.type){case"polygon":return NV(e,t.data,n);case"ellipse":return ZJ(e,t.data,n);case"line":return ed(e,t.data,n);case"polyline":return FI(e,t.data,n);case"curve":return OI(e,t.data,n);case"polycurve":return QJ(e,t.data,n);default:throw Error(`shape ${t} is not implemented`)}},t2=(e,t)=>{switch(t.type){case"polygon":return ME(e,t.data);case"line":return!1;case"curve":return!1;case"ellipse":return KJ(e,t.data);case"polyline":{let n=qg(t.data.flat());return ME(e,n)}case"polycurve":return!1;default:throw Error(`shape ${t} is not implemented`)}},QJ=(e,t,n)=>t.some(r=>OI(e,r,n)),JJ=e=>{let[t,n,r,i]=e;return(a,s)=>Math.pow(1-a,3)*i[s]+3*a*Math.pow(1-a,2)*r[s]+3*Math.pow(a,2)*(1-a)*n[s]+t[s]*Math.pow(a,3)},eee=(e,t=10)=>{let n=JJ(e),r=[n(0,0),n(0,1)],i=[],a=0,s=1/t;for(let o=0;o<t;o++)if(a+=s,a<=1){let c=A(n(a,0),n(a,1));i.push(He(r,c)),r=c}return i},OI=(e,t,n)=>FI(e,eee(t),n),FI=(e,t,n=1e-4)=>t.some(r=>ed(e,r,n));function BI(e,t,n){return{center:e,halfWidth:t,halfHeight:n}}var tee=(e,t)=>{let{halfWidth:n,halfHeight:r,center:i}=t,a=n,s=r,o=Cl(Fe(e),wn(Fe(i),-1)),c=Math.abs(o[0]),d=Math.abs(o[1]),l=.707,h=.707;for(let U=0;U<3;U++){let y=a*l,v=s*h,x=(a*a-s*s)*l**3/a,w=(s*s-a*a)*h**3/s,C=y-x,S=v-w,T=c-x,M=d-w,_=Math.hypot(S,C),R=Math.hypot(M,T);l=Math.min(1,Math.max(0,(T*_/R+x)/a)),h=Math.min(1,Math.max(0,(M*_/R+w)/s));let P=Math.hypot(h,l);l/=P,h/=P}let[f,g]=[a*l*Math.sign(o[0]),s*h*Math.sign(o[1])];return Rt(gt(o),A(f,g))};function nee({center:e,halfWidth:t,halfHeight:n},[r,i]){let[a,s]=e,o=r[0]-a,c=r[1]-s,d=i[0]-a,l=i[1]-s,h=Math.pow(d-o,2)/Math.pow(t,2)+Math.pow(l-c,2)/Math.pow(n,2),f=2*(o*(d-o)/Math.pow(t,2)+c*(l-c)/Math.pow(n,2)),g=Math.pow(o,2)/Math.pow(t,2)+Math.pow(c,2)/Math.pow(n,2)-1,U=(-f+Math.sqrt(Math.pow(f,2)-4*h*g))/(2*h),y=(-f-Math.sqrt(Math.pow(f,2)-4*h*g))/(2*h),v=[A(o+U*(d-o)+a,c+U*(l-c)+s),A(o+y*(d-o)+a,c+y*(l-c)+s)].filter(x=>!isNaN(x[0])&&!isNaN(x[1]));return v.length===2&&La(v[0],v[1])?[v[0]]:v}function $I(e,t=0){let n=Ta(Math.min(e.width,e.height),e);if(n<=0){let h=l3(A(e.x-t,e.y-t),A(e.x+e.width+t,e.y+e.height+t)),f=He(A(h[0][0]+n,h[0][1]),A(h[1][0]-n,h[0][1])),g=He(A(h[1][0],h[0][1]+n),A(h[1][0],h[1][1]-n)),U=He(A(h[0][0]+n,h[1][1]),A(h[1][0]-n,h[1][1])),y=He(A(h[0][0],h[1][1]-n),A(h[0][0],h[0][1]+n));return[[f,g,U,y],[]]}let r=A(e.x+e.width/2,e.y+e.height/2),i=l3(A(e.x,e.y),A(e.x+e.width,e.y+e.height)),a=He(A(i[0][0]+n,i[0][1]),A(i[1][0]-n,i[0][1])),s=He(A(i[1][0],i[0][1]+n),A(i[1][0],i[1][1]-n)),o=He(A(i[0][0]+n,i[1][1]),A(i[1][0]-n,i[1][1])),c=He(A(i[0][0],i[1][1]-n),A(i[0][0],i[0][1]+n)),d=[wn(_r(Fe(A(i[0][0]-t,i[0][1]-t),r)),t),wn(_r(Fe(A(i[1][0]+t,i[0][1]-t),r)),t),wn(_r(Fe(A(i[1][0]+t,i[1][1]+t),r)),t),wn(_r(Fe(A(i[0][0]-t,i[1][1]+t),r)),t)],l=[so(gt(d[0],c[1]),gt(d[0],A(c[1][0]+2/3*(i[0][0]-c[1][0]),c[1][1]+2/3*(i[0][1]-c[1][1]))),gt(d[0],A(a[0][0]+2/3*(i[0][0]-a[0][0]),a[0][1]+2/3*(i[0][1]-a[0][1]))),gt(d[0],a[0])),so(gt(d[1],a[1]),gt(d[1],A(a[1][0]+2/3*(i[1][0]-a[1][0]),a[1][1]+2/3*(i[0][1]-a[1][1]))),gt(d[1],A(s[0][0]+2/3*(i[1][0]-s[0][0]),s[0][1]+2/3*(i[0][1]-s[0][1]))),gt(d[1],s[0])),so(gt(d[2],s[1]),gt(d[2],A(s[1][0]+2/3*(i[1][0]-s[1][0]),s[1][1]+2/3*(i[1][1]-s[1][1]))),gt(d[2],A(o[1][0]+2/3*(i[1][0]-o[1][0]),o[1][1]+2/3*(i[1][1]-o[1][1]))),gt(d[2],o[1])),so(gt(d[3],o[0]),gt(d[3],A(o[0][0]+2/3*(i[0][0]-o[0][0]),o[0][1]+2/3*(i[1][1]-o[0][1]))),gt(d[3],A(c[0][0]+2/3*(i[0][0]-c[0][0]),c[0][1]+2/3*(i[1][1]-c[0][1]))),gt(d[3],c[0]))];return[[He(l[0][3],l[1][0]),He(l[1][3],l[2][0]),He(l[2][3],l[3][0]),He(l[3][3],l[0][0])],l]}function zI(e,t=0){var C;let[n,r,i,a,s,o,c,d]=lA(e),l=Ta(Math.abs(n-c),e),h=Ta(Math.abs(a-r),e);if(((C=e.roundness)==null?void 0:C.type)==null){let[S,T,M,_]=[A(e.x+n,e.y+r-t),A(e.x+i+t,e.y+a),A(e.x+s,e.y+o+t),A(e.x+c-t,e.y+d)],R=He(A(S[0]+l,S[1]+h),A(T[0]-l,T[1]-h)),P=He(A(T[0]-l,T[1]+h),A(M[0]+l,M[1]-h)),j=He(A(M[0]-l,M[1]-h),A(_[0]+l,_[1]+h)),N=He(A(_[0]+l,_[1]-h),A(S[0]-l,S[1]+h));return[[R,P,j,N],[]]}let f=A(e.x+e.width/2,e.y+e.height/2),[g,U,y,v]=[A(e.x+n,e.y+r),A(e.x+i,e.y+a),A(e.x+s,e.y+o),A(e.x+c,e.y+d)],x=[wn(_r(Fe(U,f)),t),wn(_r(Fe(y,f)),t),wn(_r(Fe(v,f)),t),wn(_r(Fe(g,f)),t)],w=[so(gt(x[0],A(U[0]-l,U[1]-h)),gt(x[0],U),gt(x[0],U),gt(x[0],A(U[0]-l,U[1]+h))),so(gt(x[1],A(y[0]+l,y[1]-h)),gt(x[1],y),gt(x[1],y),gt(x[1],A(y[0]-l,y[1]-h))),so(gt(x[2],A(v[0]+l,v[1]+h)),gt(x[2],v),gt(x[2],v),gt(x[2],A(v[0]+l,v[1]-h))),so(gt(x[3],A(g[0]-l,g[1]+h)),gt(x[3],g),gt(x[3],g),gt(x[3],A(g[0]+l,g[1]+h)))];return[[He(w[0][3],w[1][0]),He(w[1][3],w[2][0]),He(w[2][3],w[3][0]),He(w[3][3],w[0][0])],w]}var U3=e=>{if(e.type==="arrow")return!1;let t=!Ea(e.backgroundColor)||Ki(e)||Hi(e)||ke(e);return e.type==="line"||e.type==="freedraw"?t&&Uo(e.points):t||Lt(e)},pu=({x:e,y:t,element:n,shape:r,threshold:i=10,frameNameBound:a=null})=>{let s=U3(n)&&t2(A(e,t),r)||g3(A(e,t),r,i);return!s&&a&&(s=t2(A(e,t),{type:"polygon",data:NI(a).data})),s},f7=(e,t,n,r,i=0)=>{let[a,s,o,c]=Da(n,r);return a-=i,s-=i,o+=i,c+=i,qM(A(a,s),A(e,t),A(o,c))},ree=(e,t)=>!pu(e)&&!HI(e.x,e.y,XI(e.element,t))&&f7(e.x,e.y,e.element,t),HI=(e,t,n)=>!!n&&t2(A(e,t),n),WI=(e,t,n=0)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return iee(e,t,n);case"diamond":return aee(e,t,n);case"ellipse":return see(e,t,n);default:throw new Error(`Unimplemented element type '${e.type}'`)}},iee=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),i=oe(t[0],r,-e.angle),a=oe(t[1],r,-e.angle),[s,o]=$I(e,n);return[...s.map(c=>qp(He(i,a),c)).filter(c=>c!=null).map(c=>oe(c,r,e.angle)),...o.flatMap(c=>ZM(c,He(i,a))).filter(c=>c!=null).map(c=>oe(c,r,e.angle))].filter((c,d,l)=>l.findIndex(h=>La(c,h))===d)},aee=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),i=oe(t[0],r,-e.angle),a=oe(t[1],r,-e.angle),[s,o]=zI(e,n);return[...s.map(c=>qp(He(i,a),c)).filter(c=>c!=null).map(c=>oe(c,r,e.angle)),...o.flatMap(c=>ZM(c,He(i,a))).filter(c=>c!=null).map(c=>oe(c,r,e.angle))].filter((c,d,l)=>l.findIndex(h=>La(c,h))===d)},see=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),i=oe(t[0],r,-e.angle),a=oe(t[1],r,-e.angle);return nee(BI(r,e.width/2+n,e.height/2+n),o3(i,a)).map(s=>oe(s,r,e.angle))},_t={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},q={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:gs?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SLASH:"/",A:"a",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},oee=new Map([[q.Z,_t.Z],[q.Y,_t.Y]]),lee=e=>/^[a-z]$/.test(e.toLowerCase()),b3=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=oee.get(t);return!!(n&&!lee(e.key)&&e.code===n)},Jf=e=>e===q.ARROW_LEFT||e===q.ARROW_RIGHT||e===q.ARROW_DOWN||e===q.ARROW_UP,Nb=e=>e.altKey,If=e=>e.shiftKey,yp=e=>e.shiftKey,p7=[{icon:MY,value:"selection",key:q.V,numericKey:q[1],fillable:!0},{icon:IY,value:"rectangle",key:q.R,numericKey:q[2],fillable:!0},{icon:AY,value:"diamond",key:q.D,numericKey:q[3],fillable:!0},{icon:LY,value:"ellipse",key:q.O,numericKey:q[4],fillable:!0},{icon:RY,value:"arrow",key:q.A,numericKey:q[5],fillable:!0},{icon:DY,value:"line",key:q.L,numericKey:q[6],fillable:!0},{icon:Zp,value:"freedraw",key:[q.P,q.X],numericKey:q[7],fillable:!1},{icon:pI,value:"text",key:q.T,numericKey:q[8],fillable:!1},{icon:PY,value:"image",key:null,numericKey:q[9],fillable:!1},{icon:NY,value:"eraser",key:q.E,numericKey:q[0],fillable:!1}],cee=e=>{var t;return((t=p7.find((n,r)=>n.numericKey!=null&&e===n.numericKey.toString()||n.key&&(typeof n.key=="string"?n.key===e:n.key.includes(e))))==null?void 0:t.value)||null},ro=(e,t)=>{var n;switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return NI(e);case"arrow":case"line":{let r=((n=gn.get(e))==null?void 0:n[0])??gn.generateElementShape(e,null)[0],[,,,,i,a]=it(e,t);return U3(e)?GJ(e,r,A(e.x,e.y),e.angle,A(i,a)):XJ(r,A(e.x,e.y),e.angle,A(i,a))}case"ellipse":return WJ(e);case"freedraw":{let[,,,,r,i]=it(e,t);return YJ(e,A(r,i),U3(e))}}},XI=(e,t)=>{let n=ct(e,t);return n?e.type==="arrow"?ro({...n,...Me.getBoundTextElementPosition(e,n,t)},t):ro(n,t):null},VI=(e,t)=>{let n=gn.generateElementShape(e,null);if(!n)return null;let r=Vl(n[0]),i=A(0,0),a=0,s=1/0,o=null;for(;a<r.length;){let{op:c,data:d}=r[a];if(c==="move"&&(Tr(AV(d),"The returned ops is not compatible with a point"),i=d),c==="bcurveTo"){let l=i,h=A(d[0],d[1]),f=A(d[2],d[3]),g=A(d[4],d[5]),U=Rt(g,t);U<s&&(s=U,o=[l,h,f,g]),i=g}a++}return o},YI=(e,t,n,r,i)=>{let a=(c,d)=>Math.pow(1-c,3)*r[d]+3*c*Math.pow(1-c,2)*n[d]+3*Math.pow(c,2)*(1-c)*t[d]+e[d]*Math.pow(c,3),s=a(i,0),o=a(i,1);return A(s,o)},dee=(e,t)=>{let n=VI(e,t);if(!n)return[];let r=[],i=1;for(;i>0;){let a=YI(n[0],n[1],n[2],n[3],i);r.push(A(a[0],a[1])),i-=.05}return r.length&&La(r.at(-1),t)&&r.push(A(t[0],t[1])),r},GI=(e,t)=>{let n=[];n[0]=0;let r=dee(e,t),i=0,a=0;for(;i<r.length-1;){let s=Rt(r[i],r[i+1]);a+=s,n.push(a),i++}return n},uee=(e,t)=>GI(e,t).at(-1),hee=(e,t,n)=>{let r=GI(e,t),i=r.length-1,a=r.at(-1),s=n*a,o=0,c=i,d=0;for(;o<c;)d=Math.floor(o+(c-o)/2),r[d]<s?o=d+1:c=d;return r[d]>s&&d--,r[d]===s?d/i:1-(d+(s-r[d])/(r[d+1]-r[d]))/i},as=(e,t)=>{let n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},r=A(n.midX,n.midY),[i,a]=oe(A(n.minX,n.minY),r,e.angle),[s,o]=oe(A(n.maxX,n.minY),r,e.angle),[c,d]=oe(A(n.maxX,n.maxY),r,e.angle),[l,h]=oe(A(n.minX,n.maxY),r,e.angle),f=[Math.min(i,s,c,l),Math.min(a,o,d,h),Math.max(i,s,c,l),Math.max(a,o,d,h)];if(t){let[g,U,y,v]=t;return[f[0]-v,f[1]-g,f[2]+U,f[3]+y]}return f},Yu=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],Ta=(e,t)=>{var n,r,i,a;if(((n=t.roundness)==null?void 0:n.type)===Bn.PROPORTIONAL_RADIUS||((r=t.roundness)==null?void 0:r.type)===Bn.LEGACY)return e*kb;if(((i=t.roundness)==null?void 0:i.type)===Bn.ADAPTIVE_RADIUS){let s=((a=t.roundness)==null?void 0:a.value)??xV,o=s/kb;return e<=o?e*kb:s}return 0},Uo=(e,t=1)=>{if(e.length>=3){let[n,r]=[e[0],e[e.length-1]];return Rt(n,r)<=ng/t}return!1},nr=10,fee=(e,t,n,r,i,a,s)=>{var j,N;let{width:o,height:c}=bo(e),d=n/o,l=r/c,h=(((j=e.crop)==null?void 0:j.x)??0)/d,f=(((N=e.crop)==null?void 0:N.y)??0)/l,g=oe(A(i,a),A(e.x+e.width/2,e.y+e.height/2),-e.angle);i=g[0],a=g[1];let U=e.width,y=e.height,v=e.crop??{x:0,y:0,width:n,height:r,naturalWidth:n,naturalHeight:r},x=v.height,w=v.width,C=e.scale[0]===-1,S=e.scale[1]===-1,T=a-e.y,M=i-e.x;t.includes("n")&&(y=mt(e.height-T,nr,S?c-f:e.height+f)),t.includes("s")&&(T=a-e.y-e.height,y=mt(e.height+T,nr,S?e.height+f:c-f)),t.includes("e")&&(M=i-e.x-e.width,U=mt(e.width+M,nr,C?e.width+h:o-h)),t.includes("w")&&(U=mt(e.width-M,nr,C?o-h:e.width+h));let _=F=>{F.height=y*l,F.width=U*d};_(v);let R=(F,B)=>{_(B),F.includes("n")&&(S||(B.y+=x-B.height)),F.includes("s")&&S&&(B.y+=x-B.height),F.includes("e")&&C&&(B.x+=w-B.width),F.includes("w")&&(C||(B.x+=w-B.width))};switch(t){case"n":{if(s){let F=h+e.width/2,B=o-h-e.width/2,G=Math.min(F,B)*2;U=mt(y*s,nr,G),y=U/s}R(t,v),s&&(v.x+=(w-v.width)/2);break}case"s":{if(s){let F=h+e.width/2,B=o-h-e.width/2,G=Math.min(F,B)*2;U=mt(y*s,nr,G),y=U/s}R(t,v),s&&(v.x+=(w-v.width)/2);break}case"w":{if(s){let F=f+e.height/2,B=c-f-e.height/2,G=Math.min(F,B)*2;y=mt(U/s,nr,G),U=y*s}R(t,v),s&&(v.y+=(x-v.height)/2);break}case"e":{if(s){let F=f+e.height/2,B=c-f-e.height/2,G=Math.min(F,B)*2;y=mt(U/s,nr,G),U=y*s}R(t,v),s&&(v.y+=(x-v.height)/2);break}case"ne":{if(s)if(M>-T){let F=S?c-f:f+e.height;y=mt(U/s,nr,F),U=y*s}else{let F=C?h+e.width:o-h;U=mt(y*s,nr,F),y=U/s}R(t,v);break}case"nw":{if(s)if(M<T){let F=S?c-f:f+e.height;y=mt(U/s,nr,F),U=y*s}else{let F=C?o-h:h+e.width;U=mt(y*s,nr,F),y=U/s}R(t,v);break}case"se":{if(s)if(M>T){let F=S?f+e.height:c-f;y=mt(U/s,nr,F),U=y*s}else{let F=C?h+e.width:o-h;U=mt(y*s,nr,F),y=U/s}R(t,v);break}case"sw":{if(s)if(-M>T){let F=S?f+e.height:c-f;y=mt(U/s,nr,F),U=y*s}else{let F=C?o-h:h+e.width;U=mt(y*s,nr,F),y=U/s}R(t,v);break}}let P=pee(e,t,U,y,!!s);return SE(v.width,v.naturalWidth)&&SE(v.height,v.naturalHeight)&&(v=null),{x:P[0],y:P[1],width:U,height:y,crop:v}},pee=(e,t,n,r,i)=>{let[a,s,o,c]=Al(e,e.width,e.height,!0),d=A(a,s),l=A(o,c),h=I1(d,l),[f,g,U,y]=Al(e,n,r,!0),v=U-f,x=y-g,w=[...d];if(["n","w","nw"].includes(t)&&(w=[l[0]-Math.abs(v),l[1]-Math.abs(x)]),t==="ne"){let R=[d[0],l[1]];w=[R[0],R[1]-Math.abs(x)]}if(t==="sw"){let R=[l[0],d[1]];w=[R[0]-Math.abs(v),R[1]]}i&&(["s","n"].includes(t)&&(w[0]=h[0]-v/2),["e","w"].includes(t)&&(w[1]=h[1]-x/2));let C=e.angle,S=oe(w,h,C),T=[w[0]+Math.abs(v)/2,w[1]+Math.abs(x)/2],M=oe(T,h,C);w=oe(S,M,-C);let _=[...w];return _[0]+=e.x-f,_[1]+=e.y-g,_},mee=(e,t)=>{if(e.crop){let{width:n,height:r}=bo(e),[i,a,s,o,c,d]=it(e,t),l=Fe(oe(A(i,a),A(c,d),e.angle)),h=Fe(oe(A(s,a),A(c,d),e.angle)),f=_r(Yg(h,l)),g=Fe(oe(A(i,o),A(c,d),e.angle)),U=Yg(g,l),y=_r(U),{cropX:v,cropY:x}=gee(e.crop,e.scale),w=Cl(Cl(l,wn(f,-v*n/e.crop.naturalWidth)),wn(y,-x*r/e.crop.naturalHeight)),C=gt(Cl(Cl(w,wn(f,n/2)),wn(y,r/2))),S=oe(gt(w),C,-e.angle);return{...e,x:S[0],y:S[1],width:n,height:r,crop:null}}return e},bo=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),n=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:n}}return{width:e.width,height:e.height}},gee=(e,t)=>{let n=e.x,r=e.y,i=t[0]===-1,a=t[1]===-1;return i&&(n=e.naturalWidth-Math.abs(n)-e.width),a&&(r=e.naturalHeight-Math.abs(r)-e.height),{cropX:n,cropY:r}},Uee=(e,t=!1)=>{let n=e.crop;if(!n)return null;let r=e.scale[0]===-1,i=e.scale[1]===-1,a=n.x,s=n.y;if(r&&(a=n.naturalWidth-n.width-n.x),i&&(s=n.naturalHeight-n.height-n.y),t)return{x:a,y:s};let{width:o,height:c}=bo(e);return{x:a/(n.naturalWidth/o),y:s/(n.naturalHeight/c)}},qI="invert(100%) hue-rotate(180deg) saturate(1.25)",bee=Us(),ZI=(e,t)=>zi(e)&&!t.imageCache.has(e.fileId),KI=(e,t,n)=>{var r;return n.theme===yt.DARK&&zi(e)&&!ZI(e,t)&&((r=t.imageCache.get(e.fileId))==null?void 0:r.mimeType)!==Be.svg},mU=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;default:return 20}},QI=(e,t,n,r,i=1)=>{let a=((t==null?void 0:t.opacity)??100)*e.opacity/1e4*i;return(n.has(e.id)||r&&r.some(s=>s.id===e.id)||t&&n.has(t.id))&&(a*=vV/100),a},yee=(e,t,n)=>{let r=mU(e),[i,a,s,o]=it(e,t),c=rt(e)||Zi(e)?Er(i,s):e.width,d=rt(e)||Zi(e)?Er(a,o):e.height,l=c*window.devicePixelRatio+r*2,h=d*window.devicePixelRatio+r*2,f=n.value;return(l*f>32767||h*f>32767)&&(f=Math.min(32767/l,32767/h)),l*h*f*f>16777216&&(f=Math.sqrt(16777216/(l*h))),l=Math.floor(l*f),h=Math.floor(h*f),{width:l,height:h,scale:f}},JI=(e,t,n,r,i)=>{var x,w;let a=document.createElement("canvas"),s=a.getContext("2d"),o=mU(e),{width:c,height:d,scale:l}=yee(e,t,n);if(!c||!d)return null;a.width=c,a.height=d;let h=-100,f=0;if(rt(e)||Zi(e)){let[C,S]=it(e,t);h=e.x>C?Er(e.x,C)*window.devicePixelRatio*l:0,f=e.y>S?Er(e.y,S)*window.devicePixelRatio*l:0,s.translate(h,f)}s.save(),s.translate(o*l,o*l),s.scale(window.devicePixelRatio*l,window.devicePixelRatio*l);let g=Wl.canvas(a);KI(e,r,i)&&(s.filter=qI),lg(e,g,s,r),s.restore();let U=ct(e,t),y=document.createElement("canvas"),v=y.getContext("2d");if(ht(e)&&U){let[C,S,T,M]=it(e,t),_=Math.max(Er(C,T),Er(S,M));y.width=_*window.devicePixelRatio*l+o*l*10,y.height=_*window.devicePixelRatio*l+o*l*10,v.translate(y.width/2,y.height/2),v.rotate(e.angle),v.drawImage(a,-a.width/2,-a.height/2,a.width,a.height);let[,,,,R,P]=it(U,t);v.rotate(-e.angle);let j=(y.width-a.width)/2,N=(y.height-a.height)/2,F=y.width/2-(R-C)*window.devicePixelRatio*l-j-o*l,B=y.height/2-(P-S)*window.devicePixelRatio*l-N-o*l;v.translate(-F,-B),v.clearRect(-(U.width/2+Fn)*window.devicePixelRatio*l,-(U.height/2+Fn)*window.devicePixelRatio*l,(U.width+Fn*2)*window.devicePixelRatio*l,(U.height+Fn*2)*window.devicePixelRatio*l)}return{element:e,canvas:a,theme:i.theme,scale:l,zoomValue:n.value,canvasOffsetX:h,canvasOffsetY:f,boundTextElementVersion:((x=ct(e,t))==null?void 0:x.version)||null,containingFrameOpacity:((w=di(e,t))==null?void 0:w.opacity)||100,boundTextCanvas:y,angle:e.angle,imageCrop:Lt(e)?e.crop:null}},vee=14,eA=document.createElement("img");eA.src=`data:${Be.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var tA=document.createElement("img");tA.src=`data:${Be.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var xee=(e,t)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);let n=Math.min(e.width,e.height),r=Math.min(n,Math.min(n*.4,100));t.drawImage(e.status==="error"?tA:eA,e.width/2-r/2,e.height/2-r/2,r,r)},lg=(e,t,n,r,i)=>{var a;switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{n.lineJoin="round",n.lineCap="round",t.draw(gn.get(e));break}case"arrow":case"line":{n.lineJoin="round",n.lineCap="round",gn.get(e).forEach(s=>{t.draw(s)});break}case"freedraw":{n.save(),n.fillStyle=e.strokeColor;let s=Cee(e),o=gn.get(e);o&&t.draw(o),n.fillStyle=e.strokeColor,n.fill(s),n.restore();break}case"image":{let s=zi(e)?(a=r.imageCache.get(e.fileId))==null?void 0:a.image:void 0;if(s!=null&&!(s instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,Ta(Math.min(e.width,e.height),e)),n.clip());let{x:o,y:c,width:d,height:l}=e.crop?e.crop:{x:0,y:0,width:s.naturalWidth,height:s.naturalHeight};n.drawImage(s,o,c,d,l,0,0,e.width,e.height)}else xee(e,n);break}default:if(ke(e)){let s=JM(e.text),o=s&&!n.canvas.isConnected;o&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",s?"rtl":"ltr"),n.save(),n.font=$t(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;let c=e.text.replace(/\r\n?/g,`
|
|
55
|
+
`).split(`
|
|
56
|
+
`),d=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,l=L1(e.fontSize,e.lineHeight),h=PI(e.fontFamily,e.fontSize,l);for(let f=0;f<c.length;f++)n.fillText(c[f],d,f*l+h);n.restore(),o&&n.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},y3=new WeakMap,nC=(e,t,n,r)=>{var h;let i=n?r.zoom:bee.zoom,a=y3.get(e),s=a&&a.zoomValue!==i.value&&!(r!=null&&r.shouldCacheIgnoreZoom),o=ct(e,t),c=(o==null?void 0:o.version)||null,d=Lt(e)?e.crop:null,l=((h=di(e,t))==null?void 0:h.opacity)||100;if(!a||s||a.theme!==r.theme||a.boundTextElementVersion!==c||a.imageCrop!==d||a.containingFrameOpacity!==l||ht(e)&&o&&e.angle!==a.angle){let f=JI(e,t,i,n,r);return f?(y3.set(e,f),f):null}return a},Ob=(e,t,n,r,i)=>{let a=e.element,s=mU(a),o=e.scale,[c,d,l,h]=it(a,i),f=((c+l)/2+r.scrollX)*window.devicePixelRatio,g=((d+h)/2+r.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let U=ct(a,i);if(ht(a)&&U){let y=(e.boundTextCanvas.width-e.canvas.width)/2,v=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(f,g),t.drawImage(e.boundTextCanvas,-(l-c)/2*window.devicePixelRatio-y/o-s,-(h-d)/2*window.devicePixelRatio-v/o-s,e.boundTextCanvas.width/o,e.boundTextCanvas.height/o)}else t.translate(f,g),t.rotate(a.angle),"scale"in e.element&&!ZI(a,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-f,-g),t.drawImage(e.canvas,(c+r.scrollX)*window.devicePixelRatio-s*e.scale/e.scale,(d+r.scrollY)*window.devicePixelRatio-s*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),dt.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX;t.restore()},wee=(e,t,n,r)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let i=.5/n.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(i,i,e.width,e.height),t.restore()},Ec=(e,t,n,r,i,a,s)=>{var c;let o=((c=s.openDialog)==null?void 0:c.name)==="elementLinkSelector"&&!s.selectedElementIds[e.id]&&!s.hoveredElementIds[e.id];switch(i.globalAlpha=QI(e,di(e,t),a.elementsPendingErasure,a.pendingFlowchartNodes,o?YM:1),e.type){case"magicframe":case"frame":{s.frameRendering.enabled&&s.frameRendering.outline&&(i.save(),i.translate(e.x+s.scrollX,e.y+s.scrollY),i.fillStyle="rgba(0, 0, 200, 0.04)",i.lineWidth=pn.strokeWidth/s.zoom.value,i.strokeStyle=pn.strokeColor,ag(e)&&(i.strokeStyle=s.theme===yt.LIGHT?"#7affd7":"#1d8264"),i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,pn.radius/s.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break}case"freedraw":{if(gn.generateElementShape(e,null),a.isExporting){let[d,l,h,f]=it(e,t),g=(d+h)/2+s.scrollX,U=(l+f)/2+s.scrollY,y=(h-d)/2-(e.x-d),v=(f-l)/2-(e.y-l);i.save(),i.translate(g,U),i.rotate(e.angle),i.translate(-y,-v),lg(e,r,i,a),i.restore()}else{let d=nC(e,n,a,s);if(!d)return;Ob(d,i,a,s,n)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(gn.generateElementShape(e,a),a.isExporting){let[d,l,h,f]=it(e,t),g=(d+h)/2+s.scrollX,U=(l+f)/2+s.scrollY,y=(h-d)/2-(e.x-d),v=(f-l)/2-(e.y-l);if(ke(e)){let w=lr(e,t);if(ht(w)){let C=Me.getBoundTextElementPosition(w,e,t);y=(h-d)/2-(C.x-d),v=(f-l)/2-(C.y-l)}}i.save(),i.translate(g,U),KI(e,a,s)&&(i.filter="none");let x=ct(e,t);if(ht(e)&&x){let w=document.createElement("canvas"),C=w.getContext("2d"),S=Math.max(Er(d,h),Er(l,f)),T=mU(e);w.width=S*s.exportScale+T*10*s.exportScale,w.height=S*s.exportScale+T*10*s.exportScale,C.translate(w.width/2,w.height/2),C.scale(s.exportScale,s.exportScale),y=e.width/2-(e.x-d),v=e.height/2-(e.y-l),C.rotate(e.angle);let M=Wl.canvas(w);C.translate(-y,-v),lg(e,M,C,a),C.translate(y,v),C.rotate(-e.angle);let[,,,,_,R]=it(x,t),P=(d+h)/2-_,j=(l+f)/2-R;C.translate(-P,-j),C.clearRect(-x.width/2,-x.height/2,x.width,x.height),i.scale(1/s.exportScale,1/s.exportScale),i.drawImage(w,-w.width/2,-w.height/2,w.width,w.height)}else i.rotate(e.angle),e.type==="image"&&i.scale(e.scale[0],e.scale[1]),i.translate(-y,-v),lg(e,r,i,a);i.restore()}else{let d=nC(e,n,a,s);if(!d)return;let l=i.imageSmoothingEnabled;if(!(s!=null&&s.shouldCacheIgnoreZoom)&&(!e.angle||TV(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===s.croppingElementId&&Lt(d.element)&&d.element.crop!==null){i.save(),i.globalAlpha=.1;let h=JI(mee(d.element,t),n,s.zoom,a,s);h&&Ob(h,i,a,s,n),i.restore()}Ob(d,i,a,s,n),i.imageSmoothingEnabled=l}break}default:throw new Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1},nA=new WeakMap([]);function Eee(e){let t=rA(e),n=new Path2D(t);return nA.set(e,n),n}function Cee(e){return nA.get(e)}function rA(e){let t=e.simulatePressure?e.points:e.points.length?e.points.map(([r,i],a)=>[r,i,e.pressures[a]]):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:r=>Math.sin(r*Math.PI/2),last:!!e.lastCommittedPoint};return _ee(MX(t,n))}function rC(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var See=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;function _ee(e){if(!e.length)return"";let t=e.length-1;return e.reduce((n,r,i,a)=>(i===t?n.push(r,rC(r,a[0]),"L",a[0],"Z"):n.push(r,rC(r,a[i+1])),n),["M",e[0],"Q"]).join(" ").replace(See,"$1")}var Gu=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",v3=e=>e!=="image"&&e!=="frame"&&e!=="magicframe",iC=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",aC=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",x3=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",sC=e=>e==="arrow",n2=e=>e==="arrow",xn=[1,0],sr=[0,1],ri=[-1,0],ii=[0,-1],xm=(e,t)=>{let n=M1(Math.atan2(t[1]-e[1],t[0]-e[0]));return n>=315||n<45?ii:n>=45&&n<135?xn:n>=135&&n<225?sr:ri},sd=e=>{let[t,n]=e,r=Math.abs(t),i=Math.abs(n);return t>i?xn:t<=-i?ri:n>r?sr:ii},Kp=(e,t)=>sd(Fe(e,t)),io=(e,t)=>oo(Kp(e,t)),En=(e,t)=>e[0]===t[0]&&e[1]===t[1],oo=e=>En(e,xn)||En(e,ri),iA=(e,t,n)=>{let r=U7(t);if(e.type==="diamond"){if(n[0]<e.x)return ri;if(n[1]<e.y)return ii;if(n[0]>e.x+e.width)return xn;if(n[1]>e.y+e.height)return sr;let c=oe(Qs(A(e.x+e.width/2,e.y),r,2),r,e.angle),d=oe(Qs(A(e.x+e.width,e.y+e.height/2),r,2),r,e.angle),l=oe(Qs(A(e.x+e.width/2,e.y+e.height),r,2),r,e.angle),h=oe(Qs(A(e.x,e.y+e.height/2),r,2),r,e.angle);return tu([c,d,r],n)?xm(c,d):tu([d,l,r],n)?xm(d,l):tu([l,h,r],n)?xm(l,h):xm(h,c)}let i=Qs(A(t[0],t[1]),r,2),a=Qs(A(t[2],t[1]),r,2),s=Qs(A(t[0],t[3]),r,2),o=Qs(A(t[2],t[3]),r,2);return tu([i,a,r],n)?ii:tu([a,o,r],n)?xn:tu([o,s,r],n)?sr:ri},aA=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1],kee=e=>[8,8+e],sA=e=>[1.5,6+e];function Tee(e){let t=e.roughness,n=Math.max(e.width,e.height),r=Math.min(e.width,e.height);return r>=20&&n>=50||r>=15&&e.roundness&&x3(e.type)||rt(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var Ui=(e,t=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?kee(e.strokeWidth):e.strokeStyle==="dotted"?sA(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:Tee(e),stroke:e.strokeColor,preserveVertices:t||e.roughness<WM.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=Ea(e.backgroundColor)?void 0:e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return Uo(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},oC=(e,t,n)=>Hi(e)&&(t||ti(e)&&(n==null?void 0:n.get(e.id))!==!0)&&Ea(e.backgroundColor)&&Ea(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:Ul(e)?{...e,strokeColor:Ea(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Ea(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,lC=(e,t,n,r,i,a,s)=>{let o=hC(e,t,n,r);if(o===null)return[];let c=(d,l)=>{if(d===null)return[];let[,,h,f,g,U]=d;return[i.line(h,f,g,U,l)]};switch(r){case"dot":case"circle":case"circle_outline":{let[d,l,h]=o;return delete a.strokeLineDash,[i.circle(d,l,h,{...a,fill:r==="circle_outline"?s:e.strokeColor,fillStyle:"solid",stroke:e.strokeColor,roughness:Math.min(.5,a.roughness||0)})]}case"triangle":case"triangle_outline":{let[d,l,h,f,g,U]=o;return delete a.strokeLineDash,[i.polygon([[d,l],[h,f],[g,U],[d,l]],{...a,fill:r==="triangle_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"diamond":case"diamond_outline":{let[d,l,h,f,g,U,y,v]=o;return delete a.strokeLineDash,[i.polygon([[d,l],[h,f],[g,U],[y,v],[d,l]],{...a,fill:r==="diamond_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"crowfoot_one":return c(o,a);case"bar":case"arrow":case"crowfoot_many":case"crowfoot_one_or_many":default:{let[d,l,h,f,g,U]=o;if(e.strokeStyle==="dotted"){let y=sA(e.strokeWidth-1);a.strokeLineDash=[y[0],y[1]-1]}else delete a.strokeLineDash;return a.roughness=Math.min(1,a.roughness||0),[i.line(h,f,d,l,a),i.line(g,U,d,l,a),...r==="crowfoot_one_or_many"?c(hC(e,t,n,"crowfoot_one"),a):[]]}}},Mee=(e,t,{isExporting:n,canvasBackgroundColor:r,embedsValidationStatus:i})=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":{let a;if(e.roundness){let s=e.width,o=e.height,c=Ta(Math.min(s,o),e);a=t.path(`M ${c} 0 L ${s-c} 0 Q ${s} 0, ${s} ${c} L ${s} ${o-c} Q ${s} ${o}, ${s-c} ${o} L ${c} ${o} Q 0 ${o}, 0 ${o-c} L 0 ${c} Q 0 0, ${c} 0`,Ui(oC(e,n,i),!0))}else a=t.rectangle(0,0,e.width,e.height,Ui(oC(e,n,i),!1));return a}case"diamond":{let a,[s,o,c,d,l,h,f,g]=lA(e);if(e.roundness){let U=Ta(Math.abs(s-f),e),y=Ta(Math.abs(d-o),e);a=t.path(`M ${s+U} ${o+y} L ${c-U} ${d-y}
|
|
57
|
+
C ${c} ${d}, ${c} ${d}, ${c-U} ${d+y}
|
|
58
|
+
L ${l+U} ${h-y}
|
|
59
|
+
C ${l} ${h}, ${l} ${h}, ${l-U} ${h-y}
|
|
60
|
+
L ${f+U} ${g+y}
|
|
61
|
+
C ${f} ${g}, ${f} ${g}, ${f+U} ${g-y}
|
|
62
|
+
L ${s-U} ${o+y}
|
|
63
|
+
C ${s} ${o}, ${s} ${o}, ${s+U} ${o+y}`,Ui(e,!0))}else a=t.polygon([[s,o],[c,d],[l,h],[f,g]],Ui(e));return a}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,Ui(e));case"line":case"arrow":{let a,s=Ui(e),o=e.points.length?e.points:[A(0,0)];if(Ie(e)?o.every(c=>Math.abs(c[0])<=1e6&&Math.abs(c[1])<=1e6)?a=[t.path(Iee(o,16),Ui(e,!0))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(o)),a=[]):e.roundness?a=[t.curve(o,s)]:s.fill?a=[t.polygon(o,s)]:a=[t.linearPath(o,s)],e.type==="arrow"){let{startArrowhead:c=null,endArrowhead:d="arrow"}=e;if(c!==null){let l=lC(e,a,"start",c,t,s,r);a.push(...l)}if(d!==null){let l=lC(e,a,"end",d,t,s,r);a.push(...l)}}return a}case"freedraw":{let a;if(Eee(e),Uo(e.points)){let s=RX(e.points,.75);a=t.curve(s,{...Ui(e),stroke:"none"})}else a=null;return a}case"frame":case"magicframe":case"text":case"image":return null;default:return td(e,`generateElementShape(): Unimplemented type ${e==null?void 0:e.type}`),null}},Iee=(e,t)=>{let n=[];for(let i=1;i<e.length-1;i+=1){let a=e[i-1],s=e[i+1],o=e[i],c=io(o,a),d=io(s,o),l=Math.min(t,Rt(e[i],s)/2,Rt(e[i],a)/2);c?a[0]<o[0]?n.push([e[i][0]-l,e[i][1]]):n.push([e[i][0]+l,e[i][1]]):a[1]<o[1]?n.push([e[i][0],e[i][1]-l]):n.push([e[i][0],e[i][1]+l]),n.push(e[i]),d?s[0]<o[0]?n.push([e[i][0]-l,e[i][1]]):n.push([e[i][0]+l,e[i][1]]):s[1]<o[1]?n.push([e[i][0],e[i][1]-l]):n.push([e[i][0],e[i][1]+l])}let r=[`M ${e[0][0]} ${e[0][1]}`];for(let i=0;i<n.length;i+=3)r.push(`L ${n[i][0]} ${n[i][1]}`),r.push(`Q ${n[i+1][0]} ${n[i+1][1]}, ${n[i+2][0]} ${n[i+2][1]}`);return r.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),r.join(" ")},qu=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},r2=(e,t,n,r)=>{let i=n.map(f=>f[e]),a=Math.max(...i),s=Math.min(...i),o=a-s,c=o===0?1:t/o,d=1/0,l=n.map(f=>{let g=f[e]*c,U=[...f];return U[e]=g,g<d&&(d=g),U});if(!r||l.length===2)return l;let h=s-d;return l.map(f=>f.map((g,U)=>U===e?g+h:g))},oA=class cg{static getBounds(t,n){let r=cg.boundsCache.get(t);if(r!=null&&r.version&&r.version===t.version&&!tn(t))return r.bounds;let i=cg.calculateBounds(t,n);return cg.boundsCache.set(t,{version:t.version,bounds:i}),i}static calculateBounds(t,n){let r,[i,a,s,o,c,d]=it(t,n);if(Zi(t)){let[l,h,f,g]=m7(t.points.map(([U,y])=>oe(A(U,y),A(c-t.x,d-t.y),t.angle)));return[l+t.x,h+t.y,f+t.x,g+t.y]}else if(rt(t))r=Nee(t,c,d,n);else if(t.type==="diamond"){let[l,h]=oe(A(c,a),A(c,d),t.angle),[f,g]=oe(A(c,o),A(c,d),t.angle),[U,y]=oe(A(i,d),A(c,d),t.angle),[v,x]=oe(A(s,d),A(c,d),t.angle),w=Math.min(l,f,U,v),C=Math.min(h,g,y,x),S=Math.max(l,f,U,v),T=Math.max(h,g,y,x);r=[w,C,S,T]}else if(t.type==="ellipse"){let l=(s-i)/2,h=(o-a)/2,f=Math.cos(t.angle),g=Math.sin(t.angle),U=Math.hypot(l*f,h*g),y=Math.hypot(h*f,l*g);r=[c-U,d-y,c+U,d+y]}else{let[l,h]=oe(A(i,a),A(c,d),t.angle),[f,g]=oe(A(i,o),A(c,d),t.angle),[U,y]=oe(A(s,o),A(c,d),t.angle),[v,x]=oe(A(s,a),A(c,d),t.angle),w=Math.min(l,f,U,v),C=Math.min(h,g,y,x),S=Math.max(l,f,U,v),T=Math.max(h,g,y,x);r=[w,C,S,T]}return r}};z(oA,"boundsCache",new WeakMap);var Aee=oA,it=(e,t,n=!1)=>{if(Zi(e))return Ree(e);if(rt(e))return Me.getElementAbsoluteCoords(e,t,n);if(ke(e)){let r=t?lr(e,t):null;if(ht(r)){let{x:i,y:a}=Me.getBoundTextElementPosition(r,e,t);return[i,a,i+e.width,a+e.height,i+e.width/2,a+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},cC=(e,t)=>{let[n,r,i,a,s,o]=it(e,t),c=A(s,o);if(rt(e)||Zi(e)){let x=[],w=0;for(;w<e.points.length-1;)x.push(He(oe(A(e.points[w][0]+e.x,e.points[w][1]+e.y),c,e.angle),oe(A(e.points[w+1][0]+e.x,e.points[w+1][1]+e.y),c,e.angle))),w++;return x}let[d,l,h,f,g,U,y,v]=[[n,r],[i,r],[n,a],[i,a],[s,r],[s,a],[n,o],[i,o]].map(x=>oe(x,c,e.angle));return e.type==="diamond"?[He(g,y),He(g,v),He(U,y),He(U,v)]:e.type==="ellipse"?[He(g,y),He(g,v),He(U,y),He(U,v),He(g,y),He(g,v),He(U,y),He(U,v)]:[He(d,l),He(h,f),He(d,h),He(l,f),He(d,v),He(h,v),He(l,y),He(f,y)]},lA=e=>{let t=Math.floor(e.width/2)+1,n=0,r=e.width,i=Math.floor(e.height/2)+1,a=t,s=e.height;return[t,n,r,i,a,s,0,i]},dC=(e,t,n,r,i)=>{let a=1-e;return Math.pow(a,3)*t+3*Math.pow(a,2)*e*n+3*a*Math.pow(e,2)*r+Math.pow(e,3)*i},uC=(e,t,n,r)=>{let i=t-e,a=n-t,s=r-n,o=3*i-6*a+3*s,c=6*a-6*i,d=3*i,l=c*c-4*o*d;if(!(l>=0))return!1;let h=null,f=null,g=1/0,U=1/0;return o===0?g=U=-d/c:(g=(-c+Math.sqrt(l))/(2*o),U=(-c-Math.sqrt(l))/(2*o)),g>=0&&g<=1&&(h=dC(g,e,t,n,r)),U>=0&&U<=1&&(f=dC(U,e,t,n,r)),[h,f]},Lee=(e,t,n,r)=>{let i=uC(e[0],t[0],n[0],r[0]),a=uC(e[1],t[1],n[1],r[1]),s=Math.min(e[0],r[0]),o=Math.max(e[0],r[0]);if(i){let l=i.filter(h=>h!==null);s=Math.min(s,...l),o=Math.max(o,...l)}let c=Math.min(e[1],r[1]),d=Math.max(e[1],r[1]);if(a){let l=a.filter(h=>h!==null);c=Math.min(c,...l),d=Math.max(d,...l)}return[s,c,o,d]},gU=(e,t)=>{let n=A(0,0),{minX:r,minY:i,maxX:a,maxY:s}=e.reduce((o,{op:c,data:d})=>{if(c==="move"){let l=Q8(d);Tr(l!=null,"Op data is not a point"),n=l}else if(c==="bcurveTo"){let l=A(d[0],d[1]),h=A(d[2],d[3]),f=A(d[4],d[5]),g=t?t(l):l,U=t?t(h):h,y=t?t(f):f,v=t?t(n):n;n=f;let[x,w,C,S]=Lee(v,g,U,y);o.minX=Math.min(o.minX,x),o.minY=Math.min(o.minY,w),o.maxX=Math.max(o.maxX,C),o.maxY=Math.max(o.maxY,S)}return o},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,a,s]},m7=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,s]of e)t=Math.min(t,a),n=Math.min(n,s),r=Math.max(r,a),i=Math.max(i,s);return[t,n,r,i]},Ree=e=>{let[t,n,r,i]=m7(e.points),a=t+e.x,s=n+e.y,o=r+e.x,c=i+e.y;return[a,s,o,c,(a+o)/2,(s+c)/2]},Dee=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"crowfoot_many":case"crowfoot_one":case"crowfoot_one_or_many":return 20;default:return 15}},jee=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},hC=(e,t,n,r)=>{if(t.length<1)return null;let i=Vl(t[0]);if(i.length<1)return null;let a=n==="start"?1:i.length-1,s=i[a].data;Tr(s.length===6,"Op data length is not 6");let o=A(s[4],s[5]),c=A(s[2],s[3]),d=A(s[0],s[1]),l=i[a-1],h=A(0,0);if(l.op==="move"){let G=Q8(l.data);Tr(G!=null,"Op data is not a point"),h=G}else l.op==="bcurveTo"&&(h=A(l.data[4],l.data[5]));let f=(G,W)=>Math.pow(1-G,3)*o[W]+3*G*Math.pow(1-G,2)*c[W]+3*Math.pow(G,2)*(1-G)*d[W]+h[W]*Math.pow(G,3),[g,U]=n==="start"?h:o,[y,v]=[f(.3,0),f(.3,1)],x=Math.hypot(g-y,U-v),w=(g-y)/x,C=(U-v)/x,S=Dee(r),T=0;{let[G,W]=n==="end"?e.points[e.points.length-1]:e.points[0],[X,$]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];T=Math.hypot(G-X,W-$)}let M=Math.min(S,T*(r==="diamond"||r==="diamond_outline"?.25:.5)),_=g-w*M,R=U-C*M;if(r==="dot"||r==="circle"||r==="circle_outline"){let G=Math.hypot(R-U,_-g)+e.strokeWidth-2;return[g,U,G]}let P=jee(r);if(r==="crowfoot_many"||r==="crowfoot_one_or_many"){let[G,W]=oe(A(g,U),A(_,R),Bc(-P)),[X,$]=oe(A(g,U),A(_,R),Bc(P));return[_,R,G,W,X,$]}let[j,N]=oe(A(_,R),A(g,U),-P*Math.PI/180),[F,B]=oe(A(_,R),A(g,U),Bc(P));if(r==="diamond"||r==="diamond_outline"){let G,W;if(n==="start"){let[X,$]=e.points.length>1?e.points[1]:[0,0];[G,W]=oe(A(g+M*2,U),A(g,U),Math.atan2($-U,X-g))}else{let[X,$]=e.points.length>1?e.points[e.points.length-2]:[0,0];[G,W]=oe(A(g-M*2,U),A(g,U),Math.atan2(U-$,g-X))}return[g,U,j,N,G,W,F,B]}return[g,U,j,N,F,B]},Pee=e=>{let t=Wl.generator(),n=Ui(e),r=e.roundness?"curve":n.fill?"polygon":"linearPath";return t[r](e.points,n)},Nee=(e,t,n,r)=>{var d;let i=ct(e,r);if(e.points.length<2){let[l,h]=e.points[0],[f,g]=oe(A(e.x+l,e.y+h),A(t,n),e.angle),U=[f,g,f,g];if(i){let y=Me.getMinMaxXYWithBoundText(e,r,[f,g,f,g],i);U=[y[0],y[1],y[2],y[3]]}return U}let a=((d=gn.get(e))==null?void 0:d[0])??Pee(e),s=Vl(a),o=gU(s,([l,h])=>oe(A(e.x+l,e.y+h),A(t,n),e.angle)),c=[o[0],o[1],o[2],o[3]];if(i){let l=Me.getMinMaxXYWithBoundText(e,r,c,i);c=[l[0],l[1],l[2],l[3]]}return c},Da=(e,t)=>Aee.getBounds(e,t),Nt=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=-1/0,i=1/0,a=-1/0,s=t||Qe(e);return e.forEach(o=>{let[c,d,l,h]=Da(o,s);n=Math.min(n,c),i=Math.min(i,d),r=Math.max(r,l),a=Math.max(a,h)}),[n,i,r,a]},g7=(e,t)=>{let[n,r,i,a]=Nt(e);return[n+t.x,r+t.y,i+t.x,a+t.y]},Al=(e,t,n,r)=>{if(!(rt(e)||Zi(e)))return[e.x,e.y,e.x+t,e.y+n];let i=r2(0,t,r2(1,n,e.points,r),r),a;if(Zi(e))a=m7(i);else{let l=Wl.generator(),h=e.roundness?l.curve(i,Ui(e)):l.linearPath(i,Ui(e)),f=Vl(h);a=gU(f)}let[s,o,c,d]=a;return[s+e.x,o+e.y,c+e.x,d+e.y]},fC=(e,t)=>{let n=Wl.generator(),r=e.roundness==null?n.linearPath(t,Ui(e)):n.curve(t,Ui(e)),i=Vl(r),[a,s,o,c]=gU(i);return[a+e.x,s+e.y,o+e.x,c+e.y]},Oee=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0],i=Qe(e);return e.forEach(a=>{let[s,o,c,d]=Da(a,i),l=Rt(A((s+c)/2,(o+d)/2),A(t.x,t.y));l<n&&(n=l,r=a)}),Da(r,i)},Ma=e=>{let[t,n,r,i]=Nt(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},Fee=({scrollX:e,scrollY:t,width:n,height:r,zoom:i})=>[-e,-t,-e+n/i.value,-t+r/i.value],U7=e=>A(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),Bee=(e,t)=>{if(e==null||t==null)return!1;let[n,r,i,a]=e,[s,o,c,d]=t;return n<c&&i>s&&r<d&&a>o},UU=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return $ee(e,t);case"diamond":return zee(e,t);case"ellipse":return Hee(e,t)}},$ee=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=oe(t,n,-e.angle),[i,a]=$I(e);return Math.min(...i.map(s=>J8(r,s)),...a.map(s=>KM(s,r)).filter(s=>s!==null))},zee=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=oe(t,n,-e.angle),[i,a]=zI(e);return Math.min(...i.map(s=>J8(r,s)),...a.map(s=>KM(s,r)).filter(s=>s!==null))},Hee=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2);return tee(oe(t,n,-e.angle),BI(n,e.width/2,e.height/2))},Wee=e=>!e[q.CTRL_OR_CMD],jc=e=>e.isBindingEnabled,Yt=5,b7=10,y7=4,Xee=(e,t)=>{let n=[];return t.forEach(r=>{let i=e.getNonDeletedElement(r);i!=null&&n.push(i)}),n},bU=(e,t,n,r,i)=>{let a=new Set,s=new Set;pC(e,t,n,"start",a,s,r),pC(e,n,t,"end",a,s,r);let o=Array.from(s).filter(c=>!a.has(c));Xee(i,o).forEach(c=>{var d;he(c,{boundElements:(d=c.boundElements)==null?void 0:d.filter(l=>l.type!=="arrow"||l.id!==e.id)})})},pC=(e,t,n,r,i,a,s)=>{if(t!=="keep"){if(t===null){let o=Zee(e,r);o!=null&&a.add(o);return}hA(e)?(n==null||(n==="keep"?!dA(e,t,r):r==="start"||n.id!==t.id))&&(bs(e,t,r,s),i.add(t.id)):(bs(e,t,r,s),i.add(t.id))}},Vee=(e,t,n,r)=>{var s,o;let i=fA(e,t,n),a=t==="start"?(s=e.startBinding)==null?void 0:s.elementId:(o=e.endBinding)==null?void 0:o.elementId;if(a){let c=n.get(a);if(Ra(c)&&dg(c,i,n,r))return c}return null},cA=(e,t,n)=>["start","end"].map(r=>Vee(e,r,t,n)),Yee=(e,t,n,r,i,a)=>{let s=e.points.length-1,o=n.findIndex(h=>h===0)>-1,c=n.findIndex(h=>h===s)>-1,d=o?t?yu(e,"start",r,i,a):null:Ie(e)?"keep":yu(e,"start",r,i,a),l=c?t?yu(e,"end",r,i,a):null:Ie(e)?"keep":yu(e,"end",r,i,a);return[d,l]},Gee=(e,t,n,r,i)=>{if(Ie(e))return["keep","keep"];let[a,s]=cA(e,t,i),o=a&&r?yu(e,"start",t,n,i):null,c=s&&r?yu(e,"end",t,n,i):null;return[o,c]},i2=(e,t,n,r,i,a,s)=>{e.forEach(o=>{let[c,d]=a!=null&&a.length?Yee(o,i,a??[],t,n,s):Gee(o,t,n,i,s);bU(o,c,d,t,r)})},Fb=(e,t,n)=>e.length>50?[]:e.filter(rt).flatMap(r=>cA(r,t,n)).filter(r=>r!==null).filter(r=>e.filter(i=>i.id===(r==null?void 0:r.id)).length===0),w3=(e,t,n,r,i)=>{t.startBoundElement!=null&&bs(e,t.startBoundElement,"start",r);let a=Ca(n,i,r,t.zoom,Ie(e),Ie(e));a!==null&&(dA(e,a,"end")||bs(e,a,"end",r))},qee=(e,t)=>{let n=e.gap,r=D1(t,t.width,t.height);return n>r&&(n=b7+y7),{...e,gap:n}},bs=(e,t,n,r)=>{if(!ht(e))return;let i={elementId:t.id,...Ie(e)?{...a2(e,t,n),focus:0,gap:0}:{...qee(Jee(e,t,n,r),t)}};he(e,{[n==="start"?"startBinding":"endBinding"]:i}),Qe(t.boundElements||[]).has(e.id)||he(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},dA=(e,t,n)=>{let r=e[n==="start"?"endBinding":"startBinding"];return uA(e,r==null?void 0:r.elementId,t)},uA=(e,t,n)=>t===n.id&&hA(e),hA=e=>e.points.length<3,Zee=(e,t)=>{let n=t==="start"?"startBinding":"endBinding",r=e[n];return r==null?null:(he(e,{[n]:null}),r.elementId)},Ca=(e,t,n,r,i,a)=>{if(a){let s=!1,o=Qee(t,d=>Ra(d,!1)&&dg(d,e,n,r,(i||!Mb(d))&&!Ke(d))).filter(d=>s?!1:(Mb(d)||(s=!0),!0));if(!o||o.length===0)return null;if(o.length===1)return o[0];let c=o.filter(d=>dg(d,e,n,r,!1));return c.length===1?c[0]:o.sort((d,l)=>l.width**2+l.height**2-(d.width**2+d.height**2)).pop()}return Kee(t,s=>Ra(s,!1)&&dg(s,e,n,r,(i||!Mb(s))&&!Ke(s)))},Kee=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){let i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},Qee=(e,t)=>{let n=[];for(let r=e.length-1;r>=0;--r){let i=e[r];i.isDeleted||t(i)&&n.push(i)}return n},Jee=(e,t,n,r)=>{let i=n==="start"?-1:1,a=i===-1?0:e.points.length-1,s=a-i,o=Me.getPointAtIndexGlobalCoordinates(e,a,r),c=Me.getPointAtIndexGlobalCoordinates(e,s,r);return{focus:lte(t,c,o),gap:Math.max(1,UU(t,o))}},ci=(e,t,n)=>{let{newSize:r,simultaneouslyUpdated:i}=n??{},a=tte(i);Ra(e)&&yU(t,e,s=>{var U,y;if(!rt(s)||s.isDeleted||!ete(s,e))return;let o=s.startBinding?t.get(s.startBinding.elementId):null,c=s.endBinding?t.get(s.endBinding.elementId):null,d=null,l=null;o&&c&&(d=Da(o,t),l=Da(c,t));let h={startBinding:mC(e,s.startBinding,r),endBinding:mC(e,s.endBinding,r)};if(a.has(s.id)){he(s,h,!0);return}let f=vU(t,s,(v,x)=>{var w,C;if(v&&Ra(v)&&(x==="startBinding"||x==="endBinding")&&(e.id===((w=s[x])==null?void 0:w.elementId)||e.id===((C=s[x==="startBinding"?"endBinding":"startBinding"])==null?void 0:C.elementId)&&!Bee(d,l))){let S=ote(s,x,h[x],v,t);if(S)return{index:x==="startBinding"?0:s.points.length-1,point:S}}return null}).filter(v=>v!==null);Me.movePoints(s,f,{...e.id===((U=s.startBinding)==null?void 0:U.elementId)?{startBinding:h.startBinding}:{},...e.id===((y=s.endBinding)==null?void 0:y.elementId)?{endBinding:h.endBinding}:{}});let g=ct(s,t);g&&!g.isDeleted&&j1(s,t,!1)})},ete=(e,t)=>{var n,r;return((n=e.startBinding)==null?void 0:n.elementId)===t.id||((r=e.endBinding)==null?void 0:r.elementId)===t.id},tte=e=>new Set((e||[]).map(t=>t.id)),nte=(e,t,n,r,i,a,s)=>{let o=sd(Fe(t,e));return!n||!r?o:rte(a,n,i,s)?iA(n,r,e):sd(Fe(e,A(n.x+n.width/2,n.y+n.height/2)))},rte=(e,t,n,r)=>{let i=UU(t,e),a=D1(t,t.width,t.height,r);return i>a?null:i},Qp=(e,t,n)=>{let r=t&&as(t),i=e.points[n==="start"?0:e.points.length-1],a=A(e.x+i[0],e.y+i[1]),s=iY(t)?ate(t,a):a;if(t&&r){let o=U7(r),c=WI(t,He(o,gt(wn(_r(Fe(s,o)),Math.max(t.width,t.height)),o)))[0],d=Rt(s,o),l=Math.max(Rt(c??s,o),1e-4),h=hs(d/l,6);switch(!0){case h>.9:return d-l>Yt||Gp(s,c)<1e-4?s:gt(wn(_r(Fe(s,c??o)),h>1?Yt:-Yt),c??o);default:return ite(s,t,r)}}return s},ite=(e,t,n)=>{let r=U7(n),i=sd(Fe(e,r));switch(!0){case En(i,ii):return oe(A((n[0]+n[2])/2+.1,n[1]),r,t.angle);case En(i,xn):return oe(A(n[2],(n[1]+n[3])/2+.1),r,t.angle);case En(i,sr):return oe(A((n[0]+n[2])/2-.1,n[3]),r,t.angle);default:return oe(A(n[0],(n[1]+n[3])/2-.1),r,t.angle)}},ate=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=oe(t,n,-e.angle);return r[0]<e.x&&r[1]<e.y?r[1]-e.y>-Yt?oe(A(e.x-Yt,e.y),n,e.angle):oe(A(e.x,e.y-Yt),n,e.angle):r[0]<e.x&&r[1]>e.y+e.height?r[0]-e.x>-Yt?oe(A(e.x,e.y+e.height+Yt),n,e.angle):oe(A(e.x-Yt,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]>e.y+e.height?r[0]-e.x<e.width+Yt?oe(A(e.x+e.width,e.y+e.height+Yt),n,e.angle):oe(A(e.x+e.width+Yt,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]<e.y?r[0]-e.x<e.width+Yt?oe(A(e.x+e.width,e.y-Yt),n,e.angle):oe(A(e.x+e.width+Yt,e.y),n,e.angle):t},ste=(e,t,n=.05)=>{let{x:r,y:i,width:a,height:s,angle:o}=e,c=A(r+a/2-.1,i+s/2-.1),d=oe(t,c,-o),l=mt(n*s,5,80),h=mt(n*a,5,80);return d[0]<=r+a/2&&d[1]>c[1]-l&&d[1]<c[1]+l?oe(A(r-Yt,c[1]),c,o):d[1]<=i+s/2&&d[0]>c[0]-h&&d[0]<c[0]+h?oe(A(c[0],i-Yt),c,o):d[0]>=r+a/2&&d[1]>c[1]-l&&d[1]<c[1]+l?oe(A(r+a+Yt,c[1]),c,o):d[1]>=i+s/2&&d[0]>c[0]-h&&d[0]<c[0]+h?oe(A(c[0],i+s+Yt),c,o):t},ote=(e,t,n,r,i)=>{if(n==null||n.elementId!==r.id&&e.points.length>2)return null;let a=t==="startBinding"?-1:1,s=a===-1?0:e.points.length-1;if(Ie(e)&&Qg(n)){let h=xU(n.fixedPoint)??a2(e,r,t==="startBinding"?"start":"end").fixedPoint,f=A(r.x+r.width/2,r.y+r.height/2),g=A(r.x+h[0]*r.width,r.y+h[1]*r.height),U=oe(g,f,r.angle);return Me.pointFromAbsoluteCoords(e,U,i)}let o=s-a,c=Me.getPointAtIndexGlobalCoordinates(e,o,i),d=cte(r,n.focus,c),l;if(n.gap===0)l=d;else{let h=Me.getPointAtIndexGlobalCoordinates(e,s,i),f=A(r.x+r.width/2,r.y+r.height/2),g=Rt(c,h)+Rt(c,f)+Math.max(r.width,r.height)*2,U=WI(r,He(c,gt(wn(_r(Fe(d,c)),g),c)),n.gap).sort((y,v)=>Gp(y,c)-Gp(v,c));U.length>1?l=U[0]:U.length===1?l=d:l=h}return Me.pointFromAbsoluteCoords(e,l,i)},a2=(e,t,n,r)=>{let i=[t.x,t.y,t.x+t.width,t.y+t.height],a=Qp(e,t,n),s=A(i[0]+(i[2]-i[0])/2,i[1]+(i[3]-i[1])/2),o=oe(a,s,-t.angle);return{fixedPoint:xU([(o[0]-t.x)/t.width,(o[1]-t.y)/t.height])}},mC=(e,t,n)=>{if(t==null||n==null)return t;let{width:r,height:i}=n,{width:a,height:s}=e,o=Math.max(1,Math.min(D1(e,r,i),t.gap*(r<i?r/a:i/s)));return{...t,gap:o}},yu=(e,t,n,r,i)=>Ca(fA(e,t,n),r,n,i,Ie(e),Ie(e)),fA=(e,t,n)=>{let r=t==="start"?0:-1;return wa(Me.getPointAtIndexGlobalCoordinates(e,r,n))},pA=(e,t,n,r)=>{let i=new Set,a=new Set,s=r==="duplicatesServeAsOld",o=new Map([...n].map(([c,d])=>[d,c]));t.forEach(c=>{let{boundElements:d}=c;if(d!=null&&d.length>0&&(d.forEach(l=>{s&&!n.has(l.id)&&i.add(l.id)}),a.add(n.get(c.id))),ls(c)){if(c.startBinding!=null){let{elementId:l}=c.startBinding;s&&!n.has(l)&&a.add(l)}if(c.endBinding!=null){let{elementId:l}=c.endBinding;s&&!n.has(l)&&a.add(l)}(c.startBinding!=null||c.endBinding!=null)&&i.add(n.get(c.id))}}),e.filter(({id:c})=>i.has(c)).forEach(c=>{let{startBinding:d,endBinding:l}=c;he(c,{startBinding:gC(d,n),endBinding:gC(l,n)})}),e.filter(({id:c})=>a.has(c)).forEach(c=>{var h;let d=o.get(c.id),l=(h=e.find(({id:f})=>f===d))==null?void 0:h.boundElements;l&&l.length>0&&he(c,{boundElements:l.map(f=>n.has(f.id)?{id:n.get(f.id),type:f.type}:f)})})},gC=(e,t)=>e==null?null:{...e,elementId:t.get(e.elementId)??e.elementId},mA=(e,t)=>{let n=Qe(e);for(let r of t)vu.unbindAffected(n,r,he),xu.unbindAffected(n,r,he)},Jp=(e,t,n=[])=>{if(!e)return null;let r=e.filter(i=>!t.has(i.id));return r.push(...n.map(i=>({id:i.id,type:i.type}))),r},dg=(e,{x:t,y:n},r,i,a)=>{let s=D1(e,e.width,e.height,i),o=ro(e,r);return g3(A(t,n),o,s)||a===!0&&Yu(A(t,n),as(e))},D1=(e,t,n,r)=>{let i=r!=null&&r.value&&r.value<1?r.value:1,a=(e.type==="diamond"?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*a,32),b7/i+y7)},lte=(e,t,n)=>{let r=A(e.x+e.width/2,e.y+e.height/2);if(La(t,n))return 0;let i=oe(t,r,-e.angle),a=oe(n,r,-e.angle),s=Math.sign(Vn(Fe(a,t),Fe(a,r)))*-1,o=He(a,gt(wn(_r(Fe(a,i)),Math.max(e.width*2,e.height*2)),a)),c=e.type==="diamond"?[He(A(e.x+e.width/2,e.y),A(e.x+e.width/2,e.y+e.height)),He(A(e.x,e.y+e.height/2),A(e.x+e.width,e.y+e.height/2))]:[He(A(e.x,e.y),A(e.x+e.width,e.y+e.height)),He(A(e.x+e.width,e.y),A(e.x,e.y+e.height))],d=e.type==="diamond"?[He(A(e.x+e.width/2,e.y-e.height),A(e.x+e.width/2,e.y+e.height*2)),He(A(e.x-e.width,e.y+e.height/2),A(e.x+e.width*2,e.y+e.height/2))]:[He(A(e.x-e.width,e.y-e.height),A(e.x+e.width*2,e.y+e.height*2)),He(A(e.x+e.width*2,e.y-e.height),A(e.x-e.width,e.y+e.height*2))];return[qp(o,d[0]),qp(o,d[1])].filter(l=>l!==null).sort((l,h)=>Gp(l,n)-Gp(h,n)).map((l,h)=>s*Rt(r,l)/(e.type==="diamond"?Rt(c[h][0],c[h][1])/2:Math.sqrt(e.width**2+e.height**2)/2)).sort((l,h)=>Math.abs(l)-Math.abs(h))[0]??0},cte=(e,t,n)=>{let r=A(e.x+e.width/2,e.y+e.height/2);if(t===0)return r;let i=(e.type==="diamond"?[A(e.x,e.y+e.height/2),A(e.x+e.width/2,e.y),A(e.x+e.width,e.y+e.height/2),A(e.x+e.width/2,e.y+e.height)]:[A(e.x,e.y),A(e.x+e.width,e.y),A(e.x+e.width,e.y+e.height),A(e.x,e.y+e.height)]).map(s=>gt(wn(Fe(s,r),Math.abs(t)),r)).map(s=>oe(s,r,e.angle)),a=[Vn(Fe(n,i[0]),Fe(i[1],i[0]))>0&&(t>0?Vn(Fe(n,i[1]),Fe(i[2],i[1]))<0:Vn(Fe(n,i[3]),Fe(i[0],i[3]))<0),Vn(Fe(n,i[1]),Fe(i[2],i[1]))>0&&(t>0?Vn(Fe(n,i[2]),Fe(i[3],i[2]))<0:Vn(Fe(n,i[0]),Fe(i[1],i[0]))<0),Vn(Fe(n,i[2]),Fe(i[3],i[2]))>0&&(t>0?Vn(Fe(n,i[3]),Fe(i[0],i[3]))<0:Vn(Fe(n,i[1]),Fe(i[2],i[1]))<0),Vn(Fe(n,i[3]),Fe(i[0],i[3]))>0&&(t>0?Vn(Fe(n,i[0]),Fe(i[1],i[0]))<0:Vn(Fe(n,i[2]),Fe(i[3],i[2]))<0)];return a[0]?t>0?i[1]:i[0]:a[1]?t>0?i[2]:i[1]:a[2]?t>0?i[3]:i[2]:t>0?i[0]:i[3]},dte=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),yU=(e,t,n)=>{var r;Ra(t)&&(((r=t.boundElements)==null?void 0:r.slice())??[]).forEach(({id:i})=>{n(e.get(i),"boundElements",i)})},vU=(e,t,n)=>{let r=[];if(t.frameId){let i=t.frameId;r.push(n(e.get(i),"frameId",i))}if(tn(t)){let i=t.containerId;r.push(n(e.get(i),"containerId",i))}if(ht(t)){if(t.startBinding){let i=t.startBinding.elementId;r.push(n(e.get(i),"startBinding",i))}if(t.endBinding){let i=t.endBinding.elementId;r.push(n(e.get(i),"endBinding",i))}}return r},vu=class{static unbindAffected(e,t,n){t&&vU(e,t,r=>{!r||r.isDeleted||yU(e,r,(i,a,s)=>{s===t.id&&n(r,{boundElements:Jp(r.boundElements,new Set([s]))})})})}};z(vu,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||vU(e,t,(r,i)=>{var a,s;if(!r||r.isDeleted){n(t,{[i]:null});return}i!=="frameId"&&((a=r.boundElements)!=null&&a.find(o=>o.id===t.id)||(ht(t)&&n(r,{boundElements:Jp(r.boundElements,new Set,new Array(t))}),ke(t)&&((s=r.boundElements)!=null&&s.find(o=>o.type==="text")?n(t,{[i]:null}):n(r,{boundElements:Jp(r.boundElements,new Set,new Array(t))}))))})});var xu=class{static unbindAffected(e,t,n){t&&yU(e,t,r=>{!r||r.isDeleted||vU(e,r,(i,a,s)=>{s===t.id&&n(r,{[a]:null})})})}};z(xu,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||yU(e,t,(r,i,a)=>{var s,o;if(!r||r.isDeleted){n(t,{boundElements:Jp(t.boundElements,new Set([a]))});return}ke(r)&&(((o=(((s=t.boundElements)==null?void 0:s.slice())??[]).reverse().find(c=>c.type==="text"))==null?void 0:o.id)===r.id?r.containerId!==t.id&&n(r,{containerId:t.id}):(r.containerId!==null&&n(r,{containerId:null}),n(t,{boundElements:Jp(t.boundElements,new Set([r.id]))})))})});var E3=(e,t)=>{let[n,r]=xU(e);return oe(A(t.x+t.width*n,t.y+t.height*r),A(t.x+t.width/2,t.y+t.height/2),t.angle)},ute=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),r=e.endBinding&&t.get(e.endBinding.elementId),i=n&&e.startBinding?E3(e.startBinding.fixedPoint,n):A(e.x+e.points[0][0],e.y+e.points[0][1]),a=r&&e.endBinding?E3(e.endBinding.fixedPoint,r):A(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[i,a]},hte=(e,t)=>{let[n,r]=ute(e,t);return[Me.pointFromAbsoluteCoords(e,n,t),Me.pointFromAbsoluteCoords(e,r,t)]},xU=e=>e&&(Math.abs(e[0]-.5)<1e-4||Math.abs(e[1]-.5)<1e-4)?e.map(t=>Math.abs(t-.5)<1e-4?.5001:t):e,fte=(e,t)=>{let[n,r,i,a]=t,{x:s,y:o}=xa({sceneX:n,sceneY:r},e),{x:c,y:d}=xa({sceneX:i,sceneY:a},e);return c-s>e.width||d-o>e.height},gA=({scenePoint:e,viewportDimensions:t,zoom:n,offsets:r})=>{let i=(t.width-((r==null?void 0:r.right)??0))/2/n.value-e.x;i+=((r==null?void 0:r.left)??0)/2/n.value;let a=(t.height-((r==null?void 0:r.bottom)??0))/2/n.value-e.y;return a+=((r==null?void 0:r.top)??0)/2/n.value,{scrollX:i,scrollY:a}},e1=(e,t)=>{if(e=$re(e),!e.length)return{scrollX:0,scrollY:0};let[n,r,i,a]=Nt(e);fte(t,[n,r,i,a])&&([n,r,i,a]=Oee(e,qt({clientX:t.scrollX,clientY:t.scrollY},t)));let s=(n+i)/2,o=(r+a)/2;return gA({scenePoint:{x:s,y:o},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},lo=e=>mt(hs(e,6),G8,q8),pte=e=>mt(Math.round(e),1,100),UA=e=>mt(Math.round(e),1,100),bA=(e,t,n)=>{let r=n.reduce((i,a)=>(a.groupIds.includes(e)&&(i[a.id]=!0),i),{});return Object.keys(r).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...r}}},Pr=function(){let e=null,t=null,n=null,r=(a,s,o,c)=>{if(n!==void 0&&s===t&&a===e&&o.editingGroupId===(n==null?void 0:n.editingGroupId))return n;let d={};for(let f of a){let g=f.groupIds;if(o.editingGroupId){let U=g.indexOf(o.editingGroupId);U>-1&&(g=g.slice(0,U))}if(g.length>0){let U=g[g.length-1];d[U]=!0}}let l={},h=s.reduce((f,g)=>{if(g.isDeleted)return f;let U=g.groupIds.find(y=>d[y]);return U&&(f[g.id]=!0,Array.isArray(l[U])?l[U].push(g.id):l[U]=[g.id]),f},{});for(let f of Object.keys(l))l[f].length<2&&d[f]&&(d[f]=!1);return t=s,e=a,n={editingGroupId:o.editingGroupId,selectedGroupIds:d,selectedElementIds:At({...o.selectedElementIds,...h},c)},n},i=(a,s,o,c)=>{let d=c?c.scene.getSelectedElements({selectedElementIds:a.selectedElementIds,elements:s}):ut(s,a);return d.length?r(d,s,a,o):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:At(a.selectedElementIds,o)}};return i.clearCache=()=>{t=null,e=null,n=null},i}(),yA=(e,t)=>vA(e,t)!=null,vA=(e,t)=>t.groupIds.filter(n=>n!==e.editingGroupId).find(n=>e.selectedGroupIds[n]),Hc=e=>Object.entries(e.selectedGroupIds).filter(([t,n])=>n).map(([t,n])=>t),xA=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let r of e){let i=r.groupIds;if(t.editingGroupId){let a=i.indexOf(t.editingGroupId);a>-1&&(i=i.slice(0,a))}if(i.length>0){let a=i[i.length-1];n={...n,...bA(a,n,e)}}}return n.selectedGroupIds},mte=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),t1=(e,t)=>e.groupIds.includes(t),en=(e,t)=>{let n=[];for(let r of e.values())t1(r,t)&&n.push(r);return n},gte=(e,t)=>e.groupIds.find(n=>t[n]),Ute=(e,t,n)=>{let r=[...e],i=t?e.indexOf(t):-1,a=i>-1?i:e.length;for(let s=0;s<a;s++)r[s]=n(r[s]);return r},bte=(e,t,n)=>{let r=[...e],i=n?r.indexOf(n):-1,a=i>-1?i:r.length;return r.splice(a,0,t),r},yte=(e,t)=>e.filter(n=>!t[n]),wU=(e,t)=>{let n=new Map;return e.forEach(r=>{let i=r.groupIds.length===0?r.id:r.groupIds[r.groupIds.length-1],a=n.get(i)||[],s=ct(r,t);s&&a.push(s),n.set(i,[...a,r])}),Array.from(n.values())},vte=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let r of n.groupIds??[])t.add(r);return t},wA=e=>{let t=e.flatMap(i=>i.groupIds),n=new Map,r=0;for(let i of t)n.set(i,(n.get(i)??0)+1),n.get(i)>r&&(r=n.get(i));return r===e.length},Zu=e=>e.groupIds.length>0,xte=8,UC=99999,EU=e=>xte/e,Jr=class{};z(Jr,"referenceSnapPoints",null),z(Jr,"visibleGaps",null),z(Jr,"setReferenceSnapPoints",e=>{Jr.referenceSnapPoints=e}),z(Jr,"getReferenceSnapPoints",()=>Jr.referenceSnapPoints),z(Jr,"setVisibleGaps",e=>{Jr.visibleGaps=e}),z(Jr,"getVisibleGaps",()=>Jr.visibleGaps),z(Jr,"destroy",()=>{Jr.referenceSnapPoints=null,Jr.visibleGaps=null});var eo=Jr,n1=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,Pl=({event:e,app:t,selectedElements:n})=>e?t.state.objectsSnapModeEnabled&&!e[q.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[q.CTRL_OR_CMD]&&!n1(t):n.length===1&&n[0].type==="arrow"?!1:t.state.objectsSnapModeEnabled,wte=(e,t,n=.01)=>Math.abs(e-t)<=n,r1=(e,t,{omitCenter:n,boundingBoxCorners:r,dragOffset:i}={omitCenter:!1,boundingBoxCorners:!1})=>{let a=[];if(e.length===1){let s=e[0],[o,c,d,l,h,f]=it(s,t);i&&(o+=i.x,d+=i.x,h+=i.x,c+=i.y,l+=i.y,f+=i.y);let g=(d-o)/2,U=(l-c)/2;if((s.type==="diamond"||s.type==="ellipse")&&!r){let y=oe(A(o,c+U),A(h,f),s.angle),v=oe(A(o+g,c),A(h,f),s.angle),x=oe(A(d,c+U),A(h,f),s.angle),w=oe(A(o+g,l),A(h,f),s.angle),C=A(h,f);a=n?[y,v,x,w]:[y,v,x,w,C]}else{let y=oe(A(o,c),A(h,f),s.angle),v=oe(A(d,c),A(h,f),s.angle),x=oe(A(o,l),A(h,f),s.angle),w=oe(A(d,l),A(h,f),s.angle),C=A(h,f);a=n?[y,v,x,w]:[y,v,x,w,C]}}else if(e.length>1){let[s,o,c,d]=g7(e,i??{x:0,y:0}),l=c-s,h=d-o,f=A(s,o),g=A(c,o),U=A(s,d),y=A(c,d),v=A(s+l/2,o+h/2);a=n?[f,g,U,y]:[f,g,U,y,v]}return a.map(s=>A(mn(s[0]),mn(s[1])))},EA=(e,t,n,r)=>{let i=t.filter(a=>Ke(a)).map(a=>a.id);return mL(e,t,n,r).filter(a=>!(a.frameId&&i.includes(a.frameId)))},Ete=(e,t,n,r)=>{let i=EA(e,t,n,r),a=wU(i,r).filter(h=>!(h.length===1&&tn(h[0]))).map(h=>Nt(h).map(f=>mn(f))),s=a.sort((h,f)=>h[0]-f[0]),o=[],c=0;e:for(let h=0;h<s.length;h++){let f=s[h];for(let g=h+1;g<s.length;g++){if(++c>UC)break e;let U=s[g],[,y,v,x]=f,[w,C,,S]=U;v<w&&Zg(wr(y,x),wr(C,S))&&o.push({startBounds:f,endBounds:U,startSide:[A(v,y),A(v,x)],endSide:[A(w,C),A(w,S)],length:w-v,overlap:Kg(wr(y,x),wr(C,S))})}}let d=a.sort((h,f)=>h[1]-f[1]),l=[];c=0;e:for(let h=0;h<d.length;h++){let f=d[h];for(let g=h+1;g<d.length;g++){if(++c>UC)break e;let U=d[g],[y,,v,x]=f,[w,C,S]=U;x<C&&Zg(wr(y,v),wr(w,S))&&l.push({startBounds:f,endBounds:U,startSide:[A(y,x),A(v,x)],endSide:[A(w,C),A(S,C)],length:C-x,overlap:Kg(wr(y,v),wr(w,S))})}}return{horizontalGaps:o,verticalGaps:l}},bC=(e,t,n,r,i,a,s)=>{if(!Pl({app:n,event:r,selectedElements:e}))return[];if(e.length===0)return[];let o=eo.getVisibleGaps();if(o){let{horizontalGaps:c,verticalGaps:d}=o,[l,h,f,g]=g7(e,t).map(v=>mn(v)),U=(l+f)/2,y=(h+g)/2;for(let v of c){if(!Zg(wr(h,g),v.overlap))continue;let x=v.startSide[0][0]+v.length/2,w=mn(x-U);if(v.length>f-l&&Math.abs(w)<=s.x){Math.abs(w)<s.x&&(i.length=0),s.x=Math.abs(w);let P={type:"gap",direction:"center_horizontal",gap:v,offset:w};i.push(P);continue}let[,,C]=v.endBounds,S=l-C,T=mn(v.length-S);if(Math.abs(T)<=s.x){Math.abs(T)<s.x&&(i.length=0),s.x=Math.abs(T);let P={type:"gap",direction:"side_right",gap:v,offset:T};i.push(P);continue}let[M,,,]=v.startBounds,_=M-f,R=mn(_-v.length);if(Math.abs(R)<=s.x){Math.abs(R)<s.x&&(i.length=0),s.x=Math.abs(R);let P={type:"gap",direction:"side_left",gap:v,offset:R};i.push(P);continue}}for(let v of d){if(!Zg(wr(l,f),v.overlap))continue;let x=v.startSide[0][1]+v.length/2,w=mn(x-y);if(v.length>g-h&&Math.abs(w)<=s.y){Math.abs(w)<s.y&&(a.length=0),s.y=Math.abs(w);let P={type:"gap",direction:"center_vertical",gap:v,offset:w};a.push(P);continue}let[,C,,]=v.startBounds,S=C-g,T=mn(S-v.length);if(Math.abs(T)<=s.y){Math.abs(T)<s.y&&(a.length=0),s.y=Math.abs(T);let P={type:"gap",direction:"side_top",gap:v,offset:T};a.push(P);continue}let[,,,M]=v.endBounds,_=mn(h-M),R=v.length-_;if(Math.abs(R)<=s.y){Math.abs(R)<s.y&&(a.length=0),s.y=Math.abs(R);let P={type:"gap",direction:"side_bottom",gap:v,offset:R};a.push(P);continue}}}},Cte=(e,t,n,r)=>{let i=EA(e,t,n,r);return wU(i,r).filter(a=>!(a.length===1&&tn(a[0]))).flatMap(a=>r1(a,r))},Ku=(e,t,n,r,i,a,s)=>{if(!Pl({app:n,event:r,selectedElements:e})||e.length===0&&t.length===0)return[];let o=eo.getReferenceSnapPoints();if(o)for(let c of t)for(let d of o){let l=d[0]-c[0],h=d[1]-c[1];Math.abs(l)<=s.x&&(Math.abs(l)<s.x&&(i.length=0),i.push({type:"point",points:[c,d],offset:l}),s.x=Math.abs(l)),Math.abs(h)<=s.y&&(Math.abs(h)<s.y&&(a.length=0),a.push({type:"point",points:[c,d],offset:h}),s.y=Math.abs(h))}},Ste=(e,t,n,r,i)=>{var v,x;let a=n.state,s=ut(e,a);if(!Pl({app:n,event:r,selectedElements:s})||s.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=mn(t.x),t.y=mn(t.y);let o=[],c=[],d=EU(a.zoom.value),l={x:d,y:d},h=r1(s,i,{dragOffset:t});Ku(s,h,n,r,o,c,l),bC(s,t,n,r,o,c,l);let f={x:((v=o[0])==null?void 0:v.offset)??0,y:((x=c[0])==null?void 0:x.offset)??0};l.x=0,l.y=0,o.length=0,c.length=0;let g={x:mn(t.x+f.x),y:mn(t.y+f.y)};Ku(s,r1(s,i,{dragOffset:g}),n,r,o,c,l),bC(s,g,n,r,o,c,l);let U=v7(o,c),y=kte(s,g,[...o,...c].filter(w=>w.type==="gap"));return{snapOffset:f,snapLines:[...U,...y]}},mn=e=>Math.round(e*10**6)/10**6,yC=e=>{let t=new Map;for(let n of e){let r=n.join(",");t.has(r)||t.set(r,n)}return Array.from(t.values())},v7=(e,t)=>{let n={},r={};if(e.length>0){for(let i of e)if(i.type==="point"){let a=mn(i.points[0][0]);n[a]||(n[a]=[]),n[a].push(...i.points.map(s=>A(mn(s[0]),mn(s[1]))))}}if(t.length>0){for(let i of t)if(i.type==="point"){let a=mn(i.points[0][1]);r[a]||(r[a]=[]),r[a].push(...i.points.map(s=>A(mn(s[0]),mn(s[1]))))}}return Object.entries(n).map(([i,a])=>({type:"points",points:yC(a.map(s=>A(Number(i),s[1])).sort((s,o)=>s[1]-o[1]))})).concat(Object.entries(r).map(([i,a])=>({type:"points",points:yC(a.map(s=>A(s[0],Number(i))).sort((s,o)=>s[0]-o[0]))})))},_te=e=>{let t=new Map;for(let n of e){let r=n.points.flat().map(i=>[mn(i)]).join(",");t.has(r)||t.set(r,n)}return Array.from(t.values())},kte=(e,t,n)=>{let[r,i,a,s]=g7(e,t),o=[];for(let c of n){let[d,l,h,f]=c.gap.startBounds,[g,U,y,v]=c.gap.endBounds,x=Kg(wr(i,s),c.gap.overlap),w=Kg(wr(r,a),c.gap.overlap);switch(c.direction){case"center_horizontal":{if(x){let C=(x[0]+x[1])/2;o.push({type:"gap",direction:"horizontal",points:[A(c.gap.startSide[0][0],C),A(r,C)]},{type:"gap",direction:"horizontal",points:[A(a,C),A(c.gap.endSide[0][0],C)]})}break}case"center_vertical":{if(w){let C=(w[0]+w[1])/2;o.push({type:"gap",direction:"vertical",points:[A(C,c.gap.startSide[0][1]),A(C,i)]},{type:"gap",direction:"vertical",points:[A(C,s),A(C,c.gap.endSide[0][1])]})}break}case"side_right":{if(x){let C=(x[0]+x[1])/2;o.push({type:"gap",direction:"horizontal",points:[A(h,C),A(g,C)]},{type:"gap",direction:"horizontal",points:[A(y,C),A(r,C)]})}break}case"side_left":{if(x){let C=(x[0]+x[1])/2;o.push({type:"gap",direction:"horizontal",points:[A(a,C),A(d,C)]},{type:"gap",direction:"horizontal",points:[A(h,C),A(g,C)]})}break}case"side_top":{if(w){let C=(w[0]+w[1])/2;o.push({type:"gap",direction:"vertical",points:[A(C,s),A(C,l)]},{type:"gap",direction:"vertical",points:[A(C,f),A(C,U)]})}break}case"side_bottom":{if(w){let C=(w[0]+w[1])/2;o.push({type:"gap",direction:"vertical",points:[A(C,f),A(C,U)]},{type:"gap",direction:"vertical",points:[A(C,v),A(C,i)]})}break}}}return _te(o.map(c=>({...c,points:c.points.map(d=>A(mn(d[0]),mn(d[1])))})))},vC=(e,t,n,r,i,a)=>{var M,_;if(!Pl({event:r,selectedElements:e,app:n})||e.length===0||e.length===1&&!wte(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[s,o,c,d]=Nt(t);a&&(a.includes("e")?c+=i.x:a.includes("w")&&(s+=i.x),a.includes("n")?o+=i.y:a.includes("s")&&(d+=i.y));let l=[];if(a)switch(a){case"e":{l.push(A(c,o),A(c,d));break}case"w":{l.push(A(s,o),A(s,d));break}case"n":{l.push(A(s,o),A(c,o));break}case"s":{l.push(A(s,d),A(c,d));break}case"ne":{l.push(A(c,o));break}case"nw":{l.push(A(s,o));break}case"se":{l.push(A(c,d));break}case"sw":{l.push(A(s,d));break}}let h=EU(n.state.zoom.value),f={x:h,y:h},g=[],U=[];Ku(t,l,n,r,g,U,f);let y={x:((M=g[0])==null?void 0:M.offset)??0,y:((_=U[0])==null?void 0:_.offset)??0};f.x=0,f.y=0,g.length=0,U.length=0;let[v,x,w,C]=Nt(e).map(R=>mn(R)),S=[A(v,x),A(v,C),A(w,x),A(w,C)];Ku(e,S,n,r,g,U,f);let T=v7(g,U);return{snapOffset:y,snapLines:T}},Tte=(e,t,n,r,i,a)=>{var U,y;if(!Pl({event:n,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let s=[A(r.x+i.x,r.y+i.y)],o=EU(t.state.zoom.value),c={x:o,y:o},d=[],l=[];Ku([e],s,t,n,d,l,c);let h={x:((U=d[0])==null?void 0:U.offset)??0,y:((y=l[0])==null?void 0:y.offset)??0};c.x=0,c.y=0,d.length=0,l.length=0;let f=r1([e],a,{boundingBoxCorners:!0,omitCenter:!0});Ku([e],f,t,n,d,l,c);let g=v7(d,l);return{snapOffset:h,snapLines:g}},Mte=(e,t,n,r,i)=>{if(!Pl({event:r,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let a=mL(e,[],t.state,i),s=EU(t.state.zoom.value),o={x:s,y:s},c=[],d=[];for(let l of a){let h=r1([l],i);for(let f of h){let g=f[0]-n.x;Math.abs(g)<=Math.abs(o.x)&&(Math.abs(g)<Math.abs(o.x)&&(d.length=0),d.push({type:"pointer",points:[f,A(f[0],n.y)],direction:"vertical"}),o.x=g);let U=f[1]-n.y;Math.abs(U)<=Math.abs(o.y)&&(Math.abs(U)<Math.abs(o.y)&&(c.length=0),c.push({type:"pointer",points:[f,A(n.x,f[1])],direction:"horizontal"}),o.y=U)}}return{originOffset:{x:d.length>0?d[0].points[0][0]-n.x:0,y:c.length>0?c[0].points[0][1]-n.y:0},snapLines:[...d,...c]}},Ite=e=>e===Yn.rectangle||e===Yn.ellipse||e===Yn.diamond||e===Yn.frame||e===Yn.magicframe||e===Yn.image||e===Yn.text,Pn=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],sl={version:null,points:[],zoom:null},_n=class ft{constructor(t){z(this,"elementId"),z(this,"selectedPointsIndices"),z(this,"pointerDownState"),z(this,"isDragging"),z(this,"lastUncommittedPoint"),z(this,"pointerOffset"),z(this,"startBindingElement"),z(this,"endBindingElement"),z(this,"hoverPointIndex"),z(this,"segmentMidPointHoveredCoords"),z(this,"elbowed"),this.elementId=t.id,La(t.points[0],A(0,0))||console.error("Linear element is not normalized",Error().stack),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:null,segmentMidpoint:{value:null,index:null,added:!1}},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.elbowed=Ie(t)&&t.elbowed}static getElement(t,n){return n.get(t)||null}static handleBoxSelection(t,n,r,i){if(!n.editingLinearElement||!n.selectionElement)return!1;let{editingLinearElement:a}=n,{selectedPointsIndices:s,elementId:o}=a,c=ft.getElement(o,i);if(!c)return!1;let[d,l,h,f]=it(n.selectionElement,i),g=ft.getPointsGlobalCoordinates(c,i).reduce((U,y,v)=>((y[0]>=d&&y[0]<=h&&y[1]>=l&&y[1]<=f||t.shiftKey&&(s!=null&&s.includes(v)))&&U.push(v),U),[]).filter(U=>!(Ie(c)&&U!==0&&U!==c.points.length-1));r({editingLinearElement:{...a,selectedPointsIndices:g.length?g:null}})}static handlePointDragging(t,n,r,i,a,s,o){var U;if(!s)return!1;let{elementId:c}=s,d=o.getNonDeletedElementsMap(),l=ft.getElement(c,d);if(!l||Ie(l)&&!s.pointerDownState.lastClickedIsEndPoint&&s.pointerDownState.lastClickedPoint!==0)return!1;let h=Ie(l)?(U=s.selectedPointsIndices)==null?void 0:U.reduce((y,v)=>v===0?[0,y[1]]:[y[0],l.points.length-1],[!1,!1]).filter(y=>typeof y=="number"):s.selectedPointsIndices,f=Ie(l)?s.pointerDownState.lastClickedPoint>0?l.points.length-1:0:s.pointerDownState.lastClickedPoint,g=l.points[f];if(h&&g){if(yp(t)&&h.length===1&&l.points.length>1){let y=h[0],v=l.points[y===0?1:y-1],[x,w]=ft._getShiftLockedDelta(l,d,v,A(r,i),t[q.CTRL_OR_CMD]?null:n.getEffectiveGridSize());ft.movePoints(l,[{index:y,point:A(x+v[0],w+v[1]),isDragging:y===f}])}else{let y=ft.createPointAt(l,d,r-s.pointerOffset.x,i-s.pointerOffset.y,t[q.CTRL_OR_CMD]?null:n.getEffectiveGridSize()),v=y[0]-g[0],x=y[1]-g[1];ft.movePoints(l,h.map(w=>{let C=w===f?ft.createPointAt(l,d,r-s.pointerOffset.x,i-s.pointerOffset.y,t[q.CTRL_OR_CMD]?null:n.getEffectiveGridSize()):A(l.points[w][0]+v,l.points[w][1]+x);return{index:w,point:C,isDragging:w===f}}))}if(ct(l,d)&&j1(l,d,!1),ls(l,!1)){let y=[];h[0]===0&&y.push(wa(ft.getPointGlobalCoordinates(l,l.points[0],d)));let v=h[h.length-1];v===l.points.length-1&&y.push(wa(ft.getPointGlobalCoordinates(l,l.points[v],d))),y.length&&a(l,y)}return!0}return!1}static handlePointerUp(t,n,r,i){var g;let a=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),{elementId:o,selectedPointsIndices:c,isDragging:d,pointerDownState:l}=n,h=ft.getElement(o,a);if(!h)return n;let f={};if(d&&c){for(let U of c)if(U===0||U===h.points.length-1){Uo(h.points,r.zoom.value)&&ft.movePoints(h,[{index:U,point:U===0?h.points[h.points.length-1]:h.points[0]}]);let y=jc(r)?Ca(wa(ft.getPointAtIndexGlobalCoordinates(h,U,a)),s,a,r.zoom,Ie(h),Ie(h)):null;f[U===0?"startBindingElement":"endBindingElement"]=y}}return{...n,...f,selectedPointsIndices:d||t.shiftKey?!d&&t.shiftKey&&((g=l.prevSelectedPointsIndices)!=null&&g.includes(l.lastClickedPoint))?c&&c.filter(U=>U!==l.lastClickedPoint):c:c!=null&&c.includes(l.lastClickedPoint)?[l.lastClickedPoint]:c,isDragging:!1,pointerOffset:{x:0,y:0}}}static isSegmentTooShort(t,n,r,i,a){if(Ie(t))return i>=0&&i<t.points.length?Rt(n,r)*a.value<ft.POINT_HANDLE_SIZE/2:!1;let s=Rt(n,r);return t.points.length>2&&t.roundness&&(s=uee(t,r)),s*a.value<ft.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,r,i,a){let s=I1(n,r);if(t.points.length>2&&t.roundness){let o=VI(t,t.points[i]);if(o){let c=hee(t,t.points[i],.5);s=ft.getPointGlobalCoordinates(t,YI(o[0],o[1],o[2],o[3],c),a)}}return s}static getSegmentMidPointIndex(t,n,r,i){let a=ft.getElement(t.elementId,i);if(!a)return-1;let s=ft.getEditorMidPoints(a,i,n),o=0;for(;o<s.length;){if(ft.arePointsEqual(r,s[o]))return o+1;o++}return-1}static handlePointerDown(t,n,r,i,a,s){var R;let o=n.state,c=s.getNonDeletedElementsMap(),d=s.getNonDeletedElements(),l={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!a)return l;let{elementId:h}=a,f=ft.getElement(h,c);if(!f)return l;let g=ft.getSegmentMidpointHitCoords(a,i,o,c),U=null;if(g)U=ft.getSegmentMidPointIndex(a,o,g,c);else if(t.altKey&&o.editingLinearElement)return a.lastUncommittedPoint==null&&(he(f,{points:[...f.points,ft.createPointAt(f,c,i.x,i.y,t[q.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),l.didAddPoint=!0),r.shouldCaptureIncrement(),l.linearElementEditor={...a,pointerDownState:{prevSelectedPointsIndices:a.selectedPointsIndices,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:g,index:U,added:!1}},selectedPointsIndices:[f.points.length-1],lastUncommittedPoint:null,endBindingElement:Ca(i,d,c,n.state.zoom,a.elbowed)},l.didAddPoint=!0,l;let y=ft.getPointIndexUnderCursor(f,c,o.zoom,i.x,i.y);if(y>=0||g)l.hitElement=f;else{let{startBindingElement:P,endBindingElement:j}=a;jc(o)&&ls(f)&&bU(f,P,j,c,s)}let[v,x,w,C]=it(f,c),S=(v+w)/2,T=(x+C)/2,M=y>-1&&oe(A(f.x+f.points[y][0],f.y+f.points[y][1]),A(S,T),f.angle),_=y>-1||t.shiftKey?t.shiftKey||(R=a.selectedPointsIndices)!=null&&R.includes(y)?Ate([...a.selectedPointsIndices||[],y]):[y]:null;return l.linearElementEditor={...a,pointerDownState:{prevSelectedPointsIndices:a.selectedPointsIndices,lastClickedPoint:y,lastClickedIsEndPoint:y===f.points.length-1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:g,index:U,added:!1}},selectedPointsIndices:_,pointerOffset:M?{x:i.x-M[0],y:i.y-M[1]}:{x:0,y:0}},l}static arePointsEqual(t,n){return!t&&!n?!0:!t||!n?!1:La(t,n)}static handlePointerMove(t,n,r,i,a){let s=i.state;if(!s.editingLinearElement)return null;let{elementId:o,lastUncommittedPoint:c}=s.editingLinearElement,d=ft.getElement(o,a);if(!d)return s.editingLinearElement;let{points:l}=d,h=l[l.length-1];if(!t.altKey)return h===c&&ft.deletePoints(d,[l.length-1]),{...s.editingLinearElement,lastUncommittedPoint:null};let f;if(yp(t)&&l.length>=2){let g=l[l.length-2],[U,y]=ft._getShiftLockedDelta(d,a,g,A(n,r),t[q.CTRL_OR_CMD]?null:i.getEffectiveGridSize());f=A(U+g[0],y+g[1])}else f=ft.createPointAt(d,a,n-s.editingLinearElement.pointerOffset.x,r-s.editingLinearElement.pointerOffset.y,t[q.CTRL_OR_CMD]||Ie(d)?null:i.getEffectiveGridSize());return h===c?ft.movePoints(d,[{index:d.points.length-1,point:f}]):ft.addPoints(d,[{point:f}]),{...s.editingLinearElement,lastUncommittedPoint:d.points[d.points.length-1]}}static getPointGlobalCoordinates(t,n,r){let[i,a,s,o]=it(t,r),c=(i+s)/2,d=(a+o)/2,{x:l,y:h}=t;return oe(A(l+n[0],h+n[1]),A(c,d),t.angle)}static getPointsGlobalCoordinates(t,n){let[r,i,a,s]=it(t,n),o=(r+a)/2,c=(i+s)/2;return t.points.map(d=>{let{x:l,y:h}=t;return oe(A(l+d[0],h+d[1]),A(o,c),t.angle)})}static getPointAtIndexGlobalCoordinates(t,n,r){let i=n<0?t.points.length+n:n,[a,s,o,c]=it(t,r),d=(a+o)/2,l=(s+c)/2,h=t.points[i],{x:f,y:g}=t;return oe(h?A(f+h[0],g+h[1]):A(f,g),A(d,l),t.angle)}static pointFromAbsoluteCoords(t,n,r){if(Ie(t))return A(n[0]-t.x,n[1]-t.y);let[i,a,s,o]=it(t,r),c=(i+s)/2,d=(a+o)/2,[l,h]=oe(A(n[0],n[1]),A(c,d),-t.angle);return A(l-t.x,h-t.y)}static getPointIndexUnderCursor(t,n,r,i,a){let s=ft.getPointsGlobalCoordinates(t,n),o=s.length;for(;--o>-1;){let c=s[o];if(Rt(A(i,a),A(c[0],c[1]))*r.value<ft.POINT_HANDLE_SIZE+1)return o}return-1}static createPointAt(t,n,r,i,a){let s=Pn(r,i,a),[o,c,d,l]=it(t,n),h=(o+d)/2,f=(c+l)/2,[g,U]=oe(A(s[0],s[1]),A(h,f),-t.angle);return A(g-t.x,U-t.y)}static getNormalizedPoints(t){let{points:n}=t,r=n[0][0],i=n[0][1];return{points:n.map(a=>A(a[0]-r,a[1]-i)),x:t.x+r,y:t.y+i}}static normalizePoints(t){he(t,ft.getNormalizedPoints(t))}static duplicateSelectedPoints(t,n){Tr(t.editingLinearElement,"Not currently editing a linear element");let{selectedPointsIndices:r,elementId:i}=t.editingLinearElement,a=ft.getElement(i,n);Tr(a,"The linear element does not exist in the provided Scene"),Tr(r!=null,"There are no selected points to duplicate");let{points:s}=a,o=[],c=!1,d=-1,l=s.reduce((h,f,g)=>{if(++d,h.push(f),r.includes(g)){let U=s[g+1];U||(c=!0),h.push(U?A((f[0]+U[0])/2,(f[1]+U[1])/2):A(f[0],f[1])),o.push(d+1),++d}return h},[]);if(he(a,{points:l}),c){let h=a.points[a.points.length-1];ft.movePoints(a,[{index:a.points.length-1,point:A(h[0]+30,h[1]+30)}])}return{...t,editingLinearElement:{...t.editingLinearElement,selectedPointsIndices:o}}}static deletePoints(t,n){let r=0,i=0;if(n.includes(0)){let s=t.points.find((o,c)=>!n.includes(c));s&&(r=s[0],i=s[1])}let a=t.points.reduce((s,o,c)=>(n.includes(c)||s.push(s.length?A(o[0]-r,o[1]-i):A(0,0)),s),[]);ft._updatePoints(t,a,r,i)}static addPoints(t,n){let r=[...t.points,...n.map(i=>i.point)];ft._updatePoints(t,r,0,0)}static movePoints(t,n,r){var l,h,f;let{points:i}=t,[a,s]=((l=n.find(({index:g})=>g===0))==null?void 0:l.point)??A(0,0),[o,c]=A(a-i[0][0],s-i[0][1]),d=Ie(t)?[((h=n.find(g=>g.index===0))==null?void 0:h.point)??i[0],((f=n.find(g=>g.index===i.length-1))==null?void 0:f.point)??i[i.length-1]]:i.map((g,U)=>{var v;let y=((v=n.find(x=>x.index===U))==null?void 0:v.point)??g;return A(y[0]-o,y[1]-c)});ft._updatePoints(t,d,o,c,r,{isDragging:n.reduce((g,U)=>g||U.isDragging===!0,!1)})}static shouldAddMidpoint(t,n,r,i){let a=ft.getElement(t.elementId,i);if(a&&Ie(a)||!a)return!1;let{segmentMidpoint:s}=t.pointerDownState;if(s.added||s.value===null||s.index===null||t.pointerDownState.origin===null)return!1;let o=t.pointerDownState.origin,c=Rt(A(o.x,o.y),A(n.x,n.y));return!(!r.editingLinearElement&&c<wc/r.zoom.value)}static addMidpoint(t,n,r,i,a){let s=ft.getElement(t.elementId,a);if(!s)return;let{segmentMidpoint:o}=t.pointerDownState,c={pointerDownState:t.pointerDownState,selectedPointsIndices:t.selectedPointsIndices},d=ft.createPointAt(s,a,n.x,n.y,i&&!Ie(s)?r.getEffectiveGridSize():null),l=[...s.points.slice(0,o.index),d,...s.points.slice(o.index)];return he(s,{points:l}),c.pointerDownState={...t.pointerDownState,segmentMidpoint:{...t.pointerDownState.segmentMidpoint,added:!0},lastClickedPoint:o.index},c.selectedPointsIndices=[o.index],c}static _updatePoints(t,n,r,i,a,s){if(Ie(t)){let o={};(a==null?void 0:a.startBinding)!==void 0&&(o.startBinding=a.startBinding!==null&&Qg(a.startBinding)?a.startBinding:null),(a==null?void 0:a.endBinding)!==void 0&&(o.endBinding=a.endBinding!==null&&Qg(a.endBinding)?a.endBinding:null),o.points=Array.from(n),he(t,o,!0,{isDragging:s==null?void 0:s.isDragging})}else{let o=fC(t,n),c=fC(t,t.points),d=(o[0]+o[2])/2,l=(o[1]+o[3])/2,h=(c[0]+c[2])/2,f=(c[1]+c[3])/2,g=h-d,U=f-l,y=oe(A(r,i),A(g,U),t.angle);he(t,{...a,points:n,x:t.x+y[0],y:t.y+y[1]})}}static _getShiftLockedDelta(t,n,r,i,a){let s=ft.getPointGlobalCoordinates(t,r,n);if(Ie(t))return[i[0]-s[0],i[1]-s[1]];let[o,c]=Pn(i[0],i[1],a),{width:d,height:l}=L3(s[0],s[1],o,c);return oe(A(d,l),A(0,0),-t.angle)}static moveFixedSegment(t,n,r,i,a){let s=ft.getElement(t.elementId,a);if(!s||!Ie(s))return t;if(n&&n>0&&n<s.points.length){let o=oo(sd(Fe(s.points[n],s.points[n-1]))),c=(s.fixedSegments??[]).reduce((f,g)=>(f[g.index]=g,f),{});c[n]={index:n,start:A(o?s.points[n-1][0]:r-s.x,o?i-s.y:s.points[n-1][1]),end:A(o?s.points[n][0]:r-s.x,o?i-s.y:s.points[n][1])};let d=Object.values(c).sort((f,g)=>f.index-g.index),l=d.map(f=>f.index).reduce((f,g)=>g<n?f+1:f,0);he(s,{fixedSegments:d});let h=A(s.x+(s.fixedSegments[l].start[0]+s.fixedSegments[l].end[0])/2,s.y+(s.fixedSegments[l].start[1]+s.fixedSegments[l].end[1])/2);return{...t,segmentMidPointHoveredCoords:h,pointerDownState:{...t.pointerDownState,segmentMidpoint:{added:!1,index:s.fixedSegments[l].index,value:h}}}}return t}static deleteFixedSegment(t,n){var r;he(t,{fixedSegments:(r=t.fixedSegments)==null?void 0:r.filter(i=>i.index!==n)}),he(t,{},!0)}};z(_n,"POINT_HANDLE_SIZE",10),z(_n,"getEditorMidPoints",(e,t,n)=>{let r=ct(e,t);return!Ie(e)&&!n.editingLinearElement&&e.points.length>2&&!r?[]:(sl.version===e.version&&sl.zoom===n.zoom.value||_n.updateEditorMidPointsCache(e,t,n),sl.points)}),z(_n,"updateEditorMidPointsCache",(e,t,n)=>{let r=_n.getPointsGlobalCoordinates(e,t),i=0,a=[];for(;i<r.length-1;){if(_n.isSegmentTooShort(e,e.points[i],e.points[i+1],i,n.zoom)){a.push(null),i++;continue}let s=_n.getSegmentMidPoint(e,r[i],r[i+1],i+1,t);a.push(s),i++}sl.points=a,sl.version=e.version,sl.zoom=n.zoom.value}),z(_n,"getSegmentMidpointHitCoords",(e,t,n,r)=>{let{elementId:i}=e,a=_n.getElement(i,r);if(!a)return null;let s=_n.getPointIndexUnderCursor(a,r,n.zoom,t.x,t.y);if(!Ie(a)&&s>=0||_n.getPointsGlobalCoordinates(a,r).length>=3&&!n.editingLinearElement&&!Ie(a))return null;let o=(_n.POINT_HANDLE_SIZE+1)/n.zoom.value,c=e.segmentMidPointHoveredCoords;if(c&&Rt(A(c[0],c[1]),A(t.x,t.y))<=o)return c;let d=0,l=_n.getEditorMidPoints(a,r,n);for(;d<l.length;){if(l[d]!==null&&Rt(l[d],A(t.x,t.y))<=o)return l[d];d++}return null}),z(_n,"getBoundTextElementPosition",(e,t,n)=>{let r=_n.getPointsGlobalCoordinates(e,n);r.length<2&&he(t,{isDeleted:!0});let i=0,a=0;if(e.points.length%2===1){let s=Math.floor(e.points.length/2),o=_n.getPointGlobalCoordinates(e,e.points[s],n);i=o[0]-t.width/2,a=o[1]-t.height/2}else{let s=e.points.length/2-1,o=sl.points[s];e.points.length===2&&(o=I1(r[0],r[1])),(!o||sl.version!==e.version)&&(o=_n.getSegmentMidPoint(e,r[s],r[s+1],s+1,n)),i=o[0]-t.width/2,a=o[1]-t.height/2}return{x:i,y:a}}),z(_n,"getMinMaxXYWithBoundText",(e,t,n,r)=>{let[i,a,s,o]=n,c=(i+s)/2,d=(a+o)/2,{x:l,y:h}=_n.getBoundTextElementPosition(e,r,t),f=l+r.width,g=h+r.height,U=A(c,d),y=oe(A(i,a),U,e.angle),v=oe(A(s,a),U,e.angle),x=oe(A(l,h),U,-e.angle),w=oe(A(f,h),U,-e.angle),C=oe(A(l,g),U,-e.angle),S=oe(A(f,g),U,-e.angle);return y[0]<v[0]&&y[1]>=v[1]?(i=Math.min(i,C[0]),s=Math.max(s,Math.max(w[0],S[0])),a=Math.min(a,x[1]),o=Math.max(o,S[1])):y[0]>=v[0]&&y[1]>v[1]?(i=Math.min(i,S[0]),s=Math.max(s,Math.max(x[0],w[0])),a=Math.min(a,C[1]),o=Math.max(o,w[1])):y[0]>=v[0]?(i=Math.min(i,w[0]),s=Math.max(s,C[0]),a=Math.min(a,S[1]),o=Math.max(o,x[1])):y[1]<=v[1]&&(i=Math.min(i,Math.min(w[0],x[0])),s=Math.max(s,S[0]),a=Math.min(a,w[1]),o=Math.max(o,C[1])),[i,a,s,o,c,d]}),z(_n,"getElementAbsoluteCoords",(e,t,n=!1)=>{let r,i,a,s,o;if(e.points.length<2||!gn.get(e)){let{minX:h,minY:f,maxX:g,maxY:U}=e.points.reduce((y,[v,x])=>(y.minY=Math.min(y.minY,x),y.minX=Math.min(y.minX,v),y.maxX=Math.max(y.maxX,v),y.maxY=Math.max(y.maxY,x),y),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});i=h+e.x,a=f+e.y,s=g+e.x,o=U+e.y}else{let h=gn.generateElementShape(e,null),f=Vl(h[0]),[g,U,y,v]=gU(f);i=g+e.x,a=U+e.y,s=y+e.x,o=v+e.y}let c=(i+s)/2,d=(a+o)/2;if(r=[i,a,s,o,c,d],!n)return r;let l=ct(e,t);return l&&(r=_n.getMinMaxXYWithBoundText(e,t,[i,a,s,o],l)),r});var Me=_n,Ate=e=>{let t=[...new Set(e.filter(n=>n!==null&&n!==-1))];return t=t.sort((n,r)=>n-r),t.length?t:null},Qu={},s2=(e,t)=>{let n=Qu[e]||(Qu[e]={height:t});return n.height=t,n},CA=e=>{Qu[e]&&delete Qu[e]},Lte=e=>{var t;return((t=Qu[e])==null?void 0:t.height)??null},Fr=(e,t,n,r=!0)=>{let i,a={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:(t==null?void 0:t.angle)??e.angle};a.text=e.text,(t||!e.autoResize)&&(i=t?vo(t,e):e.width,a.text=gd(e.originalText,$t(e),i));let s=Mr(a.text,$t(e),e.lineHeight);if(e.autoResize&&(a.width=s.width),a.height=s.height,t){let o=SU(t,e),c=vo(t,e);if(!ht(t)&&s.height>o){let f=od(s.height,t.type);he(t,{height:f},r),s2(t.id,f)}if(s.width>c){let f=od(s.width,t.type);he(t,{width:f},r)}let d={...e,...a},{x:l,y:h}=CU(t,d,n);a.x=l,a.y=h}he(e,a,r)},SA=(e,t,n)=>{let r=Qe(e);t.forEach(i=>{let a=n.get(i.id),s=yo(i);if(s){let o=n.get(s);if(o){let c=r.get(a);c&&he(c,{boundElements:(i.boundElements||[]).filter(l=>l.id!==o&&l.id!==s).concat({type:"text",id:o})});let d=r.get(o);d&&ke(d)&&he(d,{containerId:c?a:null})}}})},j1=(e,t,n,r=!1)=>{if(!yo(e))return;CA(e.id);let i=ct(e,t);if(i&&i.text){if(!e)return;let a=i.text,s=i.height,o=i.width,c=vo(e,i),d=SU(e,i),l=e.height;if(r||n!=="n"&&n!=="s"){a&&(a=gd(i.originalText,$t(i),c));let h=Mr(a,$t(i),i.lineHeight);s=h.height,o=h.width}if(s>d){l=od(s,e.type);let h=l-e.height,f=!ht(e)&&(n==="ne"||n==="nw"||n==="n")?e.y-h:e.y;he(e,{height:l,y:f})}he(i,{text:a,width:o,height:s}),ht(e)||he(i,CU(e,i,t))}},CU=(e,t,n)=>{if(ht(e))return Me.getBoundTextElementPosition(e,t,n);let r=Rte(e),i=SU(e,t),a=vo(e,t),s,o;return t.verticalAlign===yi.TOP?o=r.y:t.verticalAlign===yi.BOTTOM?o=r.y+(i-t.height):o=r.y+(i/2-t.height/2),t.textAlign===Yp.LEFT?s=r.x:t.textAlign===Yp.RIGHT?s=r.x+(a-t.width):s=r.x+(a/2-t.width/2),{x:s,y:o}},yo=e=>{var t,n,r;return((t=e==null?void 0:e.boundElements)==null?void 0:t.length)&&((r=(n=e==null?void 0:e.boundElements)==null?void 0:n.find(i=>i.type==="text"))==null?void 0:r.id)||null},ct=(e,t)=>{if(!e)return null;let n=yo(e);return n&&t.get(n)||null},lr=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,Bb=(e,t,n)=>{if(!ht(e))return{x:e.x+e.width/2,y:e.y+e.height/2};let r=Me.getPointsGlobalCoordinates(e,n);if(r.length%2===1){let s=Math.floor(e.points.length/2),o=Me.getPointGlobalCoordinates(e,e.points[s],n);return{x:o[0],y:o[1]}}let i=e.points.length/2-1,a=Me.getEditorMidPoints(e,n,t)[i];return a||(a=Me.getSegmentMidPoint(e,r[i],r[i+1],i+1,n)),{x:a[0],y:a[1]}},Rte=e=>{let t=Fn,n=Fn;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},Dte=(e,t)=>!t||ht(t)?e.angle:t.angle,jte=(e,t)=>e.some(n=>{if(tn(n)){let r=lr(n,t);return!ht(r)}return!1}),Pte=(e,t)=>e.some(n=>{if(tn(n)){let r=lr(n,t);return!ht(r)}return ke(n)}),Nte=new Set(["rectangle","ellipse","diamond","arrow"]),Ote=e=>Nte.has(e.type),od=(e,t)=>{e=Math.ceil(e);let n=Fn*2;return t==="ellipse"?Math.round((e+n)/Math.sqrt(2)*2):t==="arrow"?e+n*8:t==="diamond"?2*(e+n):e+n},vo=(e,t)=>{let{width:n}=e;if(ht(e)){let r=((t==null?void 0:t.fontSize)??Mo)*yV;return Math.max(bV*n,r)}return e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Fn*2:e.type==="diamond"?Math.round(n/2)-Fn*2:n-Fn*2},SU=(e,t)=>{let{height:n}=e;return ht(e)?n-Fn*8*2<=0?t.height:n:e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Fn*2:e.type==="diamond"?Math.round(n/2)-Fn*2:n-Fn*2},Fte=(e,t=`
|
|
64
|
+
|
|
65
|
+
`)=>e.reduce((n,r)=>(ke(r)&&n.push(r.text),n),[]).join(t),vi=e=>(e=e.trim(),e&&LM.sanitizeUrl(ig(e))),_A=e=>!!(e!=null&&e.includes(location.origin)||e!=null&&e.startsWith("/")),kA=e=>{if(e=vi(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e},C3=[],we=e=>(C3=C3.concat(e),e),TA='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',Bte='<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>',MA='<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>',$te=`data:${Be.svg},${encodeURIComponent(`${TA}${MA}</svg>`)}`,zte=`data:${Be.svg},${encodeURIComponent(`${TA}${Bte}${MA}</svg>`)}`,ma=e=>{e&&(e.style.cursor="")},Bt=(e,t)=>{e&&(e.style.cursor=t)},Ga,xC,IA=(e,t)=>{let n=()=>{let r=t===yt.DARK;Ga=document.createElement("canvas"),Ga.theme=t,Ga.height=20,Ga.width=20;let i=Ga.getContext("2d");i.lineWidth=1,i.beginPath(),i.arc(Ga.width/2,Ga.height/2,5,0,2*Math.PI),i.fillStyle=r?or.black:or.white,i.fill(),i.strokeStyle=r?or.white:or.black,i.stroke(),xC=Ga.toDataURL(Be.svg)};(!Ga||Ga.theme!==t)&&n(),Bt(e,`url(${xC}) ${20/2} ${20/2}, auto`)},Qa=(e,t)=>{if(e)if(t.activeTool.type==="selection")ma(e);else if(zu(t))e.style.cursor=Ot.GRAB;else if(ts(t))IA(e,t.theme);else if(t.activeTool.type==="laser"){let n=t.theme===yt.LIGHT?$te:zte;e.style.cursor=`url(${n}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Ot.AUTO):e.style.cursor=Ot.CROSSHAIR},Hte=new wM(Date.now()),Wte=0,ys=()=>Math.floor(Hte.next()*2**31),Qi=()=>go()?`id${Wte++}`:H8(),ja=(e,{x:t,y:n,strokeColor:r=vn.strokeColor,backgroundColor:i=vn.backgroundColor,fillStyle:a=vn.fillStyle,strokeWidth:s=vn.strokeWidth,strokeStyle:o=vn.strokeStyle,roughness:c=vn.roughness,opacity:d=vn.opacity,width:l=0,height:h=0,angle:f=0,groupIds:g=[],frameId:U=null,index:y=null,roundness:v=null,boundElements:x=null,link:w=null,locked:C=vn.locked,...S})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||l<-1e6||l>1e6||h<-1e6||h>1e6)&&console.error("New element size or position is too large",{x:t,y:n,width:l,height:h,points:S.points}),{id:S.id||Qi(),type:e,x:t,y:n,width:l,height:h,angle:f,strokeColor:r,backgroundColor:i,fillStyle:a,strokeWidth:s,strokeStyle:o,roughness:c,opacity:d,groupIds:g,frameId:U,index:y,roundness:v,seed:S.seed??ys(),version:S.version||1,versionNonce:S.versionNonce??0,isDeleted:!1,boundElements:x,updated:yh(),link:w,locked:C,customData:S.customData}),vs=e=>ja(e.type,e),wC=e=>ja("embeddable",e),Xte=e=>({...ja("iframe",e)}),x7=e=>lt({...ja("frame",e),type:"frame",name:(e==null?void 0:e.name)||null},{}),S3=e=>lt({...ja("magicframe",e),type:"magicframe",name:(e==null?void 0:e.name)||null},{}),AA=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),Ei=e=>{let t=e.fontFamily||Xl,n=e.fontSize||Mo,r=e.lineHeight||ad(t),i=Vu(e.text),a=Mr(i,$t({fontFamily:t,fontSize:n}),r),s=e.textAlign||T1,o=e.verticalAlign||$g,c=AA({textAlign:s,verticalAlign:o},a),d={...ja("text",e),text:i,fontSize:n,fontFamily:t,textAlign:s,verticalAlign:o,x:e.x-c.x,y:e.y-c.y,width:a.width,height:a.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:r};return lt(d,{})},Vte=(e,t,n)=>{let{width:r,height:i}=Mr(n,$t(e),e.lineHeight);e.autoResize||(r=e.width);let{textAlign:a,verticalAlign:s}=e,o,c;if(a==="center"&&s===yi.MIDDLE&&!e.containerId&&e.autoResize){let d=Mr(e.text,$t(e),e.lineHeight),l=AA(e,{width:r-d.width,height:i-d.height});o=e.x-l.x,c=e.y-l.y}else{let[d,l,h,f]=it(e,t),[g,U,y,v]=Al(e,r,i,!1),x=(d-g)/2,w=(l-U)/2,C=(h-y)/2,S=(f-v)/2;[o,c]=Yte({s:!0,e:a==="center"||a==="left",w:a==="center"||a==="right"},e.x,e.y,e.angle,x,w,C,S)}return{width:r,height:i,x:Number.isFinite(o)?o:e.x,y:Number.isFinite(c)?c:e.y}},Yte=(e,t,n,r,i,a,s,o)=>{let c=Math.cos(r),d=Math.sin(r);return e.e&&e.w?t+=i+s:e.e?(t+=i*(1+c),n+=i*d,t+=s*(1-c),n+=s*-d):e.w&&(t+=i*(1-c),n+=i*-d,t+=s*(1+c),n+=s*d),e.n&&e.s?n+=a+o:e.n?(t+=a*d,n+=a*(1-c),t+=o*-d,n+=o*(1+c)):(t+=a*-d,n+=a*(1+c),t+=o*d,n+=o*(1-c)),[t,n]},LA=(e,t,n,r=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(r=gd(r,$t(e),t?vo(t,e):e.width));let i=Vte(e,n,r);return{text:r,...i}},Gte=e=>({...ja(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure,lastCommittedPoint:null}),Wc=e=>({...ja(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null}),w7=e=>e.elbowed?{...ja(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...ja(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},RA=e=>({...ja("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,scale:e.scale??[1,1],crop:e.crop??null}),o2=(e,t=0)=>{if(e==null||typeof e!="object")return e;let n=Object.prototype.toString.call(e);if(n==="[object Object]"){let r=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let i in e)if(e.hasOwnProperty(i)){if(t===0&&(i==="shape"||i==="canvas"))continue;r[i]=o2(e[i],t+1)}return r}if(Array.isArray(e)){let r=e.length,i=new Array(r);for(;r--;)i[r]=o2(e[r],t+1);return i}return dt.DEV&&n!=="[object Object]"&&n!=="[object Array]"&&n.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},Ud=e=>o2(e),DA=(e,t)=>{Object.defineProperty(e,wV,{value:t,writable:!1,enumerable:!1})},l2=()=>Qi(),jA=(e,t,n,r)=>{let i=Ud(n);return go()&&DA(i,n.id),i.id=l2(),i.boundElements=null,i.updated=yh(),i.seed=ys(),i.groupIds=Ute(i.groupIds,e,a=>(t.has(a)||t.set(a,l2()),t.get(a))),r&&(i=Object.assign(i,r)),i},PA=(e,t)=>{let n=[],r=Qe(e),i=new Map,a=o=>{if(i.has(o))return i.get(o);if(r.has(o)){let c=l2();return i.set(o,c),c}return null},s=new Map;for(let o of e){let c=o2(o);if(c.id=a(o.id),go()&&DA(c,o.id),t!=null&&t.randomizeSeed&&(c.seed=ys(),LU(c)),c.groupIds&&(c.groupIds=c.groupIds.map(d=>(s.has(d)||s.set(d,l2()),s.get(d)))),"containerId"in c&&c.containerId){let d=a(c.containerId);c.containerId=d}if("boundElements"in c&&c.boundElements&&(c.boundElements=c.boundElements.reduce((d,l)=>{let h=a(l.id);return h&&d.push({...l,id:h}),d},[])),"endBinding"in c&&c.endBinding){let d=a(c.endBinding.elementId);c.endBinding=d?{...c.endBinding,elementId:d}:null}if("startBinding"in c&&c.startBinding){let d=a(c.startBinding.elementId);c.startBinding=d?{...c.startBinding,elementId:d}:null}c.frameId&&(c.frameId=a(c.frameId)),n.push(c)}return n},E7=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:r,reconciliationContext:i})=>{let a=[],s=c=>`${c==null?void 0:c.index}:${c==null?void 0:c.id}:${c==null?void 0:c.type}:${c==null?void 0:c.isDeleted}:${c==null?void 0:c.version}:${c==null?void 0:c.versionNonce}`,o=e.map(c=>c.index);for(let[c,d]of o.entries()){let l=o[c-1],h=o[c+1];if(_3(d,l,h)||a.push(`Fractional indices invariant has been compromised: "${s(e[c-1])}", "${s(e[c])}", "${s(e[c+1])}"`),n&&Ki(e[c])){let f=e[c],g=ct(f,Qe(e));g&&g.index<=f.index&&a.push(`Fractional indices invariant for bound elements has been compromised: "${s(g)}", "${s(f)}"`)}}if(a.length){let c=new uq,d=[];if(i&&(d.push("Additional reconciliation context:"),d.push(i.localElements.map(l=>s(l))),d.push(i.remoteElements.map(l=>s(l)))),r||console.error(a.join(`
|
|
66
|
+
|
|
67
|
+
`),c.stack,e.map(l=>s(l)),...d),t)throw c}},qte=e=>e.sort((t,n)=>EC(t)&&EC(n)?t.index<n.index?-1:t.index>n.index?1:t.id<n.id?-1:1:1),xs=(e,t)=>{try{let n=Zte(e,t),r=NA(e,n),i=e.map(a=>r.has(a)?{...a,...r.get(a)}:a);E7(i,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[a,s]of r)he(a,s,!1)}catch{xo(e)}return e},xo=e=>{let t=Kte(e),n=NA(e,t);for(let[r,i]of n)he(r,i,!1);return e},Zte=(e,t)=>{let n=[],r=0;for(;r<e.length;)if(t.has(e[r].id)){let i=[r-1,r];for(;++r<e.length&&t.has(e[r].id);)i.push(r);i.push(r),n.push(i)}else r++;return n},Kte=e=>{let t=[],n,r,i=-1,a=0,s=d=>{var f;let l=e[i]?e[i].index:void 0,h=(f=e[d-1])==null?void 0:f.index;return!l&&h||l&&h&&h>l?[h,d-1]:[l,i]},o=d=>{var f;let l=e[a]?e[a].index:void 0;if(l&&d<a)return[l,a];let h=a;for(;++h<e.length;){let g=(f=e[h])==null?void 0:f.index;if(!l&&g||l&&g&&g>l)return[g,h]}return[void 0,h]},c=0;for(;c<e.length;){let d=e[c].index;if([n,i]=s(c),[r,a]=o(c),_3(d,n,r))c++;else{let l=[i,c];for(;++c<e.length;){let h=e[c].index,[f,g]=s(c),[U,y]=o(c);if(_3(h,f,U))break;[n,i]=[f,g],[r,a]=[U,y],l.push(c)}l.push(a),t.push(l)}}return t},_3=(e,t,n)=>e?t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e:!1,NA=(e,t)=>{var r,i;let n=new Map;for(let a of t){let s=a.shift(),o=a.pop(),c=a3((r=e[s])==null?void 0:r.index,(i=e[o])==null?void 0:i.index,a.length);for(let d=0;d<a.length;d++){let l=e[a[d]];n.set(l,{index:c[d]})}}return n},EC=e=>!!e.index,An=class Ka{constructor(t,n){this.deleted=t,this.inserted=n}static create(t,n,r,i){let a=r&&i!=="inserted"?r(t):t,s=r&&i!=="deleted"?r(n):n;return new Ka(a,s)}static calculate(t,n,r,i){if(t===n)return Ka.empty();let a={},s={};for(let d of this.distinctKeysIterator("full",t,n))a[d]=t[d],s[d]=n[d];let[o,c]=i?i(a,s):[a,s];return Ka.create(o,c,r)}static empty(){return new Ka({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static mergeObjects(t,n,r){let i={...t};for(let a of Object.keys(r))delete i[a];return{...i,...n}}static mergeArrays(t,n,r,i){return Object.values(Ka.mergeObjects(Ys(t??[],i),Ys(n??[],i),Ys(r??[],i)))}static diffObjects(t,n,r,i){if(!(!t[r]&&!n[r])&&(typeof t[r]=="object"||typeof n[r]=="object")){let a=t[r]??{},s=n[r]??{},o=Ka.getLeftDifferences(a,s).reduce((d,l)=>(d[l]=i(a[l]),d),{}),c=Ka.getRightDifferences(a,s).reduce((d,l)=>(d[l]=i(s[l]),d),{});Object.keys(o).length||Object.keys(c).length?(Reflect.set(t,r,o),Reflect.set(n,r,c)):(Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r))}}static diffArrays(t,n,r,i){if(!(!t[r]&&!n[r])&&(Array.isArray(t[r])||Array.isArray(n[r]))){let a=Array.isArray(t[r])?t[r]:[],s=Array.isArray(n[r])?n[r]:[],o=Ys(Ka.getLeftDifferences(Ys(a,i),Ys(s,i))),c=Ys(Ka.getRightDifferences(Ys(a,i),Ys(s,i)));if(Object.keys(o).length||Object.keys(c).length){let d=a.filter(h=>o[i?i(h):String(h)]),l=s.filter(h=>c[i?i(h):String(h)]);Reflect.set(t,r,d),Reflect.set(n,r,l)}else Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r)}}static isLeftDifferent(t,n,r=!1){return!!this.distinctKeysIterator("left",t,n,r).next().value}static isRightDifferent(t,n,r=!1){return!!this.distinctKeysIterator("right",t,n,r).next().value}static getLeftDifferences(t,n,r=!1){return Array.from(this.distinctKeysIterator("left",t,n,r))}static getRightDifferences(t,n,r=!1){return Array.from(this.distinctKeysIterator("right",t,n,r))}static*distinctKeysIterator(t,n,r,i=!1){if(n===r)return;let a=[];t==="left"?a=Object.keys(n):t==="right"?a=Object.keys(r):t==="full"?a=Array.from(new Set([...Object.keys(n),...Object.keys(r)])):td(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let s of a){let o=n[s],c=r[s];if(o!==c){if(!i&&typeof o=="object"&&typeof c=="object"&&o!==null&&c!==null&&pr(o,c))continue;yield s}}}},CC=class ei{constructor(t){this.delta=t}static calculate(t,n){let r=An.calculate(t,n,void 0,ei.postProcess);return new ei(r)}static empty(){return new ei(An.create({},{}))}inverse(){let t=An.create(this.delta.inserted,this.delta.deleted);return new ei(t)}applyTo(t,n){try{let{selectedElementIds:r={},selectedGroupIds:i={}}=this.delta.deleted,{selectedElementIds:a={},selectedGroupIds:s={},selectedLinearElementId:o,editingLinearElementId:c,...d}=this.delta.inserted,l=An.mergeObjects(t.selectedElementIds,a,r),h=An.mergeObjects(t.selectedGroupIds,s,i),f=o&&n.has(o)?new Me(n.get(o)):null,g=c&&n.has(c)?new Me(n.get(c)):null,U={...t,...d,selectedElementIds:l,selectedGroupIds:h,selectedLinearElement:typeof o<"u"?f:t.selectedLinearElement,editingLinearElement:typeof c<"u"?g:t.editingLinearElement},y=this.filterInvisibleChanges(t,U,n);return[U,y]}catch(r){if(console.error("Couldn't apply appstate change",r),dt.DEV||dt.MODE===si.TEST)throw r;return[t,!1]}}isEmpty(){return An.isEmpty(this.delta)}static postProcess(t,n){try{An.diffObjects(t,n,"selectedElementIds",r=>!0),An.diffObjects(t,n,"selectedGroupIds",r=>r??!1)}catch(r){if(console.error("Couldn't postprocess appstate change deltas."),dt.DEV||dt.MODE===si.TEST)throw r}finally{return[t,n]}}filterInvisibleChanges(t,n,r){let i=c2(t),a=c2(n),s=An.isRightDifferent(ei.stripElementsProps(i),ei.stripElementsProps(a)),o=An.isRightDifferent(ei.stripStandaloneProps(i),ei.stripStandaloneProps(a));if(!s&&!o)return!1;let c={value:s};if(o){let d=An.getRightDifferences(ei.stripStandaloneProps(i),ei.stripStandaloneProps(a)),l=new Set;(d.includes("editingGroupId")||d.includes("selectedGroupIds"))&&(l=vte(r));for(let h of d)switch(h){case"selectedElementIds":n[h]=ei.filterSelectedElements(n[h],r,c);break;case"selectedGroupIds":n[h]=ei.filterSelectedGroups(n[h],l,c);break;case"croppingElementId":{let y=n[h],v=y&&r.get(y);v&&!v.isDeleted?c.value=!0:n[h]=null;break}case"editingGroupId":let f=n[h];f?l.has(f)?c.value=!0:n[h]=null:c.value=!0;break;case"selectedLinearElementId":case"editingLinearElementId":let g=ei.convertToAppStateKey(h),U=n[g];if(!U)c.value=!0;else{let y=r.get(U.elementId);y&&!y.isDeleted?c.value=!0:n[g]=null}break;default:td(h,`Unknown ObservedElementsAppState's key "${h}"`,!0)}}return c.value}static convertToAppStateKey(t){switch(t){case"selectedLinearElementId":return"selectedLinearElement";case"editingLinearElementId":return"editingLinearElement"}}static filterSelectedElements(t,n,r){let i=Object.keys(t);if(!i.length)return r.value=!0,t;let a={...t};for(let s of i){let o=n.get(s);o&&!o.isDeleted?r.value=!0:delete a[s]}return a}static filterSelectedGroups(t,n,r){if(!Object.keys(t).length)return r.value=!0,t;let i={...t};for(let a of Object.keys(i))n.has(a)?r.value=!0:delete i[a];return i}static stripElementsProps(t){let{editingGroupId:n,selectedGroupIds:r,selectedElementIds:i,editingLinearElementId:a,selectedLinearElementId:s,croppingElementId:o,...c}=t;return c}static stripStandaloneProps(t){let{name:n,viewBackgroundColor:r,...i}=t;return i}},pl=class hn{constructor(t,n,r){this.added=t,this.removed=n,this.updated=r}static create(t,n,r,i={shouldRedistribute:!1}){let a;if(i.shouldRedistribute){let s=new Map,o=new Map,c=new Map,d=[...t,...n,...r];for(let[l,h]of d)this.satisfiesAddition(h)?s.set(l,h):this.satisfiesRemoval(h)?o.set(l,h):c.set(l,h);a=new hn(s,o,c)}else a=new hn(t,n,r);return(dt.DEV||dt.MODE===si.TEST)&&(hn.validate(a,"added",this.satisfiesAddition),hn.validate(a,"removed",this.satisfiesRemoval),hn.validate(a,"updated",this.satisfiesUpdate)),a}static validate(t,n,r){for(let[i,a]of t[n].entries())if(!r(a))throw console.error(`Broken invariant for "${n}" delta, element "${i}", delta:`,a),new Error(`ElementsChange invariant broken for element "${i}".`)}static calculate(t,n){if(t===n)return hn.empty();let r=new Map,i=new Map,a=new Map;for(let s of t.values())if(!n.get(s.id)){let o={...s,isDeleted:!1},c={isDeleted:!0},d=An.create(o,c,hn.stripIrrelevantProps);i.set(s.id,d)}for(let s of n.values()){let o=t.get(s.id);if(!o){let c={isDeleted:!0},d={...s,isDeleted:!1},l=An.create(c,d,hn.stripIrrelevantProps);r.set(s.id,l);continue}if(o.versionNonce!==s.versionNonce){let c=An.calculate(o,s,hn.stripIrrelevantProps,hn.postProcess);if(typeof o.isDeleted=="boolean"&&typeof s.isDeleted=="boolean"&&o.isDeleted!==s.isDeleted){o.isDeleted&&!s.isDeleted?r.set(s.id,c):i.set(s.id,c);continue}An.isEmpty(c)||a.set(s.id,c)}}return hn.create(r,i,a)}static empty(){return hn.create(new Map,new Map,new Map)}inverse(){let t=a=>{let s=new Map;for(let[o,c]of a.entries())s.set(o,An.create(c.inserted,c.deleted));return s},n=t(this.added),r=t(this.removed),i=t(this.updated);return hn.create(r,n,i)}isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}applyLatestChanges(t){let n=o=>c=>{let d={};for(let l of Object.keys(c))switch(l){case"boundElements":d[l]=c[l];break;default:d[l]=o[l]}return d},r=o=>{let c=new Map;for(let[d,l]of o.entries()){let h=t.get(d);if(h){let f=An.create(l.deleted,l.inserted,n(h),"inserted");c.set(d,f)}else c.set(d,l)}return c},i=r(this.added),a=r(this.removed),s=r(this.updated);return hn.create(i,a,s,{shouldRedistribute:!0})}applyTo(t,n){let r=qi(new Map(t)),i,a={containsVisibleDifference:!1,containsZindexDifference:!1};try{let s=hn.createApplier(r,n,a),o=s(this.added),c=s(this.removed),d=s(this.updated),l=this.resolveConflicts(t,r);i=new Map([...o,...c,...d,...l])}catch(s){if(console.error("Couldn't apply elements change",s),dt.DEV||dt.MODE===si.TEST)throw s;return[t,!0]}try{hn.redrawTextBoundingBoxes(r,i),r=hn.reorderElements(r,i,a),hn.redrawBoundArrows(r,i)}catch(s){if(console.error("Couldn't mutate elements after applying elements change",s),dt.DEV||dt.MODE===si.TEST)throw s}finally{return[r,a.containsVisibleDifference]}}static applyDelta(t,n,r={containsVisibleDifference:!0,containsZindexDifference:!0}){var s,o;let{boundElements:i,...a}=n.inserted;if((s=n.deleted.boundElements)!=null&&s.length||(o=n.inserted.boundElements)!=null&&o.length){let c=An.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,d=>d.id);Object.assign(a,{boundElements:c})}if(Lt(t)){let c=n;(c.deleted.crop||c.inserted.crop)&&Object.assign(a,{crop:c.inserted.crop??null})}if(!r.containsVisibleDifference){let{index:c,...d}=a,l=hn.checkForVisibleDifference(t,d);r.containsVisibleDifference=l}return r.containsZindexDifference||(r.containsZindexDifference=n.deleted.index!==n.inserted.index),lt(t,a)}static checkForVisibleDifference(t,n){return t.isDeleted&&n.isDeleted!==!1?!1:t.isDeleted&&n.isDeleted===!1||t.isDeleted===!1&&n.isDeleted?!0:An.isRightDifferent(t,n)}resolveConflicts(t,n){let r=new Map,i=(d,l)=>{let h=n.get(d.id);if(!h)return;let f;t.get(d.id)===h?f=lt(h,l):f=he(h,l),r.set(f.id,f),n.set(f.id,f)};for(let[d]of this.removed)hn.unbindAffected(t,n,d,i);for(let[d]of this.added)hn.rebindAffected(t,n,d,i);for(let[d]of Array.from(this.updated).filter(([l,h])=>Object.keys({...h.deleted,...h.inserted}).find(f=>dte.has(f)))){let l=n.get(d);!l||l.isDeleted||hn.rebindAffected(t,n,d,i)}let a=new Map(Array.from(t).filter(([d])=>r.has(d))),{added:s,removed:o,updated:c}=hn.calculate(a,r);for(let[d,l]of s)this.added.set(d,l);for(let[d,l]of o)this.removed.set(d,l);for(let[d,l]of c)this.updated.set(d,l);return r}static unbindAffected(t,n,r,i){let a=()=>t.get(r),s=()=>n.get(r);vu.unbindAffected(n,a(),i),vu.unbindAffected(n,s(),i),xu.unbindAffected(n,a(),i),xu.unbindAffected(n,s(),i)}static rebindAffected(t,n,r,i){let a=()=>t.get(r),s=()=>n.get(r);vu.unbindAffected(n,a(),i),vu.rebindAffected(n,s(),i),xu.unbindAffected(n,a(),(o,c)=>{ke(o)&&i(o,c)}),xu.rebindAffected(n,s(),i)}static redrawTextBoundingBoxes(t,n){let r=new Map;for(let i of n.values()){if(tn(i)){let{containerId:a}=i,s=a?t.get(a):void 0;s&&r.set(s.id,{container:s,boundText:i})}if(Ki(i)){let a=yo(i),s=a?t.get(a):void 0;s&&r.set(i.id,{container:i,boundText:s})}}for(let{container:i,boundText:a}of r.values())i.isDeleted||a.isDeleted||Fr(a,i,t,!1)}static redrawBoundArrows(t,n){for(let r of n.values())!r.isDeleted&&Ra(r)&&ci(r,t,{})}static reorderElements(t,n,r){if(!r.containsZindexDifference)return t;let i=Array.from(t.values()),a=qte([...i]),s=An.getRightDifferences(i,a,!0).reduce((o,c)=>{let d=i[Number(c)];return d&&n.has(d.id)&&o.set(d.id,d),o},new Map);return!r.containsVisibleDifference&&s.size&&(r.containsVisibleDifference=!0),Qe(xs(a,s))}static postProcess(t,n){try{An.diffArrays(t,n,"boundElements",r=>r.id)}catch(r){if(console.error("Couldn't postprocess elements change deltas."),dt.DEV||dt.MODE===si.TEST)throw r}finally{return[t,n]}}static stripIrrelevantProps(t){let{id:n,updated:r,version:i,versionNonce:a,seed:s,...o}=t;return o}};z(pl,"satisfiesAddition",({deleted:e,inserted:t})=>e.isDeleted===!0&&!t.isDeleted),z(pl,"satisfiesRemoval",({deleted:e,inserted:t})=>!e.isDeleted&&t.isDeleted===!0),z(pl,"satisfiesUpdate",({deleted:e,inserted:t})=>!!e.isDeleted==!!t.isDeleted),z(pl,"createApplier",(e,t,n)=>{let r=pl.createGetter(e,t,n);return i=>Array.from(i.entries()).reduce((a,[s,o])=>{let c=r(s,o.inserted);if(c){let d=pl.applyDelta(c,o,n);e.set(d.id,d),a.set(d.id,d)}return a},new Map)}),z(pl,"createGetter",(e,t,n)=>(r,i)=>{let a=e.get(r);return a||(a=t.get(r),a&&(n.containsZindexDifference=!0,(i.isDeleted===!1||i.isDeleted!==!0&&a.isDeleted===!1)&&(n.containsVisibleDifference=!0))),a});var SC=pl,ns=class{constructor(){z(this,"subscribers",[])}on(...e){let t=e.flat().filter(n=>typeof n=="function");return this.subscribers.push(...t),()=>this.off(t)}once(...e){let t=e.flat().filter(r=>typeof r=="function");t.push(()=>n());let n=this.on(...t);return n}off(...e){let t=e.flat();this.subscribers=this.subscribers.filter(n=>!t.includes(n))}trigger(...e){for(let t of this.subscribers)t(...e);return this}clear(){this.subscribers=[]}},OA="__observedAppState",c2=e=>{var n,r;let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,editingLinearElementId:((n=e.editingLinearElement)==null?void 0:n.elementId)||null,selectedLinearElementId:((r=e.selectedLinearElement)==null?void 0:r.elementId)||null,croppingElementId:e.croppingElementId};return Reflect.defineProperty(t,OA,{value:!0,enumerable:!1}),t},Qte=e=>!!Reflect.get(e,OA),se={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},Jte=class{constructor(e,t){this.elementsChange=e,this.appStateChange=t}},ene=class{constructor(){z(this,"onStoreIncrementEmitter",new ns),z(this,"scheduledActions",new Set),z(this,"_snapshot",_C.empty()),z(this,"shouldCaptureIncrement",()=>{this.scheduleAction(se.IMMEDIATELY)}),z(this,"shouldUpdateSnapshot",()=>{this.scheduleAction(se.NEVER)}),z(this,"scheduleAction",e=>{this.scheduledActions.add(e),this.satisfiesScheduledActionsInvariant()}),z(this,"commit",(e,t)=>{try{this.scheduledActions.has(se.IMMEDIATELY)?this.captureIncrement(e,t):this.scheduledActions.has(se.NEVER)&&this.updateSnapshot(e,t)}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledActions=new Set}}),z(this,"captureIncrement",(e,t)=>{let n=this.snapshot,r=this.snapshot.maybeClone(e,t);if(n!==r){let i=r.meta.didElementsChange?SC.calculate(n.elements,r.elements):SC.empty(),a=r.meta.didAppStateChange?CC.calculate(n.appState,r.appState):CC.empty();(!i.isEmpty()||!a.isEmpty())&&this.onStoreIncrementEmitter.trigger(new Jte(i,a)),this.snapshot=r}}),z(this,"updateSnapshot",(e,t)=>{let n=this.snapshot.maybeClone(e,t);this.snapshot!==n&&(this.snapshot=n)}),z(this,"filterUncomittedElements",(e,t)=>{for(let[n,r]of e.entries()){if(!t.get(n))continue;let i=this.snapshot.elements.get(n);i?i.version<r.version&&t.set(n,i):t.delete(n)}return t}),z(this,"clear",()=>{this.snapshot=_C.empty(),this.scheduledActions=new Set}),z(this,"satisfiesScheduledActionsInvariant",()=>{if(!(this.scheduledActions.size>=0&&this.scheduledActions.size<=3)){let e=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledActions.size}".`;if(console.error(e,this.scheduledActions.values()),dt.DEV||dt.MODE===si.TEST)throw new Error(e)}})}get snapshot(){return this._snapshot}set snapshot(e){this._snapshot=e}},_C=class k3{constructor(t,n,r={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t,this.appState=n,this.meta=r}static empty(){return new k3(new Map,c2(Us()),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}isEmpty(){return this.meta.isEmpty}maybeClone(t,n){let r=this.maybeCreateElementsSnapshot(t),i=this.maybeCreateAppStateSnapshot(n),a=!1,s=!1;return this.elements!==r&&(a=!0),this.appState!==i&&(s=!0),!a&&!s?this:new k3(r,i,{didElementsChange:a,didAppStateChange:s})}maybeCreateAppStateSnapshot(t){if(!t)return this.appState;let n=Qte(t)?t:c2(t);return this.detectChangedAppState(n)?n:this.appState}detectChangedAppState(t){return!pr(this.appState,t,{selectedElementIds:pr,selectedGroupIds:pr})}maybeCreateElementsSnapshot(t){return t?this.detectChangedElements(t)?this.createElementsSnapshot(t):this.elements:this.elements}detectChangedElements(t){if(this.elements===t)return!1;if(this.elements.size!==t.size)return!0;let n=Array.from(t.keys());for(let r=n.length-1;r>=0;r--){let i=this.elements.get(n[r]),a=t.get(n[r]);if(!i||!a||i.id!==a.id||i.versionNonce!==a.versionNonce)return!0}return!1}createElementsSnapshot(t){let n=new Map;for(let[r,i]of this.elements.entries())t.get(r)?n.set(r,i):n.set(r,lt(i,{isDeleted:!0}));for(let[r,i]of t.entries()){let a=n.get(r);(!a||a&&a.versionNonce!==i.versionNonce)&&n.set(r,Ud(i))}return n}},qa=new Map,tne=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/,nne=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,rne=/^https:\/\/(?:www\.)?figma\.com/,kC=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,ine=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,TC=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,ane=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,sne=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,one=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,MC=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,IC=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,lne=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,T3=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com"]),AC=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com"]),vp=e=>`<html><body>${e}</body></html>`,wu=e=>{if(!e)return null;if(qa.has(e))return qa.get(e);let t=e,n=AC.has(M3(e,AC)||""),r="generic",i={w:560,h:840},a=e.match(tne);if(a!=null&&a[2]){let c=a[3]?`&start=${a[3]}`:"",d=e.includes("shorts");switch(r="video",a[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${a[2]}?enablejsapi=1${c}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${a[2]}&enablejsapi=1${c}`;break;default:e=`https://www.youtube.com/embed/${a[2]}?enablejsapi=1${c}`;break}return i=d?{w:315,h:560}:{w:560,h:315},qa.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}}let s=e.match(nne);if(s!=null&&s[1]){let c=s==null?void 0:s[1],d=/^\d+$/.test(c)?void 0:new URIError("Invalid embed link format");return r="video",e=`https://player.vimeo.com/video/${c}?api=1`,i={w:560,h:315},qa.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,error:d,sandbox:{allowSameOrigin:n}}}if(e.match(rne))return r="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},qa.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}};let o=e.match(sne);if(o)return e=o[1]==="embed"?o[0]:o[0].replace("/v","/embed"),qa.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}};if(TC.test(e)){let c=e.match(TC)[1],d=ig(`https://twitter.com/x/status/${c}`),l={type:"document",srcdoc:h=>vp(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${h}"><a href="${d}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return qa.set(t,l),l}if(IC.test(e)){let[,c,d,l]=e.match(IC),h=ig(`https://reddit.com/r/${c}/comments/${d}/${l}`),f={type:"document",srcdoc:g=>vp(`<blockquote class="reddit-embed-bq" data-embed-theme="${g}"><a href="${h}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return qa.set(t,f),f}if(kC.test(e)){let[,c,d]=e.match(kC),l=ig(`https://gist.github.com/${c}/${d}`),h={type:"document",srcdoc:()=>vp(`
|
|
68
|
+
<script src="${l}.js"><\/script>
|
|
69
|
+
<style type="text/css">
|
|
70
|
+
* { margin: 0px; }
|
|
71
|
+
table, .gist { height: 100%; }
|
|
72
|
+
.gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
|
|
73
|
+
</style>
|
|
74
|
+
`),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return qa.set(e,h),h}return qa.set(e,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}},FA=e=>{let t;Ul(e)?t="IFrame element":t=!e.link||(e==null?void 0:e.link)===""?"Empty Web-Embed":e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),r=fn.Helvetica,i=$t({fontSize:n,fontFamily:r});return Ei({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:r,fontSize:n,text:gd(t,i,e.width-20),textAlign:"center",verticalAlign:yi.MIDDLE,angle:e.angle??0})};we({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,n,r)=>{let i=Ln(t,{type:"embeddable"});return Qa(r.canvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Ln(t,{type:"embeddable"})},captureUpdate:se.EVENTUALLY}}});var M3=(e,t)=>{try{let{hostname:n}=new URL(e),r=n.replace(/^www\./,"");if(t instanceof Set){if(T3.has(r))return r;let a=r.replace(/^([^.]+)/,"*");return T3.has(a)?a:null}let i=t.replace(/^www\./,"");if(r===i)return i}catch{}return null},cne=e=>{let t=e.match(ane);if(t&&t.length===2)return t[1];let n=e.match(lne);if(n&&n.length===2)return n[1];let r=e.match(ine);if(r&&r.length===2)return r[1];if(MC.test(e))return`https://giphy.com/embed/${MC.exec(e)[1]}`;let i=e.match(one);return i&&i.length===2?i[1]:e},ug=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let n=t(e);if(typeof n=="boolean")return n}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if(M3(e,n))return!0;return!1}}return!!M3(e,T3)},Af=(e,t,n)=>{let r={sets:t.sets,shape:t.shape,options:{...t.options,fixedDecimalPlaceDigits:n}};return e.draw(r)},Lf=(e,t,n,r,i)=>{if(!r.enabled||!r.clip)return null;let a=di(e,i);if(a){let s=t.ownerDocument.createElementNS(kt,"g");return s.setAttributeNS(kt,"clip-path",`url(#${a.id})`),n.forEach(o=>s.appendChild(o)),s}return null},hg=(e,t,n,r,i,a,s,o)=>{var C;let c={x:a,y:s},[d,l,h,f]=it(e,t),g=(h-d)/2-(e.x-d),U=(f-l)/2-(e.y-l);if(ke(e)){let S=lr(e,t);if(ht(S)){let[T,M,_,R]=it(S,t),P=Me.getBoundTextElementPosition(S,e,t);g=(_-T)/2-(P.x-T),U=(R-M)/2-(P.y-M),a=a+P.x-e.x,s=s+P.y-e.y}}let y=180*e.angle/Math.PI,v=r;if(e.link){let S=r.ownerDocument.createElementNS(kt,"a");S.setAttribute("href",vi(e.link)),v.appendChild(S),v=S}let x=(S,T)=>{go()&&S.setAttribute("data-id",T.id),v.appendChild(S)},w=(((C=di(e,t))==null?void 0:C.opacity)??100)*e.opacity/1e4;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{let S=gn.generateElementShape(e,null),T=Af(n,S,Tf);w!==1&&(T.setAttribute("stroke-opacity",`${w}`),T.setAttribute("fill-opacity",`${w}`)),T.setAttribute("stroke-linecap","round"),T.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`);let M=Lf(e,v,[T],o.frameRendering,t);x(M||T,e);break}case"iframe":case"embeddable":{let S=gn.generateElementShape(e,o),T=Af(n,S,Tf),M=e.opacity/100;M!==1&&(T.setAttribute("stroke-opacity",`${M}`),T.setAttribute("fill-opacity",`${M}`)),T.setAttribute("stroke-linecap","round"),T.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),x(T,e);let _=FA(e);hg(_,t,n,v,i,_.x+c.x-e.x,_.y+c.y-e.y,o);let R=Af(n,S,Tf);for(R.setAttribute("stroke-linecap","round"),R.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`);R.firstChild;)R.removeChild(R.firstChild);let P=Ta(Math.min(e.width,e.height),e),j=wu(kA(e.link||""));if(o.renderEmbeddables===!1||(j==null?void 0:j.type)==="document"){let N=r.ownerDocument.createElementNS(kt,"a");N.setAttribute("href",vi(e.link||"")),N.setAttribute("target","_blank"),N.setAttribute("rel","noopener noreferrer"),N.style.borderRadius=`${P}px`,R.appendChild(N)}else{let N=r.ownerDocument.createElementNS(kt,"foreignObject");N.style.width=`${e.width}px`,N.style.height=`${e.height}px`,N.style.border="none";let F=N.ownerDocument.createElementNS(kt,"div");F.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),F.style.width="100%",F.style.height="100%";let B=F.ownerDocument.createElement("iframe");B.src=(j==null?void 0:j.link)??"",B.style.width="100%",B.style.height="100%",B.style.border="none",B.style.borderRadius=`${P}px`,B.style.top="0",B.style.left="0",B.allowFullscreen=!0,F.appendChild(B),N.appendChild(F),R.appendChild(N)}x(R,e);break}case"line":case"arrow":{let S=ct(e,t),T=r.ownerDocument.createElementNS(kt,"mask");if(S){T.setAttribute("id",`mask-${e.id}`);let R=r.ownerDocument.createElementNS(kt,"rect");a=a||0,s=s||0,R.setAttribute("x","0"),R.setAttribute("y","0"),R.setAttribute("fill","#fff"),R.setAttribute("width",`${e.width+100+a}`),R.setAttribute("height",`${e.height+100+s}`),T.appendChild(R);let P=r.ownerDocument.createElementNS(kt,"rect"),j=Me.getBoundTextElementPosition(e,S,t),N=a+j.x-e.x,F=s+j.y-e.y;P.setAttribute("x",N.toString()),P.setAttribute("y",F.toString()),P.setAttribute("fill","#000"),P.setAttribute("width",`${S.width}`),P.setAttribute("height",`${S.height}`),P.setAttribute("opacity","1"),T.appendChild(P)}let M=r.ownerDocument.createElementNS(kt,"g");S&&M.setAttribute("mask",`url(#mask-${e.id})`),M.setAttribute("stroke-linecap","round"),gn.generateElementShape(e,o).forEach(R=>{let P=Af(n,R,Tf);w!==1&&(P.setAttribute("stroke-opacity",`${w}`),P.setAttribute("fill-opacity",`${w}`)),P.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),e.type==="line"&&Uo(e.points)&&e.backgroundColor!=="transparent"&&P.setAttribute("fill-rule","evenodd"),M.appendChild(P)});let _=Lf(e,v,[M,T],o.frameRendering,t);_?(x(_,e),v.appendChild(_)):(x(M,e),v.append(T));break}case"freedraw":{let S=gn.generateElementShape(e,o),T=S?Af(n,S,Tf):r.ownerDocument.createElementNS(kt,"g");w!==1&&(T.setAttribute("stroke-opacity",`${w}`),T.setAttribute("fill-opacity",`${w}`)),T.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),T.setAttribute("stroke","none");let M=r.ownerDocument.createElementNS(kt,"path");M.setAttribute("fill",e.strokeColor),M.setAttribute("d",rA(e)),T.appendChild(M);let _=Lf(e,v,[T],o.frameRendering,t);x(_||T,e);break}case"image":{let S=Math.round(e.width),T=Math.round(e.height),M=zi(e)&&i[e.fileId];if(M){let{reuseImages:_=!0}=o,R=`image-${M.id}`,P=e.width,j=e.height;e.crop&&({width:P,height:j}=bo(e),R=`image-crop-${M.id}-${Bre(`${P}x${j}`)}`),_||(R=`image-${e.id}`);let N=r.querySelector(`#${R}`);if(!N){N=r.ownerDocument.createElementNS(kt,"symbol"),N.id=R;let H=r.ownerDocument.createElementNS(kt,"image");H.setAttribute("href",M.dataURL),H.setAttribute("preserveAspectRatio","none"),e.crop||!_?(H.setAttribute("width",`${P}`),H.setAttribute("height",`${j}`)):(H.setAttribute("width","100%"),H.setAttribute("height","100%")),N.appendChild(H),(v.querySelector("defs")||v).prepend(N)}let F=r.ownerDocument.createElementNS(kt,"use");F.setAttribute("href",`#${R}`),o.exportWithDarkMode&&M.mimeType!==Be.svg&&F.setAttribute("filter",qI);let B=0,G=0;if(e.crop){let{width:H,height:Z}=bo(e);B=e.crop.x/(e.crop.naturalWidth/H),G=e.crop.y/(e.crop.naturalHeight/Z)}let W=g+B,X=U+G;F.setAttribute("width",`${S+B}`),F.setAttribute("height",`${T+G}`),F.setAttribute("opacity",`${w}`),(e.scale[0]!==1||e.scale[1]!==1)&&F.setAttribute("transform",`translate(${W} ${X}) scale(${e.scale[0]} ${e.scale[1]}) translate(${-W} ${-X})`);let $=r.ownerDocument.createElementNS(kt,"g");if(e.crop){let H=r.ownerDocument.createElementNS(kt,"mask");H.setAttribute("id",`mask-image-crop-${e.id}`),H.setAttribute("fill","#fff");let Z=r.ownerDocument.createElementNS(kt,"rect");Z.setAttribute("x",`${B}`),Z.setAttribute("y",`${G}`),Z.setAttribute("width",`${S}`),Z.setAttribute("height",`${T}`),H.appendChild(Z),v.appendChild(H),$.setAttribute("mask",`url(#${H.id})`)}if($.appendChild(F),$.setAttribute("transform",`translate(${a-B} ${s-G}) rotate(${y} ${W} ${X})`),e.roundness){let H=r.ownerDocument.createElementNS(kt,"clipPath");H.id=`image-clipPath-${e.id}`;let Z=r.ownerDocument.createElementNS(kt,"rect"),V=Ta(Math.min(e.width,e.height),e);Z.setAttribute("width",`${e.width}`),Z.setAttribute("height",`${e.height}`),Z.setAttribute("rx",`${V}`),Z.setAttribute("ry",`${V}`),H.appendChild(Z),x(H,e),$.setAttributeNS(kt,"clip-path",`url(#${H.id})`)}let Y=Lf(e,v,[$],o.frameRendering,t);x(Y||$,e)}break}case"frame":case"magicframe":{if(o.frameRendering.enabled&&o.frameRendering.outline){let S=document.createElementNS(kt,"rect");S.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),S.setAttribute("width",`${e.width}px`),S.setAttribute("height",`${e.height}px`),S.setAttribute("rx",pn.radius.toString()),S.setAttribute("ry",pn.radius.toString()),S.setAttribute("fill","none"),S.setAttribute("stroke",pn.strokeColor),S.setAttribute("stroke-width",pn.strokeWidth.toString()),x(S,e)}break}default:if(ke(e)){let S=r.ownerDocument.createElementNS(kt,"g");w!==1&&(S.setAttribute("stroke-opacity",`${w}`),S.setAttribute("fill-opacity",`${w}`)),S.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`);let T=e.text.replace(/\r\n?/g,`
|
|
75
|
+
`).split(`
|
|
76
|
+
`),M=L1(e.fontSize,e.lineHeight),_=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,R=PI(e.fontFamily,e.fontSize,M),P=JM(e.text)?"rtl":"ltr",j=e.textAlign==="center"?"middle":e.textAlign==="right"||P==="rtl"?"end":"start";for(let F=0;F<T.length;F++){let B=r.ownerDocument.createElementNS(kt,"text");B.textContent=T[F],B.setAttribute("x",`${_}`),B.setAttribute("y",`${F*M+R}`),B.setAttribute("font-family",Hu(e)),B.setAttribute("font-size",`${e.fontSize}px`),B.setAttribute("fill",e.strokeColor),B.setAttribute("text-anchor",j),B.setAttribute("style","white-space: pre;"),B.setAttribute("direction",P),B.setAttribute("dominant-baseline","alphabetic"),S.appendChild(B)}let N=Lf(e,v,[S],o.frameRendering,t);x(N||S,e)}else throw new Error(`Unimplemented type ${e.type}`)}},dne=(e,t,n,r,i,a)=>{r&&(e.filter(s=>!Hi(s)).forEach(s=>{if(!s.isDeleted){if(ke(s)&&s.containerId&&t.has(s.containerId))return;try{hg(s,t,n,r,i,s.x+a.offsetX,s.y+a.offsetY,a);let o=ct(s,t);o&&hg(o,t,n,r,i,o.x+a.offsetX,o.y+a.offsetY,a)}catch(o){console.error(o)}}}),e.filter(s=>Hi(s)).forEach(s=>{if(!s.isDeleted)try{hg(s,t,n,r,i,s.x+a.offsetX,s.y+a.offsetY,a)}catch(o){console.error(o)}}))},LC=500,C7=e=>{var r,i;let t=(r=e.extensions)==null?void 0:r.reduce((a,s)=>(a.push(Be[s]),a),[]),n=(i=e.extensions)==null?void 0:i.reduce((a,s)=>s==="jpg"?a.concat(".jpg",".jpeg"):a.concat(`.${s}`),[]);return OX({description:e.description,extensions:n,mimeTypes:t,multiple:e.multiple??!1,legacySetup:(a,s,o)=>{let c=Wu(s,LC),d=()=>{l(),document.addEventListener("keyup",c),document.addEventListener("pointerup",c),c()},l=()=>{var f;if((f=o.files)!=null&&f.length){let g=e.multiple?[...o.files]:o.files[0];a(g)}};requestAnimationFrame(()=>{window.addEventListener("focus",d)});let h=window.setInterval(()=>{l()},LC);return f=>{clearInterval(h),c.cancel(),window.removeEventListener("focus",d),document.removeEventListener("keyup",c),document.removeEventListener("pointerup",c),f&&(console.warn("Opening the file was canceled (legacy-fs)."),f(new pU))}}})},d2=(e,t)=>BX(e,{fileName:`${t.name}.${t.extension}`,description:t.description,extensions:[`.${t.extension}`],mimeTypes:t.mimeTypes},t.fileHandle),une=(e,t)=>{let n={};for(let r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},_U=(e,t,n,r)=>{let i={type:Vi.excalidraw,version:oU.excalidraw,source:Y8,elements:EL(e),appState:GM(t),files:une(e,n)};return JSON.stringify(i,null,2)},BA=async(e,t,n,r=t.name||VM)=>{let i=_U(e,t,n),a=new Blob([i],{type:Be.excalidraw});return{fileHandle:await d2(a,{name:r,extension:"excalidraw",description:"Excalidraw file",fileHandle:ev(t.fileHandle)?null:t.fileHandle})}},hne=async(e,t)=>{let n=await C7({description:"Excalidraw files"});return TL(await tv(n),e,t,n.handle)},fne=e=>(e==null?void 0:e.type)===Vi.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||typeof e.appState=="object")),$A=e=>typeof e=="object"&&e&&e.type===Vi.excalidrawLibrary&&(e.version===1||e.version===2),zA=e=>{let t={type:Vi.excalidrawLibrary,version:oU.excalidrawLibrary,source:Y8,libraryItems:e};return JSON.stringify(t,null,2)},pne=async e=>{let t=zA(e);await d2(new Blob([t],{type:Be.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})},HA=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t(r)},r.onerror=i=>{n(i)},r.src=e}),WA=async({fileIds:e,files:t,imageCache:n})=>{let r=new Map,i=new Map;return await Promise.all(e.reduce((a,s)=>{let o=t[s];return o&&!r.has(s)?(r.set(s,!0),a.concat((async()=>{try{if(o.mimeType===Be.binary)throw new Error("Only images can be added to ImageCache");let c=HA(o.dataURL),d={image:c,mimeType:o.mimeType};n.set(s,d);let l=await c;n.set(s,{...d,image:l})}catch{i.set(s,!0)}})())):a},[])),{imageCache:n,updatedFiles:r,erroredFiles:i}},XA=e=>e.filter(t=>zi(t)),mne=e=>(e==null?void 0:e.nodeName.toLowerCase())==="svg",RC=e=>{let t=new DOMParser().parseFromString(e,Be.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||!mne(n))throw new Error("Invalid SVG");{n.hasAttribute("xmlns")||n.setAttribute("xmlns",kt);let r=n.getAttribute("width"),i=n.getAttribute("height");(r!=null&&r.includes("%")||r==="auto")&&(r=null),(i!=null&&i.includes("%")||i==="auto")&&(i=null);let a=n.getAttribute("viewBox");if(!r||!i){if(r=r||"50",i=i||"50",a){let s=a.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);s&&([,r,i]=s)}n.setAttribute("width",r),n.setAttribute("height",i)}return a||n.setAttribute("viewBox",`0 0 ${r} ${i}`),n.outerHTML}},VA=document.createElement("img");VA.src=`data:${Be.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>')}`;var YA=document.createElement("img");YA.src=`data:${Be.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-big-right-line"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 9v-3.586a1 1 0 0 1 1.707 -.707l6.586 6.586a1 1 0 0 1 0 1.414l-6.586 6.586a1 1 0 0 1 -1.707 -.707v-3.586h-6v-6h6z" /><path d="M3 9v6" /></svg>')}`;var S7=([e,t,n,r],i,a)=>{let s=vee,o=s/a.zoom.value,c=s/a.zoom.value,d=s/a.zoom.value,l=(e+n)/2,h=(t+r)/2,f=(s-8)/(2*a.zoom.value),g=4/a.zoom.value,U=n+g-f,y=t-g-d+f,[v,x]=oe(A(U+o/2,y+c/2),A(l,h),i);return[v-o/2,x-c/2,o,c]},GA=(e,t,n,[r,i])=>{let a=4/n.zoom.value,[s,o,c,d]=it(e,t),[l,h,f,g]=S7([s,o,c,d],e.angle,n);return r>l-a&&r<l+a+f&&i>h-a&&i<h+g+a},$b=(e,t,n,[r,i],a)=>!e.link||n.selectedElementIds[e.id]?!1:!a&&n.viewModeEnabled&&f7(r,i,e,t)?!0:GA(e,t,n,A(r,i)),kU=(e,t,n,r,i=!0)=>{e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fill(),i&&e.stroke()},_7=(e,t)=>[e.width/t,e.height/t],k7=({canvas:e,scale:t,normalizedWidth:n,normalizedHeight:r,theme:i,isExporting:a,viewBackgroundColor:s})=>{let o=e.getContext("2d");return o.setTransform(1,0,0,1,0,0),o.scale(t,t),a&&i===yt.DARK&&(o.filter=Z8),typeof s=="string"?((s==="transparent"||s.length===5||s.length===9||/(hsla|rgba)\(/.test(s))&&o.clearRect(0,0,n,r),o.save(),o.fillStyle=s,o.fillRect(0,0,n,r),o.restore()):o.clearRect(0,0,n,r),o},qA=(e,t)=>{let n=window.location.href;try{let r=new URL(n);return r.searchParams.set(Xg,e),vi(r.toString())}catch(r){console.error(r)}return vi(n)},ZA=(e,t)=>{if(e.length>0&&u2(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},u2=e=>!!(e.length===1||e.length>1&&wA(e)),xp=e=>{try{let t=new URL(e);return t.searchParams.has(Xg)&&t.host===window.location.host}catch{return!1}},gne=e=>{try{let{searchParams:t}=new URL(e);if(t.has(Xg))return t.get(Xg)}catch{}return null},wm={Bold:"#dddddd",Regular:"#e5e5e5"},Une=(e,t,n,r,i,a,s,o)=>{let c=r%t-t,d=i%t-t,l=t*a.value,h=1/a.value;e.save(),a.value===1&&e.translate(c%1?0:.5,d%1?0:.5);for(let f=c;f<c+s+t*2;f+=t){let g=n>1&&Math.round(f-r)%(n*t)===0;if(!g&&l<10)continue;let U=Math.min(1/a.value,g?4:1);e.lineWidth=U;let y=[U*3,h+(U+h)];e.beginPath(),e.setLineDash(g?[]:y),e.strokeStyle=g?wm.Bold:wm.Regular,e.moveTo(f,d-t),e.lineTo(f,Math.ceil(d+o+t*2)),e.stroke()}for(let f=d;f<d+o+t*2;f+=t){let g=n>1&&Math.round(f-i)%(n*t)===0;if(!g&&l<10)continue;let U=Math.min(1/a.value,g?4:1);e.lineWidth=U;let y=[U*3,h+(U+h)];e.beginPath(),e.setLineDash(g?[]:y),e.strokeStyle=g?wm.Bold:wm.Regular,e.moveTo(c-t,f),e.lineTo(Math.ceil(c+s+t*2),f),e.stroke()}e.restore()},DC=(e,t,n,r)=>{t.translate(e.x+r.scrollX,e.y+r.scrollY),t.beginPath(),t.roundRect?t.roundRect(0,0,e.width,e.height,pn.radius/r.zoom.value):t.rect(0,0,e.width,e.height),t.clip(),t.translate(-(e.x+r.scrollX),-(e.y+r.scrollY))},jC={regularLink:null,elementLink:null},PC=(e,t,n,r)=>{if(e.link&&!n.selectedElementIds[e.id]){let[i,a,s,o]=it(e,r),[c,d,l,h]=S7([i,a,s,o],e.angle,n),f=c+l/2,g=d+h/2;t.save(),t.translate(n.scrollX+f,n.scrollY+g),t.rotate(e.angle);let U=xp(e.link)?"elementLink":"regularLink",y=jC[U];if(!y||y.zoom!==n.zoom.value){y=Object.assign(document.createElement("canvas"),{zoom:n.zoom.value}),y.width=l*window.devicePixelRatio*n.zoom.value,y.height=h*window.devicePixelRatio*n.zoom.value,jC[U]=y;let v=y.getContext("2d");v.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),v.fillStyle="#fff",v.fillRect(0,0,l,h),U==="elementLink"?v.drawImage(YA,0,0,l,h):v.drawImage(VA,0,0,l,h),v.restore()}t.drawImage(y,c-f,d-g,l,h),t.restore()}},KA=({canvas:e,rc:t,elementsMap:n,allElementsMap:r,visibleElements:i,scale:a,appState:s,renderConfig:o})=>{var y;if(e===null)return;let{renderGrid:c=!0,isExporting:d}=o,[l,h]=_7(e,a),f=k7({canvas:e,scale:a,normalizedWidth:l,normalizedHeight:h,theme:s.theme,isExporting:d,viewBackgroundColor:s.viewBackgroundColor});f.scale(s.zoom.value,s.zoom.value),c&&Une(f,s.gridSize,s.gridStep,s.scrollX,s.scrollY,s.zoom,l/s.zoom.value,h/s.zoom.value);let g=new Set;i.forEach(v=>{v.groupIds.length>0&&s.frameToHighlight&&s.selectedElementIds[v.id]&&(Ol(v,s.frameToHighlight,n)||v.groupIds.find(x=>g.has(x)))&&v.groupIds.forEach(x=>g.add(x))});let U=new Map;i.filter(v=>!Hi(v)).forEach(v=>{var x;try{let w=v.frameId||((x=s.frameToHighlight)==null?void 0:x.id);if(ke(v)&&v.containerId&&n.has(v.containerId))return;if(f.save(),w&&s.frameRendering.enabled&&s.frameRendering.clip){let S=I3(v,n,s);S&&ZC(v,S,s,n,U)&&DC(S,f,o,s),Ec(v,n,r,t,f,o,s)}else Ec(v,n,r,t,f,o,s);let C=ct(v,n);C&&Ec(C,n,r,t,f,o,s),f.restore(),d||PC(v,f,s,n)}catch(w){console.error(w,v.id,v.x,v.y,v.width,v.height)}}),i.filter(v=>Hi(v)).forEach(v=>{var x;try{let w=()=>{if(Ec(v,n,r,t,f,o,s),Hi(v)&&(d||ti(v)&&o.embedsValidationStatus.get(v.id)!==!0)&&v.width&&v.height){let C=FA(v);Ec(C,n,r,t,f,o,s)}d||PC(v,f,s,n)};if((v.frameId||(x=s.frameToHighlight)!=null&&x.id)&&s.frameRendering.enabled&&s.frameRendering.clip){f.save();let C=I3(v,n,s);C&&ZC(v,C,s,n,U)&&DC(C,f,o,s),w(),f.restore()}else w()}catch(w){console.error(w)}}),(y=o.pendingFlowchartNodes)==null||y.forEach(v=>{try{Ec(v,n,r,t,f,o,s)}catch(x){console.error(x)}})},QA=lU(e=>{KA(e)},{trailing:!0}),JA=(e,t)=>{if(t){QA(e);return}KA(e)},bne=(e,t)=>{if(e.width<=t)return e;let n=document.createElement("canvas").getContext("2d");n.font=$t({fontFamily:e.fontFamily,fontSize:e.fontSize});let r=e.text;if(n.measureText(r).width>t)for(let i=r.length;i>0;i--){let a=`${r.slice(0,i)}...`;if(n.measureText(a).width<=t){r=a;break}}return lt(e,{text:r,width:t})},yne=(e,t)=>{let n=[];for(let r of e){if(Ke(r)){let i=Ei({x:r.x,y:r.y-pn.nameOffsetY,fontFamily:fn.Helvetica,fontSize:pn.nameFontSize,lineHeight:pn.nameLineHeight,strokeColor:t.exportWithDarkMode?pn.nameColorDarkTheme:pn.nameColorLightTheme,text:fL(r)});i.y-=i.height,i=bne(i,r.width),n.push(i)}n.push(r)}return n},eL=(e,t)=>(t=t||Us().frameRendering,{enabled:e?!0:t.enabled,outline:e?!1:t.outline,name:e?!1:t.name,clip:e?!0:t.clip}),tL=({elements:e,exportingFrame:t,frameRendering:n,exportWithDarkMode:r})=>{let i;return t?i=V7(e,t):n.enabled&&n.name?i=yne(e,{exportWithDarkMode:r}):i=e,i},nL=async(e,t,n,{exportBackground:r,exportPadding:i=bh,viewBackgroundColor:a,exportingFrame:s},o=(d,l)=>{let h=document.createElement("canvas");return h.width=d*t.exportScale,h.height=l*t.exportScale,{canvas:h,scale:t.exportScale}},c=async()=>{await uo.loadElementsFonts(e)})=>{await c();let d=eL(s??null,t.frameRendering??null);s&&(d.clip=!1);let l=tL({elements:e,exportingFrame:s,exportWithDarkMode:t.exportWithDarkMode,frameRendering:d});s&&(i=0);let[h,f,g,U]=M7(s?[s]:X7(l),i),{canvas:y,scale:v=1}=o(g,U),x=Us(),{imageCache:w}=await WA({imageCache:new Map,fileIds:XA(l).map(C=>C.fileId),files:n});return JA({canvas:y,rc:Wl.canvas(y),elementsMap:qi(Qe(l)),allElementsMap:qi(Qe(xo(e))),visibleElements:l,scale:v,appState:{...t,frameRendering:d,viewBackgroundColor:r?a:null,scrollX:-h+i,scrollY:-f+i,zoom:x.zoom,shouldCacheIgnoreZoom:!1,theme:t.exportWithDarkMode?yt.DARK:yt.LIGHT},renderConfig:{canvasBackgroundColor:a,imageCache:w,renderGrid:!1,isExporting:!0,embedsValidationStatus:new Map,elementsPendingErasure:new Set,pendingFlowchartNodes:null}}),y},ep=e=>document.createComment(` ${e} `),T7=async(e,t,n,r)=>{let i=eL((r==null?void 0:r.exportingFrame)??null,t.frameRendering??null),{exportPadding:a=bh,exportWithDarkMode:s=!1,viewBackgroundColor:o,exportScale:c=1,exportEmbedScene:d}=t,{exportingFrame:l=null}=r||{},h=tL({elements:e,exportingFrame:l,exportWithDarkMode:s,frameRendering:i});l&&(a=0);let[f,g,U,y]=M7(l?[l]:X7(h),a),v=-f+a,x=-g+a,w=document.createElementNS(kt,"svg");w.setAttribute("version","1.1"),w.setAttribute("xmlns",kt),w.setAttribute("viewBox",`0 0 ${U} ${y}`),w.setAttribute("width",`${U*c}`),w.setAttribute("height",`${y*c}`),s&&w.setAttribute("filter",Z8);let C=w.ownerDocument.createElementNS(kt,"defs"),S=w.ownerDocument.createElementNS(kt,"metadata");if(w.appendChild(ep("svg-source:excalidraw")),w.appendChild(S),w.appendChild(C),d)try{vne({metadataElement:S,payload:_U(e,t,n||{},"local")})}catch(N){console.error(N)}let T=W7(e);if(T.length){let N=Qe(e);for(let F of T){let B=w.ownerDocument.createElementNS(kt,"clipPath");B.setAttribute("id",F.id);let[G,W,X,$]=it(F,N),Y=(X-G)/2-(F.x-G),H=($-W)/2-(F.y-W),Z=w.ownerDocument.createElementNS(kt,"rect");Z.setAttribute("transform",`translate(${F.x+v} ${F.y+x}) rotate(${F.angle} ${Y} ${H})`),Z.setAttribute("width",`${F.width}`),Z.setAttribute("height",`${F.height}`),l||(Z.setAttribute("rx",`${pn.radius}`),Z.setAttribute("ry",`${pn.radius}`)),B.appendChild(Z),C.appendChild(B)}}let M=r!=null&&r.skipInliningFonts?[]:await uo.generateFontFaceDeclarations(e),_=`
|
|
77
|
+
`,R=w.ownerDocument.createElementNS(kt,"style");if(R.classList.add("style-fonts"),R.appendChild(document.createTextNode(`${_}${M.join(_)}`)),C.appendChild(R),t.exportBackground&&o){let N=w.ownerDocument.createElementNS(kt,"rect");N.setAttribute("x","0"),N.setAttribute("y","0"),N.setAttribute("width",`${U}`),N.setAttribute("height",`${y}`),N.setAttribute("fill",o),w.appendChild(N)}let P=Wl.svg(w),j=(r==null?void 0:r.renderEmbeddables)??!1;return dne(h,qi(Qe(h)),P,w,n||{},{offsetX:v,offsetY:x,isExporting:!0,exportWithDarkMode:s,renderEmbeddables:j,frameRendering:i,canvasBackgroundColor:o,embedsValidationStatus:j?new Map(h.filter(N=>Ke(N)).map(N=>[N.id,!0])):new Map,reuseImages:(r==null?void 0:r.reuseImages)??!0}),w},vne=({payload:e,metadataElement:t})=>{let n=LL(JSON.stringify(DL({text:e})),!0);t.appendChild(ep(`payload-type:${Be.excalidraw}`)),t.appendChild(ep("payload-version:2")),t.appendChild(ep("payload-start")),t.appendChild(document.createTextNode(n)),t.appendChild(ep("payload-end"))},xne=({svg:e})=>{var t;if(e.includes(`payload-type:${Be.excalidraw}`)){let n=e.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!n)throw new Error("INVALID");let r=(((t=e.match(/<!-- payload-version:(\d+) -->/))==null?void 0:t[1])||"1")!=="1";try{let i=RL(n[1],r),a=JSON.parse(i);if(!("encoded"in a)){if("type"in a&&a.type===Vi.excalidraw)return i;throw new Error("FAILED")}return jL(a)}catch(i){throw console.error(i),new Error("FAILED")}}throw new Error("INVALID")},M7=(e,t)=>{let[n,r,i,a]=Nt(e),s=Er(n,i)+t*2,o=Er(r,a)+t*2;return[n,r,s,o]},wne=(e,t,n)=>{let[,,r,i]=M7(e,t).map(a=>Math.trunc(a*n));return[r,i]},Ene=class{constructor(t){this.scoreFunction=t,z(this,"content",[])}sinkDown(t){let n=this.content[t];for(;t>0;){let r=(t+1>>1)-1,i=this.content[r];if(this.scoreFunction(n)<this.scoreFunction(i))this.content[r]=n,this.content[t]=i,t=r;else break}}bubbleUp(t){let n=this.content.length,r=this.content[t],i=this.scoreFunction(r);for(;;){let a=t+1<<1,s=a-1,o=null,c=0;if(s<n){let d=this.content[s];c=this.scoreFunction(d),c<i&&(o=s)}if(a<n){let d=this.content[a];this.scoreFunction(d)<(o===null?i:c)&&(o=a)}if(o!==null)this.content[t]=this.content[o],this.content[o]=r,t=o;else break}}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}},I7=1,Ft=40,Cne=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let r=[];e.points.map(s=>A(e.x+s[0],e.y+s[1])).forEach((s,o,c)=>{if(o<2)return r.push(s);let d=Kp(s,c[o-1]),l=Kp(c[o-1],c[o-2]);if(En(d,l)){let h=(n==null?void 0:n.findIndex(g=>g.index===o-1))??-1,f=(n==null?void 0:n.findIndex(g=>g.index===o))??-1;f!==-1&&(n[f].start=A(c[o-2][0]-e.x,c[o-2][1]-e.y)),h!==-1&&n.splice(h,1),r.splice(-1,1),n.forEach(g=>{g.index>o-1&&(g.index-=1)})}return r.push(s)});let i=[];r.forEach((s,o,c)=>{if(o<3)return i.push(s);if(Rt(c[o-2],c[o-1])<I7){let d=(n==null?void 0:n.findIndex(f=>f.index===o-2))??-1,l=(n==null?void 0:n.findIndex(f=>f.index===o-1))??-1;l!==-1&&n.splice(l,1),d!==-1&&n.splice(d,1),i.splice(-2,2),n.forEach(f=>{f.index>o-2&&(f.index-=2)});let h=io(s,c[o-1]);return i.push(A(h?s[0]:c[o-2][0],h?c[o-2][1]:s[1]))}i.push(s)});let a=n.filter(s=>s.index!==1&&s.index!==i.length-1);return a.length===0?Nl(D7(j7(R7(e,L7(e,t,i.map(s=>A(s[0]-e.x,s[1]-e.y)),e.startBinding&&Ju(e.startBinding.elementId,t),e.endBinding&&Ju(e.endBinding.elementId,t)))??[])),a,null,null):(dt.DEV&&Tr(P7(i),"Invalid elbow points with fixed segments"),Nl(i,a,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},Sne=(e,t,n)=>{var R,P;let r=t.map(j=>j.index),i=(((R=e.fixedSegments)==null?void 0:R.map(j=>j.index))??[]).findIndex(j=>!r.includes(j));if(i===-1||!((P=e.fixedSegments)!=null&&P[i]))return{points:e.points};let a=e.fixedSegments[i].index,s=e.fixedSegments[i-1],o=e.fixedSegments[i+1],c=e.x+(s?s.end[0]:0),d=e.y+(s?s.end[1]:0),l=s?null:e.startBinding,h=o?null:e.endBinding,{startHeading:f,endHeading:g,startGlobalPoint:U,endGlobalPoint:y,hoveredStartElement:v,hoveredEndElement:x,...w}=L7({x:c,y:d,startBinding:l,endBinding:h,startArrowhead:null,endArrowhead:null,points:e.points},n,[A(0,0),A(e.x+((o==null?void 0:o.start[0])??e.points[e.points.length-1][0])-c,e.y+((o==null?void 0:o.start[1])??e.points[e.points.length-1][1])-d)],l&&Ju(l.elementId,n),h&&Ju(h.elementId,n),{isDragging:!1}),{points:C}=Nl(D7(j7(R7(e,{startHeading:f,endHeading:g,startGlobalPoint:U,endGlobalPoint:y,hoveredEndElement:x,...w})??[])),t,null,null),S=[];if(s)for(let j=0;j<s.index;j++)S.push(A(e.x+e.points[j][0],e.y+e.points[j][1]));if(C.forEach(j=>{S.push(A(e.x+(s?s.end[0]:0)+j[0],e.y+(s?s.end[1]:0)+j[1]))}),o)for(let j=o.index;j<e.points.length;j++)S.push(A(e.x+e.points[j][0],e.y+e.points[j][1]));let T=((o==null?void 0:o.index)??e.points.length)-((s==null?void 0:s.index)??0)-1,M=t.map(j=>j.index>a?{...j,index:j.index-T+(C.length-1)}:j),_=S.flatMap((j,N)=>{let F=S[N-1],B=S[N+1];if(F&&B){let G=Kp(j,F),W=Kp(B,j);if(En(G,W))return M.forEach(X=>{X.index>N&&(X.index-=1)}),[];if(En(G,aA(W)))return M.forEach(X=>{X.index>N&&(X.index+=1)}),[j,j]}return[j]});return Nl(_,M,!1,!1)},_ne=(e,t,n,r,i,a)=>{var T,M;let s=t.map((_,R)=>e.fixedSegments==null||e.fixedSegments[R]===void 0||e.fixedSegments[R].index!==_.index||(_.start[0]!==e.fixedSegments[R].start[0]&&_.end[0]!==e.fixedSegments[R].end[0])!=(_.start[1]!==e.fixedSegments[R].start[1]&&_.end[1]!==e.fixedSegments[R].end[1])?R:null).filter(_=>_!==null).shift();if(s==null)return{points:e.points};let o=((T=e.fixedSegments)==null?void 0:T.findIndex(_=>_.index===1))??-1,c=((M=e.fixedSegments)==null?void 0:M.findIndex(_=>_.index===e.points.length-1))??-1,d=Rt(t[s].start,t[s].end),l=d<Ft+5;if(o===-1&&t[s].index===1&&i){let _=oo(n),R=(_?En(n,xn):En(n,sr))?l?d/2:Ft:l?-d/2:-Ft;t[s].start=A(t[s].start[0]+(_?R:0),t[s].start[1]+(_?0:R))}if(c===-1&&t[s].index===e.points.length-1&&a){let _=oo(r),R=(_?En(r,xn):En(r,sr))?l?d/2:Ft:l?-d/2:-Ft;t[s].end=A(t[s].end[0]+(_?R:0),t[s].end[1]+(_?0:R))}let h=t.map(_=>({..._,start:A(e.x+_.start[0],e.y+_.start[1]),end:A(e.x+_.end[0],e.y+_.end[1])})),f=e.points.map((_,R)=>A(e.x+_[0],e.y+_[1])),g=h[s].index-1,U=h[s].index,y=h[s].start,v=h[s].end,x=f[g-1]&&!La(f[g],f[g-1])?io(f[g-1],f[g]):void 0,w=f[U+1]&&!La(f[U],f[U+1])?io(f[U+1],f[U]):void 0;if(x!==void 0){let _=x?1:0;f[g-1][_]=y[_]}if(f[g]=y,f[U]=v,w!==void 0){let _=w?1:0;f[U+1][_]=v[_]}let C=h.findIndex(_=>_.index===g);if(C!==-1){let _=io(h[C].end,h[C].start)?1:0;h[C].start[_]=y[_],h[C].end=y}let S=h.findIndex(_=>_.index===U+1);if(S!==-1){let _=io(h[S].end,h[S].start)?1:0;h[S].end[_]=v[_],h[S].start=v}if(o===-1&&g===0){let _=i?oo(n):io(f[1],f[0]);f.unshift(A(_?y[0]:e.x+e.points[0][0],_?e.y+e.points[0][1]:y[1])),i&&f.unshift(A(e.x+e.points[0][0],e.y+e.points[0][1]));for(let R of h)R.index+=i?2:1}if(c===-1&&U===e.points.length-1){let _=oo(r);f.push(A(_?v[0]:e.x+e.points[e.points.length-1][0],_?e.y+e.points[e.points.length-1][1]:v[1])),a&&f.push(A(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return Nl(f,h.map(_=>({..._,start:A(_.start[0]-e.x,_.start[1]-e.y),end:A(_.end[0]-e.x,_.end[1]-e.y)})),!1,!1)},kne=(e,t,n,r,i,a,s,o,c)=>{let d=e.startIsSpecial??null,l=e.endIsSpecial??null,h=t.map((v,x)=>x===0||x===t.length-1?A(e.x+v[0],e.y+v[1]):A(e.x+e.points[x][0],e.y+e.points[x][1])),f=n.map(v=>({...v,start:A(e.x+(v.start[0]-t[0][0]),e.y+(v.start[1]-t[0][1])),end:A(e.x+(v.end[0]-t[0][0]),e.y+(v.end[1]-t[0][1]))})),g=[],U=2+(d?1:0),y=2+(l?1:0);for(;g.length+U<h.length-y;)g.push(h[g.length+U]);{let v=h[d?2:1],x=h[d?3:2],w=oo(r),C=oo(sd(Fe(v,x)));if(o&&w===C){let S=w?En(r,xn):En(r,sr);if(g.unshift(A(C?a[0]+(S?Ft:-Ft):x[0],C?x[1]:a[1]+(S?Ft:-Ft))),g.unshift(A(w?a[0]+(S?Ft:-Ft):a[0],w?a[1]:a[1]+(S?Ft:-Ft))),!d){d=!0;for(let T of f)T.index>1&&(T.index+=1)}}else if(g.unshift(A(C?a[0]:v[0],C?v[1]:a[1])),d){d=!1;for(let S of f)S.index>1&&(S.index-=1)}g.unshift(a)}{let v=h[h.length-(l?3:2)],x=h[h.length-(l?4:3)],w=oo(i),C=io(x,v);if(c&&w===C){let S=w?En(i,xn):En(i,sr);g.push(A(C?s[0]+(S?Ft:-Ft):x[0],C?x[1]:s[1]+(S?Ft:-Ft))),g.push(A(w?s[0]+(S?Ft:-Ft):s[0],w?s[1]:s[1]+(S?Ft:-Ft))),l||(l=!0)}else g.push(A(C?s[0]:v[0],C?v[1]:s[1])),l&&(l=!1)}return g.push(s),Nl(g,f.map(({index:v})=>({index:v,start:g[v-1],end:g[v]})).map(v=>({...v,start:A(v.start[0]-a[0],v.start[1]-a[1]),end:A(v.end[0]-a[0],v.end[1]-a[1])})),d,l)},Xt=1e6,A7=(e,t,n,r)=>{var x,w,C,S,T,M,_,R,P,j,N,F,B,G,W,X,$,Y,H,Z,V,te,ce,be,fe;if(e.points.length<2)return{points:n.points??e.points};(e.x<-Xt||e.x>Xt||e.y<-Xt||e.y>Xt||e.x+(((C=(w=n==null?void 0:n.points)==null?void 0:w[((x=n==null?void 0:n.points)==null?void 0:x.length)-1])==null?void 0:C[0])??0)<-Xt||e.x+(((M=(T=n==null?void 0:n.points)==null?void 0:T[((S=n==null?void 0:n.points)==null?void 0:S.length)-1])==null?void 0:M[0])??0)>Xt||e.y+(((P=(R=n==null?void 0:n.points)==null?void 0:R[((_=n==null?void 0:n.points)==null?void 0:_.length)-1])==null?void 0:P[1])??0)<-Xt||e.y+(((F=(N=n==null?void 0:n.points)==null?void 0:N[((j=n==null?void 0:n.points)==null?void 0:j.length)-1])==null?void 0:F[1])??0)>Xt||e.x+(((W=(G=e==null?void 0:e.points)==null?void 0:G[((B=e==null?void 0:e.points)==null?void 0:B.length)-1])==null?void 0:W[0])??0)<-Xt||e.x+(((Y=($=e==null?void 0:e.points)==null?void 0:$[((X=e==null?void 0:e.points)==null?void 0:X.length)-1])==null?void 0:Y[0])??0)>Xt||e.y+(((V=(Z=e==null?void 0:e.points)==null?void 0:Z[((H=e==null?void 0:e.points)==null?void 0:H.length)-1])==null?void 0:V[1])??0)<-Xt||e.y+(((be=(ce=e==null?void 0:e.points)==null?void 0:ce[((te=e==null?void 0:e.points)==null?void 0:te.length)-1])==null?void 0:be[1])??0)>Xt)&&console.error("Elbow arrow (or update) is outside reasonable bounds (> 1e6)",{arrow:e,updates:n}),e.x=mt(e.x,-Xt,Xt),e.y=mt(e.y,-Xt,Xt),n.points&&(n.points=n.points.map(([Se,Ue])=>A(mt(Se,-Xt,Xt),mt(Ue,-Xt,Xt))));let i=n.points?n.points&&n.points.length===2?e.points.map((Se,Ue)=>Ue===0?n.points[0]:Ue===e.points.length-1?n.points[1]:Se):n.points.slice():e.points.slice(),a=typeof n.startBinding<"u"?n.startBinding:e.startBinding,s=typeof n.endBinding<"u"?n.endBinding:e.endBinding,o=a&&Ju(a.elementId,t),c=s&&Ju(s.elementId,t);if(t.size===0&&P7(i)||(o==null?void 0:o.id)!==(a==null?void 0:a.elementId)||(c==null?void 0:c.id)!==(s==null?void 0:s.elementId))return Nl(i.map(Se=>A(e.x+Se[0],e.y+Se[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:d,endHeading:l,startGlobalPoint:h,endGlobalPoint:f,hoveredStartElement:g,hoveredEndElement:U,...y}=L7({x:e.x,y:e.y,startBinding:a,endBinding:s,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,i,o,c,r),v=n.fixedSegments??e.fixedSegments??[];return!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?Cne(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((Se,Ue)=>La(Se,e.points[Ue]??A(1/0,1/0)))?{}:v.length===0?Nl(D7(j7(R7(e,{startHeading:d,endHeading:l,startGlobalPoint:h,endGlobalPoint:f,hoveredEndElement:U,...y})??[])),v,null,null):(((fe=e.fixedSegments)==null?void 0:fe.length)??0)>v.length?Sne(e,v,t):n.points?n.points&&n.fixedSegments?n:kne(e,i,v,d,l,h,f,g,U):_ne(e,v,d,l,g,U)},L7=(e,t,n,r,i,a)=>{var _,R;let s=Gg(n[0],hr(e.x,e.y)),o=Gg(n[n.length-1],hr(e.x,e.y)),c=r,d=i;if(a!=null&&a.isDragging){let P=Array.from(t.values());c=BC(s,t,P,a==null?void 0:a.zoom)||r,d=BC(o,t,P,a==null?void 0:a.zoom)||i}let l=OC({...e,points:n},"start",(_=e.startBinding)==null?void 0:_.fixedPoint,s,r,c,a==null?void 0:a.isDragging),h=OC({...e,points:n},"end",(R=e.endBinding)==null?void 0:R.fixedPoint,o,i,d,a==null?void 0:a.isDragging),f=FC(l,h,t,c,s),g=FC(h,l,t,d,o),U=[l[0]-2,l[1]-2,l[0]+2,l[1]+2],y=[h[0]-2,h[1]-2,h[0]+2,h[1]+2],v=c?as(c,ol(f,e.startArrowhead?Yt*6:Yt*2,1)):U,x=d?as(d,ol(g,e.endArrowhead?Yt*6:Yt*2,1)):y,w=Yu(l,d?as(d,ol(g,Ft,Ft)):y)||Yu(h,c?as(c,ol(f,Ft,Ft)):U),C=rL(w?[U,y]:[v,x]),S=Ine(w?U:v,w?y:x,C,w?ol(f,!c&&!d?0:Ft,0):ol(f,!c&&!d?0:Ft-(e.startArrowhead?Yt*6:Yt*2),Ft),w?ol(g,!c&&!d?0:Ft,0):ol(g,!c&&!d?0:Ft-(e.endArrowhead?Yt*6:Yt*2),Ft),w,c&&as(c),d&&as(d)),T=NC(S[0],f,l),M=NC(S[1],g,h);return{dynamicAABBs:S,startDonglePosition:T,startGlobalPoint:l,startHeading:f,endDonglePosition:M,endGlobalPoint:h,endHeading:g,commonBounds:C,hoveredStartElement:c,hoveredEndElement:d,boundsOverlap:w,startElementBounds:v,endElementBounds:x}},R7=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:r,startGlobalPoint:i,startHeading:a,endDonglePosition:s,endGlobalPoint:o,endHeading:c,commonBounds:d,hoveredEndElement:l}=t,h=Ane(n,r||i,a,s||o,c,d),f=r&&Em(r,h),g=s&&Em(s,h),U=Em(o,h);U&&l&&(U.closed=!0);let y=Em(i,h);y&&e.startBinding&&(y.closed=!0);let v=f&&g&&(Yu(f.pos,n[1])||Yu(g.pos,n[0])),x=Tne(f||y,g||U,h,a||xn,c||xn,v?[]:n);if(x){let w=x.map(C=>[C.pos[0],C.pos[1]]);return f&&w.unshift(i),g&&w.push(o),w}return null},ol=(e,t,n)=>{switch(e){case ii:return[t,n,n,n];case xn:return[n,t,n,n];case sr:return[n,n,t,n]}return[n,n,n,t]},Tne=(e,t,n,r,i,a)=>{let s=zb(e.pos,t.pos),o=new Ene(c=>c.f);for(o.push(e);o.size()>0;){let c=o.pop();if(!c||c.closed)continue;if(c===t)return Mne(e,c);c.closed=!0;let d=Rne(c.addr,n);for(let l=0;l<4;l++){let h=d[l];if(!h||h.closed)continue;let f=Qs(h.pos,c.pos,.5);if(nY(...a.map(C=>Yu(f,C))))continue;let g=Dne(l),U=c.parent?sd(Fe(c.pos,c.parent.pos)):r,y=aA(U);if(En(y,g)||$C(e.addr,h.addr)&&En(g,r)||$C(t.addr,h.addr)&&En(g,i))continue;let v=U!==g,x=c.g+zb(h.pos,c.pos)+(v?Math.pow(s,3):0),w=h.visited;if(!w||x<h.g){let C=Lne(h,t,g,i);h.visited=!0,h.parent=c,h.h=zb(t.pos,h.pos)+C*Math.pow(s,2),h.g=x,h.f=h.g+h.h,w?o.rescoreElement(h):o.push(h)}}}return null},Mne=(e,t)=>{let n=t,r=[];for(;n.parent;)r.unshift(n),n=n.parent;return r.unshift(e),r},zb=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),Ine=(e,t,n,r,i,a,s,o)=>{let c=s??e,d=o??t,[l,h,f,g]=r??[0,0,0,0],[U,y,v,x]=i??[0,0,0,0],w=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((c[0]+d[2])/2,e[0]-g):(c[0]+d[2])/2:e[0]>t[0]?e[0]-g:n[0]-g,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((c[1]+d[3])/2,e[1]-l):(c[1]+d[3])/2:e[1]>t[1]?e[1]-l:n[1]-l,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((c[2]+d[0])/2,e[2]+h):(c[2]+d[0])/2:e[2]<t[2]?e[2]+h:n[2]+h,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((c[3]+d[1])/2,e[3]+f):(c[3]+d[1])/2:e[3]<t[3]?e[3]+f:n[3]+f],C=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((d[0]+c[2])/2,t[0]-x):(d[0]+c[2])/2:t[0]>e[0]?t[0]-x:n[0]-x,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((d[1]+c[3])/2,t[1]-U):(d[1]+c[3])/2:t[1]>e[1]?t[1]-U:n[1]-U,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((d[2]+c[0])/2,t[2]+y):(d[2]+c[0])/2:t[2]<e[2]?t[2]+y:n[2]+y,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((d[3]+c[1])/2,t[3]+v):(d[3]+c[1])/2:t[3]<e[3]?t[3]+v:n[3]+v],S=rL([w,C]);if(!a&&w[2]-w[0]+C[2]-C[0]>S[2]-S[0]+1e-11&&w[3]-w[1]+C[3]-C[1]>S[3]-S[1]+1e-11){let[T,M]=[(C[0]+C[2])/2,(C[1]+C[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let _=w[2]+(C[0]-w[2])/2,R=C[3]+(w[1]-C[3])/2;return Vn(hr(e[2]-T,e[1]-M),hr(e[0]-T,e[3]-M))>0?[[w[0],w[1],_,w[3]],[_,C[1],C[2],C[3]]]:[[w[0],R,w[2],w[3]],[C[0],C[1],C[2],R]]}else if(e[2]<t[0]&&e[3]<t[1]){let _=w[2]+(C[0]-w[2])/2,R=w[3]+(C[1]-w[3])/2;return Vn(hr(e[0]-T,e[1]-M),hr(e[2]-T,e[3]-M))>0?[[w[0],w[1],w[2],R],[C[0],R,C[2],C[3]]]:[[w[0],w[1],_,w[3]],[_,C[1],C[2],C[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let _=C[2]+(w[0]-C[2])/2,R=w[3]+(C[1]-w[3])/2;return Vn(hr(e[2]-T,e[1]-M),hr(e[0]-T,e[3]-M))>0?[[_,w[1],w[2],w[3]],[C[0],C[1],_,C[3]]]:[[w[0],w[1],w[2],R],[C[0],R,C[2],C[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let _=C[2]+(w[0]-C[2])/2,R=C[3]+(w[1]-C[3])/2;return Vn(hr(e[0]-T,e[1]-M),hr(e[2]-T,e[3]-M))>0?[[_,w[1],w[2],w[3]],[C[0],C[1],_,C[3]]]:[[w[0],R,w[2],w[3]],[C[0],C[1],C[2],R]]}}return[w,C]},Ane=(e,t,n,r,i,a)=>{let s=new Set,o=new Set;n===ri||n===xn?o.add(t[1]):s.add(t[0]),i===ri||i===xn?o.add(r[1]):s.add(r[0]),e.forEach(l=>{s.add(l[0]),s.add(l[2]),o.add(l[1]),o.add(l[3])}),s.add(a[0]),s.add(a[2]),o.add(a[1]),o.add(a[3]);let c=Array.from(o).sort((l,h)=>l-h),d=Array.from(s).sort((l,h)=>l-h);return{row:c.length,col:d.length,data:c.flatMap((l,h)=>d.map((f,g)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[g,h],pos:[f,l]})))}},NC=(e,t,n)=>{switch(t){case ii:return A(n[0],e[1]);case xn:return A(e[2],n[1]);case sr:return A(n[0],e[3])}return A(e[0],n[1])},Lne=(e,t,n,r)=>{if(r===xn)switch(n){case xn:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case ii:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case sr:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ri:return e.pos[1]===t.pos[1]?4:2}else if(r===ri)switch(n){case xn:return e.pos[1]===t.pos[1]?4:2;case ii:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case sr:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case ri:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(r===ii)switch(n){case xn:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ii:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case sr:return e.pos[0]===t.pos[0]?4:2;case ri:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(r===sr)switch(n){case xn:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ii:return e.pos[0]===t.pos[0]?4:2;case sr:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case ri:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},Rne=([e,t],n)=>[tp([e,t-1],n),tp([e+1,t],n),tp([e,t+1],n),tp([e-1,t],n)],tp=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,Em=(e,t)=>{for(let n=0;n<t.col;n++)for(let r=0;r<t.row;r++){let i=tp([n,r],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},rL=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],Ju=(e,t)=>{let n=t.get(e);return n&&Ra(n)?n:null},Nl=(e,t,n,r)=>{let i=e[0][0],a=e[0][1],s=e.map(o=>Gg(o,wn(Fe(e[0]),-1)));return(i<-Xt||i>Xt||a<-Xt||a>Xt||i+s[s.length-1][0]<-Xt||a+s[s.length-1][0]>Xt||i+s[s.length-1][1]<-Xt||a+s[s.length-1][1]>Xt)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:a,points:s,...qu(s)}),s=s.map(([o,c])=>A(mt(o,-1e6,1e6),mt(c,-1e6,1e6))),{points:s,x:mt(i,-1e6,1e6),y:mt(a,-1e6,1e6),fixedSegments:((t==null?void 0:t.length)??0)>0?t:null,...qu(s),startIsSpecial:n,endIsSpecial:r}},D7=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,r)=>{if(r===0||r===e.length-1)return!0;let i=e[r+1],a=Math.abs(n[1]-i[1])<Math.abs(n[0]-i[0]);return t===a?(t=a,!1):(t=a,!0)})}return e},j7=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let r=e[n-1];return Rt(r,t)>I7}):e,Dne=e=>{switch(e){case 0:return ii;case 1:return xn;case 2:return sr}return ri},OC=(e,t,n,r,i,a,s)=>{if(s){if(a){let o=Qp(e,a,t);return ste(a,o)}return r}if(i){let o=E3(n||[0,0],i);return Math.abs(UU(i,o)-Yt)>.01?Qp(e,i,t):o}return r},FC=(e,t,n,r,i)=>nte(e,t,r,r&&as(r,Array(4).fill(UU(r,e))),n,i),BC=(e,t,n,r)=>Ca(wa(e),n,t,r,!0,!0),$C=(e,t)=>e[0]===t[0]&&e[1]===t[1],P7=(e,t=I7)=>e.slice(1).map((n,r)=>Math.abs(n[0]-e[r][0])<t||Math.abs(n[1]-e[r][1])<t).every(Boolean),jne={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1,custom:!0,frame:!0,embeddable:!0,hand:!0,laser:!1,magicframe:!1},Pne=e=>Object.keys(fn).includes(e)?fn[e]:Xl,nu=(e,t)=>{if(!t)return null;let n=t.focus||0;return Ie(e)?Qg(t)?{...t,focus:n,fixedPoint:xU(t.fixedPoint??[0,0])}:null:{...t,focus:n}},ll=(e,t)=>{let n={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||Qi(),fillStyle:e.fillStyle||vn.fillStyle,strokeWidth:e.strokeWidth||vn.strokeWidth,strokeStyle:e.strokeStyle??vn.strokeStyle,roughness:e.roughness??vn.roughness,opacity:e.opacity==null?vn.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||vn.strokeColor,backgroundColor:e.backgroundColor||vn.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness==="round"?{type:vh(e.type)?Bn.LEGACY:Bn.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(r=>({type:"arrow",id:r})):e.boundElements??[],updated:e.updated??yh(),link:e.link?vi(e.link):null,locked:e.locked??!1};return("customData"in e||"customData"in t)&&(n.customData="customData"in t?t.customData:e.customData),{...e,...n,...UL(n),...t}},Nne=e=>{switch(e={...e},e.type){case"text":delete e.rawText;let t=e.fontSize,n=e.fontFamily;if("font"in e){let[l,h]=e.font.split(" ");t=parseFloat(l),n=Pne(h)}let r=typeof e.text=="string"&&e.text||"",i=e.lineHeight||(e.height?lY(e):ad(e.fontFamily));return e=ll(e,{fontSize:t,fontFamily:n,text:r,textAlign:e.textAlign||T1,verticalAlign:e.verticalAlign||$g,containerId:e.containerId??null,originalText:e.originalText||r,autoResize:e.autoResize??!0,lineHeight:i}),!r&&!e.isDeleted&&(e={...e,originalText:r,isDeleted:!0},e=LU(e)),e;case"freedraw":return ll(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return ll(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case"line":case"draw":let{startArrowhead:a=null,endArrowhead:s=null}=e,o=e.x,c=e.y,d=!Array.isArray(e.points)||e.points.length<2?[A(0,0),A(e.width,e.height)]:e.points;return(d[0][0]!==0||d[0][1]!==0)&&({points:d,x:o,y:c}=Me.getNormalizedPoints(e)),ll(e,{type:e.type==="draw"?"line":e.type,startBinding:nu(e,e.startBinding),endBinding:nu(e,e.endBinding),lastCommittedPoint:null,startArrowhead:a,endArrowhead:s,points:d,x:o,y:c,...qu(d)});case"arrow":{let{startArrowhead:l=null,endArrowhead:h="arrow"}=e,f=e.x,g=e.y,U=!Array.isArray(e.points)||e.points.length<2?[A(0,0),A(e.width,e.height)]:e.points;(U[0][0]!==0||U[0][1]!==0)&&({points:U,x:f,y:g}=Me.getNormalizedPoints(e));let y={type:e.type,startBinding:nu(e,e.startBinding),endBinding:nu(e,e.endBinding),lastCommittedPoint:null,startArrowhead:l,endArrowhead:h,points:U,x:f,y:g,elbowed:e.elbowed,...qu(U)};return Ie(e)?ll(e,{...y,elbowed:!0,startBinding:nu(e,e.startBinding),endBinding:nu(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):ll(e,y)}case"ellipse":case"rectangle":case"diamond":case"iframe":case"embeddable":return ll(e,{});case"magicframe":case"frame":return ll(e,{name:e.name??null})}return null},One=(e,t)=>{if(e.boundElements){let n=e.boundElements.slice(),r=new Set;e.boundElements=n.reduce((i,a)=>{let s=t.get(a.id);if(s&&!r.has(a.id)){if(r.add(a.id),s.isDeleted)return i;i.push(a),ke(s)&&!s.containerId&&(s.containerId=e.id)}return i},[])}},Fne=(e,t)=>{let n=e.containerId?t.get(e.containerId):null;if(!n){e.containerId=null;return}if(!e.isDeleted&&n.boundElements&&!n.boundElements.find(r=>r.id===e.id)){let r=(n.boundElements||(n.boundElements=[])).slice();r.push({type:"text",id:e.id}),n.boundElements=r}},Bne=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},N7=(e,t,n)=>{let r=new Set,i=t?Qe(t):null,a=xo((e||[]).reduce((o,c)=>{if(c.type!=="selection"&&!th(c)){let d=Nne(c);if(d){let l=i==null?void 0:i.get(c.id);l&&l.version>d.version&&(d=LU(d,l.version)),r.has(d.id)&&(d={...d,id:Qi()}),r.add(d.id),o.push(d)}}return o},[]));if(!(n!=null&&n.repairBindings))return a;let s=Qe(a);for(let o of a)o.frameId&&Bne(o,s),ke(o)&&o.containerId?Fne(o,s):o.boundElements&&One(o,s),n.refreshDimensions&&ke(o)&&Object.assign(o,LA(o,lr(o,s),s)),rt(o)&&(o.startBinding&&(!s.has(o.startBinding.elementId)||!ht(o))&&(o.startBinding=null),o.endBinding&&(!s.has(o.endBinding.elementId)||!ht(o))&&(o.endBinding=null));return a.map(o=>{if(Ie(o)&&o.startBinding==null&&o.endBinding==null&&!P7(o.points))return{...o,...A7(o,s,{points:[A(0,0),o.points[o.points.length-1]]}),index:o.index};if(Ie(o)&&o.startBinding&&o.endBinding&&o.startBinding.elementId===o.endBinding.elementId&&o.points.length>1&&o.points.some(([c,d])=>Math.abs(c)>1e6||Math.abs(d)>1e6)){console.error("Fixing self-bound elbow arrow",o.id);let c=s.get(o.startBinding.elementId);return c?{...o,x:c.x+c.width/2,y:c.y-5,width:c.width,height:c.height,points:[A(0,0),A(0,-10),A(c.width/2+5,-10),A(c.width/2+5,c.height/2+5)]}:(console.error("Bound element not found",o.startBinding.elementId),o)}return o})},$ne=(e,t,n)=>{let r=t[e];return r!==void 0?r:n[e]},zC={isSidebarDocked:(e,t)=>["defaultSidebarDockedPreference",e.isSidebarDocked??$ne("defaultSidebarDockedPreference",e,t)]},zne=(e,t)=>{var i;e=e||{};let n=Us(),r={};for(let a of Object.keys(zC))if(a in e){let[s,o]=zC[a](e,n);r[s]=o}for(let[a,s]of Object.entries(n)){let o=e[a],c=t?t[a]:void 0;r[a]=o!==void 0?o:c!==void 0?c:s}return{...r,cursorButton:(t==null?void 0:t.cursorButton)||"up",penDetected:(t==null?void 0:t.penDetected)??(e.penMode?e.penDetected??!1:!1),activeTool:{...Ln(n,r.activeTool.type&&jne[r.activeTool.type]?r.activeTool:{type:"selection"}),lastActiveTool:null,locked:r.activeTool.locked??!1},zoom:{value:lo(gp(e.zoom)?e.zoom:((i=e.zoom)==null?void 0:i.value)??n.zoom.value)},openSidebar:typeof e.openSidebar=="string"?{name:ka.name}:r.openSidebar,gridSize:pte(gp(e.gridSize)?e.gridSize:Hg),gridStep:UA(gp(e.gridStep)?e.gridStep:HM),editingFrame:null}},TU=(e,t,n,r)=>({elements:N7(e==null?void 0:e.elements,n,r),appState:zne(e==null?void 0:e.appState,t||null),files:(e==null?void 0:e.files)||{}}),HC=e=>{let t=N7(Gt(e.elements),null);return t.length?{...e,elements:t}:null},O7=(e=[],t)=>{let n=[];for(let r of e)if(Array.isArray(r)){let i=HC({status:t,elements:r,id:Qi(),created:Date.now()});i&&n.push(i)}else{let i=r,a=HC({...i,id:i.id||Qi(),status:i.status||t,created:i.created||Date.now()});a&&n.push(a)}return n},ba=32,Vt=12,Ll=256,iL=50,Mc="NOT_SPREADSHEET",i1="VALID_SPREADSHEET",np=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},Hb=(e,t)=>e.slice(1).every(n=>np(n[t])!==null),WC=e=>{let t=e[0].length;if(t>2)return{type:Mc,reason:"More than 2 columns"};if(t===1){if(!Hb(e,0))return{type:Mc,reason:"Value is not numeric"};let c=np(e[0][0])===null,d=(c?e.slice(1):e).map(l=>np(l[0]));return d.length<2?{type:Mc,reason:"Less than two rows"}:{type:i1,spreadsheet:{title:c?e[0][0]:null,labels:null,values:d}}}let n=Hb(e,0),r=Hb(e,1);if(!n&&!r)return{type:Mc,reason:"Value is not numeric"};let[i,a]=r?[0,1]:[1,0],s=np(e[0][a])===null,o=s?e.slice(1):e;return o.length<2?{type:Mc,reason:"Less than 2 rows"}:{type:i1,spreadsheet:{title:s?e[0][a]:null,labels:o.map(c=>c[i]),values:o.map(c=>np(c[a]))}}},Hne=e=>{let t=[];for(let n=0;n<e[0].length;n++){let r=[];for(let i=0;i<e.length;i++)r.push(e[i][n]);t.push(r)}return t},Wne=e=>{let t=e.trim().split(`
|
|
78
|
+
`).map(i=>i.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
|
|
79
|
+
`).map(i=>i.trim().split(","))),t.length===0)return{type:Mc,reason:"No values"};let n=t[0].length;if(!t.every(i=>i.length===n))return{type:Mc,reason:"All rows don't have same number of columns"};let r=WC(t);if(r.type!==i1){let i=WC(Hne(t));if(i.type===i1)return i}return r},h2=VX(HX),Yi={fillStyle:"hachure",fontFamily:Xl,fontSize:Mo,opacity:100,roughness:1,strokeColor:pt.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:yi.MIDDLE,locked:!1},aL=e=>{let t=(ba+Vt)*e.values.length+Vt,n=Ll+Vt*2;return{chartWidth:t,chartHeight:n}},Xne=(e,t,n,r,i)=>{var a;return((a=e.labels)==null?void 0:a.map((s,o)=>Ei({groupIds:[r],backgroundColor:i,...Yi,text:s.length>8?`${s.slice(0,5)}...`:s,x:t+o*(ba+Vt)+Vt*2,y:n+Vt/2,width:ba,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))||[]},Vne=(e,t,n,r,i)=>{let a=Ei({groupIds:[r],backgroundColor:i,...Yi,x:t-Vt,y:n-Vt,text:"0",textAlign:"right"}),s=Ei({groupIds:[r],backgroundColor:i,...Yi,x:t-Vt,y:n-Ll-a.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[a,s]},Yne=(e,t,n,r,i)=>{let{chartWidth:a,chartHeight:s}=aL(e),o=Wc({backgroundColor:i,groupIds:[r],...Yi,type:"line",x:t,y:n,width:a,points:[A(0,0),A(a,0)]}),c=Wc({backgroundColor:i,groupIds:[r],...Yi,type:"line",x:t,y:n,height:s,points:[A(0,0),A(0,-s)]}),d=Wc({backgroundColor:i,groupIds:[r],...Yi,type:"line",x:t,y:n-Ll-Vt,strokeStyle:"dotted",width:a,opacity:iL,points:[A(0,0),A(a,0)]});return[o,c,d]},sL=(e,t,n,r,i,a)=>{let{chartWidth:s,chartHeight:o}=aL(e),c=e.title?Ei({backgroundColor:i,groupIds:[r],...Yi,text:e.title,x:t+s/2,y:n-Ll-Vt*2-Mo,roundness:null,textAlign:"center"}):null,d=a?vs({backgroundColor:i,groupIds:[r],...Yi,type:"rectangle",x:t,y:n-o,width:s,height:o,strokeColor:pt.black,fillStyle:"solid",opacity:6}):null;return[...d?[d]:[],...c?[c]:[],...Xne(e,t,n,r,i),...Vne(e,t,n,r,i),...Yne(e,t,n,r,i)]},Gne=(e,t,n)=>{let r=Math.max(...e.values),i=Qi(),a=h2[Math.floor(Math.random()*h2.length)];return[...e.values.map((s,o)=>{let c=s/r*Ll;return vs({backgroundColor:a,groupIds:[i],...Yi,type:"rectangle",x:t+o*(ba+Vt)+Vt,y:n-c-Vt,width:ba,height:c})}),...sL(e,t,n,i,a,dt.DEV)]},qne=(e,t,n)=>{let r=Math.max(...e.values),i=Qi(),a=h2[Math.floor(Math.random()*h2.length)],s=0,o=[];for(let y of e.values){let v=s*(ba+Vt),x=-(y/r)*Ll;o.push([v,x]),s++}let c=Math.max(...o.map(y=>y[0])),d=Math.max(...o.map(y=>y[1])),l=Math.min(...o.map(y=>y[0])),h=Math.min(...o.map(y=>y[1])),f=Wc({backgroundColor:a,groupIds:[i],...Yi,type:"line",x:t+Vt+ba/2,y:n-Vt,height:d-h,width:c-l,strokeWidth:2,points:o}),g=e.values.map((y,v)=>{let x=v*(ba+Vt)+Vt/2,w=-(y/r)*Ll+Vt/2;return vs({backgroundColor:a,groupIds:[i],...Yi,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+x+ba/2,y:n+w-Vt*2,width:Vt,height:Vt})}),U=e.values.map((y,v)=>{let x=v*(ba+Vt)+Vt/2,w=y/r*Ll+Vt/2+Vt;return Wc({backgroundColor:a,groupIds:[i],...Yi,type:"line",x:t+x+ba/2+Vt/2,y:n-w,height:w,strokeStyle:"dotted",opacity:iL,points:[A(0,0),A(0,w)]})});return[...sL(e,t,n,i,a,dt.DEV),f,...U,...g]},Zne=(e,t,n,r)=>e==="line"?qne(t,n,r):Gne(t,n,r),F7="clipboard"in navigator&&"writeText"in navigator.clipboard,B7="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Kne=e=>!!([Vi.excalidraw,Vi.excalidrawClipboard,Vi.excalidrawClipboardWithAPI].includes(e==null?void 0:e.type)&&Array.isArray(e.elements)),Qne=({types:e,files:t})=>{var r,i,a,s;!e&&!t&&console.warn("createPasteEvent: no types or files provided");let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});if(e)for(let[o,c]of Object.entries(e)){if(typeof c!="string"){t=t||[],t.push(c);continue}try{if((r=n.clipboardData)==null||r.setData(o,c),((i=n.clipboardData)==null?void 0:i.getData(o))!==c)throw new Error(`Failed to set "${o}" as clipboardData item`)}catch(d){throw new Error(d.message)}}if(t){let o=-1;for(let c of t){o++;try{if((a=n.clipboardData)==null||a.items.add(c),((s=n.clipboardData)==null?void 0:s.files[o])!==c)throw new Error(`Failed to set file "${c.name}" as clipboardData item`)}catch(d){throw new Error(d.message)}}}return n},Jne=({elements:e,files:t})=>{let n=Qe(e),r=new Set(e.filter(o=>Ke(o))),i=!1,a=e.reduce((o,c)=>(zi(c)&&(i=!0,t&&t[c.fileId]&&(o[c.fileId]=t[c.fileId])),o),{});i&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let s={type:Vi.excalidrawClipboard,elements:e.map(o=>{if(di(o,n)&&!r.has(di(o,n))){let c=Ud(o);return he(c,{frameId:null}),c}return o}),files:t?a:void 0};return JSON.stringify(s)},ere=async(e,t,n)=>{await P1(Jne({elements:e,files:t}),n)},tre=e=>{let t=Wne(e);return t.type===i1?{spreadsheet:t.spreadsheet}:null};function oL(e){var n;let t=[];for(let r of e.childNodes)if(r.nodeType===3){let i=(n=r.textContent)==null?void 0:n.trim();i&&t.push({type:"text",value:i})}else if(r instanceof HTMLImageElement){let i=r.getAttribute("src");i&&i.startsWith("http")&&t.push({type:"imageUrl",value:i})}else t=t.concat(oL(r));return t}var nre=e=>{var n;let t=(n=e.clipboardData)==null?void 0:n.getData(Be.html);if(!t)return null;try{let r=new DOMParser().parseFromString(t,Be.html),i=oL(r.body);if(i.length)return{type:"mixedContent",value:i}}catch(r){console.error(`error in parseHTMLFromPaste: ${r.message}`)}return null},rre=async()=>{var n,r,i,a;let e={},t;try{t=await((n=navigator.clipboard)==null?void 0:n.read())}catch(s){try{if((r=navigator.clipboard)!=null&&r.readText){console.warn(`navigator.clipboard.readText() failed (${s.message}). Failling back to navigator.clipboard.read()`);let o=await((i=navigator.clipboard)==null?void 0:i.readText());if(o)return{[Be.text]:o}}}catch(o){if((a=navigator.clipboard)!=null&&a.read)console.warn(`navigator.clipboard.readText() failed (${o.message}). Failling back to navigator.clipboard.read()`);else{if(o.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${o.message}`),e;throw o}}throw s}for(let s of t)for(let o of s.types)if(iI(oV,o))try{if(o===Be.text||o===Be.html)e[o]=await(await s.getType(o)).text();else if(_L(o)){let c=await s.getType(o),d=rp(c,o,void 0);e[o]=d}else throw new eC(`Unsupported clipboard type: ${o}`)}catch(c){console.warn(c instanceof eC?c.message:`Cannot retrieve ${o} from clipboardItem: ${c.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},ire=async(e,t=!1)=>{var n,r;try{let i=!t&&e&&nre(e);return i?i.value.every(a=>a.type==="text")?{type:"text",value:((n=e.clipboardData)==null?void 0:n.getData(Be.text))||i.value.map(a=>a.value).join(`
|
|
80
|
+
`).trim()}:i:{type:"text",value:(((r=e.clipboardData)==null?void 0:r.getData(Be.text))||"").trim()}}catch{return{type:"text",value:""}}},lL=async(e,t=!1)=>{let n=await ire(e,t);if(n.type==="mixedContent")return{mixedContent:n.value};try{let r=!t&&tre(n.value);if(r)return r}catch(r){console.error(r)}try{let r=JSON.parse(n.value),i=r.type===Vi.excalidrawClipboardWithAPI;if(Kne(r))return{elements:r.elements,files:r.files,text:t?JSON.stringify(r.elements,null,2):void 0,programmaticAPI:i}}catch{}return{text:n.value}},are=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[Be.png]:e})])}catch(t){if(A1(e))await navigator.clipboard.write([new window.ClipboardItem({[Be.png]:await e})]);else throw t}},P1=async(e,t)=>{var n,r;if(F7)try{await navigator.clipboard.writeText(e||"");return}catch(i){console.error(i)}try{if(t){if((n=t.clipboardData)==null||n.setData(Be.text,e||""),((r=t.clipboardData)==null?void 0:r.getData(Be.text))!==e)throw new Error("Failed to setData on clipboardEvent");return}}catch(i){console.error(i)}if(!sre(e))throw new Error("Error copying to clipboard.")},sre=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";let r=window.pageYOffset||document.documentElement.scrollTop;n.style.top=`${r}px`,n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(a){console.error(a)}return n.remove(),i},MU=({elements:e,appState:t,files:n,maxWidthOrHeight:r,getDimensions:i,exportPadding:a,exportingFrame:s})=>{let{elements:o,appState:c}=TU({elements:e,appState:t},null,null),{exportBackground:d,viewBackgroundColor:l}=c;return nL(o,{...c,offsetTop:0,offsetLeft:0,width:0,height:0},n||{},{exportBackground:d,exportPadding:a,viewBackgroundColor:l,exportingFrame:s},(h,f)=>{let g=document.createElement("canvas");if(r){typeof i=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let y=Math.max(h,f),v=r<y?r/y:(t==null?void 0:t.exportScale)??1;return g.width=h*v,g.height=f*v,{canvas:g,scale:v}}let U=(i==null?void 0:i(h,f))||{width:h,height:f};return g.width=U.width,g.height=U.height,{canvas:g,scale:U.scale??1}})},ore=async e=>{var i;let{mimeType:t=Be.png,quality:n}=e;t===Be.png&&typeof n=="number"&&console.warn(`"quality" will be ignored for "${Be.png}" mimeType`),t==="image/jpg"&&(t=Be.jpg),t===Be.jpg&&!((i=e.appState)!=null&&i.exportBackground)&&(console.warn(`Defaulting "exportBackground" to "true" for "${Be.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let r=await MU(e);return n=n||(/image\/jpe?g/.test(t)?.92:.8),new Promise((a,s)=>{r.toBlob(async o=>{var c;if(!o)return s(new Error("couldn't export to blob"));o&&t===Be.png&&((c=e.appState)!=null&&c.exportEmbedScene)&&(o=await NL({blob:o,metadata:_U(e.elements,e.appState,e.files||{})})),a(o)},t,n)})},$7=async({elements:e,appState:t=Us(),files:n={},exportPadding:r,renderEmbeddables:i,exportingFrame:a,skipInliningFonts:s,reuseImages:o})=>{let{elements:c,appState:d}=TU({elements:e,appState:t},null,null),l={...d,exportPadding:r};return T7(c,l,n,{exportingFrame:a,renderEmbeddables:i,skipInliningFonts:s,reuseImages:o})},lre=e=>e.type==="diamond"?[A(e.width/2,0),A(e.width,e.height/2),A(e.width/2,e.height),A(0,e.height/2)]:[A(0,0),A(0+e.width,0),A(0+e.width,e.height),A(0,e.height)],cre=e=>rt(e)||Zi(e)?e.points:lre(e),XC=e=>{let t=e.reduce((n,[r,i])=>(n.minY=Math.min(n.minY,i),n.minX=Math.min(n.minX,r),n.maxX=Math.max(n.maxX,r),n.maxY=Math.max(n.maxY,i),n),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},dre=e=>{let t=cre(e),{cx:n,cy:r}=XC(t),i=A(n,r),a=t.map(l=>oe(l,i,e.angle)),{minX:s,minY:o,maxX:c,maxY:d}=XC(a);return[s+e.x,o+e.y,c+e.x,d+e.y]},ure=(e,t)=>{let n=dre(e);return(bm(n[0],wr(t[0],t[2]))||bm(t[0],wr(n[0],n[2])))&&(bm(n[1],wr(t[1],t[3]))||bm(t[1],wr(n[1],n[3])))},hre=({elements:e,bounds:t,type:n,errorMargin:r=0})=>{var s;lI(t)&&(t=Da(t,Qe(e)));let i=[t[0]-r,t[1]-r,t[2]+r,t[3]+r],a=new Set;for(let o of e)if(!a.has(o.id)&&ure(o,i)){if(a.add(o.id),o.boundElements)for(let c of o.boundElements)a.add(c.id);ke(o)&&o.containerId&&a.add(o.containerId),ht(o)&&(o.startBinding&&a.add(o.startBinding.elementId),o.endBinding&&a.add((s=o.endBinding)==null?void 0:s.elementId))}return e.filter(o=>a.has(o.id))};function VC(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function fre(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var pre=1e-6;function YC(e,t){let n=Fe(e[1],e[0]),r=Fe(t,e[0]),i=Vn(n,r);return Math.abs(i)<pre}function Wb(e,t){let n=Fe(e[1],e[0]),r=Fe(t,e[0]);return Vn(n,r)<0}function GC(e,t){return YC(e,t[0])||YC(e,t[1])||(Wb(e,t[0])?!Wb(e,t[1]):Wb(e,t[1]))}function mre(e,t){return fre(VC(e),VC(t))&&GC(e,t)&&GC(t,e)}var cL=(e,t,n)=>{let r=Qe(e);for(let i of t)if(i.frameId){let a=n.get(i.id),s=n.get(i.frameId);if(a){let o=r.get(a);o&&he(o,{frameId:s??i.frameId},!1)}}};function z7(e,t,n){let r=cC(t,n),i=cC(e,n);return r.some(a=>i.some(s=>mre(a,s)))}var dL=(e,t,n)=>AU(G7(e,t,n,!1)).filter(r=>!Ke(r)&&!r.frameId||r.frameId===t.id),H7=(e,t,n)=>G7([t],e,n).some(r=>r.id===t.id),N1=(e,t,n)=>{let[r,i,a,s]=it(t,n),[o,c,d,l]=Nt(e);return r<=o&&i<=c&&a>=d&&s>=l},Ol=(e,t,n)=>N1([e],t,n)||z7(e,t,n)||H7(e,t,n),qC=(e,t,n)=>{let[r,i,a,s]=it(t,n);return qM(A(r,i),A(e.x,e.y),A(a,s))},gre=e=>{let t=new Map;for(let n of e){let r=Ke(n)?n.id:n.frameId;r&&!t.has(r)&&t.set(r,ws(e,r))}return t},ws=(e,t)=>{let n=[];for(let r of e.values())r.frameId===t&&n.push(r);return n},W7=e=>e.filter(t=>Ke(t)),X7=e=>{let t=Qe(W7(e));return e.filter(n=>t.has(n.id)||!n.frameId||!t.has(n.frameId))},fg=(e,t,n,r)=>{let i=ws(e,t.id),a=new Set(i),s=new Set([...dL(e,t,r),...i.filter(f=>H7(f,t,r))]),o=i.filter(f=>!s.has(f)),c=new Set(Array.from(s).flatMap(f=>f.groupIds));for(let f of o)if(!z7(f,t,r))f.groupIds.length===0&&a.delete(f);else if(f.groupIds.length>0)for(let g of f.groupIds)c.add(g);for(let f of o)if(f.groupIds.length>0){let g=!0;for(let U of f.groupIds)c.has(U)&&(g=!1);g&&a.delete(f)}let d=Array.from(s).filter(f=>f.groupIds.length===0);for(let f of d)a.add(f);let l=Array.from(s).filter(f=>f.groupIds.length>0),h=xA(l,n);for(let[f,g]of Object.entries(h))if(g){let U=en(e,f);if(N1(U,t,r))for(let y of U)a.add(y)}return[...a].filter(f=>!(ke(f)&&f.containerId))},Ure=(e,t,n)=>bre(AU(e,dL(e,t,n)),t,n),bre=(e,t,n)=>{let r=[],i=new Map;for(let a of e){let s=!1;if(a.groupIds.length>0){if(a.groupIds.some(o=>i.get(o)))s=!0;else{let o=new Set(a.groupIds.flatMap(c=>en(n,c)));s=!N1(Array.from(o),t,n)}a.groupIds.forEach(o=>{i.set(o,s)})}s||r.push(a)}return r},di=(e,t)=>e.frameId&&t.get(e.frameId)||null,yre=(e,t)=>{let n=new Set,r=Qe(e);e=AU(e);for(let s of e)Ke(s)&&s.id!==t.id&&n.add(s.id);let i=new Set,a=[];for(let s of e)if(!(Ke(s)||s.frameId&&n.has(s.frameId)))if(s.groupIds.length){let o=s.groupIds.at(-1);if(!i.has(o)){i.add(o);let c=en(e,o);if(c.some(d=>Ol(d,t,r)))for(let d of c)a.push(d)}}else Ol(s,t,r)&&a.push(s);return a},wp=(e,t,n,r)=>{let i=Qe(e),a=new Map;for(let d of e.values())d.frameId===n.id&&a.set(d.id,!0);let s=new Set(t.map(d=>d.id)),o=[],c=new Set;for(let d of t)Ke(d)&&d.id!==n.id&&c.add(d.id);for(let d of AU(e,t)){if(Ke(d)||d.frameId&&c.has(d.frameId)||d.frameId&&r.selectedElementIds[d.id]&&r.selectedElementIds[d.frameId])continue;a.has(d.id)||o.push(d);let l=ct(d,i);l&&!s.has(l.id)&&!a.has(l.id)&&o.push(l)}for(let d of o)he(d,{frameId:n.id},!1);return e},IU=(e,t)=>{let n=new Map,r=new Map;for(let i of e)if(i.frameId){n.set(i.id,i);let a=r.get(i.frameId)||[];a.push(i);let s=ct(i,t);s&&(n.set(s.id,s),a.push(s)),r.set(i.frameId,a)}for(let[,i]of n)he(i,{frameId:null},!1)},uL=(e,t)=>{let n=ws(e,t.id);return IU(n,Qe(e)),e},hL=(e,t,n,r)=>wp(uL(e,n),t,n,r.state).slice(),eh=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(r);if(t.editingGroupId)for(let o of r)o.groupIds.length===0?i.add(o):o.groupIds.flatMap(c=>en(e,c)).forEach(c=>i.add(c));let a=new Set,s=Qe(e);return i.forEach(o=>{o.frameId&&!Ke(o)&&!f2(o,s,t)&&a.add(o)}),a.size>0&&IU(a,s),e},AU=(e,t)=>{let n=new Set,r=t||e;for(let s of r.values()){let o=s.groupIds[s.groupIds.length-1];o&&n.add(o)}let i=new Set;for(let s of n)en(e,s).some(o=>Ke(o))&&i.add(s);let a=[];for(let s of r.values())i.has(s.groupIds[s.groupIds.length-1])||a.push(s);return a},I3=(e,t,n)=>{let r=ke(e)&&lr(e,t)||e;return r.frameId&&n.selectedElementIds[r.id]&&n.selectedElementIds[r.frameId]?di(r,t):n.selectedElementIds[r.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:di(r,t)},f2=(e,t,n,r)=>{var c;let i=(r==null?void 0:r.targetFrame)??I3(e,t,n);if(!i)return!1;let a=ke(e)&&lr(e,t)||e,s=d=>{r!=null&&r.checkedGroups&&a.groupIds.forEach(l=>{var h;(h=r.checkedGroups)==null||h.set(l,d)})};if(!n.selectedElementIds[a.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[a.id]&&n.selectedElementIds[i.id])return!0;if(a.groupIds.length===0)return Ol(a,i,t);for(let d of a.groupIds)if((c=r==null?void 0:r.checkedGroups)!=null&&c.has(d))return r.checkedGroups.get(d);let o=new Set(a.groupIds.filter(d=>r!=null&&r.checkedGroups?!r.checkedGroups.has(d):!0).flatMap(d=>en(t,d)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let d=new Set(ut(t,n));if(n.frameToHighlight!==null)return!0;d.forEach(l=>{o.delete(l)})}for(let d of o)if(Ke(d))return s(!1),!1;for(let d of o)if(Ol(d,i,t))return s(!0),!0;return!1},ZC=(e,t,n,r,i)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let a=z7(e,t,r)||H7(e,t,r);if(a){for(let s of e.groupIds)i==null||i.set(s,!0);return!0}if(!a&&e.groupIds.length>0&&!N1([e],t,r)){let s=!1;if(n.selectedElementsAreBeingDragged)s=f2(e,r,n,{targetFrame:t,checkedGroups:i});else{s=e.frameId===t.id;for(let o of e.groupIds)i==null||i.set(o,s)}for(let o of e.groupIds)i==null||i.set(o,s);return s}return!1},fL=e=>e.name===null?sI(e)?"Frame":"AI Frame":e.name,V7=(e,t)=>hre({elements:e,bounds:t,type:"overlap"}).filter(n=>!n.frameId||n.frameId===t.id),pL=e=>{let t=Qe(e);return e.length>1&&e.some(n=>n.frameId&&t.has(n.frameId))},Y7=e=>{let t=new Set;return e.forEach(n=>{Ke(n)&&t.add(n.id)}),e.filter(n=>!(n.frameId&&t.has(n.frameId)))},G7=(e,t,n,r=!0)=>{let[i,a,s,o]=it(t,n),c=e.filter(d=>{let[l,h,f,g]=Da(d,n),U=di(d,n);if(U){let[y,v,x,w]=Da(U,n);l=Math.max(y,l),h=Math.max(v,h),f=Math.min(x,f),g=Math.min(w,g)}return d.locked===!1&&d.type!=="selection"&&!tn(d)&&i<=l&&a<=h&&s>=f&&o>=g});return c=r?Y7(c):c,c=c.filter(d=>{let l=di(d,n);return l?Ol(d,l,n):!0}),c},mL=(e,t,n,r)=>{let i=new Set(t.map(a=>a.id));return e.filter(a=>{let s=p2(a,n.width,n.height,n,r);return!i.has(a.id)&&s})},$n=function(){let e=null,t=null,n=null,r=(i,a)=>(n!=null&&i===e&&a.selectedElementIds===t||(n=i.some(s=>a.selectedElementIds[s.id]),e=i,t=a.selectedElementIds),n);return r.clearCache=()=>{e=null,t=null,n=null},r}(),vre=(e,t,n)=>{let r=Array.from(new Set(ut(e,t).map(i=>n(i))));return r.length===1?r[0]:null},ut=(e,t,n)=>{let r=new Set,i=[];for(let a of e.values()){if(t.selectedElementIds[a.id]){i.push(a),r.add(a.id);continue}if(n!=null&&n.includeBoundTextElement&&tn(a)&&t.selectedElementIds[a==null?void 0:a.containerId]){i.push(a),r.add(a.id);continue}}if(n!=null&&n.includeElementsInFrames){let a=[];return i.forEach(s=>{Ke(s)&&ws(e,s.id).forEach(o=>!r.has(o.id)&&a.push(o)),a.push(s)}),a}return i},gL=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:ut(e,t,{includeBoundTextElement:!0}),At=(e,t)=>pr(t.selectedElementIds,e)?t.selectedElementIds:e,KC=e=>{let t=new Map,n=[];for(let r of e)r.isDeleted||(n.push(r),t.set(r.id,r));return{elementsMap:t,elements:n}},xre=_1(e=>{(dt.DEV||dt.MODE===si.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES)&&E7(e,{shouldThrow:dt.DEV||dt.MODE===si.TEST,includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),wre=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],n="";for(let r of t)n+=`${r}:${e[r]?"1":"0"}`;return n},QC=e=>typeof e=="string",A3=class pg{constructor(){z(this,"callbacks",new Set),z(this,"nonDeletedElements",[]),z(this,"nonDeletedElementsMap",qi(new Map)),z(this,"elements",[]),z(this,"nonDeletedFramesLikes",[]),z(this,"frames",[]),z(this,"elementsMap",qi(new Map)),z(this,"selectedElementsCache",{selectedElementIds:null,elements:null,cache:new Map}),z(this,"sceneNonce"),z(this,"insertElement",t=>{let n=t.frameId?this.getElementIndex(t.frameId):this.elements.length;this.insertElementAtIndex(t,n)}),z(this,"insertElements",t=>{var r;if(!t.length)return;let n=(r=t[0])!=null&&r.frameId?this.getElementIndex(t[0].frameId):this.elements.length;this.insertElementsAtIndex(t,n)}),z(this,"getContainerElement",t=>t&&t.containerId&&this.getElement(t.containerId)||null),z(this,"getElementsFromId",t=>{let n=this.getNonDeletedElementsMap(),r=n.get(t);return r?[r]:en(n,t)})}static mapElementToScene(t,n){QC(t)?this.sceneMapById.set(t,n):(this.sceneMapByElement.set(t,n),this.sceneMapById.set(t.id,n))}static getScene(t){return QC(t)?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(t){let n=wre(t),r=(t==null?void 0:t.elements)||this.nonDeletedElements;if(this.selectedElementsCache.elements===r&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let a=this.selectedElementsCache.cache.get(n);if(a)return a}else(t==null?void 0:t.elements)==null&&this.selectedElementsCache.cache.clear();let i=ut(r,{selectedElementIds:t.selectedElementIds},t);return(t==null?void 0:t.elements)==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(n,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let n=this.getElement(t);return n&&D3(n)?n:null}mapElements(t){let n=!1,r=this.elements.map(i=>{let a=t(i);return a!==i&&(n=!0),a});return n&&this.replaceAllElements(r),n}replaceAllElements(t){let n=t instanceof Array?t:Array.from(t.values()),r=[];xre(n),this.elements=xo(n),this.elementsMap.clear(),this.elements.forEach(a=>{Ke(a)&&r.push(a),this.elementsMap.set(a.id,a),pg.mapElementToScene(a,this)});let i=KC(this.elements);this.nonDeletedElements=i.elements,this.nonDeletedElementsMap=i.elementsMap,this.frames=r,this.nonDeletedFramesLikes=KC(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=ys();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),pg.sceneMapById.forEach((t,n)=>{t===this&&pg.sceneMapById.delete(n)}),this.callbacks.clear()}insertElementAtIndex(t,n){if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let r=[...this.elements.slice(0,n),t,...this.elements.slice(n)];xs(r,Qe([t])),this.replaceAllElements(r)}insertElementsAtIndex(t,n){if(!t.length)return;if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let r=[...this.elements.slice(0,n),...t,...this.elements.slice(n)];xs(r,Qe(t)),this.replaceAllElements(r)}getElementIndex(t){return this.elements.findIndex(n=>n.id===t)}};z(A3,"sceneMapByElement",new WeakMap),z(A3,"sceneMapById",new Map);var Ere=A3,wo=Ere,he=(e,t,n=!0,r)=>{var l,h;let i=!1,{points:a,fixedSegments:s,fileId:o,startBinding:c,endBinding:d}=t;if(Ie(e)&&(Object.keys(t).length===0||typeof a<"u"||typeof s<"u"||typeof c<"u"||typeof d<"u")){let f=qi(((l=wo.getScene(e))==null?void 0:l.getNonDeletedElementsMap())??new Map);t={...t,angle:0,...A7({...e,x:t.x||e.x,y:t.y||e.y},f,{fixedSegments:s,points:a,startBinding:c,endBinding:d},{isDragging:r==null?void 0:r.isDragging})}}else typeof a<"u"&&(t={...qu(a),...t});for(let f in t){let g=t[f];if(typeof g<"u"){if(e[f]===g&&(typeof g!="object"||g===null||f==="groupIds"||f==="scale"))continue;if(f==="scale"){let U=e[f],y=g;if(U[0]===y[0]&&U[1]===y[1])continue}else if(f==="points"){let U=e[f],y=g;if(U.length===y.length){let v=!1,x=U.length;for(;--x;){let w=U[x],C=y[x];if(w[0]!==C[0]||w[1]!==C[1]){v=!0;break}}if(!v)continue}}e[f]=g,i=!0}}return i&&((typeof t.height<"u"||typeof t.width<"u"||typeof o<"u"||typeof a<"u")&&gn.delete(e),e.version++,e.versionNonce=ys(),e.updated=yh(),n&&((h=wo.getScene(e))==null||h.triggerUpdate())),e},lt=(e,t,n=!1)=>{let r=!1;for(let i in t){let a=t[i];if(typeof a<"u"){if(e[i]===a&&(typeof a!="object"||a===null))continue;r=!0}}return!r&&!n?e:{...e,...t,updated:yh(),version:e.version+1,versionNonce:ys()}},LU=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=ys(),e.updated=yh(),e),th=e=>rt(e)||Zi(e)?e.points.length<2:e.width===0&&e.height===0,p2=(e,t,n,r,i)=>{let[a,s,o,c]=Da(e,i),d=qt({clientX:r.offsetLeft,clientY:r.offsetTop},r),l=qt({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return d.x<=o&&d.y<=c&&l.x>=a&&l.y>=s},mg=(e,t,n,r,i,a)=>{let[s,o,c,d]=Nt(e,i),l=qt({clientX:r.offsetLeft+((a==null?void 0:a.left)||0),clientY:r.offsetTop+((a==null?void 0:a.top)||0)},r),h=qt({clientX:r.offsetLeft+t-((a==null?void 0:a.right)||0),clientY:r.offsetTop+n-((a==null?void 0:a.bottom)||0)},r);return s>=l.x&&o>=l.y&&c<=h.x&&d<=h.y},JC=(e,t,n)=>{let r=Math.abs(t),i=Math.abs(n);if(e==="line"||e==="arrow"||e==="freedraw"){let a=Math.round(Math.atan(i/r)/jl)*jl;a===0?n=0:a===Math.PI/2?t=0:n=r*Math.tan(a)*Math.sign(n)||n}else e!=="selection"&&(n=r*Math.sign(n));return{width:t,height:n}},L3=(e,t,n,r)=>{let i=n-e,a=r-t,s=Math.round(Math.atan(a/i)/jl)*jl;if(s===0)a=0;else if(s===Math.PI/2)i=0;else{let o=Math.tan(s),c=-1,d=t-o*e,l=-1/o,h=-1,f=r-l*n,g=(c*f-h*d)/(o*h-l*c),U=(d*l-f*o)/(o*h-l*c);i=g-e,a=U-t}return{width:i,height:a}},UL=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},eS={mouse:8,pen:16,touch:28},Cre=16,bL={e:!0,s:!0,n:!0,w:!0},tS={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Xb={e:!0,s:!0,n:!0,w:!0},Gs=(e,t,n,r,i,a,s)=>{let[o,c]=oe(A(e+n/2,t+r/2),A(i,a),s);return[o-n/2,c-r/2,n,r]},q7=e=>!(e.viewport.isMobile||e.isTouchScreen&&(GX||$M)),Ep=e=>q7(e)?bL:{},Z7=([e,t,n,r,i,a],s,o,c,d={},l=4,h=Jc)=>{let f=eS[c],g=f/o.value,U=f/o.value,y=f/o.value,v=f/o.value,x=n-e,w=r-t,C=l/o.value,S=(f-h*2)/(2*o.value),T={nw:d.nw?void 0:Gs(e-C-y+S,t-C-v+S,g,U,i,a,s),ne:d.ne?void 0:Gs(n+C-S,t-C-v+S,g,U,i,a,s),sw:d.sw?void 0:Gs(e-C-y+S,r+C-S,g,U,i,a,s),se:d.se?void 0:Gs(n+C-S,r+C-S,g,U,i,a,s),rotation:d.rotation?void 0:Gs(e+x/2-g/2,t-C-v+S-Cre/o.value,g,U,i,a,s)},M=5*eS.mouse/o.value;return Math.abs(x)>M&&(d.n||(T.n=Gs(e+x/2-g/2,t-C-v+S,g,U,i,a,s)),d.s||(T.s=Gs(e+x/2-g/2,r+C-S,g,U,i,a,s))),Math.abs(w)>M&&(d.w||(T.w=Gs(e-C-y+S,t+w/2-U/2,g,U,i,a,s)),d.e||(T.e=Gs(n+C-S,t+w/2-U/2,g,U,i,a,s))),T},yL=(e,t,n,r="mouse",i=bL)=>{if(e.locked||Ie(e))return{};if(e.type==="freedraw"||rt(e)){if(e.points.length===2){let[,s]=e.points;s[0]===0||s[1]===0?i=Xb:s[0]>0&&s[1]<0?i=tS:s[0]>0&&s[1]>0?i=Xb:s[0]<0&&s[1]>0?i=tS:s[0]<0&&s[1]<0&&(i=Xb)}}else Ke(e)&&(i={...i,rotation:!0});let a=rt(e)?Jc+8:Lt(e)?0:Jc;return Z7(it(e,n,!0),e.angle,t,r,i,a,Lt(e)?0:void 0)},vL=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let n=e[0];return Ie(n)?!1:rt(n)?n.points.length>2:!0},R3=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],Sre=(e,t,n,r,i,a,s,o)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:c,...d}=yL(e,a,t,s,Ep(o));if(c&&R3(c,r,i))return"rotation";let l=Object.keys(d).filter(h=>{let f=d[h];return f?R3(f,r,i):!1});if(l.length>0)return l[0];if(q7(o)){let[h,f,g,U,y,v]=it(e,t);if(!(rt(e)&&e.points.length<=2)){let x=Lt(e)?0:zg/a.value,w=zg/a.value,C=xL(A(h-x,f-x),A(g+x,U+x),A(y,v),e.angle);for(let[S,T]of Object.entries(C))if(ed(A(r,i),T,w))return S}}return!1},nS=(e,t,n,r,i,a,s,o)=>e.reduce((c,d)=>{if(c)return c;let l=Sre(d,s,t,n,r,i,a,o);return l?{element:d,transformHandleType:l}:null},null),rS=([e,t,n,r],i,a,s,o,c)=>{let d=Z7([e,t,n,r,(e+n)/2,(t+r)/2],0,s,o,Ep(c)),l=Object.keys(d).find(h=>{let f=d[h];return f&&R3(f,i,a)});if(l)return l;if(q7(c)){let h=(e+n)/2,f=(t+r)/2,g=zg/s.value,U=xL(A(e-g,t-g),A(n+g,r+g),A(h,f),0);for(let[y,v]of Object.entries(U))if(ed(A(i,a),v,g))return y}return!1},Vb=["ns","nesw","ew","nwse"],_re=(e,t)=>{let n=Vb.indexOf(e);if(n>=0){let r=Math.round(t/(Math.PI/4));e=Vb[(n+r)%Vb.length]}return e},iS=e=>{let{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":r?i="nesw":i="nwse";break;case"ne":case"sw":r?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=_re(i,t.angle)),i?`${i}-resize`:""},xL=([e,t],[n,r],i,a)=>{let s=oe(A(e,t),i,a),o=oe(A(n,t),i,a),c=oe(A(e,r),i,a),d=oe(A(n,r),i,a);return{n:[s,o],e:[o,d],s:[d,c],w:[c,s]}},kre=(e,t,n,r,i,a,s,o,c,d,l,h)=>{if(n.length===1){let[f]=n;if(t==="rotation")Ie(f)||(Tre(f,r,i,c,d,a),ci(f,r));else{if(ke(f)&&t)return Mre(e,f,r,t,s,c,d),ci(f,r),!0;if(t){let g=n[0].id,U=r.get(g),y=e.get(g);if(U&&y){let{nextWidth:v,nextHeight:x}=jre(U,y,r,e,t,c,d,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s});a1(v,x,U,y,r,e,t,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s})}}}return!0}else if(n.length>1){if(t==="rotation")return Ire(e,n,r,i,c,d,a,l,h),!0;if(t){let{nextWidth:f,nextHeight:g,flipByX:U,flipByY:y,originalBoundingBox:v}=Pre(n,e,r,t,c,d,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s});return wL(n,r,t,i,e,{shouldResizeFromCenter:s,shouldMaintainAspectRatio:o,flipByX:U,flipByY:y,nextWidth:f,nextHeight:g,originalBoundingBox:v}),!0}}return!1},Tre=(e,t,n,r,i,a)=>{let[s,o,c,d]=it(e,t),l=(s+c)/2,h=(o+d)/2,f;Ke(e)?f=0:(f=5*Math.PI/2+Math.atan2(i-h,r-l),a&&(f=f+jl/2,f=f-f%jl),f=Vg(f));let g=yo(e);if(he(e,{angle:f}),g){let U=n.getElement(g);U&&!ht(e)&&he(U,{angle:f})}},K7=(e,t,n,r)=>rt(e)||Zi(e)?{points:r2(0,t,r2(1,n,e.points,r),r)}:{},Q7=(e,t,n)=>{let r=e.width;if(tn(e)){let a=lr(e,t);a&&(r=vo(a,e))}let i=e.fontSize*(n/r);return i<V8?null:{size:i}},Mre=(e,t,n,r,i,a,s)=>{let[o,c,d,l,h,f]=it(t,n),[g,U]=oe(A(a,s),A(h,f),-t.angle),y=0,v=0;r!=="e"&&r!=="w"&&(r.includes("e")&&(y=(g-o)/(d-o)),r.includes("w")&&(y=(d-g)/(d-o)),r.includes("n")&&(v=(l-U)/(l-c)),r.includes("s")&&(v=(U-c)/(l-c)));let x=Math.max(y,v);if(x>0){let w=t.width*x,C=t.height*x,S=Q7(t,n,w);if(S===null)return;let T=[o,c],M=[d,l],_=[h,f],R=A(o,c);if(["n","w","nw"].includes(r)&&(R=A(M[0]-Math.abs(w),M[1]-Math.abs(C))),r==="ne"){let W=[T[0],M[1]];R=A(W[0],W[1]-Math.abs(C))}if(r==="sw"){let W=[M[0],T[1]];R=A(W[0]-Math.abs(w),W[1])}["s","n"].includes(r)&&(R[0]=_[0]-w/2),["e","w"].includes(r)&&(R[1]=_[1]-C/2),i&&(R[0]=_[0]-Math.abs(w)/2,R[1]=_[1]-Math.abs(C)/2);let P=t.angle,j=oe(R,A(h,f),P),N=A(R[0]+Math.abs(w)/2,R[1]+Math.abs(C)/2),F=oe(N,A(h,f),P);R=oe(j,F,-P);let[B,G]=R;he(t,{fontSize:S.size,width:w,height:C,x:B,y:G})}if(r==="e"||r==="w"){let w=e.get(t.id),[C,S,T,M]=Al(w,w.width,w.height,!0),_=A(C,S),R=A(T,M),P=I1(_,R),j=oe(A(a,s),P,-w.angle),[N,,F]=Al(t,t.width,t.height,!0),B=F-N,G=R[0]-_[0],W=t7($t({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),X=G/B;r.includes("e")&&(X=(j[0]-_[0])/B),r.includes("w")&&(X=(R[0]-j[0])/B);let $=t.width*X<W?W:t.width*X,Y=gd(t.originalText,$t(t),Math.abs($)),H=Mr(Y,$t(t),t.lineHeight),Z=H.height,[V,te,ce,be]=Al(w,$,Z,!0),fe=ce-V,Se=be-te,Ue=[..._];["n","w","nw"].includes(r)&&(Ue=[R[0]-Math.abs(fe),_[1]]);let ye=w.angle,je=oe(Ue,P,ye),Le=A(Ue[0]+Math.abs(fe)/2,Ue[1]+Math.abs(Se)/2),de=oe(Le,P,ye);Ue=oe(je,de,-ye);let Te={width:Math.abs($),height:Math.abs(H.height),x:Ue[0],y:Ue[1],text:Y,autoResize:!1};he(t,Te)}},Ire=(e,t,n,r,i,a,s,o,c)=>{var l;let d=5*Math.PI/2+Math.atan2(a-c,i-o);s&&(d+=jl/2,d-=d%jl);for(let h of t)if(!Ke(h)){let[f,g,U,y]=it(h,n),v=(f+U)/2,x=(g+y)/2,w=((l=e.get(h.id))==null?void 0:l.angle)??h.angle,[C,S]=oe(A(v,x),A(o,c),d+w-h.angle);Ie(h)?he(h,{points:hte(h,n)}):he(h,{x:h.x+(C-v),y:h.y+(S-x),angle:Vg(d+w)},!1),ci(h,n,{simultaneouslyUpdated:t});let T=ct(h,n);T&&!ht(h)&&he(T,{x:T.x+(C-v),y:T.y+(S-x),angle:Vg(d+w)},!1)}r.triggerUpdate()},Are=(e,t,n,r,i)=>{let[a,s,o,c]=t.length===1?it(t[0],n):Nt(t),d=(a+o)/2,l=(s+c)/2,h=t.length===1?t[0].angle:0;switch([r,i]=oe(A(r,i),A(d,l),-h),e){case"n":return oe(A(r-(a+o)/2,i-s),A(0,0),h);case"s":return oe(A(r-(a+o)/2,i-c),A(0,0),h);case"w":return oe(A(r-a,i-(s+c)/2),A(0,0),h);case"e":return oe(A(r-o,i-(s+c)/2),A(0,0),h);case"nw":return oe(A(r-a,i-s),A(0,0),h);case"ne":return oe(A(r-o,i-s),A(0,0),h);case"sw":return oe(A(r-a,i-c),A(0,0),h);case"se":return oe(A(r-o,i-c),A(0,0),h);default:return[0,0]}},Lre=(e,t)=>{let[,[n,r]]=t.points;return e==="nw"&&(n<0||r<0)||e==="ne"&&n>=0||e==="sw"&&n<=0||e==="se"&&(n>0||r>0)?"end":"origin"},Rre=(e,t,n)=>{if(n)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},Dre=(e,t,n,r,i,a,s,o,c)=>{let d=Rre(s,o,c),[l,h]=e;switch(d){case"top-left":return{x:l+(t-r)/2+(r-t)/2*Math.cos(a)+(n-i)/2*Math.sin(a),y:h+(n-i)/2+(r-t)/2*Math.sin(a)+(i-n)/2*Math.cos(a)};case"top-right":return{x:l+(t-r)/2*(Math.cos(a)+1)+(n-i)/2*Math.sin(a),y:h+(n-i)/2+(t-r)/2*Math.sin(a)+(i-n)/2*Math.cos(a)};case"bottom-left":return{x:l+(t-r)/2*(1-Math.cos(a))+(i-n)/2*Math.sin(a),y:h+(n-i)/2*(Math.cos(a)+1)+(r-t)/2*Math.sin(a)};case"bottom-right":return{x:l+(t-r)/2*(Math.cos(a)+1)+(i-n)/2*Math.sin(a),y:h+(n-i)/2*(Math.cos(a)+1)+(t-r)/2*Math.sin(a)};case"center":return{x:l-(r-t)/2,y:h-(i-n)/2};case"east-side":return{x:l+(t-r)/2*(Math.cos(a)+1),y:h+(t-r)/2*Math.sin(a)+(n-i)/2};case"west-side":return{x:l+(t-r)/2*(1-Math.cos(a)),y:h+(r-t)/2*Math.sin(a)+(n-i)/2};case"north-side":return{x:l+(t-r)/2+(n-i)/2*Math.sin(a),y:h+(i-n)/2*(Math.cos(a)-1)};case"south-side":return{x:l+(t-r)/2+(i-n)/2*Math.sin(a),y:h+(n-i)/2*(Math.cos(a)+1)}}},a1=(e,t,n,r,i,a,s,{shouldInformMutation:o=!0,shouldMaintainAspectRatio:c=!1,shouldResizeFromCenter:d=!1}={})=>{let l={},h=ct(n,i);if(h){let y=a.get(h.id);if(y&&(l={fontSize:y.fontSize}),c){let v={...n,width:e},x=Q7(h,i,vo(v,h));if(x===null)return;l={fontSize:x.size}}else{let v=uI($t(h),h.lineHeight),x=hI(h.fontSize,h.lineHeight);e=Math.max(e,v),t=Math.max(t,x)}}let f=K7(r,e,t,!0),g=A(r.x,r.y);if(rt(r)){let[y,v]=Da(r,a);g=A(y,v)}let U=Dre(g,r.width,r.height,e,t,r.angle,s,c,d);if(rt(r)&&f.points){let y=r.x-g[0],v=r.y-g[1];U.x+=y,U.y+=v;let x=f.points[0][0],w=f.points[0][1];U.x+=x,U.y+=w,f.points=f.points.map(C=>A(C[0]-x,C[1]-w))}if(e<0&&(U.x=U.x+e),t<0&&(U.y=U.y+t),"scale"in n&&"scale"in r&&he(n,{scale:[(Math.sign(e)||r.scale[0])*r.scale[0],(Math.sign(t)||r.scale[1])*r.scale[1]]}),ht(n)&&h&&c){let y=e/n.width*h.fontSize;if(y<V8)return;l.fontSize=y}if(e!==0&&t!==0&&Number.isFinite(U.x)&&Number.isFinite(U.y)){let y={...U,width:Math.abs(e),height:Math.abs(t),...f};he(n,y,o),ci(n,i,{newSize:{width:e,height:t}}),h&&l!=null&&he(h,{fontSize:l.fontSize}),j1(n,i,s,c)}},jre=(e,t,n,r,i,a,s,{shouldMaintainAspectRatio:o=!1,shouldResizeFromCenter:c=!1}={})=>{let[d,l,h,f]=Al(t,t.width,t.height,!0),g=A(d,l),U=A(h,f),y=I1(g,U),v=oe(A(a,s),y,-t.angle),[x,w,C,S]=Al(e,e.width,e.height,!0),T=C-x,M=S-w,_=U[0]-g[0],R=U[1]-g[1],P=_/T,j=R/M;i.includes("e")&&(P=(v[0]-g[0])/T),i.includes("s")&&(j=(v[1]-g[1])/M),i.includes("w")&&(P=(U[0]-v[0])/T),i.includes("n")&&(j=(U[1]-v[1])/M);let N=e.width*P,F=e.height*j;if(c&&(N=2*N-t.width,F=2*F-t.height),o){let B=Math.abs(N)/t.width,G=Math.abs(F)/t.height;if(i.length===1&&(F*=B,N*=G),i.length===2){let W=Math.max(B,G);N=t.width*W*Math.sign(N),F=t.height*W*Math.sign(F)}}return{nextWidth:N,nextHeight:F}},Pre=(e,t,n,r,i,a,{shouldMaintainAspectRatio:s=!1,shouldResizeFromCenter:o=!1}={})=>{let c=e.map(B=>t.get(B.id)),d=c.reduce((B,G)=>{if(!rt(G))return B;let W=yo(G);if(!W)return B;let X=t.get(W)??null;return tn(X)?[...B,{...X,...Me.getBoundTextElementPosition(G,X,n)}]:B},[]),l=Ma(c.map(B=>B).concat(d)),{minX:h,minY:f,maxX:g,maxY:U,midX:y,midY:v}=l,x=g-h,w=U-f,C={ne:[h,U],se:[h,f],sw:[g,f],nw:[g,U],e:[h,f+w/2],w:[g,f+w/2],n:[h+x/2,U],s:[h+x/2,f]},[S,T]=o?[y,v]:C[r],M=o?2:1,_=Math.max(Math.abs(i-S)/x||0,Math.abs(a-T)/w||0)*M,R=r.includes("e")||r.includes("w")?Math.abs(i-S)*M:x,P=r.includes("n")||r.includes("s")?Math.abs(a-T)*M:w;s&&(R=x*_*Math.sign(i-S),P=w*_*Math.sign(a-T));let j={ne:[i<S,a>T],se:[i<S,a<T],sw:[i>S,a<T],nw:[i>S,a>T],e:[i<S,!1],w:[i>S,!1],n:[!1,a>T],s:[!1,a<T]},[N,F]=j[r].map(B=>B);return{originalBoundingBox:l,nextWidth:R,nextHeight:P,flipByX:N,flipByY:F}},wL=(e,t,n,r,i,{shouldMaintainAspectRatio:a=!1,shouldResizeFromCenter:s=!1,flipByX:o=!1,flipByY:c=!1,nextHeight:d,nextWidth:l,originalBoundingBox:h}={})=>{if(l===void 0&&d===void 0&&o===void 0&&c===void 0||d===0||l===0)return;i||(i=t);let f=e.reduce((M,_)=>{let R=i.get(_.id);return R&&M.push({orig:R,latest:_}),M},[]),g;if(h)g=h;else{let M=f.reduce((_,{orig:R})=>{if(!rt(R))return _;let P=yo(R);if(!P)return _;let j=i.get(P)??null;return tn(j)?[..._,{...j,...Me.getBoundTextElementPosition(R,j,t)}]:_},[]);g=Ma(f.map(({orig:_})=>_).concat(M))}let{minX:U,minY:y,maxX:v,maxY:x,midX:w,midY:C}=g,S=v-U,T=x-y;if(l===void 0&&d===void 0&&(l=S,d=T),a&&(l===void 0?l=d*(S/T):d===void 0?d=l*(T/S):Math.abs(l/d-S/T)>.001&&(l=d*(S/T))),l&&d){let M=n.includes("e")||n.includes("w")?Math.abs(l)/S:1,_=n.includes("n")||n.includes("s")?Math.abs(d)/T:1,R;n.length===1?R=n.includes("e")||n.includes("w")?M:_:R=Math.max(Math.abs(l)/S||0,Math.abs(d)/T||0);let P={ne:[U,x],se:[U,y],sw:[v,y],nw:[v,x],e:[U,y+T/2],w:[v,y+T/2],n:[U+S/2,x],s:[U+S/2,y]},[j,N]=s?[w,C]:P[n],F=a||f.some($=>$.latest.angle!==0||ke($.latest)||Zu($.latest));F&&(M=R,_=R);let[B,G]=[o?-1:1,c?-1:1],W=[];for(let{orig:$,latest:Y}of f){if(ke($)&&tn($))continue;let H=$.width*M,Z=$.height*_,V=Vg($.angle*B*G),te=rt($)||Zi($),ce=$.x-j,be=$.y-N,fe=o&&!te?H:0,Se=c&&!te?Z:0,Ue=j+B*(ce*M+fe),ye=N+G*(be*_+Se),je=K7($,H*B,Z*G,!1),Le={x:Ue,y:ye,width:H,height:Z,angle:V,...je};if(Ie($)&&($.startBinding&&(Le.startBinding={...$.startBinding,fixedPoint:[o?-$.startBinding.fixedPoint[0]+1:$.startBinding.fixedPoint[0],c?-$.startBinding.fixedPoint[1]+1:$.startBinding.fixedPoint[1]]}),$.endBinding&&(Le.endBinding={...$.endBinding,fixedPoint:[o?-$.endBinding.fixedPoint[0]+1:$.endBinding.fixedPoint[0],c?-$.endBinding.fixedPoint[1]+1:$.endBinding.fixedPoint[1]]}),$.fixedSegments&&je.points&&(Le.fixedSegments=$.fixedSegments.map(Te=>({...Te,start:je.points[Te.index-1],end:je.points[Te.index]})))),Lt($)&&(Le.scale=[$.scale[0]*B,$.scale[1]*G]),ke($)){let Te=Q7($,t,H);if(!Te)return;Le.fontSize=Te.size}let de=i.get(yo($)??"");if(de)if(F){let Te=de.fontSize*R;if(Te<V8)return;Le.boundTextFontSize=Te}else Le.boundTextFontSize=de.fontSize;W.push({element:Y,update:Le})}let X=W.map(({element:$})=>$);for(let{element:$,update:{boundTextFontSize:Y,...H}}of W){let{width:Z,height:V,angle:te}=H;he($,H,!1,{isDragging:!0}),ci($,t,{simultaneouslyUpdated:X,newSize:{width:Z,height:V}});let ce=ct($,t);ce&&Y&&(he(ce,{fontSize:Y,angle:rt($)?void 0:te},!1),j1($,t,n,!0))}r.triggerUpdate()}},Nre=(e,t,n,r,i,a)=>{if(t.length===1&&Ie(t[0])&&(t[0].startBinding||t[0].endBinding))return;let s=t.filter(h=>{if(Ie(h)&&h.startBinding&&h.endBinding){let f=t.find(U=>{var y;return U.id===((y=h.startBinding)==null?void 0:y.elementId)}),g=t.find(U=>{var y;return U.id===((y=h.endBinding)==null?void 0:y.elementId)});return f&&g}return!0}),o=new Set(s),c=s.filter(h=>Ke(h)).map(h=>h.id);if(c.length>0)for(let h of r.getNonDeletedElements())h.frameId!==null&&c.includes(h.frameId)&&o.add(h);let d=Nt(Array.from(o).map(h=>e.originalElements.get(h.id)??h)),l=Ore(d,n,i,a);o.forEach(h=>{if(aS(e,h,l),!ht(h)){let f=ct(h,r.getNonDeletedElementsMap());f&&aS(e,f,l),ci(h,r.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(o)})}})},Ore=(e,t,n,r)=>{let[i,a]=e,s=i+t.x+n.x,o=a+t.y+n.y;if(n.x===0||n.y===0){let[c,d]=Pn(i+t.x,a+t.y,r);n.x===0&&(s=c),n.y===0&&(o=d)}return{x:s-i,y:o-a}},aS=(e,t,n)=>{let r=e.originalElements.get(t.id)??t,i=r.x+n.x,a=r.y+n.y;he(t,{x:i,y:a})},Fre=(e,t,n)=>{let[r,i]=Nt(e);return[t-r,n-i]},sS=({newElement:e,elementType:t,originX:n,originY:r,x:i,y:a,width:s,height:o,shouldMaintainAspectRatio:c,shouldResizeFromCenter:d,zoom:l,widthAspectRatio:h=null,originOffset:f=null,informMutation:g=!0})=>{c&&e.type!=="selection"&&(h?o=s/h:(Math.abs(a-r)>Math.abs(i-n)?{width:s,height:o}=JC(t,o,i<n?-s:s):{width:s,height:o}=JC(t,s,a<r?-o:o),o<0&&(o=-o)));let U=i<n?n-s:n,y=a<r?r-o:r;d&&(s+=s,o+=o,U=n-s/2,y=r-o/2);let v=null;if(ke(e)){o=e.height;let x=t7($t({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);s=Math.max(s,x),Math.abs(i-n)>JX/l&&(v={autoResize:!1}),y=r,d&&(U=n-s/2)}if(s!==0&&o!==0){let x=null;Lt(e)&&(x={initialWidth:s,initialHeight:o}),he(e,{x:U+((f==null?void 0:f.x)??0),y:y+((f==null?void 0:f.y)??0),width:s,height:o,...v,...x},g)}},J7=(e,t)=>{var n;return!!(!e.viewModeEnabled&&((n=e.openDialog)==null?void 0:n.name)!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||ut(t,e).length))},Bre=e=>{let t=5381;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)+t+r}return t>>>0},$re=e=>e.filter(t=>!t.isDeleted&&!th(t)),Gt=e=>e.filter(t=>!t.isDeleted),D3=e=>!e.isDeleted,zre=e=>Gt(e).map(t=>e7(t.type)?{...t,lastCommittedPoint:null}:t),EL=e=>zre(e),CL=async e=>{let t;if(e.type===Be.png)try{return await(await ge(async()=>{const{decodePngMetadata:n}=await Promise.resolve().then(()=>kF);return{decodePngMetadata:n}},void 0,import.meta.url)).decodePngMetadata(e)}catch(n){throw n.message==="INVALID"?new Dc("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new Dc("Error: cannot restore image")}else if("text"in Blob?t=await e.text():t=await new Promise(n=>{let r=new FileReader;r.readAsText(e,"utf8"),r.onloadend=()=>{r.readyState===FileReader.DONE&&n(r.result)}}),e.type===Be.svg)try{return xne({svg:t})}catch(n){throw n.message==="INVALID"?new Dc("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new Dc("Error: cannot restore image")}return t},SL=e=>{var t;return e&&((t=e.name.match(/\.(json|excalidraw|png|svg)$/))==null?void 0:t[1])||null},Hre=e=>e==="png"||e==="svg",ev=e=>{let t=SL(e);return t==="png"||t==="svg"},_L=e=>!!e&&Object.values($u).includes(e),Xc=e=>{let{type:t}=e||{};return _L(t)},kL=async(e,t,n,r)=>{let i=await CL(e),a;try{try{a=JSON.parse(i)}catch(s){throw Xc(e)?new Dc("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):s}if(fne(a))return{type:Be.excalidraw,data:TU({elements:EL(a.elements||[]),appState:{theme:t==null?void 0:t.theme,fileHandle:r||e.handle||null,...GM(a.appState||{}),...t?e1(a.elements||[],t):{}},files:a.files},t,n,{repairBindings:!0,refreshDimensions:!1})};if($A(a))return{type:Be.excalidrawlib,data:a};throw new Error("Error: invalid file")}catch(s){throw s instanceof Dc?s:new Error("Error: invalid file")}},TL=async(e,t,n,r)=>{let i=await kL(e,t,n,r);if(i.type!==Be.excalidraw)throw new Error("Error: invalid file");return i.data},ML=(e,t="unpublished")=>{let n=JSON.parse(e);if(!$A(n))throw new Error("Invalid library");let r=n.libraryItems||n.library;return O7(r,t)},Wre=async(e,t="unpublished")=>ML(await CL(e),t),s1=async e=>new Promise(async(t,n)=>{try{A1(e)&&(e=await e),e.toBlob(r=>{if(!r)return n(new dq("Error: Canvas too big","CANVAS_POSSIBLY_TOO_BIG"));t(r)})}catch(r){n(r)}}),Xre=async e=>{try{let t=await window.crypto.subtle.digest("SHA-1",await Pc(e));return qV(new Uint8Array(t))}catch(t){return console.error(t),H8(40)}},oS=async e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let i=r.result;t(i)},r.onerror=i=>n(i),r.readAsDataURL(e)}),Vre=(e,t)=>`data:${t};base64,${LL(m2(e),!0)}`,Yre=(e,t="")=>{let n=e.indexOf(","),r=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],a=new ArrayBuffer(r.length),s=new Uint8Array(a);for(let o=0;o<r.length;o++)s[o]=r.charCodeAt(o);return new File([a],t,{type:i})},Gre=e=>RL(e.slice(e.indexOf(",")+1)),j3=async(e,t)=>{if(e.type===Be.svg)return e;let[n,r]=await Promise.all([ge(()=>import("./pica-DWYGHLQV.js").then(a=>a.p),__vite__mapDeps([2,3]),import.meta.url).then(a=>a.default),ge(()=>import("./image-blob-reduce.esm-B6b2_-a4.js"),[],import.meta.url).then(a=>a.default)]),i=r({pica:n({features:["js","wasm"]})});if(t.outputType){let{outputType:a}=t;i._create_blob=function(s){return this.pica.toBlob(s.out_canvas,a,.8).then(o=>(s.out_blob=o,s))}}if(!Xc(e))throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"});return new File([await i.toBlob(e,{max:t.maxWidthOrHeight,alpha:!0})],e.name,{type:t.outputType||e.type})},lS=(e,t="")=>new File([new TextEncoder().encode(e)],t,{type:Be.svg}),qre=async(e,t="")=>{let n;try{n=await fetch(e)}catch{throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"})}if(!n.ok)throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"});let r=await n.blob();if(r.type&&Xc(r)){let i=t||r.name||"";return new File([r],i,{type:r.type})}throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"})},Zre=async e=>{let t=e.dataTransfer.files.item(0),n=await Kre(e);return{file:t?await tv(t):null,fileHandle:n}},Kre=async e=>{if(md)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(t){return console.warn(t.name,t.message),null}return null},cS=e=>{let t=null,n=`${[...new Uint8Array(e).slice(0,8)].join(" ")} `,r={png:"137 80 78 71 13 10 26 10 ",jpg:"255 216 255 ",gif:"71 73 70 56 57 97 "};return n===r.png?t=Be.png:n.startsWith(r.jpg)?t=Be.jpg:n.startsWith(r.gif)&&(t=Be.gif),t},rp=(e,t,n)=>new File([e],n||"",{type:t}),tv=async e=>{var t,n;if(e.type){if(Xc(e)){let r=await Pc(e),i=cS(r);i&&i!==e.type&&(e=rp(r,i,e.name))}}else if((t=e==null?void 0:e.name)!=null&&t.endsWith(".excalidrawlib"))e=rp(await Pc(e),Be.excalidrawlib,e.name);else if((n=e==null?void 0:e.name)!=null&&n.endsWith(".excalidraw"))e=rp(await Pc(e),Be.excalidraw,e.name);else{let r=await Pc(e),i=cS(r);i&&(e=rp(r,i,e.name))}return e},Pc=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise((t,n)=>{let r=new FileReader;r.onload=i=>{var a;if(!((a=i.target)!=null&&a.result))return n(new Error("Couldn't convert blob to ArrayBuffer"));t(i.target.result)},r.readAsArrayBuffer(e)}),m2=e=>{let t=typeof e=="string"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r of t)n+=String.fromCharCode(r);return n},IL=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t},AL=e=>new TextDecoder("utf-8").decode(IL(e)),LL=(e,t=!1)=>t?window.btoa(e):window.btoa(m2(e)),RL=(e,t=!1)=>t?window.atob(e):AL(window.atob(e)),DL=({text:e,compress:t})=>{let n;if(t!==!1)try{n=m2(pW(e))}catch(r){console.error("encode: cannot deflate",r)}return{version:"1",encoding:"bstring",compressed:!!n,encoded:n||m2(e)}},jL=e=>{let t;switch(e.encoding){case"bstring":t=e.compressed?e.encoded:AL(e.encoded);break;default:throw new Error(`decode: unknown encoding "${e.encoding}"`)}return e.compressed?mW(new Uint8Array(IL(t)),{to:"string"}):t},PL=async e=>{let t=BT(new Uint8Array(await Pc(e))).find(n=>n.name==="tEXt");return t?$T.decode(t.data):null},NL=async({blob:e,metadata:t})=>{let n=BT(new Uint8Array(await Pc(e))),r=$T.encode(Be.excalidraw,JSON.stringify(DL({text:t,compress:!0})));return n.splice(-1,0,r),new Blob([P$(n)],{type:Be.png})},Qre=async e=>{let t=await PL(e);if((t==null?void 0:t.keyword)===Be.excalidraw)try{let n=JSON.parse(t.text);if(!("encoded"in n)){if("type"in n&&n.type===Vi.excalidraw)return t.text;throw new Error("FAILED")}return jL(n)}catch(n){throw console.error(n),new Error("FAILED")}throw new Error("INVALID")},OL={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",pasteCharts:"Paste charts",selectAll:"Select all",multiSelect:"Add element to selection",moveCanvas:"Move canvas",cut:"Cut",copy:"Copy",copyAsPng:"Copy to clipboard as PNG",copyAsSvg:"Copy to clipboard as SVG",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",strokeStyle:"Stroke style",strokeStyle_solid:"Solid",strokeStyle_dashed:"Dashed",strokeStyle_dotted:"Dotted",sloppiness:"Sloppiness",opacity:"Opacity",textAlign:"Text align",edges:"Edges",sharp:"Sharp",round:"Round",arrowheads:"Arrowheads",arrowhead_none:"None",arrowhead_arrow:"Arrow",arrowhead_bar:"Bar",arrowhead_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",addWatermark:'Add "Made with Excalidraw"',handDrawn:"Hand-drawn",normal:"Normal",code:"Code",small:"Small",medium:"Medium",large:"Large",veryLarge:"Very large",solid:"Solid",hachure:"Hachure",zigzag:"Zigzag",crossHatch:"Cross-hatch",thin:"Thin",bold:"Bold",left:"Left",center:"Center",right:"Right",extraBold:"Extra bold",architect:"Architect",artist:"Artist",cartoonist:"Cartoonist",fileTitle:"File name",colorPicker:"Color picker",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear canvas",layers:"Layers",actions:"Actions",language:"Language",liveCollaboration:"Live collaboration...",duplicateSelection:"Duplicate",untitled:"Untitled",name:"Name",yourName:"Your name",madeWithExcalidraw:"Made with Excalidraw",group:"Group selection",ungroup:"Ungroup selection",collaborators:"Collaborators",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library…",libraries:"Browse libraries",loadingScene:"Loading scene…",loadScene:"Load scene from file",align:"Align",alignTop:"Align top",alignBottom:"Align bottom",alignLeft:"Align left",alignRight:"Align right",centerVertically:"Center vertically",centerHorizontally:"Center horizontally",distributeHorizontally:"Distribute horizontally",distributeVertically:"Distribute vertically",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical",viewMode:"View mode",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},FL={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},BL={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},$L={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},zL={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",getShareableLink:"Get shareable link",close:"Close",selectLanguage:"Select language",scrollBackToContent:"Scroll back to content",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",menu:"Menu",done:"Done",edit:"Edit",undo:"Undo",redo:"Redo",resetLibrary:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},HL={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?
|
|
81
|
+
|
|
82
|
+
(If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available.
|
|
83
|
+
Your changes will not be saved!`},WL={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.",line2:"This could result in breaking the <bold>Text Elements</bold> in your drawings.",line3:"We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},XL={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},VL={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},YL={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},GL={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing,
|
|
84
|
+
hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
|
|
85
|
+
hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s),
|
|
86
|
+
CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
|
|
87
|
+
or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},qL={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},ZL={headingMain:"Encountered an error. Try <button>reloading the page</button>.",clearCanvasMessage:"If reloading doesn't work, try <button>clearing the canvas</button>.",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},KL={or:"Or"},QL={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},JL={title:"Error"},eR={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},tR={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},nR={title:"Clear canvas"},rR={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},iR={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>"},aR={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},sR={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
|
|
88
|
+
Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},oR={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},lR={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},cR={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
|
|
89
|
+
({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
|
|
90
|
+
({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
|
|
91
|
+
or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},dR={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},uR={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},hR={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},fR={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below."}}},pR={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},mR={placeholder:"Quick search"},gR={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},UR={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},bR={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"},nv={labels:OL,elementLink:FL,library:BL,search:$L,buttons:zL,alerts:HL,errors:WL,toolBar:XL,element:VL,headings:YL,hints:GL,canvasError:qL,errorSplash:ZL,shareDialog:KL,roomDialog:QL,errorDialog:JL,exportDialog:eR,helpDialog:tR,clearCanvasDialog:nR,publishDialog:rR,publishSuccessDialog:iR,confirmDialog:aR,imageExportDialog:sR,encrypted:oR,stats:lR,toast:cR,colors:dR,welcomeScreen:uR,colorPicker:hR,overwriteConfirm:fR,mermaid:pR,quickSearch:mR,fontList:gR,userList:UR,commandPalette:bR},yR=100,vR=36,xR={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:yR,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:vR,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100};const Eo={};let Jre=0;function cr(e,t){const n=`atom${++Jre}`,r={toString(){return(Eo?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=eie,r.write=tie),r}function eie(e){return e(this)}function tie(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const dS=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,P3=e=>"init"in e,Yb=e=>!!e.write,g2=new WeakMap,N3=e=>{var t;return O3(e)&&!((t=g2.get(e))!=null&&t[1])},nie=(e,t)=>{const n=g2.get(e);if(n)n[1]=!0,n[0].forEach(r=>r(t));else if((Eo?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},rie=e=>{if(g2.has(e))return;const t=[new Set,!1];g2.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},O3=e=>typeof(e==null?void 0:e.then)=="function",uS=e=>"v"in e||"e"in e,Cm=e=>{if("e"in e)throw e.e;if((Eo?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},wR=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},hS=(e,t,n,r,i)=>{var a;if((Eo?"production":void 0)!=="production"&&r===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),N3(n.v)&&wR(t,n.v,i),(a=i.m)==null||a.t.add(t),e&&iie(e,r,t)},Rf=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),Cp=(e,t,n)=>{e[t].add(n)},fS=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),Cp(e,"M",()=>{var r;(r=n.m)==null||r.l.forEach(i=>Cp(e,"M",i))}))},iie=(e,t,n)=>{const r=e.D.get(t);r&&r.add(n)},aie=(e,t)=>e.D.get(t),gc=e=>{let t,n=!1;const r=i=>{try{i()}catch(a){n||(t=a,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(r),e.H.clear(),e.M.forEach(r),e.M.clear(),e.L.forEach(r),e.L.clear();if(n)throw t},ER=(...[e,t,n,r])=>{const i=(x,w,C)=>{const S="v"in w,T=w.v,M=N3(w.v)?w.v:null;if(O3(C)){rie(C);for(const _ of w.d.keys())wR(x,C,e(_));w.v=C}else w.v=C;delete w.e,delete w.x,(!S||!Object.is(T,w.v))&&(++w.n,M&&nie(M,C))},a=(x,w)=>{var C;const S=e(w);if(uS(S)&&(S.m&&!S.x||Array.from(S.d).every(([j,N])=>a(x,j).n===N)))return S;S.d.clear();let T=!0;const M=j=>{if(dS(w,j)){const F=e(j);if(!uS(F))if(P3(j))i(j,F,j.init);else throw new Error("no atom init");return Cm(F)}const N=a(x,j);try{return Cm(N)}finally{if(T)hS(x,w,S,j,N);else{const F=Rf();hS(F,w,S,j,N),h(F,w,S),gc(F)}}};let _,R;const P={get signal(){return _||(_=new AbortController),_.signal},get setSelf(){return(Eo?"production":void 0)!=="production"&&!Yb(w)&&console.warn("setSelf function cannot be used with read-only atom"),!R&&Yb(w)&&(R=(...j)=>{if((Eo?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)return l(w,...j)}),R}};try{const j=t(w,M,P);if(i(w,S,j),O3(j)){(C=j.onCancel)==null||C.call(j,()=>_==null?void 0:_.abort());const N=()=>{if(S.m){const F=Rf();h(F,w,S),gc(F)}};j.then(N,N)}return S}catch(j){return delete S.v,S.e=j,delete S.x,++S.n,S}finally{T=!1}},s=x=>Cm(a(void 0,x)),o=(x,w,C)=>{var S,T;const M=new Map;for(const _ of((S=C.m)==null?void 0:S.t)||[]){const R=e(_);R.m&&M.set(_,R)}for(const _ of C.p)M.set(_,e(_));return(T=aie(x,w))==null||T.forEach(_=>{M.set(_,e(_))}),M},c=(x,w,C)=>{const S=[],T=new Set,M=new Set,_=[[w,C]];for(;_.length>0;){const[R,P]=_[_.length-1];if(M.has(R)){_.pop();continue}if(T.has(R)){S.push([R,P,P.n]),M.add(R),P.x=!0,_.pop();continue}T.add(R);for(const[j,N]of o(x,R,P))R!==j&&!T.has(j)&&_.push([j,N])}Cp(x,"H",()=>{const R=new Set([w]);for(let P=S.length-1;P>=0;--P){const[j,N,F]=S[P];let B=!1;for(const G of N.d.keys())if(G!==j&&R.has(G)){B=!0;break}B&&(a(x,j),h(x,j,N),F!==N.n&&(fS(x,j,N),R.add(j))),delete N.x}})},d=(x,w,...C)=>{let S=!0;const T=_=>Cm(a(x,_)),M=(_,...R)=>{const P=e(_);try{if(dS(w,_)){if(!P3(_))throw new Error("atom not writable");const j=P.n,N=R[0];i(_,P,N),h(x,_,P),j!==P.n&&(fS(x,_,P),c(x,_,P));return}else return d(x,_,...R)}finally{S||gc(x)}};try{return n(w,T,M,...C)}finally{S=!1}},l=(x,...w)=>{const C=Rf();try{return d(C,x,...w)}finally{gc(C)}},h=(x,w,C)=>{if(C.m&&!N3(C.v)){for(const S of C.d.keys())C.m.d.has(S)||(f(x,S,e(S)).t.add(w),C.m.d.add(S));for(const S of C.m.d||[])if(!C.d.has(S)){C.m.d.delete(S);const T=g(x,S,e(S));T==null||T.t.delete(w)}}},f=(x,w,C)=>{if(!C.m){a(x,w);for(const S of C.d.keys())f(x,S,e(S)).t.add(w);if(C.m={l:new Set,d:new Set(C.d.keys()),t:new Set},Yb(w)){const S=C.m;let T;const M=(_,R)=>{let P=!0;T=(...j)=>{try{return d(_,w,...j)}finally{P||gc(_)}};try{return R()}finally{P=!1}};Cp(x,"L",()=>{const _=M(x,()=>r(w,(...R)=>T(...R)));_&&(S.u=R=>M(R,_))})}}return C.m},g=(x,w,C)=>{if(C.m&&!C.m.l.size&&!Array.from(C.m.t).some(S=>{var T;return(T=e(S).m)==null?void 0:T.d.has(w)})){const S=C.m.u;S&&Cp(x,"L",()=>S(x)),delete C.m;for(const T of C.d.keys()){const M=g(x,T,e(T));M==null||M.t.delete(w)}return}return C.m};return{get:s,set:l,sub:(x,w)=>{const C=Rf(),S=e(x),M=f(C,x,S).l;return M.add(w),gc(C),()=>{M.delete(w);const _=Rf();g(_,x,S),gc(_)}},unstable_derive:x=>ER(...x(e,t,n,r))}},sie=e=>{const t=new WeakMap,n=new Set;let r,i=0;const a=e.unstable_derive((c,d,l,h)=>(r=c,[f=>{let g=t.get(f);if(!g){const U=c(f);g=new Proxy(U,{set(y,v,x){return v==="m"&&n.add(f),Reflect.set(y,v,x)},deleteProperty(y,v){return v==="m"&&n.delete(f),Reflect.deleteProperty(y,v)}}),t.set(f,g)}return g},d,(f,g,U,...y)=>i?U(f,...y):l(f,g,U,...y),h])),s=a.set;return Object.assign(a,{dev4_get_internal_weak_map:()=>({get:c=>{const d=r(c);if(d.n!==0)return d}}),dev4_get_mounted_atoms:()=>n,dev4_restore_atoms:c=>{s({read:()=>null,write:(l,h)=>{++i;try{for(const[f,g]of c)P3(f)&&h(f,g)}finally{--i}}})}})},rv=()=>{const e=new WeakMap,n=ER(r=>{if((Eo?"production":void 0)!=="production"&&!r)throw new Error("Atom is undefined or null");let i=e.get(r);return i||(i={d:new Map,p:new Set,n:0},e.set(r,i)),i},(r,...i)=>r.read(...i),(r,...i)=>r.write(...i),(r,...i)=>{var a;return(a=r.onMount)==null?void 0:a.call(r,...i)});return(Eo?"production":void 0)!=="production"?sie(n):n};let Df;const oie=()=>(Df||(Df=rv(),(Eo?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Df),globalThis.__JOTAI_DEFAULT_STORE__!==Df&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Df),CR={},lie=I.createContext(void 0),RU=e=>{const t=I.useContext(lie);return(e==null?void 0:e.store)||t||oie()},F3=e=>typeof(e==null?void 0:e.then)=="function",SR=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},cie=xe.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(SR(e),e)}),Gb=new WeakMap,pS=e=>{let t=Gb.get(e);return t||(t=new Promise((n,r)=>{let i=e;const a=c=>d=>{i===c&&n(d)},s=c=>d=>{i===c&&r(d)},o=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(d=>{if((CR?"production":void 0)!=="production"&&d===c)throw new Error("[Bug] p is not updated even after cancelation");F3(d)?(Gb.set(d,t),i=d,d.then(a(d),s(d)),o(d)):n(d)})};e.then(a(e),s(e)),o(e)}),Gb.set(e,t)),t};function _R(e,t){const n=RU(t),[[r,i,a],s]=I.useReducer(d=>{const l=n.get(e);return Object.is(d[0],l)&&d[1]===n&&d[2]===e?d:[l,n,e]},void 0,()=>[n.get(e),n,e]);let o=r;(i!==n||a!==e)&&(s(),o=n.get(e));const c=t==null?void 0:t.delay;if(I.useEffect(()=>{const d=n.sub(e,()=>{if(typeof c=="number"){const l=n.get(e);F3(l)&&SR(pS(l)),setTimeout(s,c);return}s()});return s(),d},[n,e,c]),I.useDebugValue(o),F3(o)){const d=pS(o);return cie(d)}return o}function kR(e,t){const n=RU(t);return I.useCallback((...i)=>{if((CR?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function die(e,t){return[_R(e,t),kR(e,t)]}const mS=new WeakMap;function uie(e,t){const n=RU(t),r=hie(n);for(const[i,a]of e)(!r.has(i)||t!=null&&t.dangerouslyForceHydrate)&&(r.add(i),n.set(i,a))}const hie=e=>{let t=mS.get(e);return t||(t=new WeakSet,mS.set(e,t)),t};function Eu(){return Eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eu.apply(this,arguments)}function TR(){const e=I.createContext(null);function t({store:s,initialValues:o=[],children:c}){const d=I.useRef(s);return d.current||(d.current=rv()),uie(o,{store:d.current}),m.jsx(e.Provider,{value:d.current,children:c})}const n=s=>{const o=I.useContext(e);if(!o)throw new Error("Missing Provider from createIsolation");return RU(Eu({store:o},s))};return{Provider:t,useStore:n,useAtom:(s,o)=>{const c=n();return die(s,Eu({store:c},o))},useAtomValue:(s,o)=>{const c=n();return _R(s,Eu({store:c},o))},useSetAtom:(s,o)=>{const c=n();return kR(s,Eu({store:c},o))}}}const{read:gxe,write:Uxe}=cr(null);I.createContext({scope:void 0,baseStore:void 0});var ar=PT();const fie=ta(ar);function Rl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function gS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function MR(...e){return t=>{let n=!1;const r=e.map(i=>{const a=gS(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():gS(e[i],null)}}}}function Yl(...e){return I.useCallback(MR(...e),e)}function IR(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];const d=h=>{var x;const{scope:f,children:g,...U}=h,y=((x=f==null?void 0:f[e])==null?void 0:x[c])||o,v=I.useMemo(()=>U,Object.values(U));return m.jsx(y.Provider,{value:v,children:g})};d.displayName=a+"Provider";function l(h,f){var y;const g=((y=f==null?void 0:f[e])==null?void 0:y[c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,pie(i,...t)]}function pie(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var iv=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(gie);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return m.jsx(B3,{...r,ref:t,children:I.isValidElement(s)?I.cloneElement(s,void 0,o):null})}return m.jsx(B3,{...r,ref:t,children:n})});iv.displayName="Slot";var B3=I.forwardRef((e,t)=>{const{children:n,...r}=e;if(I.isValidElement(n)){const i=bie(n),a=Uie(r,n.props);return n.type!==I.Fragment&&(a.ref=t?MR(t,i):i),I.cloneElement(n,a)}return I.Children.count(n)>1?I.Children.only(null):null});B3.displayName="SlotClone";var mie=({children:e})=>m.jsx(m.Fragment,{children:e});function gie(e){return I.isValidElement(e)&&e.type===mie}function Uie(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function bie(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Io=yie.reduce((e,t)=>{const n=I.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?iv:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(o,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vie(e,t){e&&ar.flushSync(()=>e.dispatchEvent(t))}function Fl(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function xie(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e);I.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var wie="DismissableLayer",$3="dismissableLayer.update",Eie="dismissableLayer.pointerDownOutside",Cie="dismissableLayer.focusOutside",US,AR=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),LR=I.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...c}=e,d=I.useContext(AR),[l,h]=I.useState(null),f=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=I.useState({}),U=Yl(t,_=>h(_)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(v),w=l?y.indexOf(l):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=x,T=kie(_=>{const R=_.target,P=[...d.branches].some(j=>j.contains(R));!S||P||(i==null||i(_),s==null||s(_),_.defaultPrevented||o==null||o())},f),M=Tie(_=>{const R=_.target;[...d.branches].some(j=>j.contains(R))||(a==null||a(_),s==null||s(_),_.defaultPrevented||o==null||o())},f);return xie(_=>{w===d.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&o&&(_.preventDefault(),o()))},f),I.useEffect(()=>{if(l)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(US=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(l)),d.layers.add(l),bS(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=US)}},[l,f,n,d]),I.useEffect(()=>()=>{l&&(d.layers.delete(l),d.layersWithOutsidePointerEventsDisabled.delete(l),bS())},[l,d]),I.useEffect(()=>{const _=()=>g({});return document.addEventListener($3,_),()=>document.removeEventListener($3,_)},[]),m.jsx(Io.div,{...c,ref:U,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:Rl(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Rl(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Rl(e.onPointerDownCapture,T.onPointerDownCapture)})});LR.displayName=wie;var Sie="DismissableLayerBranch",_ie=I.forwardRef((e,t)=>{const n=I.useContext(AR),r=I.useRef(null),i=Yl(t,r);return I.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(Io.div,{...e,ref:i})});_ie.displayName=Sie;function kie(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let c=function(){RR(Eie,n,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Tie(e,t=globalThis==null?void 0:globalThis.document){const n=Fl(e),r=I.useRef(!1);return I.useEffect(()=>{const i=a=>{a.target&&!r.current&&RR(Cie,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bS(){const e=new CustomEvent($3);document.dispatchEvent(e)}function RR(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?vie(i,a):i.dispatchEvent(a)}var qb=0;function Mie(){I.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yS()),document.body.insertAdjacentElement("beforeend",e[1]??yS()),qb++,()=>{qb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qb--}},[])}function yS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zb="focusScope.autoFocusOnMount",Kb="focusScope.autoFocusOnUnmount",vS={bubbles:!1,cancelable:!0},Iie="FocusScope",DR=I.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[o,c]=I.useState(null),d=Fl(i),l=Fl(a),h=I.useRef(null),f=Yl(t,y=>c(y)),g=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let y=function(C){if(g.paused||!o)return;const S=C.target;o.contains(S)?h.current=S:ml(h.current,{select:!0})},v=function(C){if(g.paused||!o)return;const S=C.relatedTarget;S!==null&&(o.contains(S)||ml(h.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&ml(o)};document.addEventListener("focusin",y),document.addEventListener("focusout",v);const w=new MutationObserver(x);return o&&w.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),w.disconnect()}}},[r,o,g.paused]),I.useEffect(()=>{if(o){wS.add(g);const y=document.activeElement;if(!o.contains(y)){const x=new CustomEvent(Zb,vS);o.addEventListener(Zb,d),o.dispatchEvent(x),x.defaultPrevented||(Aie(Pie(jR(o)),{select:!0}),document.activeElement===y&&ml(o))}return()=>{o.removeEventListener(Zb,d),setTimeout(()=>{const x=new CustomEvent(Kb,vS);o.addEventListener(Kb,l),o.dispatchEvent(x),x.defaultPrevented||ml(y??document.body,{select:!0}),o.removeEventListener(Kb,l),wS.remove(g)},0)}}},[o,d,l,g]);const U=I.useCallback(y=>{if(!n&&!r||g.paused)return;const v=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,x=document.activeElement;if(v&&x){const w=y.currentTarget,[C,S]=Lie(w);C&&S?!y.shiftKey&&x===S?(y.preventDefault(),n&&ml(C,{select:!0})):y.shiftKey&&x===C&&(y.preventDefault(),n&&ml(S,{select:!0})):x===w&&y.preventDefault()}},[n,r,g.paused]);return m.jsx(Io.div,{tabIndex:-1,...s,ref:f,onKeyDown:U})});DR.displayName=Iie;function Aie(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ml(r,{select:t}),document.activeElement!==n)return}function Lie(e){const t=jR(e),n=xS(t,e),r=xS(t.reverse(),e);return[n,r]}function jR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xS(e,t){for(const n of e)if(!Rie(n,{upTo:t}))return n}function Rie(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Die(e){return e instanceof HTMLInputElement&&"select"in e}function ml(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Die(e)&&t&&e.select()}}var wS=jie();function jie(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ES(e,t),e.unshift(t)},remove(t){var n;e=ES(e,t),(n=e[0])==null||n.resume()}}}function ES(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pie(e){return e.filter(t=>t.tagName!=="A")}var ld=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{},Nie=O8.useId||(()=>{}),Oie=0;function Fie(e){const[t,n]=I.useState(Nie());return ld(()=>{n(r=>r??String(Oie++))},[e]),e||(t?`radix-${t}`:"")}const Bie=["top","right","bottom","left"],Bl=Math.min,bi=Math.max,U2=Math.round,Sm=Math.floor,fs=e=>({x:e,y:e}),$ie={left:"right",right:"left",bottom:"top",top:"bottom"},zie={start:"end",end:"start"};function z3(e,t,n){return bi(e,Bl(t,n))}function Co(e,t){return typeof e=="function"?e(t):e}function So(e){return e.split("-")[0]}function wh(e){return e.split("-")[1]}function av(e){return e==="x"?"y":"x"}function sv(e){return e==="y"?"height":"width"}const Hie=new Set(["top","bottom"]);function ds(e){return Hie.has(So(e))?"y":"x"}function ov(e){return av(ds(e))}function Wie(e,t,n){n===void 0&&(n=!1);const r=wh(e),i=ov(e),a=sv(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=b2(s)),[s,b2(s)]}function Xie(e){const t=b2(e);return[H3(e),t,H3(t)]}function H3(e){return e.replace(/start|end/g,t=>zie[t])}const CS=["left","right"],SS=["right","left"],Vie=["top","bottom"],Yie=["bottom","top"];function Gie(e,t,n){switch(e){case"top":case"bottom":return n?t?SS:CS:t?CS:SS;case"left":case"right":return t?Vie:Yie;default:return[]}}function qie(e,t,n,r){const i=wh(e);let a=Gie(So(e),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(H3)))),a}function b2(e){return e.replace(/left|right|bottom|top/g,t=>$ie[t])}function Zie(e){return{top:0,right:0,bottom:0,left:0,...e}}function PR(e){return typeof e!="number"?Zie(e):{top:e,right:e,bottom:e,left:e}}function y2(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _S(e,t,n){let{reference:r,floating:i}=e;const a=ds(t),s=ov(t),o=sv(s),c=So(t),d=a==="y",l=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let g;switch(c){case"top":g={x:l,y:r.y-i.height};break;case"bottom":g={x:l,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-i.width,y:h};break;default:g={x:r.x,y:r.y}}switch(wh(t)){case"start":g[s]-=f*(n&&d?-1:1);break;case"end":g[s]+=f*(n&&d?-1:1);break}return g}const Kie=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:h}=_S(d,r,c),f=r,g={},U=0;for(let y=0;y<o.length;y++){const{name:v,fn:x}=o[y],{x:w,y:C,data:S,reset:T}=await x({x:l,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});l=w??l,h=C??h,g={...g,[v]:{...g[v],...S}},T&&U<=50&&(U++,typeof T=="object"&&(T.placement&&(f=T.placement),T.rects&&(d=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:l,y:h}=_S(d,f,c)),y=-1)}return{x:l,y:h,placement:f,strategy:i,middlewareData:g}};async function o1(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:s,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:l="viewport",elementContext:h="floating",altBoundary:f=!1,padding:g=0}=Co(t,e),U=PR(g),v=o[f?h==="floating"?"reference":"floating":h],x=y2(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:d,rootBoundary:l,strategy:c})),w=h==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),S=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},T=y2(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:C,strategy:c}):w);return{top:(x.top-T.top+U.top)/S.y,bottom:(T.bottom-x.bottom+U.bottom)/S.y,left:(x.left-T.left+U.left)/S.x,right:(T.right-x.right+U.right)/S.x}}const Qie=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:c}=t,{element:d,padding:l=0}=Co(e,t)||{};if(d==null)return{};const h=PR(l),f={x:n,y:r},g=ov(i),U=sv(g),y=await s.getDimensions(d),v=g==="y",x=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=a.reference[U]+a.reference[g]-f[g]-a.floating[U],T=f[g]-a.reference[g],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let _=M?M[C]:0;(!_||!await(s.isElement==null?void 0:s.isElement(M)))&&(_=o.floating[C]||a.floating[U]);const R=S/2-T/2,P=_/2-y[U]/2-1,j=Bl(h[x],P),N=Bl(h[w],P),F=j,B=_-y[U]-N,G=_/2-y[U]/2+R,W=z3(F,G,B),X=!c.arrow&&wh(i)!=null&&G!==W&&a.reference[U]/2-(G<F?j:N)-y[U]/2<0,$=X?G<F?G-F:G-B:0;return{[g]:f[g]+$,data:{[g]:W,centerOffset:G-W-$,...X&&{alignmentOffset:$}},reset:X}}}),Jie=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:s,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:l=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:U="none",flipAlignment:y=!0,...v}=Co(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=So(i),w=ds(o),C=So(o)===o,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),T=f||(C||!y?[b2(o)]:Xie(o)),M=U!=="none";!f&&M&&T.push(...qie(o,y,U,S));const _=[o,...T],R=await o1(t,v),P=[];let j=((r=a.flip)==null?void 0:r.overflows)||[];if(l&&P.push(R[x]),h){const G=Wie(i,s,S);P.push(R[G[0]],R[G[1]])}if(j=[...j,{placement:i,overflows:P}],!P.every(G=>G<=0)){var N,F;const G=(((N=a.flip)==null?void 0:N.index)||0)+1,W=_[G];if(W&&(!(h==="alignment"?w!==ds(W):!1)||j.every(Y=>Y.overflows[0]>0&&ds(Y.placement)===w)))return{data:{index:G,overflows:j},reset:{placement:W}};let X=(F=j.filter($=>$.overflows[0]<=0).sort(($,Y)=>$.overflows[1]-Y.overflows[1])[0])==null?void 0:F.placement;if(!X)switch(g){case"bestFit":{var B;const $=(B=j.filter(Y=>{if(M){const H=ds(Y.placement);return H===w||H==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(H=>H>0).reduce((H,Z)=>H+Z,0)]).sort((Y,H)=>Y[1]-H[1])[0])==null?void 0:B[0];$&&(X=$);break}case"initialPlacement":X=o;break}if(i!==X)return{reset:{placement:X}}}return{}}}};function kS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TS(e){return Bie.some(t=>e[t]>=0)}const eae=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Co(e,t);switch(r){case"referenceHidden":{const a=await o1(t,{...i,elementContext:"reference"}),s=kS(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:TS(s)}}}case"escaped":{const a=await o1(t,{...i,altBoundary:!0}),s=kS(a,n.floating);return{data:{escapedOffsets:s,escaped:TS(s)}}}default:return{}}}}},NR=new Set(["left","top"]);async function tae(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=So(n),o=wh(n),c=ds(n)==="y",d=NR.has(s)?-1:1,l=a&&c?-1:1,h=Co(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:U}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof U=="number"&&(g=o==="end"?U*-1:U),c?{x:g*l,y:f*d}:{x:f*d,y:g*l}}const nae=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=t,c=await tae(t,e);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:s}}}}},rae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...c}=Co(e,t),d={x:n,y:r},l=await o1(t,c),h=ds(So(i)),f=av(h);let g=d[f],U=d[h];if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=g+l[v],C=g-l[x];g=z3(w,g,C)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=U+l[v],C=U-l[x];U=z3(w,U,C)}const y=o.fn({...t,[f]:g,[h]:U});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:a,[h]:s}}}}}},iae=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=Co(e,t),l={x:n,y:r},h=ds(i),f=av(h);let g=l[f],U=l[h];const y=Co(o,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const C=f==="y"?"height":"width",S=a.reference[f]-a.floating[C]+v.mainAxis,T=a.reference[f]+a.reference[C]-v.mainAxis;g<S?g=S:g>T&&(g=T)}if(d){var x,w;const C=f==="y"?"width":"height",S=NR.has(So(i)),T=a.reference[h]-a.floating[C]+(S&&((x=s.offset)==null?void 0:x[h])||0)+(S?0:v.crossAxis),M=a.reference[h]+a.reference[C]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?v.crossAxis:0);U<T?U=T:U>M&&(U=M)}return{[f]:g,[h]:U}}}},aae=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:s,elements:o}=t,{apply:c=()=>{},...d}=Co(e,t),l=await o1(t,d),h=So(i),f=wh(i),g=ds(i)==="y",{width:U,height:y}=a.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=f===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(x=h,v=f==="end"?"top":"bottom");const w=y-l.top-l.bottom,C=U-l.left-l.right,S=Bl(y-l[v],w),T=Bl(U-l[x],C),M=!t.middlewareData.shift;let _=S,R=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=w),M&&!f){const j=bi(l.left,0),N=bi(l.right,0),F=bi(l.top,0),B=bi(l.bottom,0);g?R=U-2*(j!==0||N!==0?j+N:bi(l.left,l.right)):_=y-2*(F!==0||B!==0?F+B:bi(l.top,l.bottom))}await c({...t,availableWidth:R,availableHeight:_});const P=await s.getDimensions(o.floating);return U!==P.width||y!==P.height?{reset:{rects:!0}}:{}}}};function DU(){return typeof window<"u"}function Eh(e){return OR(e)?(e.nodeName||"").toLowerCase():"#document"}function xi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){var t;return(t=(OR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function OR(e){return DU()?e instanceof Node||e instanceof xi(e).Node:!1}function Pa(e){return DU()?e instanceof Element||e instanceof xi(e).Element:!1}function Es(e){return DU()?e instanceof HTMLElement||e instanceof xi(e).HTMLElement:!1}function MS(e){return!DU()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xi(e).ShadowRoot}const sae=new Set(["inline","contents"]);function O1(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Na(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!sae.has(i)}const oae=new Set(["table","td","th"]);function lae(e){return oae.has(Eh(e))}const cae=[":popover-open",":modal"];function jU(e){return cae.some(t=>{try{return e.matches(t)}catch{return!1}})}const dae=["transform","translate","scale","rotate","perspective"],uae=["transform","translate","scale","rotate","perspective","filter"],hae=["paint","layout","strict","content"];function lv(e){const t=cv(),n=Pa(e)?Na(e):e;return dae.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||uae.some(r=>(n.willChange||"").includes(r))||hae.some(r=>(n.contain||"").includes(r))}function fae(e){let t=$l(e);for(;Es(t)&&!nh(t);){if(lv(t))return t;if(jU(t))return null;t=$l(t)}return null}function cv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pae=new Set(["html","body","#document"]);function nh(e){return pae.has(Eh(e))}function Na(e){return xi(e).getComputedStyle(e)}function PU(e){return Pa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $l(e){if(Eh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||MS(e)&&e.host||ks(e);return MS(t)?t.host:t}function FR(e){const t=$l(e);return nh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Es(t)&&O1(t)?t:FR(t)}function l1(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=FR(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),s=xi(i);if(a){const o=W3(s);return t.concat(s,s.visualViewport||[],O1(i)?i:[],o&&n?l1(o):[])}return t.concat(i,l1(i,[],n))}function W3(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BR(e){const t=Na(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Es(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:r,o=U2(n)!==a||U2(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function dv(e){return Pa(e)?e:e.contextElement}function Iu(e){const t=dv(e);if(!Es(t))return fs(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=BR(t);let s=(a?U2(n.width):n.width)/r,o=(a?U2(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const mae=fs(0);function $R(e){const t=xi(e);return!cv()||!t.visualViewport?mae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xi(e)?!1:t}function cd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=dv(e);let s=fs(1);t&&(r?Pa(r)&&(s=Iu(r)):s=Iu(e));const o=gae(a,n,r)?$R(a):fs(0);let c=(i.left+o.x)/s.x,d=(i.top+o.y)/s.y,l=i.width/s.x,h=i.height/s.y;if(a){const f=xi(a),g=r&&Pa(r)?xi(r):r;let U=f,y=W3(U);for(;y&&r&&g!==U;){const v=Iu(y),x=y.getBoundingClientRect(),w=Na(y),C=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,S=x.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,d*=v.y,l*=v.x,h*=v.y,c+=C,d+=S,U=xi(y),y=W3(U)}}return y2({width:l,height:h,x:c,y:d})}function uv(e,t){const n=PU(e).scrollLeft;return t?t.left+n:cd(ks(e)).left+n}function zR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:uv(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function Uae(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",s=ks(r),o=t?jU(t.floating):!1;if(r===s||o&&a)return n;let c={scrollLeft:0,scrollTop:0},d=fs(1);const l=fs(0),h=Es(r);if((h||!h&&!a)&&((Eh(r)!=="body"||O1(s))&&(c=PU(r)),Es(r))){const g=cd(r);d=Iu(r),l.x=g.x+r.clientLeft,l.y=g.y+r.clientTop}const f=s&&!h&&!a?zR(s,c,!0):fs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+l.x+f.x,y:n.y*d.y-c.scrollTop*d.y+l.y+f.y}}function bae(e){return Array.from(e.getClientRects())}function yae(e){const t=ks(e),n=PU(e),r=e.ownerDocument.body,i=bi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=bi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+uv(e);const o=-n.scrollTop;return Na(r).direction==="rtl"&&(s+=bi(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}function vae(e,t){const n=xi(e),r=ks(e),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,c=0;if(i){a=i.width,s=i.height;const d=cv();(!d||d&&t==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}return{width:a,height:s,x:o,y:c}}const xae=new Set(["absolute","fixed"]);function wae(e,t){const n=cd(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Es(e)?Iu(e):fs(1),s=e.clientWidth*a.x,o=e.clientHeight*a.y,c=i*a.x,d=r*a.y;return{width:s,height:o,x:c,y:d}}function IS(e,t,n){let r;if(t==="viewport")r=vae(e,n);else if(t==="document")r=yae(ks(e));else if(Pa(t))r=wae(t,n);else{const i=$R(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return y2(r)}function HR(e,t){const n=$l(e);return n===t||!Pa(n)||nh(n)?!1:Na(n).position==="fixed"||HR(n,t)}function Eae(e,t){const n=t.get(e);if(n)return n;let r=l1(e,[],!1).filter(o=>Pa(o)&&Eh(o)!=="body"),i=null;const a=Na(e).position==="fixed";let s=a?$l(e):e;for(;Pa(s)&&!nh(s);){const o=Na(s),c=lv(s);!c&&o.position==="fixed"&&(i=null),(a?!c&&!i:!c&&o.position==="static"&&!!i&&xae.has(i.position)||O1(s)&&!c&&HR(e,s))?r=r.filter(l=>l!==s):i=o,s=$l(s)}return t.set(e,r),r}function Cae(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?jU(t)?[]:Eae(t,this._c):[].concat(n),r],o=s[0],c=s.reduce((d,l)=>{const h=IS(t,l,i);return d.top=bi(h.top,d.top),d.right=Bl(h.right,d.right),d.bottom=Bl(h.bottom,d.bottom),d.left=bi(h.left,d.left),d},IS(t,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Sae(e){const{width:t,height:n}=BR(e);return{width:t,height:n}}function _ae(e,t,n){const r=Es(t),i=ks(t),a=n==="fixed",s=cd(e,!0,a,t);let o={scrollLeft:0,scrollTop:0};const c=fs(0);function d(){c.x=uv(i)}if(r||!r&&!a)if((Eh(t)!=="body"||O1(i))&&(o=PU(t)),r){const g=cd(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else i&&d();a&&!r&&i&&d();const l=i&&!r&&!a?zR(i,o):fs(0),h=s.left+o.scrollLeft-c.x-l.x,f=s.top+o.scrollTop-c.y-l.y;return{x:h,y:f,width:s.width,height:s.height}}function Qb(e){return Na(e).position==="static"}function AS(e,t){if(!Es(e)||Na(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ks(e)===n&&(n=n.ownerDocument.body),n}function WR(e,t){const n=xi(e);if(jU(e))return n;if(!Es(e)){let i=$l(e);for(;i&&!nh(i);){if(Pa(i)&&!Qb(i))return i;i=$l(i)}return n}let r=AS(e,t);for(;r&&lae(r)&&Qb(r);)r=AS(r,t);return r&&nh(r)&&Qb(r)&&!lv(r)?n:r||fae(e)||n}const kae=async function(e){const t=this.getOffsetParent||WR,n=this.getDimensions,r=await n(e.floating);return{reference:_ae(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tae(e){return Na(e).direction==="rtl"}const Mae={convertOffsetParentRelativeRectToViewportRelativeRect:Uae,getDocumentElement:ks,getClippingRect:Cae,getOffsetParent:WR,getElementRects:kae,getClientRects:bae,getDimensions:Sae,getScale:Iu,isElement:Pa,isRTL:Tae};function XR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Iae(e,t){let n=null,r;const i=ks(e);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:l,top:h,width:f,height:g}=d;if(o||t(),!f||!g)return;const U=Sm(h),y=Sm(i.clientWidth-(l+f)),v=Sm(i.clientHeight-(h+g)),x=Sm(l),C={rootMargin:-U+"px "+-y+"px "+-v+"px "+-x+"px",threshold:bi(0,Bl(1,c))||1};let S=!0;function T(M){const _=M[0].intersectionRatio;if(_!==c){if(!S)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_===1&&!XR(d,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(T,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,C)}n.observe(e)}return s(!0),a}function Aae(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=dv(e),l=i||a?[...d?l1(d):[],...l1(t)]:[];l.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const h=d&&o?Iae(d,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(x=>{let[w]=x;w&&w.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),d&&!c&&g.observe(d),g.observe(t));let U,y=c?cd(e):null;c&&v();function v(){const x=cd(e);y&&!XR(y,x)&&n(),y=x,U=requestAnimationFrame(v)}return n(),()=>{var x;l.forEach(w=>{i&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),h==null||h(),(x=g)==null||x.disconnect(),g=null,c&&cancelAnimationFrame(U)}}const Lae=nae,Rae=rae,Dae=Jie,jae=aae,Pae=eae,LS=Qie,Nae=iae,Oae=(e,t,n)=>{const r=new Map,i={platform:Mae,...n},a={...i.platform,_c:r};return Kie(e,t,{...i,platform:a})};var Fae=typeof document<"u",Bae=function(){},gg=Fae?I.useLayoutEffect:Bae;function v2(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!v2(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!v2(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function VR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RS(e,t){const n=VR(e);return Math.round(t*n)/n}function Jb(e){const t=I.useRef(e);return gg(()=>{t.current=e}),t}function $ae(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[l,h]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=I.useState(r);v2(f,r)||g(r);const[U,y]=I.useState(null),[v,x]=I.useState(null),w=I.useCallback(Y=>{Y!==M.current&&(M.current=Y,y(Y))},[]),C=I.useCallback(Y=>{Y!==_.current&&(_.current=Y,x(Y))},[]),S=a||U,T=s||v,M=I.useRef(null),_=I.useRef(null),R=I.useRef(l),P=c!=null,j=Jb(c),N=Jb(i),F=Jb(d),B=I.useCallback(()=>{if(!M.current||!_.current)return;const Y={placement:t,strategy:n,middleware:f};N.current&&(Y.platform=N.current),Oae(M.current,_.current,Y).then(H=>{const Z={...H,isPositioned:F.current!==!1};G.current&&!v2(R.current,Z)&&(R.current=Z,ar.flushSync(()=>{h(Z)}))})},[f,t,n,N,F]);gg(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(Y=>({...Y,isPositioned:!1})))},[d]);const G=I.useRef(!1);gg(()=>(G.current=!0,()=>{G.current=!1}),[]),gg(()=>{if(S&&(M.current=S),T&&(_.current=T),S&&T){if(j.current)return j.current(S,T,B);B()}},[S,T,B,j,P]);const W=I.useMemo(()=>({reference:M,floating:_,setReference:w,setFloating:C}),[w,C]),X=I.useMemo(()=>({reference:S,floating:T}),[S,T]),$=I.useMemo(()=>{const Y={position:n,left:0,top:0};if(!X.floating)return Y;const H=RS(X.floating,l.x),Z=RS(X.floating,l.y);return o?{...Y,transform:"translate("+H+"px, "+Z+"px)",...VR(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:Z}},[n,o,X.floating,l.x,l.y]);return I.useMemo(()=>({...l,update:B,refs:W,elements:X,floatingStyles:$}),[l,B,W,X,$])}const zae=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?LS({element:r.current,padding:i}).fn(n):{}:r?LS({element:r,padding:i}).fn(n):{}}}},Hae=(e,t)=>({...Lae(e),options:[e,t]}),Wae=(e,t)=>({...Rae(e),options:[e,t]}),Xae=(e,t)=>({...Nae(e),options:[e,t]}),Vae=(e,t)=>({...Dae(e),options:[e,t]}),Yae=(e,t)=>({...jae(e),options:[e,t]}),Gae=(e,t)=>({...Pae(e),options:[e,t]}),qae=(e,t)=>({...zae(e),options:[e,t]});var Zae="Arrow",YR=I.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return m.jsx(Io.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});YR.displayName=Zae;var Kae=YR;function Qae(e){const[t,n]=I.useState(void 0);return ld(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,o=d.blockSize}else s=e.offsetWidth,o=e.offsetHeight;n({width:s,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var hv="Popper",[GR,qR]=IR(hv),[Jae,ZR]=GR(hv),KR=e=>{const{__scopePopper:t,children:n}=e,[r,i]=I.useState(null);return m.jsx(Jae,{scope:t,anchor:r,onAnchorChange:i,children:n})};KR.displayName=hv;var QR="PopperAnchor",JR=I.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=ZR(QR,n),s=I.useRef(null),o=Yl(t,s);return I.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.jsx(Io.div,{...i,ref:o})});JR.displayName=QR;var fv="PopperContent",[ese,tse]=GR(fv),eD=I.forwardRef((e,t)=>{var Ue,ye,je,Le,de,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:l=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:U,...y}=e,v=ZR(fv,n),[x,w]=I.useState(null),C=Yl(t,qe=>w(qe)),[S,T]=I.useState(null),M=Qae(S),_=(M==null?void 0:M.width)??0,R=(M==null?void 0:M.height)??0,P=r+(a!=="center"?"-"+a:""),j=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},N=Array.isArray(d)?d:[d],F=N.length>0,B={padding:j,boundary:N.filter(rse),altBoundary:F},{refs:G,floatingStyles:W,placement:X,isPositioned:$,middlewareData:Y}=$ae({strategy:"fixed",placement:P,whileElementsMounted:(...qe)=>Aae(...qe,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[Hae({mainAxis:i+R,alignmentAxis:s}),c&&Wae({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Xae():void 0,...B}),c&&Vae({...B}),Yae({...B,apply:({elements:qe,rects:Ut,availableWidth:Pe,availableHeight:bt})=>{const{width:Tt,height:zn}=Ut.reference,Et=qe.floating.style;Et.setProperty("--radix-popper-available-width",`${Pe}px`),Et.setProperty("--radix-popper-available-height",`${bt}px`),Et.setProperty("--radix-popper-anchor-width",`${Tt}px`),Et.setProperty("--radix-popper-anchor-height",`${zn}px`)}}),S&&qae({element:S,padding:o}),ise({arrowWidth:_,arrowHeight:R}),f&&Gae({strategy:"referenceHidden",...B})]}),[H,Z]=rD(X),V=Fl(U);ld(()=>{$&&(V==null||V())},[$,V]);const te=(Ue=Y.arrow)==null?void 0:Ue.x,ce=(ye=Y.arrow)==null?void 0:ye.y,be=((je=Y.arrow)==null?void 0:je.centerOffset)!==0,[fe,Se]=I.useState();return ld(()=>{x&&Se(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:$?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(Le=Y.transformOrigin)==null?void 0:Le.x,(de=Y.transformOrigin)==null?void 0:de.y].join(" "),...((Te=Y.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(ese,{scope:n,placedSide:H,onArrowChange:T,arrowX:te,arrowY:ce,shouldHideArrow:be,children:m.jsx(Io.div,{"data-side":H,"data-align":Z,...y,ref:C,style:{...y.style,animation:$?void 0:"none"}})})})});eD.displayName=fv;var tD="PopperArrow",nse={top:"bottom",right:"left",bottom:"top",left:"right"},nD=I.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=tse(tD,r),s=nse[a.placedSide];return m.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:m.jsx(Kae,{...i,ref:n,style:{...i.style,display:"block"}})})});nD.displayName=tD;function rse(e){return e!==null}var ise=e=>({name:"transformOrigin",options:e,fn(t){var v,x,w;const{placement:n,rects:r,middlewareData:i}=t,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,l]=rD(n),h={start:"0%",center:"50%",end:"100%"}[l],f=(((x=i.arrow)==null?void 0:x.x)??0)+o/2,g=(((w=i.arrow)==null?void 0:w.y)??0)+c/2;let U="",y="";return d==="bottom"?(U=s?h:`${f}px`,y=`${-c}px`):d==="top"?(U=s?h:`${f}px`,y=`${r.floating.height+c}px`):d==="right"?(U=`${-c}px`,y=s?h:`${g}px`):d==="left"&&(U=`${r.floating.width+c}px`,y=s?h:`${g}px`),{data:{x:U,y}}}});function rD(e){const[t,n="center"]=e.split("-");return[t,n]}var ase=KR,iD=JR,sse=eD,ose=nD,lse="Portal",aD=I.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,a]=I.useState(!1);ld(()=>a(!0),[]);const s=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?fie.createPortal(m.jsx(Io.div,{...r,ref:t}),s):null});aD.displayName=lse;function cse(e,t){return I.useReducer((n,r)=>t[n][r]??n,e)}var pv=e=>{const{present:t,children:n}=e,r=dse(t),i=typeof n=="function"?n({present:r.isPresent}):I.Children.only(n),a=Yl(r.ref,use(i));return typeof n=="function"||r.isPresent?I.cloneElement(i,{ref:a}):null};pv.displayName="Presence";function dse(e){const[t,n]=I.useState(),r=I.useRef({}),i=I.useRef(e),a=I.useRef("none"),s=e?"mounted":"unmounted",[o,c]=cse(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const d=_m(r.current);a.current=o==="mounted"?d:"none"},[o]),ld(()=>{const d=r.current,l=i.current;if(l!==e){const f=a.current,g=_m(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(l&&f!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),ld(()=>{if(t){let d;const l=t.ownerDocument.defaultView??window,h=g=>{const y=_m(r.current).includes(g.animationName);if(g.target===t&&y&&(c("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=g=>{g.target===t&&(a.current=_m(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{l.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:I.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function _m(e){return(e==null?void 0:e.animationName)||"none"}function use(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function hse({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=fse({defaultProp:t,onChange:n}),a=e!==void 0,s=a?e:r,o=Fl(n),c=I.useCallback(d=>{if(a){const h=typeof d=="function"?d(e):d;h!==e&&o(h)}else i(d)},[a,e,i,o]);return[s,c]}function fse({defaultProp:e,onChange:t}){const n=I.useState(e),[r]=n,i=I.useRef(r),a=Fl(t);return I.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var pse=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ru=new WeakMap,km=new WeakMap,Tm={},ey=0,sD=function(e){return e&&(e.host||sD(e.parentNode))},mse=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},gse=function(e,t,n,r){var i=mse(t,Array.isArray(e)?e:[e]);Tm[n]||(Tm[n]=new WeakMap);var a=Tm[n],s=[],o=new Set,c=new Set(i),d=function(h){!h||o.has(h)||(o.add(h),d(h.parentNode))};i.forEach(d);var l=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(o.has(f))l(f);else try{var g=f.getAttribute(r),U=g!==null&&g!=="false",y=(ru.get(f)||0)+1,v=(a.get(f)||0)+1;ru.set(f,y),a.set(f,v),s.push(f),y===1&&U&&km.set(f,!0),v===1&&f.setAttribute(n,"true"),U||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return l(t),o.clear(),ey++,function(){s.forEach(function(h){var f=ru.get(h)-1,g=a.get(h)-1;ru.set(h,f),a.set(h,g),f||(km.has(h)||h.removeAttribute(r),km.delete(h)),g||h.removeAttribute(n)}),ey--,ey||(ru=new WeakMap,ru=new WeakMap,km=new WeakMap,Tm={})}},Use=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=pse(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),gse(r,i,n,"aria-hidden")):function(){return null}},cs=function(){return cs=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},cs.apply(this,arguments)};function oD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function bse(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ug="right-scroll-bar-position",bg="width-before-scroll-bar",yse="with-scroll-bars-hidden",vse="--removed-body-scroll-bar-size";function ty(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xse(e,t){var n=I.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var wse=typeof window<"u"?I.useLayoutEffect:I.useEffect,DS=new WeakMap;function Ese(e,t){var n=xse(null,function(r){return e.forEach(function(i){return ty(i,r)})});return wse(function(){var r=DS.get(n);if(r){var i=new Set(r),a=new Set(e),s=n.current;i.forEach(function(o){a.has(o)||ty(o,null)}),a.forEach(function(o){i.has(o)||ty(o,s)})}DS.set(n,e)},[e]),n}function Cse(e){return e}function Sse(e,t){t===void 0&&(t=Cse);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(a),s=n}var c=function(){var l=s;s=[],l.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(l){s.push(l),d()},filter:function(l){return s=s.filter(l),n}}}};return i}function _se(e){e===void 0&&(e={});var t=Sse(null);return t.options=cs({async:!0,ssr:!1},e),t}var lD=function(e){var t=e.sideCar,n=oD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return I.createElement(r,cs({},n))};lD.isSideCarExport=!0;function kse(e,t){return e.useMedium(t),lD}var cD=_se(),ny=function(){},NU=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:ny,onWheelCapture:ny,onTouchMoveCapture:ny}),i=r[0],a=r[1],s=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,l=e.enabled,h=e.shards,f=e.sideCar,g=e.noRelative,U=e.noIsolation,y=e.inert,v=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,C=e.gapMode,S=oD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,M=Ese([n,t]),_=cs(cs({},S),i);return I.createElement(I.Fragment,null,l&&I.createElement(T,{sideCar:cD,removeScrollBar:d,shards:h,noRelative:g,noIsolation:U,inert:y,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:C}),s?I.cloneElement(I.Children.only(o),cs(cs({},_),{ref:M})):I.createElement(w,cs({},_,{className:c,ref:M}),o))});NU.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};NU.classNames={fullWidth:bg,zeroRight:Ug};var Tse=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mse(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Tse();return t&&e.setAttribute("nonce",t),e}function Ise(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ase(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lse=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mse())&&(Ise(t,n),Ase(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Rse=function(){var e=Lse();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dD=function(){var e=Rse(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Dse={left:0,top:0,right:0,gap:0},ry=function(e){return parseInt(e||"",10)||0},jse=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ry(n),ry(r),ry(i)]},Pse=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Dse;var t=jse(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nse=dD(),Au="data-scroll-locked",Ose=function(e,t,n,r){var i=e.left,a=e.top,s=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
92
|
+
.`.concat(yse,` {
|
|
93
|
+
overflow: hidden `).concat(r,`;
|
|
94
|
+
padding-right: `).concat(o,"px ").concat(r,`;
|
|
95
|
+
}
|
|
96
|
+
body[`).concat(Au,`] {
|
|
97
|
+
overflow: hidden `).concat(r,`;
|
|
98
|
+
overscroll-behavior: contain;
|
|
99
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
100
|
+
padding-left: `.concat(i,`px;
|
|
101
|
+
padding-top: `).concat(a,`px;
|
|
102
|
+
padding-right: `).concat(s,`px;
|
|
103
|
+
margin-left:0;
|
|
104
|
+
margin-top:0;
|
|
105
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
106
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.`).concat(Ug,` {
|
|
110
|
+
right: `).concat(o,"px ").concat(r,`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.`).concat(bg,` {
|
|
114
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.`).concat(Ug," .").concat(Ug,` {
|
|
118
|
+
right: 0 `).concat(r,`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.`).concat(bg," .").concat(bg,` {
|
|
122
|
+
margin-right: 0 `).concat(r,`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
body[`).concat(Au,`] {
|
|
126
|
+
`).concat(vse,": ").concat(o,`px;
|
|
127
|
+
}
|
|
128
|
+
`)},jS=function(){var e=parseInt(document.body.getAttribute(Au)||"0",10);return isFinite(e)?e:0},Fse=function(){I.useEffect(function(){return document.body.setAttribute(Au,(jS()+1).toString()),function(){var e=jS()-1;e<=0?document.body.removeAttribute(Au):document.body.setAttribute(Au,e.toString())}},[])},Bse=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Fse();var a=I.useMemo(function(){return Pse(i)},[i]);return I.createElement(Nse,{styles:Ose(a,!t,i,n?"":"!important")})},X3=!1;if(typeof window<"u")try{var Mm=Object.defineProperty({},"passive",{get:function(){return X3=!0,!0}});window.addEventListener("test",Mm,Mm),window.removeEventListener("test",Mm,Mm)}catch{X3=!1}var iu=X3?{passive:!1}:!1,$se=function(e){return e.tagName==="TEXTAREA"},uD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$se(e)&&n[t]==="visible")},zse=function(e){return uD(e,"overflowY")},Hse=function(e){return uD(e,"overflowX")},PS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hD(e,r);if(i){var a=fD(e,r),s=a[1],o=a[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wse=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Xse=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hD=function(e,t){return e==="v"?zse(t):Hse(t)},fD=function(e,t){return e==="v"?Wse(t):Xse(t)},Vse=function(e,t){return e==="h"&&t==="rtl"?-1:1},Yse=function(e,t,n,r,i){var a=Vse(e,window.getComputedStyle(t).direction),s=a*r,o=n.target,c=t.contains(o),d=!1,l=s>0,h=0,f=0;do{if(!o)break;var g=fD(e,o),U=g[0],y=g[1],v=g[2],x=y-v-a*U;(U||x)&&hD(e,o)&&(h+=x,f+=U);var w=o.parentNode;o=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(l&&Math.abs(h)<1||!l&&Math.abs(f)<1)&&(d=!0),d},Im=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NS=function(e){return[e.deltaX,e.deltaY]},OS=function(e){return e&&"current"in e?e.current:e},Gse=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qse=function(e){return`
|
|
129
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
130
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
131
|
+
`)},Zse=0,au=[];function Kse(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(Zse++)[0],a=I.useState(dD)[0],s=I.useRef(e);I.useEffect(function(){s.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=bse([e.lockRef.current],(e.shards||[]).map(OS),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=I.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var x=Im(y),w=n.current,C="deltaX"in y?y.deltaX:w[0]-x[0],S="deltaY"in y?y.deltaY:w[1]-x[1],T,M=y.target,_=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in y&&_==="h"&&M.type==="range")return!1;var R=PS(_,M);if(!R)return!0;if(R?T=_:(T=_==="v"?"h":"v",R=PS(_,M)),!R)return!1;if(!r.current&&"changedTouches"in y&&(C||S)&&(r.current=T),!T)return!0;var P=r.current||T;return Yse(P,v,y,P==="h"?C:S)},[]),c=I.useCallback(function(y){var v=y;if(!(!au.length||au[au.length-1]!==a)){var x="deltaY"in v?NS(v):Im(v),w=t.current.filter(function(T){return T.name===v.type&&(T.target===v.target||v.target===T.shadowParent)&&Gse(T.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var C=(s.current.shards||[]).map(OS).filter(Boolean).filter(function(T){return T.contains(v.target)}),S=C.length>0?o(v,C[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),d=I.useCallback(function(y,v,x,w){var C={name:y,delta:v,target:x,should:w,shadowParent:Qse(x)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),l=I.useCallback(function(y){n.current=Im(y),r.current=void 0},[]),h=I.useCallback(function(y){d(y.type,NS(y),y.target,o(y,e.lockRef.current))},[]),f=I.useCallback(function(y){d(y.type,Im(y),y.target,o(y,e.lockRef.current))},[]);I.useEffect(function(){return au.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,iu),document.addEventListener("touchmove",c,iu),document.addEventListener("touchstart",l,iu),function(){au=au.filter(function(y){return y!==a}),document.removeEventListener("wheel",c,iu),document.removeEventListener("touchmove",c,iu),document.removeEventListener("touchstart",l,iu)}},[]);var g=e.removeScrollBar,U=e.inert;return I.createElement(I.Fragment,null,U?I.createElement(a,{styles:qse(i)}):null,g?I.createElement(Bse,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Qse(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jse=kse(cD,Kse);var pD=I.forwardRef(function(e,t){return I.createElement(NU,cs({},e,{ref:t,sideCar:Jse}))});pD.classNames=NU.classNames;var mv="Popover",[mD,bxe]=IR(mv,[qR]),F1=qR(),[eoe,Gl]=mD(mv),gD=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,o=F1(t),c=I.useRef(null),[d,l]=I.useState(!1),[h=!1,f]=hse({prop:r,defaultProp:i,onChange:a});return m.jsx(ase,{...o,children:m.jsx(eoe,{scope:t,contentId:Fie(),triggerRef:c,open:h,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(g=>!g),[f]),hasCustomAnchor:d,onCustomAnchorAdd:I.useCallback(()=>l(!0),[]),onCustomAnchorRemove:I.useCallback(()=>l(!1),[]),modal:s,children:n})})};gD.displayName=mv;var UD="PopoverAnchor",toe=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Gl(UD,n),a=F1(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=i;return I.useEffect(()=>(s(),()=>o()),[s,o]),m.jsx(iD,{...a,...r,ref:t})});toe.displayName=UD;var bD="PopoverTrigger",yD=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Gl(bD,n),a=F1(n),s=Yl(t,i.triggerRef),o=m.jsx(Io.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":SD(i.open),...r,ref:s,onClick:Rl(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:m.jsx(iD,{asChild:!0,...a,children:o})});yD.displayName=bD;var gv="PopoverPortal",[noe,roe]=mD(gv,{forceMount:void 0}),vD=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Gl(gv,t);return m.jsx(noe,{scope:t,forceMount:n,children:m.jsx(pv,{present:n||a.open,children:m.jsx(aD,{asChild:!0,container:i,children:r})})})};vD.displayName=gv;var rh="PopoverContent",xD=I.forwardRef((e,t)=>{const n=roe(rh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Gl(rh,e.__scopePopover);return m.jsx(pv,{present:r||a.open,children:a.modal?m.jsx(ioe,{...i,ref:t}):m.jsx(aoe,{...i,ref:t})})});xD.displayName=rh;var ioe=I.forwardRef((e,t)=>{const n=Gl(rh,e.__scopePopover),r=I.useRef(null),i=Yl(t,r),a=I.useRef(!1);return I.useEffect(()=>{const s=r.current;if(s)return Use(s)},[]),m.jsx(pD,{as:iv,allowPinchZoom:!0,children:m.jsx(wD,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rl(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),a.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Rl(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,d=o.button===2||c;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Rl(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),aoe=I.forwardRef((e,t)=>{const n=Gl(rh,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return m.jsx(wD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,o;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),wD=I.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:l,...h}=e,f=Gl(rh,n),g=F1(n);return Mie(),m.jsx(DR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m.jsx(LR,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:l,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:m.jsx(sse,{"data-state":SD(f.open),role:"dialog",id:f.contentId,...g,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ED="PopoverClose",soe=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Gl(ED,n);return m.jsx(Io.button,{type:"button",...r,ref:t,onClick:Rl(e.onClick,()=>i.onOpenChange(!1))})});soe.displayName=ED;var ooe="PopoverArrow",CD=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=F1(n);return m.jsx(ose,{...i,...r,ref:t})});CD.displayName=ooe;function SD(e){return e?"open":"closed"}var OU=gD,FU=yD,loe=vD,Uv=xD,_D=CD,iy={exports:{}},FS;function coe(){return FS||(FS=1,function(e,t){(function(){var n={};e.exports=n,n.simpleFilter=function(r,i){return i.filter(function(a){return n.test(r,a)})},n.test=function(r,i){return n.match(r,i)!==null},n.match=function(r,i,a){a=a||{};var s=0,o=[],c=i.length,d=0,l=0,h=a.pre||"",f=a.post||"",g=a.caseSensitive&&i||i.toLowerCase(),U;r=a.caseSensitive&&r||r.toLowerCase();for(var y=0;y<c;y++)U=i[y],g[y]===r[s]?(U=h+U+f,s+=1,l+=1+l):l=0,d+=l,o[o.length]=U;return s===r.length?(d=g===r?1/0:d,{rendered:o.join(""),score:d}):null},n.filter=function(r,i,a){return!i||i.length===0?[]:typeof r!="string"?i:(a=a||{},i.reduce(function(s,o,c,d){var l=o;a.extract&&(l=a.extract(o));var h=n.match(r,l,a);return h!=null&&(s[s.length]={string:h.rendered,score:h.score,index:c,original:o}),s},[]).sort(function(s,o){var c=o.score-s.score;return c||s.index-o.index}))}})()}(iy)),iy.exports}var doe=coe();const uoe=ta(doe),hoe={},BS=e=>{let t;const n=new Set,r=(l,h)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const g=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(U=>U(t,g))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>d,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(hoe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,i,c);return c},foe=e=>e?BS(e):BS;var ay={exports:{}},sy={},oy={exports:{}},ly={};/**
|
|
132
|
+
* @license React
|
|
133
|
+
* use-sync-external-store-shim.production.js
|
|
134
|
+
*
|
|
135
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the MIT license found in the
|
|
138
|
+
* LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/var $S;function poe(){if($S)return ly;$S=1;var e=E1();function t(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,s=e.useDebugValue;function o(h,f){var g=f(),U=r({inst:{value:g,getSnapshot:f}}),y=U[0].inst,v=U[1];return a(function(){y.value=g,y.getSnapshot=f,c(y)&&v({inst:y})},[h,g,f]),i(function(){return c(y)&&v({inst:y}),h(function(){c(y)&&v({inst:y})})},[h]),s(g),g}function c(h){var f=h.getSnapshot;h=h.value;try{var g=f();return!n(h,g)}catch{return!0}}function d(h,f){return f()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:o;return ly.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,ly}var zS;function moe(){return zS||(zS=1,oy.exports=poe()),oy.exports}/**
|
|
140
|
+
* @license React
|
|
141
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
142
|
+
*
|
|
143
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the MIT license found in the
|
|
146
|
+
* LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/var HS;function goe(){if(HS)return sy;HS=1;var e=E1(),t=moe();function n(d,l){return d===l&&(d!==0||1/d===1/l)||d!==d&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,s=e.useEffect,o=e.useMemo,c=e.useDebugValue;return sy.useSyncExternalStoreWithSelector=function(d,l,h,f,g){var U=a(null);if(U.current===null){var y={hasValue:!1,value:null};U.current=y}else y=U.current;U=o(function(){function x(M){if(!w){if(w=!0,C=M,M=f(M),g!==void 0&&y.hasValue){var _=y.value;if(g(_,M))return S=_}return S=M}if(_=S,r(C,M))return _;var R=f(M);return g!==void 0&&g(_,R)?(C=M,_):(C=M,S=R)}var w=!1,C,S,T=h===void 0?null:h;return[function(){return x(l())},T===null?void 0:function(){return x(T())}]},[l,h,f,g]);var v=i(d,U[0],U[1]);return s(function(){y.hasValue=!0,y.value=v},[v]),c(v),v},sy}var WS;function Uoe(){return WS||(WS=1,ay.exports=goe()),ay.exports}var boe=Uoe();const yoe=ta(boe),kD={},{useDebugValue:voe}=xe,{useSyncExternalStoreWithSelector:xoe}=yoe;let XS=!1;const woe=e=>e;function Eoe(e,t=woe,n){(kD?"production":void 0)!=="production"&&n&&!XS&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),XS=!0);const r=xoe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return voe(r),r}const VS=e=>{(kD?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?foe(e):e,n=(r,i)=>Eoe(t,r,i);return Object.assign(n,t),n},Coe=e=>e?VS(e):VS;var YS,GS;const qS=typeof window<"u"&&((YS=window.document)!=null&&YS.createElement||((GS=window.navigator)==null?void 0:GS.product)==="ReactNative")?xe.useLayoutEffect:xe.useEffect;function Za(){const e=Coe(t=>({current:new Array,version:0,set:t}));return{In:({children:t})=>{const n=e(i=>i.set),r=e(i=>i.version);return qS(()=>{n(i=>({version:i.version+1}))},[]),qS(()=>(n(({current:i})=>({current:[...i,t]})),()=>n(({current:i})=>({current:i.filter(a=>a!==t)}))),[t,r]),null},Out:()=>{const t=e(n=>n.current);return xe.createElement(xe.Fragment,null,t)}}}function qn(){return qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qn.apply(null,arguments)}function cy(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Soe(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];function d(h){const{scope:f,children:g,...U}=h,y=(f==null?void 0:f[e][c])||o,v=I.useMemo(()=>U,Object.values(U));return I.createElement(y.Provider,{value:v},g)}function l(h,f){const g=(f==null?void 0:f[e][c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,_oe(i,...t)]}function _oe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Lu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function koe(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];function d(h){const{scope:f,children:g,...U}=h,y=(f==null?void 0:f[e][c])||o,v=I.useMemo(()=>U,Object.values(U));return I.createElement(y.Provider,{value:v},g)}function l(h,f){const g=(f==null?void 0:f[e][c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,Toe(i,...t)]}function Toe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Moe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function TD(...e){return t=>e.forEach(n=>Moe(n,t))}function ZS(...e){return I.useCallback(TD(...e),e)}const V3=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(Aoe);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return I.createElement(Y3,qn({},r,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,o):null)}return I.createElement(Y3,qn({},r,{ref:t}),n)});V3.displayName="Slot";const Y3=I.forwardRef((e,t)=>{const{children:n,...r}=e;return I.isValidElement(n)?I.cloneElement(n,{...Loe(r,n.props),ref:TD(t,n.ref)}):I.Children.count(n)>1?I.Children.only(null):null});Y3.displayName="SlotClone";const Ioe=({children:e})=>I.createElement(I.Fragment,null,e);function Aoe(e){return I.isValidElement(e)&&e.type===Ioe}function Loe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Roe(e){const t=e+"CollectionProvider",[n,r]=koe(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:U,children:y}=g,v=xe.useRef(null),x=xe.useRef(new Map).current;return xe.createElement(i,{scope:U,itemMap:x,collectionRef:v},y)},o=e+"CollectionSlot",c=xe.forwardRef((g,U)=>{const{scope:y,children:v}=g,x=a(o,y),w=ZS(U,x.collectionRef);return xe.createElement(V3,{ref:w},v)}),d=e+"CollectionItemSlot",l="data-radix-collection-item",h=xe.forwardRef((g,U)=>{const{scope:y,children:v,...x}=g,w=xe.useRef(null),C=ZS(U,w),S=a(d,y);return xe.useEffect(()=>(S.itemMap.set(w,{ref:w,...x}),()=>void S.itemMap.delete(w))),xe.createElement(V3,{[l]:"",ref:C},v)});function f(g){const U=a(e+"CollectionConsumer",g);return xe.useCallback(()=>{const v=U.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${l}]`));return Array.from(U.itemMap.values()).sort((S,T)=>x.indexOf(S.ref.current)-x.indexOf(T.ref.current))},[U.collectionRef,U.itemMap])}return[{Provider:s,Slot:c,ItemSlot:h},f,r]}function Doe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function MD(...e){return t=>e.forEach(n=>Doe(n,t))}function joe(...e){return I.useCallback(MD(...e),e)}function Poe(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];function d(h){const{scope:f,children:g,...U}=h,y=(f==null?void 0:f[e][c])||o,v=I.useMemo(()=>U,Object.values(U));return I.createElement(y.Provider,{value:v},g)}function l(h,f){const g=(f==null?void 0:f[e][c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,Noe(i,...t)]}function Noe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const Ooe=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{},Foe=O8.useId||(()=>{});let Boe=0;function $oe(e){const[t,n]=I.useState(Foe());return Ooe(()=>{n(r=>r??String(Boe++))},[e]),t?`radix-${t}`:""}const ID=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(Hoe);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return I.createElement(G3,qn({},r,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,o):null)}return I.createElement(G3,qn({},r,{ref:t}),n)});ID.displayName="Slot";const G3=I.forwardRef((e,t)=>{const{children:n,...r}=e;return I.isValidElement(n)?I.cloneElement(n,{...Woe(r,n.props),ref:MD(t,n.ref)}):I.Children.count(n)>1?I.Children.only(null):null});G3.displayName="SlotClone";const zoe=({children:e})=>I.createElement(I.Fragment,null,e);function Hoe(e){return I.isValidElement(e)&&e.type===zoe}function Woe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}const Xoe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],AD=Xoe.reduce((e,t)=>{const n=I.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?ID:t;return I.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),I.createElement(o,qn({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function bv(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Voe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Yoe({defaultProp:t,onChange:n}),a=e!==void 0,s=a?e:r,o=bv(n),c=I.useCallback(d=>{if(a){const h=typeof d=="function"?d(e):d;h!==e&&o(h)}else i(d)},[a,e,i,o]);return[s,c]}function Yoe({defaultProp:e,onChange:t}){const n=I.useState(e),[r]=n,i=I.useRef(r),a=bv(t);return I.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}const Goe=I.createContext(void 0);function LD(e){const t=I.useContext(Goe);return e||t||"ltr"}const dy="rovingFocusGroup.onEntryFocus",qoe={bubbles:!1,cancelable:!0},yv="RovingFocusGroup",[q3,RD,Zoe]=Roe(yv),[Koe,DD]=Poe(yv,[Zoe]),[Qoe,Joe]=Koe(yv),ele=I.forwardRef((e,t)=>I.createElement(q3.Provider,{scope:e.__scopeRovingFocusGroup},I.createElement(q3.Slot,{scope:e.__scopeRovingFocusGroup},I.createElement(tle,qn({},e,{ref:t}))))),tle=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,...l}=e,h=I.useRef(null),f=joe(t,h),g=LD(a),[U=null,y]=Voe({prop:s,defaultProp:o,onChange:c}),[v,x]=I.useState(!1),w=bv(d),C=RD(n),S=I.useRef(!1),[T,M]=I.useState(0);return I.useEffect(()=>{const _=h.current;if(_)return _.addEventListener(dy,w),()=>_.removeEventListener(dy,w)},[w]),I.createElement(Qoe,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:U,onItemFocus:I.useCallback(_=>y(_),[y]),onItemShiftTab:I.useCallback(()=>x(!0),[]),onFocusableItemAdd:I.useCallback(()=>M(_=>_+1),[]),onFocusableItemRemove:I.useCallback(()=>M(_=>_-1),[])},I.createElement(AD.div,qn({tabIndex:v||T===0?-1:0,"data-orientation":r},l,{ref:f,style:{outline:"none",...e.style},onMouseDown:Lu(e.onMouseDown,()=>{S.current=!0}),onFocus:Lu(e.onFocus,_=>{const R=!S.current;if(_.target===_.currentTarget&&R&&!v){const P=new CustomEvent(dy,qoe);if(_.currentTarget.dispatchEvent(P),!P.defaultPrevented){const j=C().filter(W=>W.focusable),N=j.find(W=>W.active),F=j.find(W=>W.id===U),G=[N,F,...j].filter(Boolean).map(W=>W.ref.current);jD(G)}}S.current=!1}),onBlur:Lu(e.onBlur,()=>x(!1))})))}),nle="RovingFocusGroupItem",rle=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...s}=e,o=$oe(),c=a||o,d=Joe(nle,n),l=d.currentTabStopId===c,h=RD(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=d;return I.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),I.createElement(q3.ItemSlot,{scope:n,id:c,focusable:r,active:i},I.createElement(AD.span,qn({tabIndex:l?0:-1,"data-orientation":d.orientation},s,{ref:t,onMouseDown:Lu(e.onMouseDown,U=>{r?d.onItemFocus(c):U.preventDefault()}),onFocus:Lu(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Lu(e.onKeyDown,U=>{if(U.key==="Tab"&&U.shiftKey){d.onItemShiftTab();return}if(U.target!==U.currentTarget)return;const y=sle(U,d.orientation,d.dir);if(y!==void 0){U.preventDefault();let x=h().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const w=x.indexOf(U.currentTarget);x=d.loop?ole(x,w+1):x.slice(w+1)}setTimeout(()=>jD(x))}})})))}),ile={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ale(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sle(e,t,n){const r=ale(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ile[r]}function jD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ole(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const lle=ele,cle=rle;function dle(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function PD(...e){return t=>e.forEach(n=>dle(n,t))}function ule(...e){return I.useCallback(PD(...e),e)}const Z3=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{};function hle(e,t){return I.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const ND=e=>{const{present:t,children:n}=e,r=fle(t),i=typeof n=="function"?n({present:r.isPresent}):I.Children.only(n),a=ule(r.ref,i.ref);return typeof n=="function"||r.isPresent?I.cloneElement(i,{ref:a}):null};ND.displayName="Presence";function fle(e){const[t,n]=I.useState(),r=I.useRef({}),i=I.useRef(e),a=I.useRef("none"),s=e?"mounted":"unmounted",[o,c]=hle(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const d=Am(r.current);a.current=o==="mounted"?d:"none"},[o]),Z3(()=>{const d=r.current,l=i.current;if(l!==e){const f=a.current,g=Am(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(l&&f!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Z3(()=>{if(t){const d=h=>{const g=Am(r.current).includes(h.animationName);h.target===t&&g&&ar.flushSync(()=>c("ANIMATION_END"))},l=h=>{h.target===t&&(a.current=Am(r.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:I.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Am(e){return(e==null?void 0:e.animationName)||"none"}const OD=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(mle);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return I.createElement(K3,qn({},r,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,o):null)}return I.createElement(K3,qn({},r,{ref:t}),n)});OD.displayName="Slot";const K3=I.forwardRef((e,t)=>{const{children:n,...r}=e;return I.isValidElement(n)?I.cloneElement(n,{...gle(r,n.props),ref:PD(t,n.ref)}):I.Children.count(n)>1?I.Children.only(null):null});K3.displayName="SlotClone";const ple=({children:e})=>I.createElement(I.Fragment,null,e);function mle(e){return I.isValidElement(e)&&e.type===ple}function gle(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}const Ule=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],BU=Ule.reduce((e,t)=>{const n=I.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?OD:t;return I.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),I.createElement(o,qn({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function FD(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function ble({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=yle({defaultProp:t,onChange:n}),a=e!==void 0,s=a?e:r,o=FD(n),c=I.useCallback(d=>{if(a){const h=typeof d=="function"?d(e):d;h!==e&&o(h)}else i(d)},[a,e,i,o]);return[s,c]}function yle({defaultProp:e,onChange:t}){const n=I.useState(e),[r]=n,i=I.useRef(r),a=FD(t);return I.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}const vle=O8.useId||(()=>{});let xle=0;function wle(e){const[t,n]=I.useState(vle());return Z3(()=>{n(r=>r??String(xle++))},[e]),e||(t?`radix-${t}`:"")}const BD="Tabs",[Ele,yxe]=Soe(BD,[DD]),$D=DD(),[Cle,vv]=Ele(BD),Sle=I.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:o,activationMode:c="automatic",...d}=e,l=LD(o),[h,f]=ble({prop:r,onChange:i,defaultProp:a});return I.createElement(Cle,{scope:n,baseId:wle(),value:h,onValueChange:f,orientation:s,dir:l,activationMode:c},I.createElement(BU.div,qn({dir:l,"data-orientation":s},d,{ref:t})))}),_le="TabsList",kle=I.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=vv(_le,n),s=$D(n);return I.createElement(lle,qn({asChild:!0},s,{orientation:a.orientation,dir:a.dir,loop:r}),I.createElement(BU.div,qn({role:"tablist","aria-orientation":a.orientation},i,{ref:t})))}),Tle="TabsTrigger",Mle=I.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,s=vv(Tle,n),o=$D(n),c=zD(s.baseId,r),d=HD(s.baseId,r),l=r===s.value;return I.createElement(cle,qn({asChild:!0},o,{focusable:!i,active:l}),I.createElement(BU.button,qn({type:"button",role:"tab","aria-selected":l,"aria-controls":d,"data-state":l?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},a,{ref:t,onMouseDown:cy(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:cy(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:cy(e.onFocus,()=>{const h=s.activationMode!=="manual";!l&&!i&&h&&s.onValueChange(r)})})))}),Ile="TabsContent",Ale=I.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,o=vv(Ile,n),c=zD(o.baseId,r),d=HD(o.baseId,r),l=r===o.value,h=I.useRef(l);return I.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),I.createElement(ND,{present:i||l},({present:f})=>I.createElement(BU.div,qn({"data-state":l?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:d,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0}}),f&&a))});function zD(e,t){return`${e}-trigger-${t}`}function HD(e,t){return`${e}-content-${t}`}const WD=Sle,XD=kle,VD=Mle,YD=Ale;var uy,KS;function Lle(){if(KS)return uy;KS=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,c=typeof xl=="object"&&xl&&xl.Object===Object&&xl,d=typeof self=="object"&&self&&self.Object===Object&&self,l=c||d||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,U=Math.min,y=function(){return l.Date.now()};function v(T,M,_){var R,P,j,N,F,B,G=0,W=!1,X=!1,$=!0;if(typeof T!="function")throw new TypeError(e);M=S(M)||0,x(_)&&(W=!!_.leading,X="maxWait"in _,j=X?g(S(_.maxWait)||0,M):j,$="trailing"in _?!!_.trailing:$);function Y(Ue){var ye=R,je=P;return R=P=void 0,G=Ue,N=T.apply(je,ye),N}function H(Ue){return G=Ue,F=setTimeout(te,M),W?Y(Ue):N}function Z(Ue){var ye=Ue-B,je=Ue-G,Le=M-ye;return X?U(Le,j-je):Le}function V(Ue){var ye=Ue-B,je=Ue-G;return B===void 0||ye>=M||ye<0||X&&je>=j}function te(){var Ue=y();if(V(Ue))return ce(Ue);F=setTimeout(te,Z(Ue))}function ce(Ue){return F=void 0,$&&R?Y(Ue):(R=P=void 0,N)}function be(){F!==void 0&&clearTimeout(F),G=0,R=B=P=F=void 0}function fe(){return F===void 0?N:ce(y())}function Se(){var Ue=y(),ye=V(Ue);if(R=arguments,P=this,B=Ue,ye){if(F===void 0)return H(B);if(X)return F=setTimeout(te,M),Y(B)}return F===void 0&&(F=setTimeout(te,M)),N}return Se.cancel=be,Se.flush=fe,Se}function x(T){var M=typeof T;return!!T&&(M=="object"||M=="function")}function w(T){return!!T&&typeof T=="object"}function C(T){return typeof T=="symbol"||w(T)&&f.call(T)==n}function S(T){if(typeof T=="number")return T;if(C(T))return t;if(x(T)){var M=typeof T.valueOf=="function"?T.valueOf():T;T=x(M)?M+"":M}if(typeof T!="string")return T===0?T:+T;T=T.replace(r,"");var _=a.test(T);return _||s.test(T)?o(T.slice(2),_?2:8):i.test(T)?t:+T}return uy=v,uy}var Rle=Lle();const Dle=ta(Rle);function jle(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var Ple={};jle(Ple,"LaserPointer",()=>w2);function kn([e,t,n],[r,i,a]){return[e+r,t+i,n+a]}function ip([e,t,n],[r,i,a]){return[e-r,t-i,n-a]}function jn([e,t,n],r){return[e*r,t*r,n*r]}function su([e,t,n]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),n]}function vr([e,t,n],r){return[Math.cos(r)*e-Math.sin(r)*t,Math.sin(r)*e+Math.cos(r)*t,n]}function Nle(e,t,n){return kn(e,jn(ip(t,e),n))}function QS(e,t,n){return Math.atan2(n[1]-e[1],n[0]-e[0])-Math.atan2(t[1]-e[1],t[0]-e[0])}function JS(e){return Math.atan2(Math.sin(e),Math.cos(e))}function e_([e,t]){return Math.sqrt(e**2+t**2)}function Ru([e,t],[n,r]){return Math.sqrt((n-e)**2+(r-t)**2)}function Ole(e){if(e.length<2)return 0;let t=0;for(let n=1;n<=e.length-1;n++)t+=Ru(e[n-1],e[n]);return t+=Ru(e[e.length-2],e[e.length-1]),t}const Fle=(e,t,n)=>Math.max(t,Math.min(n,e));function Ble(e,t,n){const r=Ru(t,n);if(r===0)return Ru(e,t);const i=Fle(((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r**2,0,1),a=[t[0]+i*(n[0]-t[0]),t[1]+i*(n[1]-t[1]),e[2]];return Ru(a,e)}function x2(e,t){if(t===0||e.length<=2)return e;const n=e[0],r=e[e.length-1],[i,a]=e.reduce(([s,o],c,d)=>{const l=Ble(c,n,r);return l>s?[l,d]:[s,o]},[0,-1]);if(i>=t){const s=e[a];return[...x2([n,...e.slice(1,a),s],t).slice(0,-1),s,...x2([s,...e.slice(a,-1),r],t).slice(1)]}else return[n,r]}const yl=class yl{constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},yl.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){const n=this.originalPoints[this.originalPoints.length-1];if(!(n&&n[0]===t[0]&&n[1]===t[1])){if(this.originalPoints.push(t),this.isFresh){this.isFresh=!1,this.stablePoints.push(t);return}this.options.streamline>0&&(t=Nle(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),Ole(this.tailPoints)>yl.constants.maxTailLength&&this.stabilizeTail()}}close(){this.stabilizeTail()}stabilizeTail(){if(this.options.simplify>0&&this.options.simplifyPhase=="tail")throw new Error("Not implemented yet");this.stablePoints.push(...this.tailPoints),this.tailPoints=[]}getSize(t,n,r,i,a){return(t??this.options.size)*this.options.sizeMapping({pressure:n,runningLength:a,currentIndex:r,totalLength:i})}getStrokeOutline(t){if(this.isFresh)return[];let n=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase==="input"&&(n=x2(n,this.options.simplify));const r=n.length;if(r===0)return[];if(r===1){const _=n[0],R=this.getSize(t,_[2],0,r,0);if(R<.5)return[];const P=[];for(let j=0;j<=Math.PI*2;j+=Math.PI/16)P.push(kn(_,jn(vr([1,0,0],j),R)));return P.push(kn(_,jn([1,0,0],this.getSize(t,_[2],0,r,0)))),P}if(r===2){const _=n[0],R=n[1],P=this.getSize(t,_[2],0,r,0),j=this.getSize(t,R[2],0,r,0);if(P<.5||j<.5)return[];const N=[],F=QS(_,[_[0],_[1]-100,_[2]],R);for(let B=F;B<=Math.PI+F;B+=Math.PI/16)N.push(kn(_,jn(vr([1,0,0],B),P)));for(let B=Math.PI+F;B<=Math.PI*2+F;B+=Math.PI/16)N.push(kn(R,jn(vr([1,0,0],B),j)));return N.push(N[0]),N}const i=[],a=[];let s=0,o=0,c=0,d=0;for(let _=1;_<r-1;_++){const R=n[_-1],P=n[_],j=n[_+1];let N=P[2];const F=Ru(R,P);d+=F,s=o+(F-o)*.2;const B=this.getSize(t,N,_,r,d);if(B===0){c=_+1;continue}const G=su(ip(R,P)),W=su(ip(j,P)),X=vr(G,Math.PI/2),$=vr(G,-Math.PI/2),Y=vr(W,Math.PI/2),H=vr(W,-Math.PI/2),Z=kn(P,jn(X,B)),V=kn(P,jn($,B)),te=kn(P,jn(Y,B)),ce=kn(P,jn(H,B)),be=kn(X,H),fe=kn($,Y),Se=kn(P,jn(e_(be)===0?G:su(be),B)),Ue=kn(P,jn(e_(fe)===0?W:su(fe),B)),ye=JS(QS(P,R,j)),je=yl.constants.cornerDetectionMaxAngle/180*Math.PI*yl.constants.cornerDetectionVariance(s);if(Math.abs(ye)<je){const Le=Math.abs(JS(Math.PI-ye));if(Le===0)continue;if(ye<0){a.push(V,Ue);for(let de=0;de<=Le;de+=Le/4)i.push(kn(P,vr(jn(X,B),de)));for(let de=Le;de>=0;de-=Le/4)a.push(kn(P,vr(jn(X,B),de)));a.push(Ue,te)}else{i.push(Z,Se);for(let de=0;de<=Le;de+=Le/4)a.push(kn(P,vr(jn(X,-B),-de)));for(let de=Le;de>=0;de-=Le/4)i.push(kn(P,vr(jn(X,-B),-de)));i.push(Se,ce)}}else i.push(Se),a.push(Ue);o=s}if(c>=r-2)if(this.options.keepHead){const _=n[r-1],R=[];for(let P=0;P<=Math.PI*2;P+=Math.PI/16)R.push(kn(_,jn(vr([1,0,0],P),this.options.size)));return R.push(kn(_,jn([1,0,0],this.options.size))),R}else return[];const l=n[c],h=n[c+1],f=n[r-2],g=n[r-1],U=su(ip(h,l)),y=su(ip(f,g)),v=vr(U,-Math.PI/2),x=vr(y,Math.PI/2),w=this.getSize(t,l[2],0,r,0),C=[],S=this.options.keepHead?this.options.size:this.getSize(t,f[2],r-2,r,d),T=[];if(w>1){for(let _=0;_<=Math.PI;_+=Math.PI/16)C.unshift(kn(l,vr(jn(v,w),-_)));C.unshift(kn(l,jn(v,-w)))}else C.push(l);for(let _=0;_<=Math.PI*3;_+=Math.PI/16)T.push(kn(g,vr(jn(x,-S),-_)));const M=[...C,...i,...T.reverse(),...a.reverse()];return C.length>0&&M.push(C[0]),this.options.simplify>0&&this.options.simplifyPhase==="output"?x2(M,this.options.simplify):M}};yl.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:"output",keepHead:!1,sizeMapping:()=>1},yl.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:t=>t>35?.5:1,maxTailLength:50};let w2=yl;var GD=TR(),{useAtom:Cn,useSetAtom:$U,useAtomValue:qD,useStore:vxe}=GD,$le=GD.Provider,Sa=rv(),zle=_$({"./locales/ar-SA.json":()=>ge(()=>import("./ar-SA-G6X2FPQ2-C7K_UR3P.js"),[],import.meta.url),"./locales/az-AZ.json":()=>ge(()=>import("./az-AZ-76LH7QW2-PkhuRuSr.js"),[],import.meta.url),"./locales/bg-BG.json":()=>ge(()=>import("./bg-BG-XCXSNQG7-CgLRSYTl.js"),[],import.meta.url),"./locales/bn-BD.json":()=>ge(()=>import("./bn-BD-2XOGV67Q-CEvkU0mz.js"),[],import.meta.url),"./locales/ca-ES.json":()=>ge(()=>import("./ca-ES-6MX7JW3Y-DzP6q9bE.js"),[],import.meta.url),"./locales/cs-CZ.json":()=>ge(()=>import("./cs-CZ-2BRQDIVT-Bf4TOzpR.js"),[],import.meta.url),"./locales/da-DK.json":()=>ge(()=>import("./da-DK-5WZEPLOC-jO-5kyXb.js"),[],import.meta.url),"./locales/de-DE.json":()=>ge(()=>import("./de-DE-XR44H4JA-BkNXWOVh.js"),[],import.meta.url),"./locales/el-GR.json":()=>ge(()=>import("./el-GR-BZB4AONW-Dv7Y9hMk.js"),[],import.meta.url),"./locales/en.json":()=>ge(()=>Promise.resolve().then(()=>dxe),void 0,import.meta.url),"./locales/es-ES.json":()=>ge(()=>import("./es-ES-U4NZUMDT-CWhs0SQY.js"),[],import.meta.url),"./locales/eu-ES.json":()=>ge(()=>import("./eu-ES-A7QVB2H4-BfkFwc3e.js"),[],import.meta.url),"./locales/fa-IR.json":()=>ge(()=>import("./fa-IR-HGAKTJCU-BgWzSj46.js"),[],import.meta.url),"./locales/fi-FI.json":()=>ge(()=>import("./fi-FI-Z5N7JZ37-CUyvkum-.js"),[],import.meta.url),"./locales/fr-FR.json":()=>ge(()=>import("./fr-FR-RHASNOE6-7xzoRwbd.js"),[],import.meta.url),"./locales/gl-ES.json":()=>ge(()=>import("./gl-ES-HMX3MZ6V-CXuDDwNP.js"),[],import.meta.url),"./locales/he-IL.json":()=>ge(()=>import("./he-IL-6SHJWFNN-O9dzh9EM.js"),[],import.meta.url),"./locales/hi-IN.json":()=>ge(()=>import("./hi-IN-IWLTKZ5I-DlrOXhWs.js"),[],import.meta.url),"./locales/hu-HU.json":()=>ge(()=>import("./hu-HU-A5ZG7DT2-C3eNg-uI.js"),[],import.meta.url),"./locales/id-ID.json":()=>ge(()=>import("./id-ID-SAP4L64H-6iM4pI5c.js"),[],import.meta.url),"./locales/it-IT.json":()=>ge(()=>import("./it-IT-JPQ66NNP-B26NQzGp.js"),[],import.meta.url),"./locales/ja-JP.json":()=>ge(()=>import("./ja-JP-DBVTYXUO-CB0fvnYJ.js"),[],import.meta.url),"./locales/kaa.json":()=>ge(()=>import("./kaa-6HZHGXH3-YNdBdcwJ.js"),[],import.meta.url),"./locales/kab-KAB.json":()=>ge(()=>import("./kab-KAB-ZGHBKWFO-D86pwZO0.js"),[],import.meta.url),"./locales/kk-KZ.json":()=>ge(()=>import("./kk-KZ-P5N5QNE5-CpG5oheM.js"),[],import.meta.url),"./locales/km-KH.json":()=>ge(()=>import("./km-KH-HSX4SM5Z-DYOZ3Azw.js"),[],import.meta.url),"./locales/ko-KR.json":()=>ge(()=>import("./ko-KR-MTYHY66A-BHorm6lC.js"),[],import.meta.url),"./locales/ku-TR.json":()=>ge(()=>import("./ku-TR-6OUDTVRD-CM9RgEHv.js"),[],import.meta.url),"./locales/lt-LT.json":()=>ge(()=>import("./lt-LT-XHIRWOB4-DvriKXBj.js"),[],import.meta.url),"./locales/lv-LV.json":()=>ge(()=>import("./lv-LV-5QDEKY6T-DzQpwk87.js"),[],import.meta.url),"./locales/mr-IN.json":()=>ge(()=>import("./mr-IN-CRQNXWMA-C7RzxxP5.js"),[],import.meta.url),"./locales/my-MM.json":()=>ge(()=>import("./my-MM-5M5IBNSE-B-RRuy29.js"),[],import.meta.url),"./locales/nb-NO.json":()=>ge(()=>import("./nb-NO-T6EIAALU-B47x16Ik.js"),[],import.meta.url),"./locales/nl-NL.json":()=>ge(()=>import("./nl-NL-IS3SIHDZ-BxAKoQne.js"),[],import.meta.url),"./locales/nn-NO.json":()=>ge(()=>import("./nn-NO-6E72VCQL-dfpbEDSZ.js"),[],import.meta.url),"./locales/oc-FR.json":()=>ge(()=>import("./oc-FR-POXYY2M6-gv6geBjV.js"),[],import.meta.url),"./locales/pa-IN.json":()=>ge(()=>import("./pa-IN-N4M65BXN-CY30-qH7.js"),[],import.meta.url),"./locales/percentages.json":()=>ge(()=>Promise.resolve().then(()=>uxe),void 0,import.meta.url),"./locales/pl-PL.json":()=>ge(()=>import("./pl-PL-T2D74RX3-TrHugsIA.js"),[],import.meta.url),"./locales/pt-BR.json":()=>ge(()=>import("./pt-BR-5N22H2LF-CJxdFp9c.js"),[],import.meta.url),"./locales/pt-PT.json":()=>ge(()=>import("./pt-PT-UZXXM6DQ-CB-1q6YJ.js"),[],import.meta.url),"./locales/ro-RO.json":()=>ge(()=>import("./ro-RO-JPDTUUEW-DQq9DBOd.js"),[],import.meta.url),"./locales/ru-RU.json":()=>ge(()=>import("./ru-RU-B4JR7IUQ-CWX32rfh.js"),[],import.meta.url),"./locales/si-LK.json":()=>ge(()=>import("./si-LK-N5RQ5JYF-Lkc5ZxyG.js"),[],import.meta.url),"./locales/sk-SK.json":()=>ge(()=>import("./sk-SK-C5VTKIMK-DyvYXjqZ.js"),[],import.meta.url),"./locales/sl-SI.json":()=>ge(()=>import("./sl-SI-NN7IZMDC-D_MvP9Rh.js"),[],import.meta.url),"./locales/sv-SE.json":()=>ge(()=>import("./sv-SE-XGPEYMSR-t6voGQSI.js"),[],import.meta.url),"./locales/ta-IN.json":()=>ge(()=>import("./ta-IN-2NMHFXQM-7VmfDDyV.js"),[],import.meta.url),"./locales/th-TH.json":()=>ge(()=>import("./th-TH-HPSO5L25-B5rLEY9P.js"),[],import.meta.url),"./locales/tr-TR.json":()=>ge(()=>import("./tr-TR-DEFEU3FU-0CgOHXTn.js"),[],import.meta.url),"./locales/uk-UA.json":()=>ge(()=>import("./uk-UA-QMV73CPH-CzSFsIsx.js"),[],import.meta.url),"./locales/vi-VN.json":()=>ge(()=>import("./vi-VN-M7AON7JQ-Bhx3rYU9.js"),[],import.meta.url),"./locales/zh-CN.json":()=>ge(()=>import("./zh-CN-LNUGB5OW-Br52_wH4.js"),[],import.meta.url),"./locales/zh-HK.json":()=>ge(()=>import("./zh-HK-E62DVLB3-Cj6mnIQ9.js"),[],import.meta.url),"./locales/zh-TW.json":()=>ge(()=>import("./zh-TW-RAJ6MFWO-yLEsVBbC.js"),[],import.meta.url)}),Hle=85,Ch={code:"en",label:"English"},xv=[Ch,...[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"ku-TR",label:"Kurdî"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Slovenščina"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"vi-VN",label:"Tiếng Việt"},{code:"mr-IN",label:"मराठी"}].filter(e=>xR[e.code]>=Hle).sort((e,t)=>e.label>t.label?1:-1)],E2="__test__";dt.DEV&&xv.unshift({code:E2,label:"test language"},{code:`${E2}.rtl`,label:"test language (rtl)",rtl:!0});var Cu=Ch,yg={},ZD=async e=>{if(Cu=e,document.documentElement.dir=Cu.rtl?"rtl":"ltr",document.documentElement.lang=Cu.code,e.code.startsWith(E2))yg={};else try{yg=await zle(`./locales/${Cu.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),yg=nv}Sa.set(KD,e.code)},c1=()=>Cu,t_=(e,t)=>{for(let n=0;n<t.length;++n){let r=t[n];if(e[r]===void 0)return;e=e[r]}if(typeof e=="string")return e},D=(e,t,n)=>{if(Cu.code.startsWith(E2))return`[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]`;let r=e.split("."),i=t_(yg,r)||t_(nv,r)||n;if(i===void 0){let a=`Can't find translation for ${e}`;return console.warn(a),""}if(t)for(let a in t)i=i.replace(`{{${a}}}`,String(t[a]));return i},KD=cr(Ch.code),Ar=()=>{let e=qD(KD);return{t:D,langCode:e}},Wle=({size:e="1em",circleWidth:t=8,synchronized:n=!1,className:r=""})=>{let i=-(xe.useRef(Date.now()).current%1600);return m.jsx("div",{className:`Spinner ${r}`,children:m.jsx("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":n?`${i}ms`:0},children:m.jsx("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},_o=Wle,QD=({delay:e,theme:t})=>{let[n,r]=I.useState(!!e);return I.useEffect(()=>{if(!e)return;let i=setTimeout(()=>{r(!1)},e);return()=>clearTimeout(i)},[e]),n?null:m.jsxs("div",{className:De("LoadingMessage",{"LoadingMessage--dark":t===yt.DARK}),children:[m.jsx("div",{children:m.jsx(_o,{})}),m.jsx("div",{className:"LoadingMessage-text",children:D("labels.loadingScene")})]})},Xle=e=>{let[t,n]=I.useState(!0);return I.useEffect(()=>{let r=async()=>{await ZD(i),n(!1)},i=xv.find(a=>a.code===e.langCode)||Ch;r()},[e.langCode]),t?m.jsx(QD,{theme:e.theme}):e.children},wt=xe.forwardRef(({size:e="medium",visible:t=!0,className:n="",...r},i)=>{let{id:a}=Is(),s=xe.useRef(null);xe.useImperativeHandle(i,()=>s.current);let o=`ToolIcon_size_${e}`,[c,d]=I.useState(!1),l=I.useRef(!0),h=async g=>{var y;let U="onClick"in r&&((y=r.onClick)==null?void 0:y.call(r,g));if(A1(U))try{d(!0),await U}catch(v){if(v instanceof pU)console.warn(v);else throw v}finally{l.current&&d(!1)}};I.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);let f=I.useRef(null);if(r.type==="button"||r.type==="icon"||r.type==="submit"){let g=r.type==="icon"?"button":r.type;return m.jsxs("button",{className:De("ToolIcon_type_button",o,n,t&&!r.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!r.hidden,"ToolIcon--selected":r.selected,"ToolIcon--plain":r.type==="icon"}),style:r.style,"data-testid":r["data-testid"],hidden:r.hidden,title:r.title,"aria-label":r["aria-label"],type:g,onClick:h,ref:s,disabled:c||r.isLoading||!!r.disabled,children:[(r.icon||r.label)&&m.jsxs("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!r.disabled,children:[r.icon||r.label,r.keyBindingLabel&&m.jsx("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel}),r.isLoading&&m.jsx(_o,{})]}),r.showAriaLabel&&m.jsxs("div",{className:"ToolIcon__label",children:[r["aria-label"]," ",c&&m.jsx(_o,{})]}),r.children]})}return m.jsxs("label",{className:De("ToolIcon",n),title:r.title,onPointerDown:g=>{var U;f.current=g.pointerType||null,(U=r.onPointerDown)==null||U.call(r,{pointerType:g.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{f.current=null})},children:[m.jsx("input",{className:`ToolIcon_type_radio ${o}`,type:"radio",name:r.name,"aria-label":r["aria-label"],"aria-keyshortcuts":r["aria-keyshortcuts"],"data-testid":r["data-testid"],id:`${a}-${r.id}`,onChange:()=>{var g;(g=r.onChange)==null||g.call(r,{pointerType:f.current})},checked:r.checked,ref:s}),m.jsxs("div",{className:"ToolIcon__icon",children:[r.icon,r.keyBindingLabel&&m.jsx("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel})]})]})});wt.displayName="ToolButton";var Vle=(e,t,n)=>{let r=new Set(ut(e.filter(l=>Ke(l)),t).map(l=>l.id)),i={},a=n.scene.getNonDeletedElementsMap(),s=new Set;for(let l of r){let h=ws(e,l);for(let f of h)if(!s.has(f.id)){if(tn(f)){let g=lr(f,a);g&&(i[g.id]=!0)}else i[f.id]=!0;s.add(f.id)}}let o=!0,c=e.map(l=>{if(t.selectedElementIds[l.id]){let h=tn(l)?lr(l,a):null;return l.frameId&&r.has(l.frameId)?(o=!1,i[l.id]=!0,l):h!=null&&h.frameId&&r.has(h==null?void 0:h.frameId)?l:(l.boundElements&&l.boundElements.forEach(f=>{var U,y;let g=n.scene.getNonDeletedElementsMap().get(f.id);g&&Ie(g)&&(he(g,{startBinding:l.id===((U=g.startBinding)==null?void 0:U.elementId)?null:g.startBinding,endBinding:l.id===((y=g.endBinding)==null?void 0:y.elementId)?null:g.endBinding}),he(g,{points:g.points}))}),lt(l,{isDeleted:!0}))}return l.frameId&&r.has(l.frameId)?(o=!1,tn(l)||(i[l.id]=!0),lt(l,{frameId:null})):tn(l)&&t.selectedElementIds[l.containerId]?lt(l,{isDeleted:!0}):l}),d=t.editingGroupId;if(o&&t.editingGroupId){let l=en(c,t.editingGroupId).filter(h=>!h.isDeleted);if(l.length>1)l[0]&&(i[l[0].id]=!0);else{d=null,l[0]&&(i[l[0].id]=!0);let h=l[0];if(h){let f=h.groupIds.findIndex(U=>U===t.editingGroupId),g=h.groupIds[f+1];if(g){let U=en(c,g).filter(y=>!y.isDeleted);U.length>1&&(d=g,U.forEach(y=>{i[y.id]=!0}))}}}}return{elements:c,appState:{...t,...Pr({selectedElementIds:i,editingGroupId:d},c,t,null)}}},n_=(e,t)=>{if(e.editingGroupId){let n=en(Gt(t),e.editingGroupId);if(n.length)return{...e,selectedElementIds:{[n[0].id]:!0}}}return e},JD=we({name:"deleteSelectedElements",label:"labels.delete",icon:rd,trackEvent:{category:"element",action:"delete"},perform:(e,t,n,r)=>{if(t.editingLinearElement){let{elementId:s,selectedPointsIndices:o,startBindingElement:c,endBindingElement:d}=t.editingLinearElement,l=r.scene.getNonDeletedElementsMap(),h=Me.getElement(s,l);if(!h||o==null)return!1;if(h.points.length<2){let g=e.map(y=>y.id===h.id?lt(y,{isDeleted:!0}):y),U=n_(t,g);return{elements:g,appState:{...U,editingLinearElement:null},captureUpdate:se.IMMEDIATELY}}let f={startBindingElement:o!=null&&o.includes(0)?null:c,endBindingElement:o!=null&&o.includes(h.points.length-1)?null:d};return Me.deletePoints(h,o),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...f,selectedPointsIndices:(o==null?void 0:o[0])>0?[o[0]-1]:[0]}},captureUpdate:se.IMMEDIATELY}}let{elements:i,appState:a}=Vle(e,t,r);return mA(i,i.filter(s=>s.isDeleted)),a=n_(a,i),{elements:i,appState:{...a,activeTool:Ln(t,{type:"selection"}),multiElement:null,activeEmbeddable:null},captureUpdate:$n(Gt(e),t)?se.IMMEDIATELY:se.EVENTUALLY}},keyTest:(e,t,n)=>(e.key===q.BACKSPACE||e.key===q.DELETE)&&!e[q.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(wt,{type:"button",icon:rd,title:D("labels.delete"),"aria-label":D("labels.delete"),onClick:()=>n(null),visible:$n(Gt(e),t)})}),Q3=(e,t)=>e.frameId===t||e.id===t,ej=(e,t,n)=>{let r=[],i=[],a=null,s=-1,o=Qe(n||ut(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++s<e.length;){let c=e[s];o.get(c.id)?(i.length&&(r=r.concat(i),i=[]),r.push(s),a=s+1):c.isDeleted&&a===s?(a=s+1,i.push(s)):i=[]}return r},Yle=e=>{let t=0;return e.reduce((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n),[])},r_=(e,t,n)=>{var r,i;if("containerId"in e&&e.containerId){let a=wo.getScene(e).getElement(e.containerId);if(a)return n==="left"?Math.min(t.indexOf(a),t.indexOf(e)):Math.max(t.indexOf(a),t.indexOf(e))}else{let a=(i=(r=e.boundElements)==null?void 0:r.find(s=>s.type!=="arrow"))==null?void 0:i.id;if(a){let s=wo.getScene(e).getElement(a);if(s)return n==="left"?Math.min(t.indexOf(s),t.indexOf(e)):Math.max(t.indexOf(s),t.indexOf(e))}}},Gle=(e,t)=>{let n=-1,r=-1;return e.forEach((i,a)=>{Q3(i,t)&&(n===-1&&(n=a),r=a)}),n===-1?[]:e.slice(n,r+1)},qle=(e,t,n,r,i)=>{let a=t[n],s=h=>h.isDeleted?!1:i?h.frameId===i:e.editingGroupId?h.groupIds.includes(e.editingGroupId):!0,o=r==="left"?kc(t,h=>s(h),Math.max(0,n-1)):tI(t,h=>s(h),n+1),c=t[o];if(!c)return-1;if(e.editingGroupId){if((a==null?void 0:a.groupIds.join(""))===(c==null?void 0:c.groupIds.join("")))return r_(c,t,r)??o;if(!(c!=null&&c.groupIds.includes(e.editingGroupId)))return-1}if(!i&&(c.frameId||Ke(c))){let h=Gle(t,c.frameId||c.id);return r==="left"?t.indexOf(h[0]):t.indexOf(h[h.length-1])}if(!c.groupIds.length)return r_(c,t,r)??o;let d=e.editingGroupId?c.groupIds[c.groupIds.indexOf(e.editingGroupId)-1]:c.groupIds[c.groupIds.length-1],l=en(t,d);return l.length?r==="left"?t.indexOf(l[0]):t.indexOf(l[l.length-1]):o},tj=(e,t)=>t.reduce((n,r)=>{let i=e[r];return n.set(i.id,i),n},new Map),nj=(e,t,n)=>{let r=ej(e,t),i=tj(e,r),a=Yle(r);n==="right"&&(a=a.reverse());let s=new Set(r.filter(o=>Ke(e[o])).map(o=>e[o].id));return a.forEach((o,c)=>{var w;let d=o[0],l=o[o.length-1],h=n==="left"?d:l,f=o.some(C=>{let S=e[C];return S.frameId&&s.has(S.frameId)})?null:(w=e[h])==null?void 0:w.frameId,g=qle(t,e,h,n,f);if(g===-1||h===g)return;let U=n==="left"?e.slice(0,g):e.slice(0,d),y=e.slice(d,l+1),v=n==="left"?e.slice(g,d):e.slice(l+1,g+1),x=n==="left"?e.slice(l+1):e.slice(g+1);e=n==="left"?[...U,...y,...v,...x]:[...U,...v,...y,...x]}),xs(e,i),e},rj=(e,t,n,r,i)=>{let a=ej(e,t,i),s=tj(e,a),o=[],c,d;if(n==="left"){if(r)c=tI(e,U=>Q3(U,r));else if(t.editingGroupId){let U=en(e,t.editingGroupId);if(!U.length)return e;c=e.indexOf(U[0])}else c=0;d=a[a.length-1]}else{if(r)d=kc(e,U=>Q3(U,r));else if(t.editingGroupId){let U=en(e,t.editingGroupId);if(!U.length)return e;d=e.indexOf(U[U.length-1])}else d=e.length-1;c=a[0]}c===-1&&(c=0);for(let U=c;U<d+1;U++)a.includes(U)||o.push(e[U]);let l=Array.from(s.values()),h=e.slice(0,c),f=e.slice(d+1),g=n==="left"?[...h,...l,...o,...f]:[...h,...o,...l,...f];return xs(g,s),g};function ij(e,t,n,r){let i=Qe(ut(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),a={regularElements:[],frameChildren:new Map},s=new Set;for(let d of e)i.has(d.id)&&Ke(d)&&s.add(d.id);for(let d of e)if(i.has(d.id))if(Ke(d)||d.frameId&&s.has(d.frameId))a.regularElements.push(d);else if(!d.frameId)a.regularElements.push(d);else{let l=a.frameChildren.get(d.frameId)||[];l.push(d),a.frameChildren.set(d.frameId,l)}let o=e,c=Array.from(a.frameChildren.entries());for(let[d,l]of c)o=r(e,t,n,d,l);return r(o,t,n,null,a.regularElements)}var Zle=(e,t)=>nj(e,t,"left"),Kle=(e,t)=>nj(e,t,"right"),Qle=(e,t)=>ij(e,t,"left",rj),Jle=(e,t)=>ij(e,t,"right",rj),ece=we({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:$E,trackEvent:{category:"element"},perform:(e,t)=>({elements:Zle(e,t),appState:t,captureUpdate:se.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[q.CTRL_OR_CMD]&&!e.shiftKey&&e.code===_t.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${D("labels.sendBackward")} — ${ue("CtrlOrCmd+[")}`,children:$E})}),tce=we({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:BE,trackEvent:{category:"element"},perform:(e,t)=>({elements:Kle(e,t),appState:t,captureUpdate:se.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[q.CTRL_OR_CMD]&&!e.shiftKey&&e.code===_t.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${D("labels.bringForward")} — ${ue("CtrlOrCmd+]")}`,children:BE})}),nce=we({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:HE,trackEvent:{category:"element"},perform:(e,t)=>({elements:Qle(e,t),appState:t,captureUpdate:se.IMMEDIATELY}),keyTest:e=>gs?e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.BRACKET_LEFT:e[q.CTRL_OR_CMD]&&e.shiftKey&&e.code===_t.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${D("labels.sendToBack")} — ${ue(gs?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")}`,children:HE})}),rce=we({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:zE,trackEvent:{category:"element"},perform:(e,t)=>({elements:Jle(e,t),appState:t,captureUpdate:se.IMMEDIATELY}),keyTest:e=>gs?e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.BRACKET_RIGHT:e[q.CTRL_OR_CMD]&&e.shiftKey&&e.code===_t.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:n=>e(null),title:`${D("labels.bringToFront")} — ${ue(gs?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")}`,children:zE})}),ice=we({name:"selectAll",label:"labels.selectAll",icon:YG,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,n,r)=>{if(t.editingLinearElement)return!1;let i=e.filter(a=>!a.isDeleted&&!(ke(a)&&a.containerId)&&!a.locked).reduce((a,s)=>(a[s.id]=!0,a),{});return{appState:{...t,...Pr({editingGroupId:null,selectedElementIds:i},Gt(e),t,r),selectedLinearElement:Object.keys(i).length===1&&rt(e[0])?new Me(e[0]):null},captureUpdate:se.IMMEDIATELY}},keyTest:e=>e[q.CTRL_OR_CMD]&&e.key===q.A}),ace=e=>{let t=e.slice(),n=new Set,r=a=>{var d,l,h;let s=(l=(d=a[0])==null?void 0:d.groupIds)==null?void 0:l.join(""),o=[a[0]],c=[];for(let f of a.slice(1))((h=f.groupIds)==null?void 0:h.join(""))===s?o.push(f):c.push(f);return c.length?[...o,...r(c)]:o},i=new Map;return t.forEach((a,s)=>{var o;if(!i.has(a.id))if((o=a.groupIds)!=null&&o.length){let c=a.groupIds[a.groupIds.length-1],d=t.slice(s).filter(l=>{var f;let h=(f=l==null?void 0:l.groupIds)==null?void 0:f.some(g=>g===c);return h&&i.set(l.id,!0),h});for(let l of r(d))n.add(l)}else n.add(a)}),n.size!==e.length?(console.error("normalizeGroupElementOrder: lost some elements... bailing!"),e):[...n]},sce=e=>{let t=ZV(e),n=e.slice(),r=new Set;return n.forEach((i,a)=>{var s,o,c;i&&((s=i.boundElements)!=null&&s.length?(r.add(i),n[a]=null,i.boundElements.forEach(d=>{let l=t.get(d.id);l&&d.type==="text"&&(r.add(l[0]),n[l[1]]=null)})):i.type==="text"&&i.containerId&&((c=(o=t.get(i.containerId))==null?void 0:o[0].boundElements)!=null&&c.find(d=>d.id===i.id))||(r.add(i),n[a]=null))}),r.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...r]},oce=e=>sce(ace(e)),lce=we({name:"duplicateSelection",label:"labels.duplicateSelection",icon:u3,trackEvent:{category:"element"},perform:(e,t,n,r)=>{if(t.editingLinearElement)try{let a=Me.duplicateSelectedPoints(t,r.scene.getNonDeletedElementsMap());return{elements:e,appState:a,captureUpdate:se.IMMEDIATELY}}catch{return!1}let i=cce(e,t);if(r.props.onDuplicate&&i.elements){let a=r.props.onDuplicate(i.elements,e);a&&(i.elements=a)}return{...i,captureUpdate:se.IMMEDIATELY}},keyTest:e=>e[q.CTRL_OR_CMD]&&e.key===q.D,PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(wt,{type:"button",icon:u3,title:`${D("labels.duplicateSelection")} — ${ue("CtrlOrCmd+D")}`,"aria-label":D("labels.duplicateSelection"),onClick:()=>n(null),visible:$n(Gt(e),t)})}),cce=(e,t)=>{let n=new Map,r=[],i=[],a=new Map,s=new Map,o=Qe(e),c=y=>{let v=DE(y).reduce((x,w)=>{if(l.has(w.id))return x;l.set(w.id,!0);let C=jA(t.editingGroupId,n,w,{x:w.x+Hg/2,y:w.y+Hg/2});return l.set(C.id,!0),s.set(C.id,C),a.set(w.id,C.id),i.push(w),r.push(C),x.push(C),x},[]);return Array.isArray(y)?v:v[0]||null};e=oce(e);let d=Qe(ut(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),l=new Map,h=e.slice(),f=(y,v)=>{Tr(y!==-1,"targetIndex === -1 "),!(!Array.isArray(v)&&!v)&&h.splice(y+1,0,...DE(v))},g=new Set(e.filter(y=>d.has(y.id)&&Ke(y)).map(y=>y.id));for(let y of e){if(l.has(y.id)||!d.has(y.id))continue;let v=vA(t,y);if(v){let x=en(e,v).flatMap(C=>Ke(C)?[...ws(e,C.id),C]:[C]),w=kc(h,C=>{var S;return(S=C.groupIds)==null?void 0:S.includes(v)});f(w,c(x));continue}if(!(y.frameId&&g.has(y.frameId))){if(Ke(y)){let x=y.id,w=ws(e,x),C=kc(h,S=>S.frameId===x||S.id===x);f(C,c([...w,y]));continue}if(Ki(y)){let x=ct(y,o),w=kc(h,C=>C.id===y.id||"containerId"in C&&C.containerId===y.id);x?f(w,c([y,x])):f(w,c(y));continue}if(tn(y)){let x=lr(y,o),w=kc(h,C=>C.id===y.id||C.id===(x==null?void 0:x.id));x?f(w,c([x,y])):f(w,c(y));continue}f(kc(h,x=>x.id===y.id),c(y))}}SA(h,i,a),pA(h,i,a),cL(h,i,a);let U=Y7(r);return{elements:h,appState:{...t,...Pr({editingGroupId:t.editingGroupId,selectedElementIds:U.reduce((y,v)=>(tn(v)||(y[v.id]=!0),y),{})},Gt(h),t,null)}}},dce=new Set(["command_palette","export"]),Zt=(e,t,n,r)=>{try{if(typeof window>"u"||dt.VITE_WORKER_ID||dt.VITE_APP_ENABLE_TRACKING!=="true"||!dce.has(e)||dt.DEV)return;dt.PROD||console.info("trackEvent",{category:e,action:t,label:n,value:r}),window.sa_event&&window.sa_event(t,{category:e,label:n,value:r})}catch(i){console.error("error during analytics",i)}},aj=I.forwardRef((e,t)=>{let{title:n,className:r,testId:i,active:a,standalone:s,icon:o,onClick:c}=e;return m.jsx("button",{type:"button",ref:t,title:n,"data-testid":i,className:De(r,{standalone:s,active:a}),onClick:c,children:o},n)}),Ts=e=>m.jsx("div",{className:"buttonList",children:e.options.map(t=>e.type==="button"?m.jsx(aj,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:n=>e.onClick(t.value,n)},t.text):m.jsxs("label",{className:De({active:e.value===t.value}),title:t.text,children:[m.jsx("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),uce=({onChange:e,type:t,activeColor:n,topPicks:r})=>{let i;return t==="elementStroke"&&(i=NM),t==="elementBackground"&&(i=OM),t==="canvasBackground"&&(i=FM),r&&(i=r),i?m.jsx("div",{className:"color-picker__top-picks",children:i.map(a=>m.jsx("button",{className:De("color-picker__button",{active:a===n,"is-transparent":a==="transparent"||!a}),style:{"--swatch-color":a},type:"button",title:a,onClick:()=>e(a),"data-testid":`color-top-pick-${a}`,children:m.jsx("div",{className:"color-picker__button-outline"})},a))}):(console.error("Invalid type for TopPicks"),null)},sj=()=>m.jsx("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),zU=({palette:e,color:t})=>{for(let[n,r]of Object.entries(e))if(Array.isArray(r)){let i=r.indexOf(t);if(i>-1)return{colorName:n,shade:i}}else if(r===t)return{colorName:n,shade:null};return null},J3=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),oj=({color:e,palette:t})=>!Object.values(t).flat().includes(e),hce=(e,t,n)=>{let r={elementBackground:"backgroundColor",elementStroke:"strokeColor"},i=e.filter(s=>{if(s.isDeleted)return!1;let o=s[r[t]];return oj({color:o,palette:n})}),a=new Map;return i.forEach(s=>{let o=s[r[t]];a.has(o)?a.set(o,a.get(o)+1):a.set(o,1)}),[...a.entries()].sort((s,o)=>o[1]-s[1]).map(s=>s[0]).slice(0,zX)},Sh=cr(null),i_=(e,t,n)=>(e*299+t*587+n*114)/1e3>=160?"black":"white",fce=(e,t)=>{if(t){let a=new Option().style;if(a.color=e,a.color){let s=a.color.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(","),o=parseInt(s[0]),c=parseInt(s[1]),d=parseInt(s[2]);return i_(o,c,d)}}if(e==="transparent")return"black";let n=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),i=parseInt(e.substring(5,7),16);return i_(n,r,i)},pce=({color:e,keyLabel:t,isCustomColor:n=!1,isShade:r=!1})=>m.jsxs("div",{className:"color-picker__button__hotkey-label",style:{color:fce(e,n)},children:[r&&"⇧",t]}),wv=pce,mce=({hex:e,onChange:t,palette:n})=>{let r=zU({color:e||"transparent",palette:n}),[i,a]=Cn(Sh),s=I.useRef(null);if(I.useEffect(()=>{s.current&&i==="shades"&&s.current.focus()},[r,i]),r){let{colorName:o,shade:c}=r,d=n[o];if(Array.isArray(d))return m.jsx("div",{className:"color-picker-content--default shades",children:d.map((l,h)=>m.jsxs("button",{ref:h===c&&i==="shades"?s:void 0,tabIndex:-1,type:"button",className:De("color-picker__button color-picker__button--large",{active:h===c}),"aria-label":"Shade",title:`${o} - ${h+1}`,style:l?{"--swatch-color":l}:void 0,onClick:()=>{t(l),a("shades")},children:[m.jsx("div",{className:"color-picker__button-outline"}),m.jsx(wv,{color:l,keyLabel:h+1,isShade:!0})]},h))})}return m.jsxs("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[m.jsx("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),m.jsx("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:D("colorPicker.noShades")})]})},gce=({palette:e,color:t,onChange:n,label:r,activeShade:i})=>{let a=zU({color:t||"transparent",palette:e}),[s,o]=Cn(Sh),c=I.useRef(null);return I.useEffect(()=>{c.current&&s==="baseColors"&&c.current.focus()},[a==null?void 0:a.colorName,s]),m.jsx("div",{className:"color-picker-content--default",children:Object.entries(e).map(([d,l],h)=>{let f=(Array.isArray(l)?l[i]:l)||"transparent",g=J3[h],U=D(`colors.${d.replace(/\d+/,"")}`,null,"");return m.jsxs("button",{ref:(a==null?void 0:a.colorName)===d?c:void 0,tabIndex:-1,type:"button",className:De("color-picker__button color-picker__button--large",{active:(a==null?void 0:a.colorName)===d,"is-transparent":f==="transparent"||!f}),onClick:()=>{n(f),o("baseColors")},title:`${U}${f.startsWith("#")?` ${f}`:""} — ${g}`,"aria-label":`${U} — ${g}`,style:{"--swatch-color":f},"data-testid":`color-${d}`,children:[m.jsx("div",{className:"color-picker__button-outline"}),m.jsx(wv,{color:f,keyLabel:g})]},d)})})},Uce=gce,bce=({colors:e,color:t,onChange:n,label:r})=>{let[i,a]=Cn(Sh),s=I.useRef(null);return I.useEffect(()=>{s.current&&s.current.focus()},[t,i]),m.jsx("div",{className:"color-picker-content--default",children:e.map((o,c)=>m.jsxs("button",{ref:t===o?s:void 0,tabIndex:-1,type:"button",className:De("color-picker__button color-picker__button--large",{active:t===o,"is-transparent":o==="transparent"||!o}),onClick:()=>{n(o),a("custom")},title:o,"aria-label":r,style:{"--swatch-color":o},children:[m.jsx("div",{className:"color-picker__button-outline"}),m.jsx(wv,{color:o,keyLabel:c+1,isCustomColor:!0})]},c))})},hy=(e,t,n)=>{let r=Math.ceil(n/fu);switch(t=t??-1,e){case"ArrowLeft":{let i=t-1;return i<0?n-1:i}case"ArrowRight":return(t+1)%n;case"ArrowDown":{let i=t+fu;return i>=n?t%fu:i}case"ArrowUp":{let i=t-fu,a=i<0?fu*r+i:i;return a>=n?void 0:a}}},yce=({e,colorObj:t,onChange:n,palette:r,customColors:i,setActiveColorPickerSection:a,activeShade:s})=>{if((t==null?void 0:t.shade)!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let o=Number(e.code.slice(-1))-1;return n(r[t.colorName][o]),a("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&i[Number(e.key)-1])return n(i[Number(e.key)-1]),a("custom"),!0;if(J3.includes(e.key)){let o=J3.indexOf(e.key),c=Object.keys(r)[o],d=r[c],l=Array.isArray(d)?d[s]:d;return n(l),a("baseColors"),!0}return!1},vce=({event:e,activeColorPickerSection:t,palette:n,color:r,onChange:i,customColors:a,setActiveColorPickerSection:s,updateData:o,activeShade:c,onEyeDropperToggle:d,onEscape:l})=>{if(e[q.CTRL_OR_CMD])return!1;if(e.key===q.ESCAPE)return l(e),!0;if(e.key===q.ALT)return d(!0),!0;if(e.key===q.I)return d(),!0;let h=zU({color:r,palette:n});if(e.key===q.TAB){let f={custom:!!a.length,baseColors:!0,shades:(h==null?void 0:h.shade)!=null,hex:!0},g=Object.entries(f).reduce((w,[C,S])=>(S&&w.push(C),w),[]),U=g.indexOf(t),y=e.shiftKey?-1:1,v=U+y>g.length-1?0:U+y<0?g.length-1:U+y,x=g[v];return x&&s(x),x==="custom"?i(a[0]):x==="baseColors"&&(Object.entries(n).find(([w,C])=>Array.isArray(C)?C.includes(r):C===r?w:null)||i(pt.black)),e.preventDefault(),e.stopPropagation(),!0}if(yce({e,colorObj:h,onChange:i,palette:n,customColors:a,setActiveColorPickerSection:s,activeShade:c}))return!0;if(t==="shades"&&h){let{shade:f}=h,g=hy(e.key,f,fu);if(g!==void 0)return i(n[h.colorName][g]),!0}if(t==="baseColors"&&h){let{colorName:f}=h,g=Object.keys(n),U=g.indexOf(f),y=hy(e.key,U,g.length);if(y!==void 0){let v=g[y],x=n[v];return i(Array.isArray(x)?x[c]:x),!0}}if(t==="custom"){let f=a.indexOf(r),g=hy(e.key,f,a.length);if(g!==void 0){let U=a[g];return i(U),!0}}return!1},xce=({children:e})=>m.jsx("div",{className:"color-picker__heading",children:e}),vg=xce,wce=({color:e,onChange:t,label:n,type:r,elements:i,palette:a,updateData:s,children:o,onEyeDropperToggle:c,onEscape:d})=>{let[l]=xe.useState(()=>r==="canvasBackground"?[]:hce(i,r,a)),[h,f]=Cn(Sh),g=zU({color:e,palette:a});I.useEffect(()=>{if(!h){let x=oj({color:e,palette:a}),w=x&&!l.includes(e);f(w?"hex":x?"custom":(g==null?void 0:g.shade)!=null?"shades":"baseColors")}},[h,e,a,f,g,l]);let[U,y]=I.useState((g==null?void 0:g.shade)??(r==="elementBackground"?Qf:Kf));I.useEffect(()=>{(g==null?void 0:g.shade)!=null&&y(g.shade);let x=w=>{w.key===q.ALT&&c(!1)};return document.addEventListener("keyup",x,{capture:!0}),()=>{document.removeEventListener("keyup",x,{capture:!0})}},[g,c]);let v=xe.useRef(null);return m.jsx("div",{role:"dialog","aria-modal":"true","aria-label":D("labels.colorPicker"),children:m.jsxs("div",{ref:v,onKeyDown:x=>{vce({event:x,activeColorPickerSection:h,palette:a,color:e,onChange:t,onEyeDropperToggle:c,customColors:l,setActiveColorPickerSection:f,updateData:s,activeShade:U,onEscape:d})&&(x.preventDefault(),x.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[!!l.length&&m.jsxs("div",{children:[m.jsx(vg,{children:D("colorPicker.mostUsedCustomColors")}),m.jsx(bce,{colors:l,color:e,label:D("colorPicker.mostUsedCustomColors"),onChange:t})]}),m.jsxs("div",{children:[m.jsx(vg,{children:D("colorPicker.colors")}),m.jsx(Uce,{color:e,label:n,palette:a,onChange:t,activeShade:U})]}),m.jsxs("div",{children:[m.jsx(vg,{children:D("colorPicker.shades")}),m.jsx(mce,{hex:e,onChange:t,palette:a})]}),o]})})},lj=xe.createContext(null),Hr=()=>xe.useContext(lj),cj=e=>{let[t,n]=I.useState(null),r=Zn(),{theme:i}=Hr(),{container:a}=Is();return I.useLayoutEffect(()=>{var s;t&&(t.className="",t.classList.add("excalidraw",...((s=e==null?void 0:e.className)==null?void 0:s.split(/\s+/))||[]),t.classList.toggle("excalidraw--mobile",r.editor.isMobile),t.classList.toggle("theme--dark",i===yt.DARK))},[t,i,r.editor.isMobile,e==null?void 0:e.className]),I.useLayoutEffect(()=>{let s=e!=null&&e.parentSelector?a==null?void 0:a.querySelector(e.parentSelector):document.body;if(!s)return;let o=document.createElement("div");return s.appendChild(o),n(o),()=>{s.removeChild(o)}},[a,e==null?void 0:e.parentSelector]),t};function Ev(e,t,n){I.useEffect(()=>{function r(i){let a=i;if(!e.current)return;let s=n==null?void 0:n(a,e.current);if(s!==!0){if(s===!1)return t(a);e.current.contains(a.target)||!document.documentElement.contains(a.target)||a.target.closest("[data-radix-portal]")||a.target===document.documentElement&&document.body.style.pointerEvents==="none"||a.target.closest("[data-prevent-outside-click]")||t(a)}}return document.addEventListener("pointerdown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("touchstart",r)}},[e,t,n])}var HU=e=>{let t=I.useRef(e);return Object.assign(t.current,e),t.current},WU=cr(null),Ece=({onCancel:e,onChange:t,onSelect:n,colorPickerType:r})=>{let i=cj({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=Hr(),s=KU(),o=Ms(),c=ut(s,a),d=HU({app:o,onCancel:e,onChange:t,onSelect:n,selectedElements:c}),{container:l}=Is();I.useEffect(()=>{let f=h.current;if(!f||!o.canvas||!i)return;let g=!1,U=o.canvas.getContext("2d"),y=({clientX:M,clientY:_})=>{let R=U.getImageData((M-a.offsetLeft)*window.devicePixelRatio,(_-a.offsetTop)*window.devicePixelRatio,1,1).data;return YX(R[0],R[1],R[2])},v=({clientX:M,clientY:_,altKey:R})=>{f.style.top=`${_+20}px`,f.style.left=`${M+20}px`;let P=y({clientX:M,clientY:_});g&&d.onChange(r,P,d.selectedElements,{altKey:R}),f.style.background=P},x=()=>{d.onCancel()},w=(M,_)=>{d.onSelect(M,_)},C=M=>{g=!0,M.stopImmediatePropagation()},S=M=>{g=!1,l==null||l.focus(),M.stopImmediatePropagation(),M.preventDefault(),w(y(M),M)},T=M=>{M.key===q.ESCAPE&&(M.preventDefault(),M.stopImmediatePropagation(),x())};return i.tabIndex=-1,i.focus(),v({clientX:d.app.lastViewportPosition.x,clientY:d.app.lastViewportPosition.y,altKey:!1}),i.addEventListener("keydown",T),i.addEventListener("pointerdown",C),i.addEventListener("pointerup",S),window.addEventListener("pointermove",v,{passive:!0}),window.addEventListener("blur",x),()=>{g=!1,i.removeEventListener("keydown",T),i.removeEventListener("pointerdown",C),i.removeEventListener("pointerup",S),window.removeEventListener("pointermove",v),window.removeEventListener("blur",x)}},[d,o.canvas,i,r,l,a.offsetLeft,a.offsetTop]);let h=I.useRef(null);return Ev(h,()=>{e()},f=>!!f.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),i?ar.createPortal(m.jsx("div",{ref:h,className:"excalidraw-eye-dropper-preview"}),i):null},Cce=({color:e,onChange:t,label:n,colorPickerType:r})=>{let i=Zn(),[a,s]=I.useState(e),[o,c]=Cn(Sh);I.useEffect(()=>{s(e)},[e]);let d=I.useCallback(U=>{let y=U.toLowerCase(),v=Sce(y);v&&t(v),s(y)},[t]),l=I.useRef(null),h=I.useRef(null);I.useEffect(()=>{l.current&&l.current.focus()},[o]);let[f,g]=Cn(WU);return I.useEffect(()=>()=>{g(null)},[g]),m.jsxs("div",{className:"color-picker__input-label",children:[m.jsx("div",{className:"color-picker__input-hash",children:"#"}),m.jsx("input",{ref:o==="hex"?l:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":n,onChange:U=>{d(U.target.value)},value:(a||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>c("hex"),onKeyDown:U=>{var y;U.key!==q.TAB&&(U.key===q.ESCAPE&&((y=h.current)==null||y.focus()),U.stopPropagation())}}),!i.editor.isMobile&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),m.jsx("div",{ref:h,className:De("excalidraw-eye-dropper-trigger",{selected:f}),onClick:()=>g(U=>U?null:{keepOpenOnAlt:!1,onSelect:y=>t(y),colorPickerType:r}),title:`${D("labels.eyeDropper")} — ${q.I.toLocaleUpperCase()} or ${ue("Alt")} `,children:FG})]})]})},Ia=xe.forwardRef(({children:e,padding:t,className:n,style:r},i)=>m.jsx("div",{className:De("Island",n),style:{"--padding":t,...r},ref:i,children:e})),dj=xe.forwardRef(({className:e,container:t,children:n,style:r,onClose:i,onKeyDown:a,onFocusOutside:s,onPointerLeave:o,onPointerDownOutside:c},d)=>{let l=Zn();return m.jsx(loe,{container:t,children:m.jsxs(Uv,{ref:d,className:De("focus-visible-none",e),"data-prevent-outside-click":!0,side:l.editor.isMobile&&!l.viewport.isLandscape?"bottom":"right",align:l.editor.isMobile&&!l.viewport.isLandscape?"center":"start",alignOffset:-16,sideOffset:20,style:{zIndex:"var(--zIndex-popup)"},onPointerLeave:o,onKeyDown:a,onFocusOutside:s,onPointerDownOutside:c,onCloseAutoFocus:h=>{h.stopPropagation(),h.preventDefault(),t&&!BV(document.activeElement)&&t.focus(),i()},children:[m.jsx(Ia,{padding:3,style:r,children:n}),m.jsx(_D,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),a_=e=>{let t=new Option().style;return t.color=e,!!t.color},Sce=e=>Ea(e)?e:a_(`#${e}`)?`#${e}`:a_(e)?e:null,_ce=({type:e,color:t,onChange:n,label:r,elements:i,palette:a=pt,updateData:s})=>{let{container:o}=Is(),[,c]=Cn(Sh),[d,l]=Cn(WU),h=m.jsxs("div",{children:[m.jsx(vg,{children:D("colorPicker.hexCode")}),m.jsx(Cce,{color:t,label:r,onChange:U=>{n(U)},colorPickerType:e})]}),f=I.useRef(null),g=()=>{var U,y;(y=(U=f.current)==null?void 0:U.querySelector(".color-picker-content"))==null||y.focus()};return m.jsx(dj,{container:o,style:{maxWidth:"13rem"},onFocusOutside:U=>{g(),U.preventDefault()},onPointerDownOutside:U=>{d&&U.preventDefault()},onClose:()=>{s({openPopup:null}),c(null)},children:a?m.jsx(wce,{palette:a,color:t,onChange:U=>{n(U)},onEyeDropperToggle:U=>{l(y=>U?(y=y||{keepOpenOnAlt:!0,onSelect:n,colorPickerType:e},y.keepOpenOnAlt=!0,y):U===!1||y?null:{keepOpenOnAlt:!1,onSelect:n,colorPickerType:e})},onEscape:U=>{d?l(null):s({openPopup:null})},label:r,type:e,elements:i,updateData:s,children:h}):h})},kce=({label:e,color:t,type:n})=>m.jsx(FU,{type:"button",className:De("color-picker__button active-color properties-trigger",{"is-transparent":t==="transparent"||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:D(n==="elementStroke"?"labels.showStroke":"labels.showBackground"),children:m.jsx("div",{className:"color-picker__button-outline"})}),Cv=({type:e,color:t,onChange:n,label:r,elements:i,palette:a=pt,topPicks:s,updateData:o,appState:c})=>m.jsx("div",{children:m.jsxs("div",{role:"dialog","aria-modal":"true",className:"color-picker-container",children:[m.jsx(uce,{activeColor:t,onChange:n,type:e,topPicks:s}),m.jsx(sj,{}),m.jsxs(OU,{open:c.openPopup===e,onOpenChange:d=>{o({openPopup:d?e:null})},children:[m.jsx(kce,{color:t,label:r,type:e}),c.openPopup===e&&m.jsx(_ce,{type:e,color:t,onChange:n,label:r,elements:i,palette:a,updateData:o})]})]})}),XU=({icon:e})=>m.jsx("span",{style:{width:"1em",margin:"0 0.5ex 0 0.5ex",display:"inline-block",lineHeight:0,verticalAlign:"middle"},children:e}),Tce=({label:e,open:t,openTrigger:n,children:r,className:i})=>m.jsxs(m.Fragment,{children:[m.jsxs("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:i,onClick:n,children:[e,m.jsx(XU,{icon:t?lq:II})]}),t&&m.jsx("div",{style:{display:"flex",flexDirection:"column"},children:r})]}),e8=Tce,Mce=cr(!1);function Ice({options:e,value:t,label:n,onChange:r,onClose:i,numberOfOptionsToAlwaysShow:a=e.length}){let s=Zn(),o=g=>{let U=e.find(y=>y.keyBinding===g.key.toLowerCase());if(!(g.metaKey||g.altKey||g.ctrlKey)&&U)r(U.value),g.preventDefault();else if(g.key===q.TAB){let y=e.findIndex(x=>x.value===t),v=g.shiftKey?(e.length+y-1)%e.length:(y+1)%e.length;r(e[v].value)}else if(Jf(g.key)){let y=c1().rtl,v=e.findIndex(x=>x.value===t);if(v!==-1){let x=e.length,w=v;switch(g.key){case(y?q.ARROW_LEFT:q.ARROW_RIGHT):w=(v+1)%x;break;case(y?q.ARROW_RIGHT:q.ARROW_LEFT):w=(x+v-1)%x;break;case q.ARROW_DOWN:{w=(v+(a??1))%x;break}case q.ARROW_UP:{w=(x+v-(a??1))%x;break}}r(e[w].value)}g.preventDefault()}else(g.key===q.ESCAPE||g.key===q.ENTER)&&(g.preventDefault(),i());g.nativeEvent.stopImmediatePropagation(),g.stopPropagation()},[c,d]=Cn(Mce),l=xe.useMemo(()=>e.slice(0,a),[e,a]),h=xe.useMemo(()=>e.slice(a),[e,a]);I.useEffect(()=>{l.some(g=>g.value===t)||d(!0)},[t,l,d]);let f=g=>m.jsx("div",{className:"picker-content",children:g.map((U,y)=>m.jsxs("button",{type:"button",className:De("picker-option",{active:t===U.value}),onClick:v=>{r(U.value)},title:`${U.text} ${U.keyBinding&&`— ${U.keyBinding.toUpperCase()}`}`,"aria-label":U.text||"none","aria-keyshortcuts":U.keyBinding||void 0,ref:v=>{t===U.value&&setTimeout(()=>{v==null||v.focus()},0)},children:[U.icon,U.keyBinding&&m.jsx("span",{className:"picker-keybinding",children:U.keyBinding})]},U.text))});return m.jsx(Uv,{side:s.editor.isMobile&&!s.viewport.isLandscape?"top":"bottom",align:"start",sideOffset:12,style:{zIndex:"var(--zIndex-popup)"},onKeyDown:o,children:m.jsxs("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":n,children:[f(l),h.length>0&&m.jsx(e8,{label:D("labels.more_options"),open:c,openTrigger:()=>{d(g=>!g)},className:"picker-collapsible",children:f(h)})]})})}function s_({value:e,label:t,options:n,onChange:r,group:i="",numberOfOptionsToAlwaysShow:a}){var d;let[s,o]=xe.useState(!1),c=xe.useRef(null);return m.jsx("div",{children:m.jsxs(OU,{open:s,onOpenChange:l=>o(l),children:[m.jsx(FU,{name:i,type:"button","aria-label":t,onClick:()=>o(!s),ref:c,className:s?"active":"",children:(d=n.find(l=>l.value===e))==null?void 0:d.icon}),s&&m.jsx(Ice,{options:n,value:e,label:t,onChange:r,onClose:()=>{o(!1)},numberOfOptionsToAlwaysShow:a})]})})}var uj=xe.forwardRef(({className:e,placeholder:t,onChange:n},r)=>m.jsxs("div",{className:De("QuickSearch__wrapper",e),children:[id,m.jsx("input",{ref:r,className:"QuickSearch__input",type:"text",placeholder:t,onChange:i=>n(i.target.value.trim().toLowerCase())})]})),hj=({className:e,placeholder:t,children:n})=>{let r=!I.Children.count(n);return m.jsx("div",{className:De("ScrollableList__wrapper",e),role:"menu",children:r?m.jsx("div",{className:"empty",children:t}):n})},fj=({children:e,className:t="",style:n,title:r})=>m.jsxs("div",{className:`dropdown-menu-group ${t}`,style:n,children:[r&&m.jsx("p",{className:"dropdown-menu-group-title",children:r}),e]}),t8=fj;fj.displayName="DropdownMenuGroup";var pj=xe.createContext({}),mj=(e="",t=!1,n=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e}
|
|
148
|
+
${t?"dropdown-menu-item--selected":""} ${n?"dropdown-menu-item--hovered":""}`.trim(),gj=(e,t)=>{let n=I.useContext(pj);return cU(e,r=>{var a;let i=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});t==null||t(i),i.defaultPrevented||((a=n.onSelect)==null||a.call(n,i))})},Ace=({textStyle:e,icon:t,shortcut:n,children:r})=>{let i=Zn();return m.jsxs(m.Fragment,{children:[t&&m.jsx("div",{className:"dropdown-menu-item__icon",children:t}),m.jsx("div",{style:e,className:"dropdown-menu-item__text",children:r}),n&&!i.editor.isMobile&&m.jsx("div",{className:"dropdown-menu-item__shortcut",children:n})]})},Uj=Ace,Sv=({icon:e,value:t,order:n,children:r,shortcut:i,className:a,hovered:s,selected:o,textStyle:c,onSelect:d,onClick:l,...h})=>{let f=gj(l,d),g=I.useRef(null);return I.useEffect(()=>{var U,y;s&&(n===0?(U=g.current)==null||U.scrollIntoView({block:"end"}):(y=g.current)==null||y.scrollIntoView({block:"nearest"}))},[s,n]),m.jsx("button",{...h,ref:g,value:t,onClick:f,className:mj(a,o,s),title:h.title??h["aria-label"],children:m.jsx(Uj,{textStyle:c,icon:e,shortcut:i,children:r})})};Sv.displayName="DropdownMenuItem";var ap={GREEN:"green",RED:"red",BLUE:"blue"},_v=({type:e=ap.BLUE,children:t})=>{let{theme:n}=H1(),r={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:n===yt.LIGHT?"1.5px solid white":"none"};switch(e){case ap.GREEN:Object.assign(r,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case ap.RED:Object.assign(r,{backgroundColor:"pink",color:"darkred"});break;case ap.BLUE:default:Object.assign(r,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return m.jsx("div",{className:"DropDownMenuItemBadge",style:r,children:t})};_v.displayName="DropdownMenuItemBadge";Sv.Badge=_v;var na=Sv,Lce=({event:e,inputRef:t,hoveredFont:n,filteredFonts:r,onClose:i,onSelect:a,onHover:s})=>{var o,c,d;if(!e[q.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===q.F)return(o=t.current)==null||o.focus(),!0;if(e.key===q.ESCAPE)return i(),!0;if(e.key===q.ENTER)return n!=null&&n.value&&a(n.value),!0;if(e.key===q.ARROW_DOWN)return n!=null&&n.next?s(n.next.value):(c=r[0])!=null&&c.value&&s(r[0].value),!0;if(e.key===q.ARROW_UP)return n!=null&&n.prev?s(n.prev.value):(d=r[r.length-1])!=null&&d.value&&s(r[r.length-1].value),!0},Rce=xe.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:n,onHover:r,onLeave:i,onOpen:a,onClose:s})=>{let{container:o}=Is(),{fonts:c}=Ms(),{showDeprecatedFonts:d}=z1(),[l,h]=I.useState(""),f=I.useRef(null),g=I.useMemo(()=>Array.from(uo.registered.entries()).filter(([R,{metadata:P}])=>!P.serverSide&&!P.fallback).map(([R,{metadata:P,fontFaces:j}])=>{var F,B;let N={value:R,icon:P.icon??Jg,text:((B=(F=j[0])==null?void 0:F.fontFace)==null?void 0:B.family)??"Unknown"};return P.deprecated&&Object.assign(N,{deprecated:P.deprecated,badge:{type:ap.RED,placeholder:D("fontList.badge.old")}}),N}).sort((R,P)=>R.text.toLowerCase()>P.text.toLowerCase()?1:-1),[]),U=I.useMemo(()=>new Set(c.getSceneFamilies()),[e]),y=I.useMemo(()=>g.filter(R=>U.has(R.value)),[g,U]),v=I.useMemo(()=>g.filter(R=>!U.has(R.value)&&(d||!R.deprecated)),[g,U,d]),x=I.useMemo(()=>KV([...y,...v].filter(R=>{var P;return(P=R.text)==null?void 0:P.toLowerCase().includes(l)})),[y,v,l]),w=I.useMemo(()=>{var P;let R;return t?R=x.find(j=>j.value===t):e&&(R=x.find(j=>j.value===e)),!R&&l&&((P=x[0])!=null&&P.value?r(x[0].value):i()),R},[t,e,l,x,r,i]),C=I.useCallback(R=>{Lce({event:R,inputRef:f,hoveredFont:w,filteredFonts:x,onSelect:n,onHover:r,onClose:s})&&(R.preventDefault(),R.stopPropagation())},[w,x,n,r,s]);I.useEffect(()=>(a(),()=>{s()}),[]);let S=I.useMemo(()=>x.filter(R=>U.has(R.value)),[x,U]),T=I.useMemo(()=>x.filter(R=>!U.has(R.value)),[x,U]),M=(R,P)=>m.jsxs(na,{icon:R.icon,value:R.value,order:P,textStyle:{fontFamily:Hu({fontFamily:R.value})},hovered:R.value===(w==null?void 0:w.value),selected:R.value===e,tabIndex:R.value===e?0:-1,onClick:j=>{n(Number(j.currentTarget.value))},onMouseMove:()=>{(w==null?void 0:w.value)!==R.value&&r(R.value)},children:[R.text,R.badge&&m.jsx(_v,{type:R.badge.type,children:R.badge.placeholder})]},R.value),_=[];return S.length&&_.push(m.jsx(t8,{title:D("fontList.sceneFonts"),children:S.map(M)},"group_1")),T.length&&_.push(m.jsx(t8,{title:D("fontList.availableFonts"),children:T.map((R,P)=>M(R,P+S.length))},"group_2")),m.jsxs(dj,{className:"properties-content",container:o,style:{width:"15rem"},onClose:s,onPointerLeave:i,onKeyDown:C,children:[m.jsx(uj,{ref:f,placeholder:D("quickSearch.placeholder"),onChange:Wu(h,20)}),m.jsx(hj,{className:"dropdown-menu fonts manual-hover",placeholder:D("fontList.empty"),children:_.length?_:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),Dce=({selectedFontFamily:e})=>{let t=I.useMemo(()=>!!(e&&!Pce(e)),[e]);return m.jsx(FU,{asChild:!0,children:m.jsx("div",{children:m.jsx(aj,{standalone:!0,icon:pI,title:D("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{}})})})},bj=[{value:fn.Excalifont,icon:Zp,text:D("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:fn.Nunito,icon:Jg,text:D("labels.normal"),testId:"font-family-normal"},{value:fn["Comic Shanns"],icon:m3,text:D("labels.code"),testId:"font-family-code"}],jce=new Set(bj.map(e=>e.value)),Pce=e=>e?jce.has(e):!1,Nce=xe.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:n,onSelect:r,onHover:i,onLeave:a,onPopupChange:s})=>{let o=I.useMemo(()=>bj,[]),c=I.useCallback(d=>{d&&r(d)},[r]);return m.jsxs("div",{role:"dialog","aria-modal":"true",className:"FontPicker__container",children:[m.jsx(Ts,{type:"button",options:o,value:t,onClick:c}),m.jsx(sj,{}),m.jsxs(OU,{open:e,onOpenChange:s,children:[m.jsx(Dce,{selectedFontFamily:t}),e&&m.jsx(Rce,{selectedFontFamily:t,hoveredFontFamily:n,onSelect:c,onHover:i,onLeave:a,onOpen:()=>s(!0),onClose:()=>s(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),Oce=({updateData:e,appState:t,elements:n,testId:r})=>{let i=xe.useRef(null),a=xe.useRef(null),s=$r(n,t,o=>o.opacity,!0,t.currentItemOpacity);return I.useEffect(()=>{if(i.current&&a.current){let o=i.current,c=a.current,d=o.offsetWidth,l=15,h=s/100*(d-l)+l/2;c.style.left=`${h}px`,o.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${s}%, var(--button-bg) ${s}%, var(--button-bg) 100%)`}},[s]),m.jsxs("label",{className:"control-label",children:[D("labels.opacity"),m.jsxs("div",{className:"range-wrapper",children:[m.jsx("input",{ref:i,type:"range",min:"0",max:"100",step:"10",onChange:o=>{e(+o.target.value)},value:s,className:"range-input","data-testid":r}),m.jsx("div",{className:"value-bubble",ref:a,children:s!==0?s:null}),m.jsx("div",{className:"zero-label",children:"0"})]})]})},yj=.1,Br=(e,t,n,r=!1)=>{let i=Qe(ut(e,t,{includeBoundTextElement:r}));return e.map(a=>{var s;return i.get(a.id)||a.id===((s=t.editingTextElement)==null?void 0:s.id)?n(a):a})},$r=function(e,t,n,r,i){let a=t.editingTextElement,s=Gt(e),o=null;return a&&(o=n(a)),o||($n(s,t)?o=vre(r===!0?s:s.filter(c=>r(c)),t,n)??(typeof i=="function"?i(!0):i):o=typeof i=="function"?i(!1):i),o},Fce=(e,t)=>tn(t)||!t.autoResize?t:he(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2},!1),kv=(e,t,n,r,i)=>{let a=new Set,s=Br(e,t,c=>{if(ke(c)){let d=r(c);a.add(d);let l=lt(c,{fontSize:d});return Fr(l,n.scene.getContainerElement(c),n.scene.getNonDeletedElementsMap()),l=Fce(c,l),l}return c},!0),o=Qe(s);return ut(e,t,{includeBoundTextElement:!0}).forEach(c=>{ke(c)&&ci(c,o)}),{elements:s,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:i??t.currentItemFontSize},captureUpdate:se.IMMEDIATELY}};we({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemStrokeColor&&{elements:Br(e,t,r=>v3(r.type)?lt(r,{strokeColor:n.currentItemStrokeColor}):r,!0)},appState:{...t,...n},captureUpdate:n.currentItemStrokeColor?se.IMMEDIATELY:se.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>m.jsxs(m.Fragment,{children:[m.jsx("h3",{"aria-hidden":"true",children:D("labels.stroke")}),m.jsx(Cv,{topPicks:NM,palette:WX,type:"elementStroke",label:D("labels.stroke"),color:$r(e,t,i=>i.strokeColor,!0,t.currentItemStrokeColor),onChange:i=>n({currentItemStrokeColor:i}),elements:e,appState:t,updateData:n})]})});we({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemBackgroundColor&&{elements:Br(e,t,r=>lt(r,{backgroundColor:n.currentItemBackgroundColor}))},appState:{...t,...n},captureUpdate:n.currentItemBackgroundColor?se.IMMEDIATELY:se.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>m.jsxs(m.Fragment,{children:[m.jsx("h3",{"aria-hidden":"true",children:D("labels.background")}),m.jsx(Cv,{topPicks:OM,palette:XX,type:"elementBackground",label:D("labels.background"),color:$r(e,t,i=>i.backgroundColor,!0,t.currentItemBackgroundColor),onChange:i=>n({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:n})]})});we({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,n,r)=>(Zt("element","changeFillStyle",`${n} (${r.device.editor.isMobile?"mobile":"desktop"})`),{elements:Br(e,t,i=>lt(i,{fillStyle:n})),appState:{...t,currentItemFillStyle:n},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=ut(e,t),i=r.length>0&&r.every(a=>a.fillStyle==="zigzag");return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.fill")}),m.jsx(Ts,{type:"button",options:[{value:"hachure",text:`${D(i?"labels.zigzag":"labels.hachure")} (${ue("Alt-Click")})`,icon:i?QY:JY,active:i?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:D("labels.crossHatch"),icon:eG,testId:"fill-cross-hatch"},{value:"solid",text:D("labels.solid"),icon:tG,testId:"fill-solid"}],value:$r(e,t,a=>a.fillStyle,a=>a.hasOwnProperty("fillStyle"),a=>a?null:t.currentItemFillStyle),onClick:(a,s)=>{let o=s.altKey&&a==="hachure"&&r.every(c=>c.fillStyle==="hachure")?"zigzag":a;n(o)}})]})}});we({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:Br(e,t,r=>lt(r,{strokeWidth:n})),appState:{...t,currentItemStrokeWidth:n},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.strokeWidth")}),m.jsx(Ts,{group:"stroke-width",options:[{value:Tb.thin,text:D("labels.thin"),icon:xI,testId:"strokeWidth-thin"},{value:Tb.bold,text:D("labels.bold"),icon:nG,testId:"strokeWidth-bold"},{value:Tb.extraBold,text:D("labels.extraBold"),icon:rG,testId:"strokeWidth-extraBold"}],value:$r(e,t,r=>r.strokeWidth,r=>r.hasOwnProperty("strokeWidth"),r=>r?null:t.currentItemStrokeWidth),onChange:r=>n(r)})]})});we({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:Br(e,t,r=>lt(r,{seed:ys(),roughness:n})),appState:{...t,currentItemRoughness:n},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.sloppiness")}),m.jsx(Ts,{group:"sloppiness",options:[{value:0,text:D("labels.architect"),icon:sG},{value:1,text:D("labels.artist"),icon:oG},{value:2,text:D("labels.cartoonist"),icon:lG}],value:$r(e,t,r=>r.roughness,r=>r.hasOwnProperty("roughness"),r=>r?null:t.currentItemRoughness),onChange:r=>n(r)})]})});we({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:Br(e,t,r=>lt(r,{strokeStyle:n})),appState:{...t,currentItemStrokeStyle:n},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.strokeStyle")}),m.jsx(Ts,{group:"strokeStyle",options:[{value:"solid",text:D("labels.strokeStyle_solid"),icon:xI},{value:"dashed",text:D("labels.strokeStyle_dashed"),icon:iG},{value:"dotted",text:D("labels.strokeStyle_dotted"),icon:aG}],value:$r(e,t,r=>r.strokeStyle,r=>r.hasOwnProperty("strokeStyle"),r=>r?null:t.currentItemStrokeStyle),onChange:r=>n(r)})]})});we({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,n)=>({elements:Br(e,t,r=>lt(r,{opacity:n}),!0),appState:{...t,currentItemOpacity:n},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(Oce,{updateData:n,elements:e,appState:t,testId:"opacity"})});we({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,n,r)=>kv(e,t,r,()=>n,n),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.fontSize")}),m.jsx(Ts,{group:"font-size",options:[{value:16,text:D("labels.small"),icon:EG,testId:"fontSize-small"},{value:20,text:D("labels.medium"),icon:CG,testId:"fontSize-medium"},{value:28,text:D("labels.large"),icon:SG,testId:"fontSize-large"},{value:36,text:D("labels.veryLarge"),icon:_G,testId:"fontSize-veryLarge"}],value:$r(e,t,i=>{if(ke(i))return i.fontSize;let a=ct(i,r.scene.getNonDeletedElementsMap());return a?a.fontSize:null},i=>ke(i)||ct(i,r.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||Mo),onChange:i=>n(i)})]})});var o_=we({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:fU,trackEvent:!1,perform:(e,t,n,r)=>kv(e,t,r,i=>Math.round(1/(1+yj)*i.fontSize)),keyTest:e=>e[q.CTRL_OR_CMD]&&e.shiftKey&&(e.key===q.CHEVRON_LEFT||e.key===q.COMMA)}),l_=we({name:"increaseFontSize",label:"labels.increaseFontSize",icon:fU,trackEvent:!1,perform:(e,t,n,r)=>kv(e,t,r,i=>Math.round(i.fontSize*(1+yj))),keyTest:e=>e[q.CTRL_OR_CMD]&&e.shiftKey&&(e.key===q.CHEVRON_RIGHT||e.key===q.PERIOD)});we({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,n,r)=>{var U;let{cachedElements:i,resetAll:a,resetContainers:s,...o}=n;if(a)return{elements:Br(e,t,y=>{let v=i==null?void 0:i.get(y.id);return v?lt(y,{...v}):y},!0),appState:{...t,...o},captureUpdate:se.NEVER};let{currentItemFontFamily:c,currentHoveredFontFamily:d}=n,l=se.EVENTUALLY,h,f=!1;if(c)h=c,l=se.IMMEDIATELY;else if(d){h=d,l=se.EVENTUALLY;let y=ut(e,t,{includeBoundTextElement:!0}).filter(v=>ke(v));if(y.length>200)f=!0;else{let v=0,x=0;for(;v<y.length&&x<5e3;){let w=y[v];x+=(w==null?void 0:w.originalText.length)||0,v++}x>5e3&&(f=!0)}}let g={appState:{...t,...o},captureUpdate:l};if(h&&!f){let y=new Map,v=new Set,x=!1,w=Array.from(uo.loadedFontsCache.values()),C=(U=Object.entries(fn).find(([M,_])=>_===h))==null?void 0:U[0];d&&C&&w.some(M=>M.startsWith(C))&&(x=!0),Object.assign(g,{elements:Br(e,t,M=>{if(ke(M)&&(M.fontFamily!==h||c)){let _=lt(M,{fontFamily:h,lineHeight:ad(h)}),R=(i==null?void 0:i.get(M.containerId||""))||{},P=r.scene.getContainerElement(M);return s&&P&&R&&he(P,{...R},!1),x||(v=new Set([...v,...Array.from(_.originalText)])),y.set(_,P),_}return M},!0)});let S=`10px ${Hu({fontFamily:h})}`,T=Array.from(v.values()).join();if(x||window.document.fonts.check(S,T))for(let[M,_]of y)Fr(M,_,r.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(S,T).then(M=>{for(let[_,R]of y){let P=r.scene.getElement(_.id),j=R?r.scene.getElement(R.id):null;P&&Fr(P,j,r.scene.getNonDeletedElementsMap(),!1)}r.fonts.onLoaded(M)})}return g},PanelComponent:({elements:e,appState:t,app:n,updateData:r})=>{let i=I.useRef(new Map),a=I.useRef(null),[s,o]=I.useState({}),c=I.useRef(!0),d=I.useMemo(()=>{var h;let l=(f,g)=>$r(f,t,U=>{if(ke(U))return U.fontFamily;let y=ct(U,g);return y?y.fontFamily:null},U=>ke(U)||ct(U,g)!==null,U=>U?null:t.currentItemFontFamily||Xl);return s.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?l(Array.from(((h=i.current)==null?void 0:h.values())??[]),i.current):!s.openPopup&&t.openPopup!=="fontFamily"?l(e,n.scene.getNonDeletedElementsMap()):a.current},[s.openPopup,t,e,n.scene]);return I.useEffect(()=>{a.current=d},[d]),I.useEffect(()=>{Object.keys(s).length&&(r(s),o({}))},[s]),I.useEffect(()=>(c.current=!1,()=>{c.current=!0}),[]),m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.fontFamily")}),m.jsx(Nce,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:d,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:l=>{o({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:l}),i.current.clear()},onHover:l=>{o({currentHoveredFontFamily:l,cachedElements:new Map(i.current),resetContainers:!0})},onLeave:()=>{o({currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0})},onPopupChange:l=>{if(l){i.current.clear();let{editingTextElement:h}=t;if((h==null?void 0:h.type)==="text"){let f=n.scene.getElement(h.id);i.current.set(h.id,lt(f||h,{},!0))}else{let f=ut(e,t,{includeBoundTextElement:!0});for(let g of f)i.current.set(g.id,lt(g,{},!0))}o({openPopup:"fontFamily"})}else{let h={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0};c.current?r({...s,...h}):o(h),i.current.clear()}}})]})}});we({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,n,r)=>({elements:Br(e,t,i=>{if(ke(i)){let a=lt(i,{textAlign:n});return Fr(a,r.scene.getContainerElement(i),r.scene.getNonDeletedElementsMap()),a}return i},!0),appState:{...t,currentItemTextAlign:n},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let i=r.scene.getNonDeletedElementsMap();return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.textAlign")}),m.jsx(Ts,{group:"text-align",options:[{value:"left",text:D("labels.left"),icon:TG,testId:"align-left"},{value:"center",text:D("labels.center"),icon:MG,testId:"align-horizontal-center"},{value:"right",text:D("labels.right"),icon:IG,testId:"align-right"}],value:$r(e,t,a=>{if(ke(a))return a.textAlign;let s=ct(a,i);return s?s.textAlign:null},a=>ke(a)||ct(a,i)!==null,a=>a?null:t.currentItemTextAlign),onChange:a=>n(a)})]})}});we({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:Br(e,t,i=>{if(ke(i)){let a=lt(i,{verticalAlign:n});return Fr(a,r.scene.getContainerElement(i),r.scene.getNonDeletedElementsMap()),a}return i},!0),appState:{...t},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx("fieldset",{children:m.jsx(Ts,{group:"text-align",options:[{value:yi.TOP,text:D("labels.alignTop"),icon:m.jsx(AG,{theme:t.theme}),testId:"align-top"},{value:yi.MIDDLE,text:D("labels.centerVertically"),icon:m.jsx(RG,{theme:t.theme}),testId:"align-middle"},{value:yi.BOTTOM,text:D("labels.alignBottom"),icon:m.jsx(LG,{theme:t.theme}),testId:"align-bottom"}],value:$r(e,t,i=>{if(ke(i)&&i.containerId)return i.verticalAlign;let a=ct(i,r.scene.getNonDeletedElementsMap());return a?a.verticalAlign:null},i=>ke(i)||ct(i,r.scene.getNonDeletedElementsMap())!==null,i=>i?null:yi.MIDDLE),onChange:i=>n(i)})})});we({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,n)=>({elements:Br(e,t,r=>Ie(r)?r:lt(r,{roundness:n==="round"?{type:vh(r.type)?Bn.ADAPTIVE_RADIUS:Bn.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:n},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=gL(Gt(e),t).some(i=>{var a;return((a=i.roundness)==null?void 0:a.type)===Bn.LEGACY});return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.edges")}),m.jsx(Ts,{group:"edges",options:[{value:"sharp",text:D("labels.sharp"),icon:cG},{value:"round",text:D("labels.round"),icon:dG}],value:$r(e,t,i=>r?null:i.roundness?"round":"sharp",i=>!ht(i)&&i.hasOwnProperty("roundness"),i=>i?null:t.currentItemRoundness),onChange:i=>n(i)})]})}});var c_=e=>[{value:null,text:D("labels.arrowhead_none"),keyBinding:"q",icon:uG},{value:"arrow",text:D("labels.arrowhead_arrow"),keyBinding:"w",icon:m.jsx(hG,{flip:e})},{value:"triangle",text:D("labels.arrowhead_triangle"),icon:m.jsx(gG,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:D("labels.arrowhead_triangle_outline"),icon:m.jsx(UG,{flip:e}),keyBinding:"r"},{value:"circle",text:D("labels.arrowhead_circle"),keyBinding:"a",icon:m.jsx(fG,{flip:e})},{value:"circle_outline",text:D("labels.arrowhead_circle_outline"),keyBinding:"s",icon:m.jsx(pG,{flip:e})},{value:"diamond",text:D("labels.arrowhead_diamond"),icon:m.jsx(bG,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:D("labels.arrowhead_diamond_outline"),icon:m.jsx(yG,{flip:e}),keyBinding:"f"},{value:"bar",text:D("labels.arrowhead_bar"),keyBinding:"z",icon:m.jsx(mG,{flip:e})},{value:"crowfoot_one",text:D("labels.arrowhead_crowfoot_one"),icon:m.jsx(xG,{flip:e}),keyBinding:"c"},{value:"crowfoot_many",text:D("labels.arrowhead_crowfoot_many"),icon:m.jsx(vG,{flip:e}),keyBinding:"x"},{value:"crowfoot_one_or_many",text:D("labels.arrowhead_crowfoot_one_or_many"),icon:m.jsx(wG,{flip:e}),keyBinding:"v"}];we({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,n)=>({elements:Br(e,t,r=>{if(rt(r)){let{position:i,type:a}=n;if(i==="start")return lt(r,{startArrowhead:a});if(i==="end")return lt(r,{endArrowhead:a})}return r}),appState:{...t,[n.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type},captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=c1().rtl;return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.arrowheads")}),m.jsxs("div",{className:"iconSelectList buttonList",children:[m.jsx(s_,{label:"arrowhead_start",options:c_(!r),value:$r(e,t,i=>rt(i)&&n2(i.type)?i.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:i=>n({position:"start",type:i}),numberOfOptionsToAlwaysShow:4}),m.jsx(s_,{label:"arrowhead_end",group:"arrowheads",options:c_(!!r),value:$r(e,t,i=>rt(i)&&n2(i.type)?i.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:i=>n({position:"end",type:i}),numberOfOptionsToAlwaysShow:4})]})]})}});we({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,n,r)=>{var o;let i=Br(e,t,c=>{if(!ht(c))return c;let d=lt(c,{roundness:n===ir.round?{type:Bn.PROPORTIONAL_RADIUS}:null,elbowed:n===ir.elbow,points:n===ir.elbow||c.elbowed?[c.points[0],c.points[c.points.length-1]]:c.points});if(Ie(d)){let l=r.scene.getNonDeletedElementsMap();r.dismissLinearEditor();let h=Me.getPointAtIndexGlobalCoordinates(d,0,l),f=Me.getPointAtIndexGlobalCoordinates(d,-1,l),g=!d.startBinding&&Ca(wa(h),e,l,t.zoom,!1,!0),U=!d.endBinding&&Ca(wa(f),e,l,t.zoom,!1,!0),y=g||d.startBinding&&l.get(d.startBinding.elementId),v=U||d.endBinding&&l.get(d.endBinding.elementId),x=g?Qp(d,g,"start"):h,w=U?Qp(d,U,"end"):f;g&&bs(d,g,"start",l),U&&bs(d,U,"end",l),he(d,{points:[x,w].map(C=>A(C[0]-d.x,C[1]-d.y)),...y&&d.startBinding?{startBinding:{...d.startBinding,...a2(d,y,"start")}}:{},...v&&d.endBinding?{endBinding:{...d.endBinding,...a2(d,v,"end")}}:{}}),Me.updateEditorMidPointsCache(d,l,r.state)}return d}),a={...t,currentItemArrowType:n},s=(o=t.selectedLinearElement)==null?void 0:o.elementId;if(s){let c=i.find(d=>d.id===s);c&&(a.selectedLinearElement=new Me(c))}return{elements:i,appState:a,captureUpdate:se.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.arrowtypes")}),m.jsx(Ts,{group:"arrowtypes",options:[{value:ir.sharp,text:D("labels.arrowtype_sharp"),icon:aq,testId:"sharp-arrow"},{value:ir.round,text:D("labels.arrowtype_round"),icon:oq,testId:"round-arrow"},{value:ir.elbow,text:D("labels.arrowtype_elbowed"),icon:sq,testId:"elbow-arrow"}],value:$r(e,t,r=>ht(r)?r.elbowed?ir.elbow:r.roundness?ir.round:ir.sharp:null,r=>ht(r),r=>r?null:t.currentItemArrowType),onChange:r=>n(r)})]})});var Nc=({viewportX:e,viewportY:t,nextZoom:n},r)=>{let i=e-r.offsetLeft,a=t-r.offsetTop,s=r.zoom.value,o=r.scrollX+(i-i/s),c=r.scrollY+(a-a/s),d=-(i-i/n),l=-(a-a/n);return{scrollX:o+d,scrollY:c+l,zoom:{value:n}}},Sp=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},vj=(e,t,n="bottom")=>{let r=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,s=5,o=t.left+t.width/2-r.width/2;o<0?o=s:o+r.width>=i&&(o=i-r.width-s);let c;n==="bottom"?(c=t.top+t.height+s,c+r.height>=a&&(c=t.top-r.height-s)):(c=t.top-r.height-s,c<0&&(c=t.top+t.height+s)),Object.assign(e.style,{top:`${c}px`,left:`${o}px`})},Bce=(e,t,n,r)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;let i=e.getBoundingClientRect();vj(t,i)},dd=({children:e,label:t,long:n=!1,style:r,disabled:i})=>(I.useEffect(()=>()=>Sp().classList.remove("excalidraw-tooltip--visible"),[]),i?null:m.jsx("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>Bce(a.currentTarget,Sp(),t,n),onPointerLeave:()=>Sp().classList.remove("excalidraw-tooltip--visible"),style:r,children:e}));we({name:"changeViewBackgroundColor",label:"labels.canvasBackground",paletteName:"Change canvas background color",trackEvent:!1,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,n)=>({appState:{...t,...n},captureUpdate:n.viewBackgroundColor?se.IMMEDIATELY:se.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>m.jsx(Cv,{palette:null,topPicks:FM,label:D("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:i=>n({viewBackgroundColor:i}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:n})});var _p=we({name:"clearCanvas",label:"labels.clearCanvas",paletteName:"Clear canvas",icon:rd,trackEvent:{category:"canvas"},predicate:(e,t,n,r)=>{var i;return!!r.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&((i=t.openDialog)==null?void 0:i.name)!=="elementLinkSelector"},perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map(i=>lt(i,{isDeleted:!0})),appState:{...Us(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:"selection"}:t.activeTool},captureUpdate:se.IMMEDIATELY})}),d_=we({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:jE,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...Nc({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:lo(t.zoom.value+sU)},t),userToFollow:null},captureUpdate:se.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>m.jsx(wt,{type:"button",className:"zoom-in-button zoom-button",icon:jE,title:`${D("buttons.zoomIn")} — ${ue("CtrlOrCmd++")}`,"aria-label":D("buttons.zoomIn"),disabled:t.zoom.value>=q8,onClick:()=>{e(null)}}),keyTest:e=>(e.code===_t.EQUAL||e.code===_t.NUM_ADD)&&(e[q.CTRL_OR_CMD]||e.shiftKey)}),u_=we({name:"zoomOut",label:"buttons.zoomOut",icon:PE,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...Nc({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:lo(t.zoom.value-sU)},t),userToFollow:null},captureUpdate:se.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>m.jsx(wt,{type:"button",className:"zoom-out-button zoom-button",icon:PE,title:`${D("buttons.zoomOut")} — ${ue("CtrlOrCmd+-")}`,"aria-label":D("buttons.zoomOut"),disabled:t.zoom.value<=G8,onClick:()=>{e(null)}}),keyTest:e=>(e.code===_t.MINUS||e.code===_t.NUM_SUBTRACT)&&(e[q.CTRL_OR_CMD]||e.shiftKey)}),h_=we({name:"resetZoom",label:"buttons.resetZoom",icon:OY,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...Nc({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:lo(1)},t),userToFollow:null},captureUpdate:se.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>m.jsx(dd,{label:D("buttons.resetZoom"),style:{height:"100%"},children:m.jsxs(wt,{type:"button",className:"reset-zoom-button zoom-button",title:D("buttons.resetZoom"),"aria-label":D("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===_t.ZERO||e.code===_t.NUM_ZERO)&&(e[q.CTRL_OR_CMD]||e.shiftKey)}),$ce=(e,t,n=1)=>{let[r,i,a,s]=e,o=a-r,c=t.width/o,d=s-i,l=t.height/d,h=Math.min(c,l)*mt(n,.1,1);return Math.min(h,1)},zce=({bounds:e,appState:t,canvasOffsets:n,fitToViewport:r=!1,viewportZoomFactor:i=1,minZoom:a=-1/0,maxZoom:s=1/0})=>{i=mt(i,G8,q8);let[o,c,d,l]=e,h=(o+d)/2,f=(c+l)/2,g=(n==null?void 0:n.left)??0,U=(n==null?void 0:n.top)??0,y=(n==null?void 0:n.right)??0,v=(n==null?void 0:n.bottom)??0,x=t.width-g-y,w=t.height-U-v,C;if(r){let M=d-o,_=l-c;C=Math.min(x/M,w/_)*i}else C=$ce(e,{width:x,height:w},i);let S=lo(mt(kV(C,sU,"floor"),a,s)),T=gA({scenePoint:{x:h,y:f},viewportDimensions:{width:t.width,height:t.height},offsets:n,zoom:{value:S}});return{appState:{...t,scrollX:T.scrollX,scrollY:T.scrollY,zoom:{value:S}},captureUpdate:se.EVENTUALLY}},VU=({canvasOffsets:e,targetElements:t,appState:n,fitToViewport:r,viewportZoomFactor:i,minZoom:a,maxZoom:s})=>{let o=Nt(Gt(t));return zce({canvasOffsets:e,bounds:o,appState:n,fitToViewport:r,viewportZoomFactor:i,minZoom:a,maxZoom:s})};we({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:u7,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return VU({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===_t.TWO&&e.shiftKey&&!e.altKey&&!e[q.CTRL_OR_CMD]});we({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:u7,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return VU({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===_t.THREE&&e.shiftKey&&!e.altKey&&!e[q.CTRL_OR_CMD]});we({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:u7,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>VU({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()}),keyTest:e=>e.code===_t.ONE&&e.shiftKey&&!e.altKey&&!e[q.CTRL_OR_CMD]});var C2=we({name:"toggleTheme",label:(e,t)=>t.theme===yt.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:e=>e.theme===yt.LIGHT?h3:f3,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n)=>({appState:{...t,theme:n||(t.theme===yt.LIGHT?yt.DARK:yt.LIGHT)},captureUpdate:se.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===_t.D,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.toggleTheme});we({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{let n;return ts(t)?n=Ln(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):n=Ln(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:n},captureUpdate:se.IMMEDIATELY}},keyTest:e=>e.key===q.E});var Hce=we({name:"toggleHandTool",label:"toolBar.hand",paletteName:"Toggle hand tool",trackEvent:{category:"toolbar"},icon:EI,viewMode:!1,perform:(e,t,n,r)=>{let i;return zu(t)?i=Ln(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(i=Ln(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),Bt(r.interactiveCanvas,Ot.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:i},captureUpdate:se.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[q.CTRL_OR_CMD]&&e.key===q.H}),fa=we({name:"finalize",label:"",trackEvent:!1,perform:(e,t,n,r)=>{var f;let{interactiveCanvas:i,focusContainer:a,scene:s}=r,o=s.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:g,startBindingElement:U,endBindingElement:y}=t.editingLinearElement,v=Me.getElement(g,o);if(v)return ls(v)&&bU(v,U,y,o,s),{elements:v.points.length<2||th(v)?e.filter(x=>x.id!==v.id):void 0,appState:{...t,cursorButton:"up",editingLinearElement:null},captureUpdate:se.IMMEDIATELY}}let c=e,d=t.pendingImageElementId&&s.getElement(t.pendingImageElementId);d&&he(d,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();let l=t.multiElement?t.multiElement:((f=t.newElement)==null?void 0:f.type)==="freedraw"?t.newElement:null;if(l){if(l.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:U,lastCommittedPoint:y}=l;(!y||U[U.length-1]!==y)&&he(l,{points:l.points.slice(0,-1)})}th(l)&&(c=c.filter(U=>U.id!==l.id));let g=Uo(l.points,t.zoom.value);if((l.type==="line"||l.type==="freedraw")&&g){let U=l.points,y=U[0];he(l,{points:U.map((v,x)=>x===U.length-1?A(y[0],y[1]):v)})}if(ls(l)&&!g&&l.points.length>1){let[U,y]=Me.getPointAtIndexGlobalCoordinates(l,-1,Qe(e));w3(l,t,{x:U,y},o,e)}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!l)&&ma(i);let h;return t.activeTool.type==="eraser"?h=Ln(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):h=Ln(t,{type:"selection"}),{elements:c,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&l?t.activeTool:h,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[l.id]:!0}:t.selectedElementIds,selectedLinearElement:l&&rt(l)?new Me(l):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:se.IMMEDIATELY}},keyTest:(e,t)=>e.key===q.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===q.ESCAPE||e.key===q.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:n})=>m.jsx(wt,{type:"button",icon:GY,title:D("buttons.done"),"aria-label":D("buttons.done"),onClick:t,visible:e.multiElement!=null,size:(n==null?void 0:n.size)||"medium",style:{pointerEvents:"all"}})}),Wce=e=>{let{id:t}=Is(),[n,r]=I.useState(e.value),i=s=>{e.ignoreFocus||GV(s.target);let o=s.target.value;o!==e.value&&e.onChange(o)},a=s=>{if(s.key===q.ENTER){if(s.preventDefault(),s.nativeEvent.isComposing||s.keyCode===229)return;s.currentTarget.blur()}};return m.jsxs("div",{className:"ProjectName",children:[m.jsx("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),m.jsx("input",{type:"text",className:"TextInput",onBlur:i,onKeyDown:a,id:`${t}-filename`,value:n,onChange:s=>r(s.target.value)})]})},Xce=e=>{let t=e.title||(e.value===yt.DARK?D("buttons.lightMode"):D("buttons.darkMode"));return m.jsx(wt,{type:"icon",icon:e.value===yt.LIGHT?f_.MOON:f_.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===yt.DARK?yt.LIGHT:yt.DARK),"data-testid":"toggle-dark-mode"})},f_={SUN:m.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:m.jsx("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:m.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:m.jsx("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},YU=(e,{selectedElementIds:t},n)=>{e=Gt(e);let r=n&&$n(e,{selectedElementIds:t}),i=null,a=r?ut(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return r&&(a.length===1&&Ke(a[0])?(i=a[0],a=V7(e,i)):a.length>1&&(a=ut(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:i,exportedElements:co(a)}},GU=async(e,t,n,r,{exportBackground:i,exportPadding:a=bh,viewBackgroundColor:s,name:o=n.name||VM,fileHandle:c=null,exportingFrame:d=null})=>{if(t.length===0)throw new Error(D("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let h=T7(t,{exportBackground:i,exportWithDarkMode:n.exportWithDarkMode,viewBackgroundColor:s,exportPadding:a,exportScale:n.exportScale,exportEmbedScene:n.exportEmbedScene&&e==="svg"},r,{exportingFrame:d});if(e==="svg")return d2(h.then(f=>new Blob([f.outerHTML],{type:Be.svg})),{description:"Export to SVG",name:o,extension:n.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[$u.svg],fileHandle:c});if(e==="clipboard-svg"){let f=await h.then(g=>g.outerHTML);try{await P1(f)}catch{throw new Error(D("errors.copyToSystemClipboardFailed"))}return}}let l=nL(t,n,r,{exportBackground:i,viewBackgroundColor:s,exportPadding:a,exportingFrame:d});if(e==="png"){let h=s1(l);return n.exportEmbedScene&&(h=h.then(f=>ge(async()=>{const{encodePngMetadata:g}=await Promise.resolve().then(()=>kF);return{encodePngMetadata:g}},void 0,import.meta.url).then(({encodePngMetadata:g})=>g({blob:f,metadata:_U(t,n,r)})))),d2(h,{description:"Export to PNG",name:o,extension:n.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[$u.png],fileHandle:c})}else if(e==="clipboard")try{let h=s1(l);await are(h)}catch(h){throw console.warn(h),h.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(D("canvasError.canvasTooBig")):Xp&&h.name==="TypeError"?new Error(`${D("alerts.couldNotCopyToClipboard")}
|
|
149
|
+
|
|
150
|
+
${D("hints.firefox_clipboard_write")}`):new Error(D("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},Vce=async(e,t,n,r)=>{let{exportBackground:i,viewBackgroundColor:a,fileHandle:s}=t,o=SL(s);if(!s||!Hre(o))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:c,exportingFrame:d}=YU(e,t,!1);return await GU(o,c,t,n,{exportBackground:i,viewBackgroundColor:a,name:r,fileHandle:s,exportingFrame:d}),{fileHandle:s}},Tv=({children:e,checked:t,onChange:n,className:r})=>m.jsxs("div",{className:De("Checkbox",r,{"is-checked":t}),onClick:i=>{n(!t,i),i.currentTarget.querySelector(".Checkbox-box").focus()},children:[m.jsx("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:HY}),m.jsx("div",{className:"Checkbox-label",children:e})]}),Yce=we({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,n)=>({appState:{...t,name:n},captureUpdate:se.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:n,data:r,app:i})=>m.jsx(Wce,{label:D("labels.fileTitle"),value:i.getName(),onChange:a=>t(a),ignoreFocus:(r==null?void 0:r.ignoreFocus)??!1})}),Gce=we({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,n)=>({appState:{...t,exportScale:n},captureUpdate:se.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=Gt(e),i=$n(r,t)?ut(r,t):r;return m.jsx(m.Fragment,{children:K8.map(a=>{let[s,o]=wne(i,bh,a),c=`${D("imageExportDialog.label.scale")} ${a}x (${s}x${o})`;return m.jsx(wt,{size:"small",type:"radio",icon:`${a}x`,name:"export-canvas-scale",title:c,"aria-label":c,id:"export-canvas-scale",checked:a===t.exportScale,onChange:()=>n(a)},a)})})}}),qce=we({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,n)=>({appState:{...t,exportBackground:n},captureUpdate:se.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsx(Tv,{checked:e.exportBackground,onChange:n=>t(n),children:D("imageExportDialog.label.withBackground")})}),xj=we({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,n)=>({appState:{...t,exportEmbedScene:n},captureUpdate:se.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsxs(Tv,{checked:e.exportEmbedScene,onChange:n=>t(n),children:[D("imageExportDialog.label.embedScene"),m.jsx(dd,{label:D("imageExportDialog.tooltip.embedScene"),long:!0,children:m.jsx("div",{className:"excalidraw-tooltip-icon",children:qY})})]})}),p_=we({name:"saveToActiveFile",label:"buttons.save",icon:hU,trackEvent:{category:"export"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{let i=!!t.fileHandle;try{let{fileHandle:a}=ev(t.fileHandle)?await Vce(e,t,r.files,r.getName()):await BA(e,t,r.files,r.getName());return{captureUpdate:se.EVENTUALLY,appState:{...t,fileHandle:a,toast:i?{message:a!=null&&a.name?D("toast.fileSavedToFilename").replace("{filename}",`"${a.name}"`):D("toast.fileSaved")}:null}}}catch(a){return(a==null?void 0:a.name)!=="AbortError"?console.error(a):console.warn(a),{captureUpdate:se.EVENTUALLY}}},keyTest:e=>e.key===q.S&&e[q.CTRL_OR_CMD]&&!e.shiftKey}),wj=we({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:hU,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,n,r)=>{try{let{fileHandle:i}=await BA(e,{...t,fileHandle:null},r.files,r.getName());return{captureUpdate:se.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:i,toast:{message:D("toast.fileSaved")}}}}catch(i){return(i==null?void 0:i.name)!=="AbortError"?console.error(i):console.warn(i),{captureUpdate:se.EVENTUALLY}}},keyTest:e=>e.key===q.S&&e.shiftKey&&e[q.CTRL_OR_CMD],PanelComponent:({updateData:e})=>m.jsx(wt,{type:"button",icon:XY,title:D("buttons.saveAs"),"aria-label":D("buttons.saveAs"),showAriaLabel:Zn().editor.isMobile,hidden:!md,onClick:()=>e(null),"data-testid":"save-as-button"})}),n8=we({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{try{let{elements:i,appState:a,files:s}=await hne(t,e);return{elements:i,appState:a,files:s,captureUpdate:se.IMMEDIATELY}}catch(i){return(i==null?void 0:i.name)==="AbortError"?(console.warn(i),!1):{elements:e,appState:{...t,errorMessage:i.message},files:r.files,captureUpdate:se.EVENTUALLY}}},keyTest:e=>e[q.CTRL_OR_CMD]&&e.key===q.O}),Zce=we({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,n)=>({appState:{...t,exportWithDarkMode:n},captureUpdate:se.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:m.jsx(Xce,{value:e.exportWithDarkMode?yt.DARK:yt.LIGHT,onChange:n=>{t(n===yt.DARK)},title:D("imageExportDialog.label.darkMode")})})}),Ej="{}",Kce=we({name:"copyStyles",label:"labels.copyStyles",icon:MI,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=[],a=e.find(s=>t.selectedElementIds[s.id]);if(i.push(a),a&&Ki(a)){let s=ct(a,r.scene.getNonDeletedElementsMap());i.push(s)}return a&&(Ej=JSON.stringify(i)),{appState:{...t,toast:{message:D("toast.copyStyles")}},captureUpdate:se.EVENTUALLY}},keyTest:e=>e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.C}),Qce=we({name:"pasteStyles",label:"labels.pasteStyles",icon:MI,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=JSON.parse(Ej),a=i[0],s=i[1];if(!lI(a))return{elements:e,captureUpdate:se.EVENTUALLY};let o=ut(e,t,{includeBoundTextElement:!0}),c=o.map(d=>d.id);return{elements:e.map(d=>{if(c.includes(d.id)){let l=a;if(ke(d)&&d.containerId&&(l=s),!l)return d;let h=lt(d,{backgroundColor:l==null?void 0:l.backgroundColor,strokeWidth:l==null?void 0:l.strokeWidth,strokeColor:l==null?void 0:l.strokeColor,strokeStyle:l==null?void 0:l.strokeStyle,fillStyle:l==null?void 0:l.fillStyle,opacity:l==null?void 0:l.opacity,roughness:l==null?void 0:l.roughness,roundness:l.roundness?aY(l.roundness.type,d)?l.roundness:sY(d):null});if(ke(h)){let f=l.fontSize||Mo,g=l.fontFamily||Xl;h=lt(h,{fontSize:f,fontFamily:g,textAlign:l.textAlign||T1,lineHeight:l.lineHeight||ad(g)});let U=null;h.containerId&&(U=o.find(y=>ke(h)&&y.id===h.containerId)||null),Fr(h,U,r.scene.getNonDeletedElementsMap())}return h.type==="arrow"&&ht(l)&&(h=lt(h,{startArrowhead:l.startArrowhead,endArrowhead:l.endArrowhead})),Ke(d)&&(h=lt(h,{roundness:null,backgroundColor:"transparent"})),h}return d}),captureUpdate:se.IMMEDIATELY}},keyTest:e=>e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.V});we({name:"toggleCanvasMenu",label:"buttons.menu",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="canvas"?null:"canvas"},captureUpdate:se.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsx(wt,{type:"button",icon:mI,"aria-label":D("buttons.menu"),onClick:t,selected:e.openMenu==="canvas"})});we({name:"toggleEditMenu",label:"buttons.edit",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="shape"?null:"shape"},captureUpdate:se.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(wt,{visible:J7(t,Gt(e)),type:"button",icon:VY,"aria-label":D("buttons.edit"),onClick:n,selected:t.openMenu==="shape"})});var Mv=we({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:BY,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,n,{focusContainer:r})=>{var i,a;return((i=t.openDialog)==null?void 0:i.name)==="help"&&r(),{appState:{...t,openDialog:((a=t.openDialog)==null?void 0:a.name)==="help"?null:{name:"help"}},captureUpdate:se.EVENTUALLY}},keyTest:e=>e.key===q.QUESTION_MARK}),Jce=e=>{if(e.length>=2){let t=e[0].groupIds;for(let n of t)if(e.reduce((r,i)=>r&&t1(i,n),!0))return!0}return!1},m_=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return r.length>=2&&!Jce(r)&&!pL(r)},ede=we({name:"group",label:"labels.group",icon:e=>m.jsx(ZE,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=X7(r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(i.length<2)return{appState:t,elements:e,captureUpdate:se.EVENTUALLY};let a=Hc(t);if(a.length===1){let y=a[0],v=new Set(en(e,y).map(w=>w.id)),x=new Set(i.map(w=>w.id));if(new Set([...Array.from(v),...Array.from(x)]).size===v.size)return{appState:t,elements:e,captureUpdate:se.EVENTUALLY}}let s=[...e];new Set(i.map(y=>y.frameId)).size>1&&gre(i).forEach((y,v)=>{IU(y,r.scene.getNonDeletedElementsMap())});let o=Qi(),c=Qe(i);s=s.map(y=>c.get(y.id)?lt(y,{groupIds:bte(y.groupIds,o,t.editingGroupId)}):y);let d=en(s,o),l=d[d.length-1],h=s.lastIndexOf(l),f=s.slice(h+1),g=s.slice(0,h).filter(y=>!t1(y,o)),U=xs([...g,...d,...f],Qe(d));return{appState:{...t,...bA(o,{...t,selectedGroupIds:{}},Gt(s))},elements:U,captureUpdate:se.IMMEDIATELY}},predicate:(e,t,n,r)=>m_(e,t,r),keyTest:e=>!e.shiftKey&&e[q.CTRL_OR_CMD]&&e.key===q.G,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!m_(e,t,r),type:"button",icon:m.jsx(ZE,{theme:t.theme}),onClick:()=>n(null),title:`${D("labels.group")} — ${ue("CtrlOrCmd+G")}`,"aria-label":D("labels.group"),visible:$n(Gt(e),t)})}),tde=we({name:"ungroup",label:"labels.ungroup",icon:e=>m.jsx(KE,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=Hc(t),a=Qe(e);if(i.length===0)return{appState:t,elements:e,captureUpdate:se.EVENTUALLY};let s=[...e],o=[];s=s.map(h=>{tn(h)&&o.push(h.id);let f=yte(h.groupIds,t.selectedGroupIds);return f.length===h.groupIds.length?h:lt(h,{groupIds:f})});let c=Pr(t,Gt(s),t,null),d=r.scene.getSelectedElements(t),l=new Set(d.filter(h=>h.frameId).map(h=>h.frameId));return W7(e).filter(h=>l.has(h.id)).forEach(h=>{h&&(s=hL(s,fg(s,h,t,a),h,r))}),c.selectedElementIds=Object.entries(c.selectedElementIds).reduce((h,[f,g])=>(g&&!o.includes(f)&&(h[f]=!0),h),{}),{appState:{...t,...c},elements:s,captureUpdate:se.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[q.CTRL_OR_CMD]&&e.key===q.G.toUpperCase(),predicate:(e,t)=>Hc(t).length>0,PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(wt,{type:"button",hidden:Hc(t).length===0,icon:m.jsx(KE,{theme:t.theme}),onClick:()=>n(null),title:`${D("labels.ungroup")} — ${ue("CtrlOrCmd+Shift+G")}`,"aria-label":D("labels.ungroup"),visible:$n(Gt(e),t)})}),Cj=(e,t,n,r,i,a,s)=>{e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill(),s&&(e.strokeStyle=s),e.stroke()};function nde(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r}return t}var qU=(e,t)=>`hsl(${Math.abs(nde((t==null?void 0:t.id)||e))%37*10}, 100%, 83%)`,rde=e=>{var n;let t=(n=e==null?void 0:e.trim())==null?void 0:n.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},ide=({context:e,renderConfig:t,appState:n,normalizedWidth:r,normalizedHeight:i})=>{for(let[a,s]of t.remotePointerViewportCoords){let{x:o,y:c}=s,d=n.collaborators.get(a);o-=n.offsetLeft,c-=n.offsetTop;let l=11,h=14,f=o<0||o>r-l||c<0||c>i-h;o=Math.max(o,0),o=Math.min(o,r-l),c=Math.max(c,0),c=Math.min(c,i-h);let g=qU(a,d);e.save(),e.strokeStyle=g,e.fillStyle=g;let U=t.remotePointerUserStates.get(a),y=f||U==="idle"||U==="away";y&&(e.globalAlpha=.3),t.remotePointerButton.get(a)==="down"&&(e.beginPath(),e.arc(o,c,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(o,c,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=g,e.stroke(),e.closePath());let v=n.theme===yt.DARK?"#2f6330":sV,x=d==null?void 0:d.isSpeaking;x&&(e.fillStyle=v,e.strokeStyle=v,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(o,c),e.lineTo(o+0,c+14),e.lineTo(o+4,c+9),e.lineTo(o+11,c+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=gm,e.strokeStyle=gm,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(o,c),e.lineTo(o+0,c+14),e.lineTo(o+4,c+9),e.lineTo(o+11,c+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=g,e.strokeStyle=g,e.lineWidth=2,e.lineJoin="round",e.beginPath(),y?(e.moveTo(o-1,c-1),e.lineTo(o-1,c+15),e.lineTo(o+5,c+10),e.lineTo(o+12,c+9),e.closePath(),e.fill()):(e.moveTo(o,c),e.lineTo(o+0,c+14),e.lineTo(o+4,c+9),e.lineTo(o+11,c+8),e.closePath(),e.fill(),e.stroke());let w=t.remotePointerUsernames.get(a)||"";if(!f&&w){e.font="600 12px sans-serif";let C=(x?o+0:o)+l/2,S=(x?c+0:c)+h+2,T=5,M=3,_=e.measureText(w),R=_.actualBoundingBoxDescent+_.actualBoundingBoxAscent,P=Math.max(R,12),j=C-1,N=S-1,F=_.width+2+T*2+2,B=P+2+M*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(j,N,F,B,8),e.fillStyle=g,e.fill(),e.strokeStyle=gm,e.stroke(),x&&(e.beginPath(),e.roundRect(j-2,N-2,F+4,B+4,8),e.strokeStyle=v,e.stroke())):Cj(e,j,N,F,B,8,gm),e.fillStyle=aV,e.fillText(w,C+T+1,S+M+_.actualBoundingBoxAscent+Math.floor((P-R)/2)+2),x){e.fillStyle=v;let G=8,W=8,X=5;e.fillRect(j+F+W,N+(B/2-G/2),2,G),e.fillRect(j+F+W+X,N+(B/2-G*2/2),2,G*2),e.fillRect(j+F+W+X*2,N+(B/2-G/2),2,G)}}e.restore(),e.closePath()}},g_=({color:e,onClick:t,name:n,src:r,className:i})=>{let a=rde(n),[s,o]=I.useState(!1),c=!s&&r,d=c?void 0:{background:e};return m.jsx("div",{className:De("Avatar",i),style:d,onClick:t,children:c?m.jsx("img",{className:"Avatar-img",src:r,alt:a,referrerPolicy:"no-referrer",onError:()=>o(!0)}):a})};we({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,n)=>{var r;return!n.socketId||((r=t.userToFollow)==null?void 0:r.socketId)===n.socketId||n.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:se.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:n.socketId,username:n.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:se.EVENTUALLY}},PanelComponent:({updateData:e,data:t,appState:n})=>{let{socketId:r,collaborator:i,withName:a,isBeingFollowed:s}=t,o=qU(r,i),c=De({"is-followed":s,"is-current-user":i.isCurrentUser===!0,"is-speaking":i.isSpeaking,"is-in-call":i.isInCall,"is-muted":i.isMuted}),d=i.isInCall?i.isSpeaking?m.jsxs("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:D("userList.hint.isSpeaking"),children:[m.jsx("div",{}),m.jsx("div",{}),m.jsx("div",{})]}):i.isMuted?m.jsx("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:D("userList.hint.micMuted"),children:VG}):m.jsx("div",{title:D("userList.hint.inCall"),children:XG}):null;return a?m.jsxs("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${c}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(i),children:[m.jsx(g_,{color:o,onClick:()=>{},name:i.username||"",src:i.avatarUrl,className:c}),m.jsx("div",{className:"UserList__collaborator-name",children:i.username}),m.jsxs("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[s&&m.jsx("div",{className:"UserList__collaborator-status-icon-is-followed",title:D("userList.hint.followStatus"),children:d7}),d]})]}):m.jsxs("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${c}`,children:[m.jsx(g_,{color:o,onClick:()=>{e(i)},name:i.username||"",src:i.avatarUrl,className:c}),d&&m.jsx("div",{className:"UserList__collaborator-status-icon",children:d})]})}});var ade=we({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let a of XM)if(i.some(s=>s.type===a))return{captureUpdate:se.EVENTUALLY,appState:{...t,errorMessage:D(`errors.libraryElementTypeError.${a}`)}};return r.library.getLatestLibrary().then(a=>r.library.setLibrary([{id:Qi(),status:"unpublished",elements:i.map(Ud),created:Date.now()},...a])).then(()=>({captureUpdate:se.EVENTUALLY,appState:{...t,toast:{message:D("toast.addedToLibrary")}}})).catch(a=>({captureUpdate:se.EVENTUALLY,appState:{...t,errorMessage:a.message}}))},label:"labels.addToLibrary"}),sde=(e,t,n,r)=>{let i=wU(e,t),a=Ma(e);return i.flatMap(s=>{let o=ode(s,a,n);return s.map(c=>{let d=he(c,{x:c.x+o.x,y:c.y+o.y});return ci(c,r.getNonDeletedElementsMap(),{simultaneouslyUpdated:s}),d})})},ode=(e,t,{axis:n,position:r})=>{let i=Ma(e),[a,s]=n==="x"?["minX","maxX"]:["minY","maxY"],o={x:0,y:0};return r==="start"?{...o,[n]:t[a]-i[a]}:r==="end"?{...o,[n]:t[s]-i[s]}:{...o,[n]:(t[a]+t[s])/2-(i[a]+i[s])/2}},Ci=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(r=>Ke(r))},_h=(e,t,n,r)=>{let i=n.scene.getSelectedElements(t),a=Qe(e),s=sde(i,a,r,n.scene),o=Qe(s);return eh(e.map(c=>o.get(c.id)||c),t,n)};we({name:"alignTop",label:"labels.alignTop",icon:WE,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Ci(t,r),perform:(e,t,n,r)=>({appState:t,elements:_h(e,t,r,{position:"start",axis:"y"}),captureUpdate:se.IMMEDIATELY}),keyTest:e=>e[q.CTRL_OR_CMD]&&e.shiftKey&&e.key===q.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Ci(t,r),type:"button",icon:WE,onClick:()=>n(null),title:`${D("labels.alignTop")} — ${ue("CtrlOrCmd+Shift+Up")}`,"aria-label":D("labels.alignTop"),visible:$n(Gt(e),t)})});we({name:"alignBottom",label:"labels.alignBottom",icon:XE,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Ci(t,r),perform:(e,t,n,r)=>({appState:t,elements:_h(e,t,r,{position:"end",axis:"y"}),captureUpdate:se.IMMEDIATELY}),keyTest:e=>e[q.CTRL_OR_CMD]&&e.shiftKey&&e.key===q.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Ci(t,r),type:"button",icon:XE,onClick:()=>n(null),title:`${D("labels.alignBottom")} — ${ue("CtrlOrCmd+Shift+Down")}`,"aria-label":D("labels.alignBottom"),visible:$n(Gt(e),t)})});we({name:"alignLeft",label:"labels.alignLeft",icon:VE,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Ci(t,r),perform:(e,t,n,r)=>({appState:t,elements:_h(e,t,r,{position:"start",axis:"x"}),captureUpdate:se.IMMEDIATELY}),keyTest:e=>e[q.CTRL_OR_CMD]&&e.shiftKey&&e.key===q.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Ci(t,r),type:"button",icon:VE,onClick:()=>n(null),title:`${D("labels.alignLeft")} — ${ue("CtrlOrCmd+Shift+Left")}`,"aria-label":D("labels.alignLeft"),visible:$n(Gt(e),t)})});we({name:"alignRight",label:"labels.alignRight",icon:YE,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Ci(t,r),perform:(e,t,n,r)=>({appState:t,elements:_h(e,t,r,{position:"end",axis:"x"}),captureUpdate:se.IMMEDIATELY}),keyTest:e=>e[q.CTRL_OR_CMD]&&e.shiftKey&&e.key===q.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Ci(t,r),type:"button",icon:YE,onClick:()=>n(null),title:`${D("labels.alignRight")} — ${ue("CtrlOrCmd+Shift+Right")}`,"aria-label":D("labels.alignRight"),visible:$n(Gt(e),t)})});we({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:GE,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Ci(t,r),perform:(e,t,n,r)=>({appState:t,elements:_h(e,t,r,{position:"center",axis:"y"}),captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Ci(t,r),type:"button",icon:GE,onClick:()=>n(null),title:D("labels.centerVertically"),"aria-label":D("labels.centerVertically"),visible:$n(Gt(e),t)})});we({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:qE,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Ci(t,r),perform:(e,t,n,r)=>({appState:t,elements:_h(e,t,r,{position:"center",axis:"x"}),captureUpdate:se.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Ci(t,r),type:"button",icon:qE,onClick:()=>n(null),title:D("labels.centerHorizontally"),"aria-label":D("labels.centerHorizontally"),visible:$n(Gt(e),t)})});var lde=(e,t,n)=>{let[r,i,a,s]=n.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],o=Ma(e),c=wU(e,t).map(f=>[f,Ma(f)]).sort((f,g)=>f[1][i]-g[1][i]),d=0;for(let f of c)d+=f[1][s];let l=(o[s]-d)/(c.length-1);if(l<0){let f=c.findIndex(v=>v[1][r]===o[r]),g=c.findIndex(v=>v[1][a]===o[a]),U=(c[g][1][i]-c[f][1][i])/(c.length-1),y=c[f][1][i];return c.flatMap(([v,x],w)=>{let C={x:0,y:0};return w!==f&&w!==g&&(y+=U,C[n.axis]=y-x[i]),v.map(S=>lt(S,{x:S.x+C.x,y:S.y+C.y}))})}let h=o[r];return c.flatMap(([f,g])=>{let U={x:0,y:0};return U[n.axis]=h-g[r],h+=l,h+=g[s],f.map(y=>lt(y,{x:y.x+U.x,y:y.y+U.y}))})},Sj=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(r=>Ke(r))},_j=(e,t,n,r)=>{let i=n.scene.getSelectedElements(t),a=lde(i,n.scene.getNonDeletedElementsMap(),r),s=Qe(a);return eh(e.map(o=>s.get(o.id)||o),t,n)};we({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:_j(e,t,r,{axis:"x"}),captureUpdate:se.IMMEDIATELY}),keyTest:e=>!e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.H,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Sj(t,r),type:"button",icon:ZY,onClick:()=>n(null),title:`${D("labels.distributeHorizontally")} — ${ue("Alt+H")}`,"aria-label":D("labels.distributeHorizontally"),visible:$n(Gt(e),t)})});we({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:_j(e,t,r,{axis:"y"}),captureUpdate:se.IMMEDIATELY}),keyTest:e=>!e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.V,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(wt,{hidden:!Sj(t,r),type:"button",icon:KY,onClick:()=>n(null),title:`${D("labels.distributeVertically")} — ${ue("Alt+V")}`,"aria-label":D("labels.distributeVertically"),visible:$n(Gt(e),t)})});var cde=we({name:"flipHorizontal",label:"labels.flipHorizontal",icon:ZG,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:eh(kj(e,r.scene.getNonDeletedElementsMap(),t,"horizontal",r),t,r),appState:t,captureUpdate:se.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===_t.H}),dde=we({name:"flipVertical",label:"labels.flipVertical",icon:qG,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:eh(kj(e,r.scene.getNonDeletedElementsMap(),t,"vertical",r),t,r),appState:t,captureUpdate:se.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===_t.V&&!e[q.CTRL_OR_CMD]}),kj=(e,t,n,r,i)=>{let a=ut(Gt(e),n,{includeBoundTextElement:!0,includeElementsInFrames:!0}),s=ude(a,t,n,r,i),o=Qe(s);return e.map(c=>o.get(c.id)||c)},ude=(e,t,n,r,i)=>{if(e.every(g=>ht(g)&&(g.startBinding||g.endBinding)))return e.map(g=>{let U=g;return lt(U,{startArrowhead:U.endArrowhead,endArrowhead:U.startArrowhead})});let{midX:a,midY:s}=Ma(e);wL(e,t,"nw",i.scene,new Map(Array.from(t.values()).map(g=>[g.id,Ud(g)])),{flipByX:r==="horizontal",flipByY:r==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),i2(e.filter(rt),t,i.scene.getNonDeletedElements(),i.scene,jc(n),[],n.zoom);let{elbowArrows:o,otherElements:c}=e.reduce((g,U)=>Ie(U)?{...g,elbowArrows:g.elbowArrows.concat(U)}:{...g,otherElements:g.otherElements.concat(U)},{elbowArrows:[],otherElements:[]}),{midX:d,midY:l}=Ma(e),[h,f]=[a-d,s-l];return c.forEach(g=>he(g,{x:g.x+h,y:g.y+f})),o.forEach(g=>he(g,{x:g.x+h,y:g.y+f})),e},xg=we({name:"copy",label:"labels.copy",icon:u3,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await ere(i,r.files,n)}catch(a){return{captureUpdate:se.EVENTUALLY,appState:{...t,errorMessage:a.message}}}return{captureUpdate:se.EVENTUALLY}},keyTest:void 0}),U_=we({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let i;try{i=await rre()}catch(a){return a.name==="AbortError"||a.name==="NotAllowedError"?!1:(console.error(`actionPaste ${a.name}: ${a.message}`),Xp?{captureUpdate:se.EVENTUALLY,appState:{...t,errorMessage:D("hints.firefox_clipboard_write")}}:{captureUpdate:se.EVENTUALLY,appState:{...t,errorMessage:D("errors.asyncPasteFailedOnRead")}})}try{r.pasteFromClipboard(Qne({types:i}))}catch(a){return console.error(a),{captureUpdate:se.EVENTUALLY,appState:{...t,errorMessage:D("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:se.EVENTUALLY}},keyTest:void 0}),b_=we({name:"cut",label:"labels.cut",icon:jG,trackEvent:{category:"element"},perform:(e,t,n,r)=>(xg.perform(e,t,n,r),JD.perform(e,t,null,r)),keyTest:e=>e[q.CTRL_OR_CMD]&&e.key===q.X}),y_=we({name:"copyAsSvg",label:"labels.copyAsSvg",icon:KG,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:se.EVENTUALLY};let{exportedElements:i,exportingFrame:a}=YU(e,t,!0);try{await GU("clipboard-svg",i,t,r.files,{...t,exportingFrame:a,name:r.getName()});let s=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:D("toast.copyToClipboardAsSvg",{exportSelection:s.length?D("toast.selection"):D("toast.canvas"),exportColorScheme:t.exportWithDarkMode?D("buttons.darkMode"):D("buttons.lightMode")})}},captureUpdate:se.EVENTUALLY}}catch(s){return console.error(s),{appState:{errorMessage:s.message},captureUpdate:se.EVENTUALLY}}},predicate:e=>F7&&e.length>0,keywords:["svg","clipboard","copy"]}),v_=we({name:"copyAsPng",label:"labels.copyAsPng",icon:QG,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:se.EVENTUALLY};let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:a,exportingFrame:s}=YU(e,t,!0);try{return await GU("clipboard",a,t,r.files,{...t,exportingFrame:s,name:r.getName()}),{appState:{...t,toast:{message:D("toast.copyToClipboardAsPng",{exportSelection:i.length?D("toast.selection"):D("toast.canvas"),exportColorScheme:t.exportWithDarkMode?D("buttons.darkMode"):D("buttons.lightMode")})}},captureUpdate:se.EVENTUALLY}}catch(o){return console.error(o),{appState:{...t,errorMessage:o.message},captureUpdate:se.EVENTUALLY}}},predicate:e=>B7&&e.length>0,keyTest:e=>e.code===_t.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),x_=we({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{P1(Fte(i))}catch{throw new Error(D("errors.copyToSystemClipboardFailed"))}return{captureUpdate:se.EVENTUALLY}},predicate:(e,t,n,r)=>F7&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(ke),keywords:["text","clipboard","copy"]}),w_=we({name:"gridMode",icon:rq,keywords:["snap"],label:"labels.toggleGrid",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:se.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[q.CTRL_OR_CMD]&&e.code===_t.QUOTE}),r8=we({name:"zenMode",label:"buttons.zenMode",icon:eq,paletteName:"Toggle zen mode",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:se.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,n)=>typeof n.zenModeEnabled>"u",keyTest:e=>!e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.Z}),hde=we({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:JG,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:se.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,n)=>typeof n.objectsSnapModeEnabled>"u",keyTest:e=>!e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.S}),i8=we({name:"stats",label:"stats.fullTitle",icon:GG,paletteName:"Toggle stats",viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:se.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.SLASH}),fde=we({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>r.scene.getSelectedElements(t).some(i=>Ki(i)),perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a=r.scene.getNonDeletedElementsMap();return i.forEach(s=>{var c;let o=ct(s,a);if(o){let{width:d,height:l}=Mr(o.originalText,$t(o),o.lineHeight),h=Lte(s.id);CA(s.id);let{x:f,y:g}=CU(s,o,a);he(o,{containerId:null,width:d,height:l,text:o.originalText,x:f,y:g}),he(s,{boundElements:(c=s.boundElements)==null?void 0:c.filter(U=>U.id!==o.id),height:h||s.height})}}),{elements:e,appState:t,captureUpdate:se.IMMEDIATELY}}}),pde=we({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);if(i.length===2){let a=ke(i[0])||ke(i[1]),s;if(zc(i[0])?s=i[0]:zc(i[1])&&(s=i[1]),a&&s&&ct(s,r.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a,s;ke(i[0])&&zc(i[1])?(a=i[0],s=i[1]):(a=i[1],s=i[0]),he(a,{containerId:s.id,verticalAlign:yi.MIDDLE,textAlign:Yp.CENTER,autoResize:!0}),he(s,{boundElements:(s.boundElements||[]).concat({type:"text",id:a.id})});let o=s.height;return Fr(a,s,r.scene.getNonDeletedElementsMap()),s2(s.id,o),{elements:mde(e,s,a),appState:{...t,selectedElementIds:{[s.id]:!0}},captureUpdate:se.IMMEDIATELY}}}),mde=(e,t,n)=>{let r=e.slice(),i=r.findIndex(s=>s.id===n.id);r.splice(i,1);let a=r.findIndex(s=>s.id===t.id);return r.splice(a+1,0,n),xs(r,Qe([t,n])),r},gde=(e,t,n)=>{let r=e.slice(),i=r.findIndex(s=>s.id===t.id);r.splice(i,1);let a=r.findIndex(s=>s.id===n.id);return r.splice(a,0,t),xs(r,Qe([t,n])),r},Ude=we({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a=i.every(s=>ke(s));return i.length>0&&a},perform:(e,t,n,r)=>{var o;let i=r.scene.getSelectedElements(t),a=e.slice(),s={};for(let c of i)if(ke(c)){let d=vs({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...c.boundElements||[],{id:c.id,type:"text"}],angle:c.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:vh("rectangle")?Bn.ADAPTIVE_RADIUS:Bn.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:c.x-Fn,y:c.y-Fn,width:od(c.width,"rectangle"),height:od(c.height,"rectangle"),groupIds:c.groupIds,frameId:c.frameId});if((o=c.boundElements)!=null&&o.length){let l=c.boundElements.filter(h=>h.type==="arrow").map(h=>h.id);a.filter(h=>l.includes(h.id)).forEach(h=>{let f=h.startBinding,g=h.endBinding;(f==null?void 0:f.elementId)===c.id&&(f={...f,elementId:d.id}),(g==null?void 0:g.elementId)===c.id&&(g={...g,elementId:d.id}),(f||g)&&he(h,{startBinding:f,endBinding:g},!1)})}he(c,{containerId:d.id,verticalAlign:yi.MIDDLE,boundElements:null,textAlign:Yp.CENTER,autoResize:!0},!1),Fr(c,d,r.scene.getNonDeletedElementsMap()),a=gde([...a,d],d,c),s[d.id]=!0}return{elements:a,appState:{...t,selectedElementIds:s},captureUpdate:se.IMMEDIATELY}}}),Iv=380,bde=42,a8=5,Tj=85,yde=500,s8=!1,Lm=new Map,vde=({element:e,elementsMap:t,setAppState:n,onLinkOpen:r,setToast:i,updateEmbedValidationStatus:a})=>{let s=H1(),o=z1(),c=Zn(),d=e.link||"",[l,h]=I.useState(d),f=I.useRef(null),g=s.showHyperlinkPopup==="editor",U=I.useCallback(()=>{var S;if(!f.current)return;let C=vi(f.current.value)||null;if(!e.link&&C&&Zt("hyperlink","create"),ti(e)){if(((S=s.activeEmbeddable)==null?void 0:S.element)===e&&n({activeEmbeddable:null}),!C){he(e,{link:null}),a(e,!1);return}if(!ug(C,o.validateEmbeddable))C&&i({message:D("toast.unableToEmbed"),closable:!0}),e.link&&Lm.set(e.id,e.link),he(e,{link:C}),a(e,!1);else{let{width:T,height:M}=e,_=wu(C);(_==null?void 0:_.error)instanceof URIError&&i({message:D("toast.unrecognizedLinkFormat"),closable:!0});let R=_?_.intrinsicSize.w/_.intrinsicSize.h:1,P=Lm.get(e.id)!==e.link;he(e,{...P?{width:(_==null?void 0:_.type)==="video"?T>M?T:M*R:T,height:(_==null?void 0:_.type)==="video"&&T>M?T/R:M}:{},link:C}),a(e,!0),Lm.has(e.id)&&Lm.delete(e.id)}}else he(e,{link:C})},[e,i,o.validateEmbeddable,s.activeEmbeddable,n,a]);I.useLayoutEffect(()=>()=>{U()},[U]),I.useEffect(()=>{g&&(f!=null&&f.current)&&!(c.viewport.isMobile||c.isTouchScreen)&&f.current.select()},[g,c.viewport.isMobile,c.isTouchScreen]),I.useEffect(()=>{let C=null,S=T=>{g||(C&&clearTimeout(C),Ede(e,t,s,A(T.clientX,T.clientY))&&(C=window.setTimeout(()=>{n({showHyperlinkPopup:!1})},yde)))};return window.addEventListener("pointermove",S,!1),()=>{window.removeEventListener("pointermove",S,!1),C&&clearTimeout(C)}},[s,e,g,n,t]);let y=I.useCallback(()=>{Zt("hyperlink","delete"),he(e,{link:null}),n({showHyperlinkPopup:!1})},[n,e]),v=()=>{Zt("hyperlink","edit","popup-ui"),n({showHyperlinkPopup:"editor"})},{x,y:w}=Mj(e,s,t);return s.contextMenu||s.selectedElementsAreBeingDragged||s.resizingElement||s.isRotating||s.openMenu||s.viewModeEnabled?null:m.jsxs("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${w}px`,left:`${x}px`,width:Iv,padding:a8},children:[g?m.jsx("input",{className:De("excalidraw-hyperlinkContainer-input"),placeholder:D("labels.link.hint"),ref:f,value:l,onChange:C=>h(C.target.value),autoFocus:!0,onKeyDown:C=>{C.stopPropagation(),C[q.CTRL_OR_CMD]&&C.key===q.K&&C.preventDefault(),(C.key===q.ENTER||C.key===q.ESCAPE)&&(U(),n({showHyperlinkPopup:"info"}))}}):e.link?m.jsx("a",{href:vi(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:_A(e.link)?"_self":"_blank",onClick:C=>{if(e.link&&r){let S=rI("excalidraw-link",C.nativeEvent);r({...e,link:vi(e.link)},S),S.defaultPrevented&&C.preventDefault()}},rel:"noopener noreferrer",children:e.link}):m.jsx("div",{className:"excalidraw-hyperlinkContainer-link",children:D("labels.link.empty")}),m.jsxs("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!g&&m.jsx(wt,{type:"button",title:D("buttons.edit"),"aria-label":D("buttons.edit"),label:D("buttons.edit"),onClick:v,className:"excalidraw-hyperlinkContainer--edit",icon:Zp}),m.jsx(wt,{type:"button",title:D("labels.linkToElement"),"aria-label":D("labels.linkToElement"),label:D("labels.linkToElement"),onClick:()=>{n({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:AI}),d&&!ti(e)&&m.jsx(wt,{type:"button",title:D("buttons.remove"),"aria-label":D("buttons.remove"),label:D("buttons.remove"),onClick:y,className:"excalidraw-hyperlinkContainer--remove",icon:rd})]})]})},Mj=(e,t,n)=>{let[r,i]=it(e,n),{x:a,y:s}=xa({sceneX:r+e.width/2,sceneY:i},t),o=a-t.offsetLeft-Iv/2,c=s-t.offsetTop-Tj;return{x:o,y:c}},E_=(e,t)=>{var r;let n=ut(e,t);return ti(n[0])?"labels.link.editEmbed":(r=n[0])!=null&&r.link?"labels.link.edit":"labels.link.create"},kp=null,xde=(e,t,n)=>{kp&&clearTimeout(kp),kp=window.setTimeout(()=>wde(e,t,n),hV)},wde=(e,t,n)=>{if(!e.link)return;let r=Sp();r.classList.add("excalidraw-tooltip--visible"),r.style.maxWidth="20rem",r.textContent=xp(e.link)?D("labels.link.goToElement"):e.link;let[i,a,s,o]=it(e,n),[c,d,l,h]=S7([i,a,s,o],e.angle,t),f=xa({sceneX:c,sceneY:d},t);vj(r,{left:f.x,top:f.y,width:l,height:h},"top"),Zt("hyperlink","tooltip","link-icon"),s8=!0},C_=()=>{kp&&clearTimeout(kp),s8&&(s8=!1,Sp().classList.remove("excalidraw-tooltip--visible"))},Ede=(e,t,n,[r,i])=>{let{x:a,y:s}=qt({clientX:r,clientY:i},n),o=15/n.zoom.value;if(f7(a,s,e,t))return!1;let[c,d,l]=it(e,t);if(a>=c&&a<=l&&s>=d-Tj&&s<=d)return!1;let{x:h,y:f}=Mj(e,n,t);return!(r>=h-o&&r<=h+Iv+a8*2+o&&i>=f-o&&i<=f+o+a8*2+bde)},Ij=we({name:"hyperlink",label:(e,t)=>E_(e,t),icon:p3,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:se.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[q.CTRL_OR_CMD]&&e.key===q.K,predicate:(e,t)=>ut(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=ut(e,t);return m.jsx(wt,{type:"button",icon:p3,"aria-label":D(E_(e,t)),title:`${ti(e[0])?D("labels.link.labelEmbed"):D("labels.link.label")} - ${ue("CtrlOrCmd+K")}`,onClick:()=>n(null),selected:r.length===1&&!!r[0].link})}}),fy=e=>e.every(t=>!t.locked),Cde=we({name:"toggleElementLock",label:(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return r.length===1&&!Ke(r[0])?r[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":fy(r)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},icon:(e,t)=>{let n=ut(t,e);return fy(n)?s7:uU},trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return i.length>0&&!i.some(a=>a.locked&&a.frameId)},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!i.length)return!1;let a=fy(i),s=Qe(i);return{elements:e.map(o=>s.has(o.id)?lt(o,{locked:a}):o),appState:{...t,selectedLinearElement:a?null:t.selectedLinearElement},captureUpdate:se.IMMEDIATELY}},keyTest:(e,t,n,r)=>e.key.toLocaleLowerCase()===q.L&&e[q.CTRL_OR_CMD]&&e.shiftKey&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),Sde=we({name:"unlockAllElements",paletteName:"Unlock all elements",trackEvent:{category:"canvas"},viewMode:!1,icon:uU,predicate:(e,t)=>ut(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let n=e.filter(r=>r.locked);return{elements:e.map(r=>r.locked?lt(r,{locked:!1}):r),appState:{...t,selectedElementIds:Object.fromEntries(n.map(r=>[r.id,!0]))},captureUpdate:se.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),_de=()=>{let[e,t]=I.useState(null),n=I.useCallback(r=>t(r),[]);return[e,n]},kde=e=>{let{closeOnClickOutside:t=!0}=e,n=cj({className:"excalidraw-modal-container"}),r=I.useRef(document.body.classList.contains("excalidraw-animations-disabled"));if(!n)return null;let i=a=>{a.key===q.ESCAPE&&(a.nativeEvent.stopImmediatePropagation(),a.stopPropagation(),e.onCloseRequest())};return ar.createPortal(m.jsxs("div",{className:De("Modal",e.className,{"animations-disabled":r.current}),role:"dialog","aria-modal":"true",onKeyDown:i,"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[m.jsx("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),m.jsx("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),n)},Aj=cr(new Map),S_=async e=>await $7({elements:e,appState:{exportBackground:!1,viewBackgroundColor:pt.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),Tde=(e,t,n)=>{let[r,i]=I.useState();return I.useEffect(()=>{if(t)if(e){let a=n.get(e);a?i(a):(async()=>{var o;let s=await S_(t);(o=s.querySelector(".style-fonts"))==null||o.remove(),s&&(n.set(e,s),i(s))})()}else(async()=>{let a=await S_(t);i(a)})()},[e,t,n,i]),r},Lj=()=>{let[e]=Cn(Aj);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(n=>e.delete(n))},svgCache:e}},Mde=class{constructor(){z(this,"jobs",[]),z(this,"running",!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(Xu(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let n=VV();return this.jobs.push({jobFactory:e,promise:n,args:t}),this.tick(),n}},Ide=new ns,d1=cr({status:"loaded",isInitialized:!1,libraryItems:[]}),jf=e=>co(e),Ade=(e,t)=>!e.find(n=>n.elements.length!==t.elements.length?!1:n.elements.every((r,i)=>r.id===t.elements[i].id&&r.versionNonce===t.elements[i].versionNonce)),Lde=(e,t)=>{let n=[];for(let r of t)Ade(e,r)&&n.push(r);return[...n,...e]},Rde=(e,t)=>{let n=Qe(t),r={deletedItems:new Map,addedItems:new Map};for(let a of e)n.has(a.id)||r.deletedItems.set(a.id,a);let i=Qe(e);for(let a of t)i.has(a.id)||r.addedItems.set(a.id,a);return r},Dde=class{constructor(e){z(this,"currLibraryItems",[]),z(this,"prevLibraryItems",jf(this.currLibraryItems)),z(this,"app"),z(this,"updateQueue",[]),z(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),z(this,"notifyListeners",()=>{var t,n;if(this.updateQueue.length>0)Sa.set(d1,r=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:r.isInitialized}));else{Sa.set(d1,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let r=this.prevLibraryItems;this.prevLibraryItems=jf(this.currLibraryItems);let i=jf(this.currLibraryItems);(n=(t=this.app.props).onLibraryChange)==null||n.call(t,i),Ide.trigger(Rde(r,i),i)}catch(r){console.error(r)}}}),z(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],Sa.set(Aj,new Map)}),z(this,"resetLibrary",()=>this.setLibrary([])),z(this,"getLatestLibrary",()=>new Promise(async t=>{try{let n=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(jf(n))}catch{return t(this.currLibraryItems)}})),z(this,"updateLibrary",async({libraryItems:t,prompt:n=!1,merge:r=!1,openLibraryMenu:i=!1,defaultStatus:a="unpublished"})=>(i&&this.app.setState({openSidebar:{name:ka.name,tab:Wg}}),this.setLibrary(()=>new Promise(async(s,o)=>{try{let c=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),d;c instanceof Blob?d=await Wre(c,a):d=O7(c,a),!n||window.confirm(D("alerts.confirmAddLibrary",{numShapes:d.length}))?(n&&this.app.focusContainer(),s(r?Lde(this.currLibraryItems,d):d)):o(new pU)}catch(c){o(c)}})))),z(this,"setLibrary",t=>{let n=new Promise(async(r,i)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=jf(await t),r(this.currLibraryItems)}catch(a){i(a)}}).catch(r=>{if(r.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw r}).finally(()=>{this.updateQueue=this.updateQueue.filter(r=>r!==n),this.notifyListeners()});return this.updateQueue.push(n),this.notifyListeners(),n}),this.app=e}},jde=Dde,Rj=e=>{let t=Math.ceil(Math.sqrt(e.length)),n=[],r=f=>e.slice(f*t,f*t+t).reduce((g,U)=>{let{height:y}=Ma(U.elements);return Math.max(g,y)},0),i=f=>{let g=0,U=0,y=0;for(let v of e){if(g%t===0&&(U=0),U===f){let{width:x}=Ma(v.elements);y=Math.max(y,x)}g++,U++}return y},a=0,s=0,o=0,c=0,d=0,l=0,h=0;for(let f of e){d&&d%t===0&&(s+=o+50,a=0,l=0,h++),l===0&&(o=r(h)),c=i(l);let{minX:g,minY:U,width:y,height:v}=Ma(f.elements),x=(c-y)/2,w=(o-v)/2;n.push(...f.elements.map(C=>({...C,x:C.x+a+x-g,y:C.y+s+w-U}))),a+=c+50,d++,l++}return n},Rm=class o8{constructor(t){z(this,"adapter"),this.adapter=t}static async getLibraryItems(t,n,r=!0){let i=()=>new Promise(async(a,s)=>{try{let o=await t.load({source:n});a(O7((o==null?void 0:o.libraryItems)||[],"published"))}catch(o){s(o)}});return r?o8.queue.push(i):i()}getLibraryItems(t){return o8.getLibraryItems(this.adapter,t,!1)}};z(Rm,"queue",new Mde),z(Rm,"run",async(e,t)=>{let n=new Rm(e);return Rm.queue.push(()=>t(n))});var Pde=I.forwardRef(({children:e,gap:t,align:n,justifyContent:r,className:i,style:a},s)=>m.jsx("div",{className:De("Stack Stack_horizontal",i),style:{"--gap":t,alignItems:n,justifyContent:r,...a},ref:s,children:e})),Nde=I.forwardRef(({children:e,gap:t,align:n,justifyContent:r,className:i,style:a},s)=>m.jsx("div",{className:De("Stack Stack_vertical",i),style:{"--gap":t,justifyItems:n,justifyContent:r,...a},ref:s,children:e})),Wi={Row:Pde,Col:Nde},Ode=({theme:e,id:t,libraryReturnUrl:n})=>{let r=n||window.location.origin+window.location.pathname;return m.jsx("a",{className:"library-menu-browse-button",href:`${dt.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${r}&useHash=true&token=${t}&theme=${e}&version=${oU.excalidrawLibrary}`,target:"_excalidraw_libraries",children:D("labels.libraries")})},Fde=Ode,Dj=({libraryReturnUrl:e,theme:t,id:n,style:r,children:i,className:a})=>m.jsxs("div",{className:De("library-menu-control-buttons",a),style:r,children:[m.jsx(Fde,{id:n,libraryReturnUrl:e,theme:t}),i]}),Bde=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,$de=/{{([\w-]+)}}/,zde=/<([\w-]+)>/,Hde=/<\/([\w-]+)>/,Wde=(e,t)=>{let n=[{name:"",children:[]}];return e.split(Bde).filter(Boolean).forEach(r=>{let i=r.match(zde),a=r.match(Hde),s=r.match($de);if(i!==null){let o=i[1];t.hasOwnProperty(o)?n.push({name:o,children:[]}):console.warn(`Trans: missed to pass in prop ${o} for interpolating ${e}`)}else if(a!==null)if(a[1]===n[n.length-1].name){let o=n.pop(),c=xe.createElement(xe.Fragment,{},...o.children),d=t[o.name];typeof d=="function"&&n[n.length-1].children.push(d(c))}else console.warn(`Trans: unexpected end tag ${r} for interpolating ${e}`);else if(s!==null){let o=s[1];t.hasOwnProperty(o)?n[n.length-1].children.push(t[o]):console.warn(`Trans: key ${o} not in props for interpolating ${e}`)}else n[n.length-1].children.push(r)}),n.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),n[0].children},Xde=({i18nKey:e,children:t,...n})=>{let{t:r}=Ar();return xe.createElement(xe.Fragment,{},...Wde(r(e),n))},us=Xde,Vde=({label:e,onClick:t,className:n,children:r,actionType:i,type:a="button",isLoading:s,...o})=>{let c=i?`Dialog__action-button--${i}`:"";return m.jsxs("button",{className:De("Dialog__action-button",c,n),type:a,"aria-label":e,onClick:t,...o,children:[r&&m.jsx("div",{style:s?{visibility:"hidden"}:{},children:r}),m.jsx("div",{style:s?{visibility:"hidden"}:{},children:e}),s&&m.jsx("div",{style:{position:"absolute",inset:0},children:m.jsx(_o,{})})]})},ih=Vde,Yde=e=>{let{onConfirm:t,onCancel:n,children:r,confirmText:i=D("buttons.confirm"),cancelText:a=D("buttons.cancel"),className:s="",...o}=e,c=Kn(),d=$U(Av),{container:l}=Is();return m.jsxs(Oa,{onCloseRequest:n,size:"small",...o,className:`confirm-dialog ${s}`,children:[r,m.jsxs("div",{className:"confirm-dialog-buttons",children:[m.jsx(ih,{label:a,onClick:()=>{c({openMenu:null}),d(!1),ar.flushSync(()=>{n()}),l==null||l.focus()}}),m.jsx(ih,{label:i,onClick:()=>{c({openMenu:null}),d(!1),ar.flushSync(()=>{t()}),l==null||l.focus()},actionType:"danger"})]})]})},jj=Yde,Vc=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),null}}};z(Vc,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),z(Vc,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var Gde=async e=>{let t=Math.round(8),n=Math.max(Math.round(128/64),2),r=zV(e,6),i=document.createElement("canvas");i.width=r[0].length*128+(r[0].length+1)*(t*2)-t*2,i.height=r.length*128+(r.length+1)*(t*2)-t*2;let a=i.getContext("2d");a.fillStyle=or.white,a.fillRect(0,0,i.width,i.height);for(let[s,o]of e.entries()){let c=await MU({elements:o.elements,files:null,maxWidthOrHeight:128}),{width:d,height:l}=c,h=Math.floor(s/6)*(128+t*2),f=s%6*(128+t*2);a.drawImage(c,f+(128-d)/2+t,h+(128-l)/2+t),a.lineWidth=n,a.strokeStyle=or.gray[4],a.strokeRect(f+t/2,h+t/2,128+t,128+t)}return await j3(new File([await s1(i)],"preview",{type:Be.png}),{outputType:Be.jpg,maxWidthOrHeight:5e3})},qde=({libItem:e,appState:t,index:n,onChange:r,onRemove:i})=>{let a=I.useRef(null),s=I.useRef(null);return I.useEffect(()=>{let o=a.current;o&&(async()=>{let c=await $7({elements:e.elements,appState:{...t,viewBackgroundColor:or.white,exportBackground:!0},files:null,skipInliningFonts:!0});o.innerHTML=c.outerHTML})()},[e.elements,t]),m.jsxs("div",{className:"single-library-item",children:[e.status==="published"&&m.jsx("span",{className:"single-library-item-status",children:D("labels.statusPublished")}),m.jsx("div",{ref:a,className:"single-library-item__svg"}),m.jsx(wt,{"aria-label":D("buttons.remove"),type:"button",icon:xh,className:"single-library-item--remove",onClick:i.bind(null,e.id),title:D("buttons.remove")}),m.jsxs("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[m.jsxs("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[m.jsxs("div",{style:{padding:"0.5em 0"},children:[m.jsx("span",{style:{fontWeight:500,color:or.gray[6]},children:D("publishDialog.itemName")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("input",{type:"text",ref:s,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:o=>{r(o.target.value,n)}})]}),m.jsx("span",{className:"error",children:e.error})]})]})},Zde=({onClose:e,libraryItems:t,appState:n,onSuccess:r,onError:i,updateItemsInStorage:a,onRemove:s})=>{let[o,c]=I.useState({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[d,l]=I.useState(!1);I.useEffect(()=>{let C=Vc.get(mp.PUBLISH_LIBRARY);C&&c(C)},[]);let[h,f]=I.useState(t.slice());I.useEffect(()=>{f(t.slice())},[t]);let g=C=>{c({...o,[C.target.name]:C.target.value})},U=async C=>{C.preventDefault(),l(!0);let S=[],T=!1;if(h.forEach(N=>{let F="";N.name||(F=D("publishDialog.errors.required"),T=!0),S.push({...N,error:F})}),T){f(S),l(!1);return}let M=await Gde(h),_={type:Vi.excalidrawLibrary,version:oU.excalidrawLibrary,source:Y8,libraryItems:h},R=JSON.stringify(_,null,2),P=new Blob([R],{type:"application/json"}),j=new FormData;j.append("excalidrawLib",P),j.append("previewImage",M),j.append("previewImageType",M.type),j.append("title",o.name),j.append("authorName",o.authorName),j.append("githubHandle",o.githubHandle),j.append("name",o.name),j.append("description",o.description),j.append("twitterHandle",o.twitterHandle),j.append("website",o.website),fetch(`${dt.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:j}).then(N=>N.ok?N.json().then(({url:F})=>{Vc.delete(mp.PUBLISH_LIBRARY),r({url:F,authorName:o.authorName,items:h})}):N.json().catch(()=>{throw new Error(N.statusText||"something went wrong")}).then(F=>{throw new Error(F.message||N.statusText||"something went wrong")}),N=>{console.error(N),i(N),l(!1)}).catch(N=>{console.error(N),i(N),l(!1)})},y=()=>{let C=[];return h.forEach((S,T)=>{C.push(m.jsx("div",{className:"single-library-item-wrapper",children:m.jsx(qde,{libItem:S,appState:n,index:T,onChange:(M,_)=>{let R=h.slice();R[_].name=M,f(R)},onRemove:s})},T))}),m.jsx("div",{className:"selected-library-items",children:C})},v=I.useCallback(()=>{a(h),Vc.set(mp.PUBLISH_LIBRARY,o),e()},[h,e,a,o]),x=!!t.length,w=t.some(C=>C.status==="published");return m.jsx(Oa,{onCloseRequest:v,title:D("publishDialog.title"),className:"publish-library",children:x?m.jsxs("form",{onSubmit:U,children:[m.jsx("div",{className:"publish-library-note",children:m.jsx(us,{i18nKey:"publishDialog.noteDescription",link:C=>m.jsx("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:C})})}),m.jsx("span",{className:"publish-library-note",children:m.jsx(us,{i18nKey:"publishDialog.noteGuidelines",link:C=>m.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:C})})}),m.jsx("div",{className:"publish-library-note",children:D("publishDialog.noteItems")}),w&&m.jsx("span",{className:"publish-library-note publish-library-warning",children:D("publishDialog.republishWarning")}),y(),m.jsxs("div",{className:"publish-library__fields",children:[m.jsxs("label",{children:[m.jsxs("div",{children:[m.jsx("span",{children:D("publishDialog.libraryName")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("input",{type:"text",name:"name",required:!0,value:o.name,onChange:g,placeholder:D("publishDialog.placeholder.libraryName")})]}),m.jsxs("label",{style:{alignItems:"flex-start"},children:[m.jsxs("div",{children:[m.jsx("span",{children:D("publishDialog.libraryDesc")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("textarea",{name:"description",rows:4,required:!0,value:o.description,onChange:g,placeholder:D("publishDialog.placeholder.libraryDesc")})]}),m.jsxs("label",{children:[m.jsxs("div",{children:[m.jsx("span",{children:D("publishDialog.authorName")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("input",{type:"text",name:"authorName",required:!0,value:o.authorName,onChange:g,placeholder:D("publishDialog.placeholder.authorName")})]}),m.jsxs("label",{children:[m.jsx("span",{children:D("publishDialog.githubUsername")}),m.jsx("input",{type:"text",name:"githubHandle",value:o.githubHandle,onChange:g,placeholder:D("publishDialog.placeholder.githubHandle")})]}),m.jsxs("label",{children:[m.jsx("span",{children:D("publishDialog.twitterUsername")}),m.jsx("input",{type:"text",name:"twitterHandle",value:o.twitterHandle,onChange:g,placeholder:D("publishDialog.placeholder.twitterHandle")})]}),m.jsxs("label",{children:[m.jsx("span",{children:D("publishDialog.website")}),m.jsx("input",{type:"text",name:"website",pattern:"https?://.+",title:D("publishDialog.errors.website"),value:o.website,onChange:g,placeholder:D("publishDialog.placeholder.website")})]}),m.jsx("span",{className:"publish-library-note",children:m.jsx(us,{i18nKey:"publishDialog.noteLicense",link:C=>m.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:C})})})]}),m.jsxs("div",{className:"publish-library__buttons",children:[m.jsx(ih,{label:D("buttons.cancel"),onClick:v,"data-testid":"cancel-clear-canvas-button"}),m.jsx(ih,{type:"submit",label:D("buttons.submit"),actionType:"primary",isLoading:d})]})]}):m.jsx("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:D("publishDialog.atleastOneLibItem")})})},Kde=Zde,Pj=({className:e="",children:t,onToggle:n,title:r,...i})=>{let a=Zn(),s=De(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":a.editor.isMobile}).trim();return m.jsx("button",{"data-prevent-outside-click":!0,className:s,onClick:n,type:"button","data-testid":"dropdown-menu-button",title:r,...i,children:t})},Qde=Pj;Pj.displayName="DropdownMenuTrigger";var Nj=()=>m.jsx("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:".5rem 0"}}),Jde=Nj;Nj.displayName="DropdownMenuSeparator";var Oj=({children:e,onClickOutside:t,className:n="",onSelect:r,style:i})=>{let a=Zn(),s=I.useRef(null),o=HU({onClickOutside:t});Ev(s,()=>{var d;(d=o.onClickOutside)==null||d.call(o)}),I.useEffect(()=>{let d=h=>{var f;h.key===q.ESCAPE&&(h.stopImmediatePropagation(),(f=o.onClickOutside)==null||f.call(o))},l={capture:!0};return document.addEventListener("keydown",d,l),()=>{document.removeEventListener("keydown",d,l)}},[o]);let c=De(`dropdown-menu ${n}`,{"dropdown-menu--mobile":a.editor.isMobile}).trim();return m.jsx(pj.Provider,{value:{onSelect:r},children:m.jsx("div",{ref:s,className:c,style:i,"data-testid":"dropdown-menu",children:a.editor.isMobile?m.jsx(Wi.Col,{className:"dropdown-menu-container",children:e}):m.jsx(Ia,{className:"dropdown-menu-container",padding:2,style:{zIndex:2},children:e})})})};Oj.displayName="DropdownMenuContent";var eue=Oj,Fj=({icon:e,shortcut:t,href:n,children:r,onSelect:i,className:a="",selected:s,rel:o="noreferrer",...c})=>{let d=gj(c.onClick,i);return m.jsx("a",{...c,href:n,target:"_blank",rel:"noreferrer",className:mj(a,s),title:c.title??c["aria-label"],onClick:d,children:m.jsx(Uj,{icon:e,shortcut:t,children:r})})},wg=Fj;Fj.displayName="DropdownMenuItemLink";var tue=({children:e,className:t="",selected:n,...r})=>m.jsx("div",{...r,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${n?"dropdown-menu-item--selected":""}`.trim(),children:e}),nue=tue,rue=e=>xe.Children.toArray(e).find(n=>xe.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuTrigger")||null,iue=e=>xe.Children.toArray(e).find(n=>xe.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuContent")||null,Ao=({children:e,open:t})=>{let n=rue(e),r=iue(e);return m.jsxs(m.Fragment,{children:[n,t&&r]})};Ao.Trigger=Qde;Ao.Content=eue;Ao.Item=na;Ao.ItemLink=wg;Ao.ItemCustom=nue;Ao.Group=t8;Ao.Separator=Jde;var ln=Ao;Ao.displayName="DropdownMenu";var aue=(e,t)=>e.filter(n=>t.includes(n.id)),sue=({setAppState:e,selectedItems:t,library:n,onRemoveFromLibrary:r,resetLibrary:i,onSelectItems:a,appState:s,className:o})=>{let[c]=Cn(d1),[d,l]=Cn(Av),h=()=>{let j=t.length?D("alerts.removeItemsFromsLibrary",{count:t.length}):D("alerts.resetLibrary"),N=t.length?D("confirmDialog.removeItemsFromLib"):D("confirmDialog.resetLibrary");return m.jsx(jj,{onConfirm:()=>{t.length?r():i(),g(!1)},onCancel:()=>{g(!1)},title:N,children:m.jsx("p",{children:j})})},[f,g]=I.useState(!1),U=!!t.length,y=U?c.libraryItems.filter(j=>t.includes(j.id)):c.libraryItems,v=D(U?"buttons.remove":"buttons.resetLibrary"),[x,w]=I.useState(!1),[C,S]=I.useState(null),T=I.useCallback(()=>m.jsxs(Oa,{onCloseRequest:()=>S(null),title:D("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[m.jsx("p",{children:m.jsx(us,{i18nKey:"publishSuccessDialog.content",authorName:C.authorName,link:j=>m.jsx("a",{href:C==null?void 0:C.url,target:"_blank",rel:"noopener noreferrer",children:j})})}),m.jsx(wt,{type:"button",title:D("buttons.close"),"aria-label":D("buttons.close"),label:D("buttons.close"),onClick:()=>S(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[S,C]),M=(j,N)=>{w(!1),S({url:j.url,authorName:j.authorName});let F=N.slice();F.forEach(B=>{t.includes(B.id)&&(B.status="published")}),n.setLibrary(F)},_=async()=>{try{await n.updateLibrary({libraryItems:C7({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(j){if((j==null?void 0:j.name)==="AbortError"){console.warn(j);return}e({errorMessage:D("errors.importLibraryError")})}},R=async()=>{let j=U?y:await n.getLatestLibrary();pne(j).catch(eI).catch(N=>{e({errorMessage:N.message})})},P=()=>m.jsxs(ln,{open:d,children:[m.jsx(ln.Trigger,{onToggle:()=>l(!d),children:CY}),m.jsxs(ln.Content,{onClickOutside:()=>l(!1),onSelect:()=>l(!1),className:"library-menu",children:[!U&&m.jsx(ln.Item,{onSelect:_,icon:l7,"data-testid":"lib-dropdown--load",children:D("buttons.load")}),!!y.length&&m.jsx(ln.Item,{onSelect:R,icon:hU,"data-testid":"lib-dropdown--export",children:D("buttons.export")}),!!y.length&&m.jsx(ln.Item,{onSelect:()=>g(!0),icon:rd,children:v}),U&&m.jsx(ln.Item,{icon:DG,onSelect:()=>w(!0),"data-testid":"lib-dropdown--remove",children:D("buttons.publishLibrary")})]})]});return m.jsxs("div",{className:De("library-menu-dropdown-container",o),children:[P(),t.length>0&&m.jsx("div",{className:"library-actions-counter",children:t.length}),f&&h(),x&&m.jsx(Kde,{onClose:()=>w(!1),libraryItems:aue(c.libraryItems,t),appState:s,onSuccess:j=>M(j,c.libraryItems),onError:j=>window.alert(j),updateItemsInStorage:()=>n.setLibrary(c.libraryItems),onRemove:j=>a(t.filter(N=>N!==j))}),C&&T()]})},__=({selectedItems:e,onSelectItems:t,className:n})=>{let{library:r}=Ms(),{clearLibraryCache:i,deleteItemsFromLibraryCache:a}=Lj(),s=Hr(),o=Kn(),[c]=Cn(d1),d=async l=>{let h=l.filter(f=>!e.includes(f.id));r.setLibrary(h).catch(()=>{o({errorMessage:D("alerts.errorRemovingFromLibrary")})}),a(e),t([])};return m.jsx(sue,{appState:s,setAppState:o,selectedItems:e,onSelectItems:t,library:r,onRemoveFromLibrary:()=>d(c.libraryItems),resetLibrary:()=>{r.resetLibrary(),i()},className:n})},oue=I.memo(({id:e,elements:t,isPending:n,onClick:r,selected:i,onToggle:a,onDrag:s,svgCache:o})=>{let c=I.useRef(null),d=Tde(e,t,o);I.useEffect(()=>{let U=c.current;if(U)return d&&(U.innerHTML=d.outerHTML),()=>{U.innerHTML=""}},[d]);let[l,h]=I.useState(!1),f=Zn().editor.isMobile,g=n&&m.jsx("div",{className:"library-unit__adder",children:EY});return m.jsxs("div",{className:De("library-unit",{"library-unit__active":t,"library-unit--hover":t&&l,"library-unit--selected":i,"library-unit--skeleton":!d}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[m.jsx("div",{className:De("library-unit__dragger",{"library-unit__pulse":!!n}),ref:c,draggable:!!t,onClick:t||n?U=>{e&&U.shiftKey?a(e,U):r(e)}:void 0,onDragStart:U=>{if(!e){U.preventDefault();return}h(!1),s(e,U)}}),g,e&&t&&(l||f||i)&&m.jsx(Tv,{checked:i,onChange:(U,y)=>a(e,y),className:"library-unit__checkbox"})]})}),lue=()=>m.jsx("div",{className:"library-unit library-unit--skeleton"});function cue(){return[!1,I.useCallback(e=>e(),[])]}var due=xe.useTransition||cue,k_=({children:e})=>m.jsx("div",{className:"library-menu-items-container__grid",children:e}),py=I.memo(({items:e,onItemSelectToggle:t,onItemDrag:n,isItemSelected:r,onClick:i,svgCache:a,itemsRenderedPerBatch:s})=>{let[,o]=due(),[c,d]=I.useState(0);return I.useEffect(()=>{c<e.length&&o(()=>{d(c+s)})},[c,e.length,o,s]),m.jsx(m.Fragment,{children:e.map((l,h)=>h<c?m.jsx(oue,{elements:l==null?void 0:l.elements,isPending:!(l!=null&&l.id)&&!!(l!=null&&l.elements),onClick:i,svgCache:a,id:l==null?void 0:l.id,selected:r(l.id),onToggle:t,onDrag:n},(l==null?void 0:l.id)??h):m.jsx(lue,{},h))})}),uue=cr(0),hue=e=>{let[t,n]=Cn(uue);return I.useEffect(()=>{let{current:r}=e;if(!r)return;let i=_1(()=>{let{scrollTop:a}=r;n(a)},200);return r.addEventListener("scroll",i),()=>{i.cancel(),r.removeEventListener("scroll",i)}},[e,n]),t},fue=17,pue=64;function mue({isLoading:e,libraryItems:t,onAddToLibrary:n,onInsertLibraryItems:r,pendingElements:i,theme:a,id:s,libraryReturnUrl:o,onSelectItems:c,selectedItems:d}){let l=I.useRef(null),h=hue(l);I.useEffect(()=>{var j;h>0&&((j=l.current)==null||j.scrollTo(0,h))},[]);let{svgCache:f}=Lj(),g=I.useMemo(()=>t.filter(j=>j.status!=="published"),[t]),U=I.useMemo(()=>t.filter(j=>j.status==="published"),[t]),y=!t.length&&!i.length,v=!i.length&&!g.length&&!U.length,[x,w]=I.useState(null),C=I.useCallback((j,N)=>{let F=!d.includes(j),B=[...g,...U];if(F){if(N.shiftKey&&x){let G=B.findIndex(Y=>Y.id===x),W=B.findIndex(Y=>Y.id===j);if(G===-1||W===-1){c([...d,j]);return}let X=Qe(d),$=B.reduce((Y,H,Z)=>((Z>=G&&Z<=W||X.has(H.id))&&Y.push(H.id),Y),[]);c($)}else c([...d,j]);w(j)}else w(null),c(d.filter(G=>G!==j))},[x,c,U,d,g]),S=I.useCallback(j=>{let N;return d.includes(j)?N=t.filter(F=>d.includes(F.id)):N=t.filter(F=>F.id===j),N.map(F=>({...F,elements:PA(F.elements,{randomizeSeed:!0})}))},[t,d]),T=I.useCallback((j,N)=>{N.dataTransfer.setData(Be.excalidrawlib,zA(S(j)))},[S]),M=I.useCallback(j=>j?d.includes(j):!1,[d]),_=I.useCallback(()=>{n(i)},[i,n]),R=I.useCallback(j=>{j&&r(S(j))},[S,r]),P=f.size>=t.length?pue:fue;return m.jsxs("div",{className:"library-menu-items-container",style:i.length||g.length||U.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[!v&&m.jsx(__,{selectedItems:d,onSelectItems:c,className:"library-menu-dropdown-container--in-heading"}),m.jsxs(Wi.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:U.length>0?1:"0 1 auto",marginBottom:0},ref:l,children:[m.jsxs(m.Fragment,{children:[!v&&m.jsx("div",{className:"library-menu-items-container__header",children:D("labels.personalLib")}),e&&m.jsx("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:m.jsx(_o,{})}),!i.length&&!g.length?m.jsxs("div",{className:"library-menu-items__no-items",children:[m.jsx("div",{className:"library-menu-items__no-items__label",children:D("library.noItems")}),m.jsx("div",{className:"library-menu-items__no-items__hint",children:U.length>0?D("library.hint_emptyPrivateLibrary"):D("library.hint_emptyLibrary")})]}):m.jsxs(k_,{children:[i.length>0&&m.jsx(py,{itemsRenderedPerBatch:P,items:[{id:null,elements:i}],onItemSelectToggle:C,onItemDrag:T,onClick:_,isItemSelected:M,svgCache:f}),m.jsx(py,{itemsRenderedPerBatch:P,items:g,onItemSelectToggle:C,onItemDrag:T,onClick:R,isItemSelected:M,svgCache:f})]})]}),m.jsxs(m.Fragment,{children:[(U.length>0||i.length>0||g.length>0)&&m.jsx("div",{className:"library-menu-items-container__header library-menu-items-container__header--excal",children:D("labels.excalidrawLib")}),U.length>0?m.jsx(k_,{children:m.jsx(py,{itemsRenderedPerBatch:P,items:U,onItemSelectToggle:C,onItemDrag:T,onClick:R,isItemSelected:M,svgCache:f})}):g.length>0?m.jsx("div",{style:{margin:"1rem 0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",fontSize:".9rem"},children:D("library.noItems")}):null]}),y&&m.jsx(Dj,{style:{padding:"16px 0",width:"100%"},id:s,libraryReturnUrl:o,theme:a,children:m.jsx(__,{selectedItems:d,onSelectItems:c})})]})]})}var Av=cr(!1),T_=({children:e})=>m.jsx("div",{className:"layer-ui__library",children:e}),gue=I.memo(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:n,setAppState:r,libraryReturnUrl:i,library:a,id:s,theme:o,selectedItems:c,onSelectItems:d})=>{let[l]=Cn(d1),h=I.useCallback(U=>{(async(y,v)=>{Zt("element","addToLibrary","ui");for(let w of XM)if(y.some(C=>C.type===w))return r({errorMessage:D(`errors.libraryElementTypeError.${w}`)});let x=[{status:"unpublished",elements:y,id:Qi(),created:Date.now()},...v];n(),a.setLibrary(x).catch(()=>{r({errorMessage:D("alerts.errorAddingToLibrary")})})})(U,l.libraryItems)},[n,a,r,l.libraryItems]),f=I.useMemo(()=>l.libraryItems,[l]);if(l.status==="loading"&&!l.isInitialized)return m.jsx(T_,{children:m.jsx("div",{className:"layer-ui__library-message",children:m.jsxs("div",{children:[m.jsx(_o,{size:"2em"}),m.jsx("span",{children:D("labels.libraryLoadingMessage")})]})})});let g=l.libraryItems.length>0||t.length>0;return m.jsxs(T_,{children:[m.jsx(mue,{isLoading:l.status==="loading",libraryItems:f,onAddToLibrary:h,onInsertLibraryItems:e,pendingElements:t,id:s,libraryReturnUrl:i,theme:o,onSelectItems:d,selectedItems:c}),g&&m.jsx(Dj,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:s,libraryReturnUrl:i,theme:o})]})}),my=(e,t)=>({elements:e,pending:ut(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),Uue=(e,t)=>{let n=KU(),[r,i]=I.useState(()=>my(n,e.selectedElementIds)),a=I.useRef(new Map);return I.useEffect(()=>{for(let s of r.pending)a.current.set(s.id,s.version)},[r.pending]),I.useEffect(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&i(s=>{var c;if(!pr(s.selectedElementIds,e.selectedElementIds))return a.current.clear(),my(n,e.selectedElementIds);let o=t.scene.getNonDeletedElementsMap();for(let d of Object.keys(e.selectedElementIds)){let l=(c=o.get(d))==null?void 0:c.version;if(l&&l!==a.current.get(d))return my(n,e.selectedElementIds)}return s})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,n]),r.pending},bue=I.memo(()=>{let e=Ms(),{onInsertElements:t}=e,n=z1(),r=Hr(),i=Kn(),[a,s]=I.useState([]),o=I.useMemo(()=>e.library,[e.library]),c=Uue(r,e),d=I.useCallback(h=>{t(Rj(h))},[t]),l=I.useCallback(()=>{i({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[i]);return m.jsx(gue,{pendingElements:c,onInsertLibraryItems:d,onAddToLibrary:l,setAppState:i,libraryReturnUrl:n.libraryReturnUrl,library:o,id:e.id,theme:r.theme,selectedItems:a,onSelectItems:s})});function yue(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var Oa=e=>{let[t,n]=_de(),[r]=I.useState(document.activeElement),{id:i}=Is(),a=Zn().viewport.isMobile;I.useEffect(()=>{if(!t)return;let d=d3(t);setTimeout(()=>{d.length>0&&e.autofocus!==!1&&(d[1]||d[0]).focus()});let l=h=>{if(h.key===q.TAB){let f=d3(t),{activeElement:g}=document,U=f.findIndex(y=>y===g);U===0&&h.shiftKey?(f[f.length-1].focus(),h.preventDefault()):U===f.length-1&&!h.shiftKey&&(f[0].focus(),h.preventDefault())}};return t.addEventListener("keydown",l),()=>t.removeEventListener("keydown",l)},[t,e.autofocus]);let s=Kn(),o=$U(Av),c=()=>{s({openMenu:null}),o(!1),r.focus(),e.onCloseRequest()};return m.jsx(kde,{className:De("Dialog",e.className,{"Dialog--fullscreen":a}),labelledBy:"dialog-title",maxWidth:yue(e.size),onCloseRequest:c,closeOnClickOutside:e.closeOnClickOutside,children:m.jsxs(Ia,{ref:n,children:[e.title&&m.jsx("h2",{id:`${i}-dialog-title`,className:"Dialog__title",children:m.jsx("span",{className:"Dialog__titleContent",children:e.title})}),a&&m.jsx("button",{className:"Dialog__close",onClick:c,title:D("buttons.close"),"aria-label":D("buttons.close"),type:"button",children:xh}),m.jsx("div",{className:"Dialog__content",children:e.children})]})})},ah=({type:e="button",onSelect:t,selected:n,children:r,className:i="",...a})=>m.jsx("button",{onClick:cU(a.onClick,s=>{t()}),type:e,className:De("excalidraw-button",i,{selected:n}),...a,children:r}),Lv=I.forwardRef(({onChange:e,label:t,fullWidth:n,placeholder:r,readonly:i,selectOnRender:a,onKeyDown:s,isRedacted:o=!1,icon:c,className:d,...l},h)=>{let f=I.useRef(null);I.useImperativeHandle(h,()=>f.current),I.useLayoutEffect(()=>{var y,v;a&&((y=f.current)==null||y.focus(),(v=f.current)==null||v.select())},[a]);let[g,U]=I.useState(!1);return m.jsxs("div",{className:De("ExcTextField",d,{"ExcTextField--fullWidth":n,"ExcTextField--hasIcon":!!c}),onClick:()=>{var y;(y=f.current)==null||y.focus()},children:[c,t&&m.jsx("div",{className:"ExcTextField__label",children:t}),m.jsxs("div",{className:De("ExcTextField__input",{"ExcTextField__input--readonly":i}),children:[m.jsx("input",{className:De({"is-redacted":"value"in l&&l.value&&o&&!g}),readOnly:i,value:"value"in l?l.value:void 0,defaultValue:"defaultValue"in l?l.defaultValue:void 0,placeholder:r,ref:f,onChange:y=>e==null?void 0:e(y.target.value),onKeyDown:s}),o&&m.jsx(ah,{onSelect:()=>U(!g),style:{border:0,userSelect:"none"},children:g?zG:d7})]})]})}),vue={toggleTheme:[ue("Shift+Alt+D")],saveScene:[ue("CtrlOrCmd+S")],loadScene:[ue("CtrlOrCmd+O")],clearCanvas:[ue("CtrlOrCmd+Delete")],imageExport:[ue("CtrlOrCmd+Shift+E")],commandPalette:[ue("CtrlOrCmd+/"),ue("CtrlOrCmd+Shift+P")],cut:[ue("CtrlOrCmd+X")],copy:[ue("CtrlOrCmd+C")],paste:[ue("CtrlOrCmd+V")],copyStyles:[ue("CtrlOrCmd+Alt+C")],pasteStyles:[ue("CtrlOrCmd+Alt+V")],selectAll:[ue("CtrlOrCmd+A")],deleteSelectedElements:[ue("Delete")],duplicateSelection:[ue("CtrlOrCmd+D"),ue(`Alt+${D("helpDialog.drag")}`)],sendBackward:[ue("CtrlOrCmd+[")],bringForward:[ue("CtrlOrCmd+]")],sendToBack:[ue(gs?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[ue(gs?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[ue("Shift+Alt+C")],group:[ue("CtrlOrCmd+G")],ungroup:[ue("CtrlOrCmd+Shift+G")],gridMode:[ue("CtrlOrCmd+'")],zenMode:[ue("Alt+Z")],objectsSnapMode:[ue("Alt+S")],stats:[ue("Alt+/")],addToLibrary:[],flipHorizontal:[ue("Shift+H")],flipVertical:[ue("Shift+V")],viewMode:[ue("Alt+R")],hyperlink:[ue("CtrlOrCmd+K")],toggleElementLock:[ue("CtrlOrCmd+Shift+L")],resetZoom:[ue("CtrlOrCmd+0")],zoomOut:[ue("CtrlOrCmd+-")],zoomIn:[ue("CtrlOrCmd++")],zoomToFitSelection:[ue("Shift+3")],zoomToFit:[ue("Shift+1")],zoomToFitSelectionInViewport:[ue("Shift+2")],toggleEraserTool:[ue("E")],toggleHandTool:[ue("H")],setFrameAsActiveTool:[ue("F")],saveFileToDisk:[ue("CtrlOrCmd+S")],saveToActiveFile:[ue("CtrlOrCmd+S")],toggleShortcuts:[ue("?")],searchMenu:[ue("CtrlOrCmd+F")],wrapSelectionInFrame:[]},kr=(e,t=0)=>{let n=vue[e];return n&&n.length>0?n[t]||n[0]:""},xue="\\u0300-\\u036f",wue="\\ufe20-\\ufe2f",Eue="\\u20d0-\\u20ff",Cue=xue+wue+Eue,Sue=`[${Cue}]`,_ue=RegExp(Sue,"g"),kue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tue={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"E",æ:"e",Þ:"T",þ:"t",ß:"s",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"I",ij:"i",Œ:"E",œ:"e",ʼn:"n",ſ:"s"},M_=e=>e.replace(kue,t=>Tue[t]||t).replace(_ue,""),Bj=xe.createContext(null),ki=()=>xe.useContext(Bj),Mue=TR(),Iue=()=>xe.useMemo(()=>({MainMenuTunnel:Za(),WelcomeScreenMenuHintTunnel:Za(),WelcomeScreenToolbarHintTunnel:Za(),WelcomeScreenHelpHintTunnel:Za(),WelcomeScreenCenterTunnel:Za(),FooterCenterTunnel:Za(),DefaultSidebarTriggerTunnel:Za(),DefaultSidebarTabTriggersTunnel:Za(),OverwriteConfirmDialogTunnel:Za(),TTDDialogTriggerTunnel:Za(),tunnelsJotai:Mue}),[]),$j=(e,t)=>{var r;let n=((r=t[0])==null?void 0:r.type)||null;for(let i of t)if(i.type!==n){n=null;break}return v3(e.activeTool.type)&&e.activeTool.type!=="image"&&n!=="image"&&n!=="frame"&&n!=="magicframe"||t.some(i=>v3(i.type))},zj=(e,t)=>Gu(e.activeTool.type)||t.some(n=>Gu(n.type)),Hj=({appState:e,elementsMap:t,renderAction:n,app:r})=>{let i=gL(t,e),a=!1;i.length===2&&(Ki(i[0])||Ki(i[1]))&&(a=!0);let s=!!(e.editingTextElement||e.newElement),o=Zn(),c=document.documentElement.getAttribute("dir")==="rtl",d=Gu(e.activeTool.type)&&!Ea(e.currentItemBackgroundColor)||i.some(U=>Gu(U.type)&&!Ea(U.backgroundColor)),l=i.length===1||a,h=!e.editingLinearElement&&i.length===1&&rt(i[0])&&!Ie(i[0]),f=!e.croppingElementId&&i.length===1&&Lt(i[0]),g=!a&&Ci(e,r);return m.jsxs("div",{className:"panelColumn",children:[m.jsx("div",{children:$j(e,i)&&n("changeStrokeColor")}),zj(e,i)&&m.jsx("div",{children:n("changeBackgroundColor")}),d&&n("changeFillStyle"),(iC(e.activeTool.type)||i.some(U=>iC(U.type)))&&n("changeStrokeWidth"),(e.activeTool.type==="freedraw"||i.some(U=>U.type==="freedraw"))&&n("changeStrokeShape"),(aC(e.activeTool.type)||i.some(U=>aC(U.type)))&&m.jsxs(m.Fragment,{children:[n("changeStrokeStyle"),n("changeSloppiness")]}),(x3(e.activeTool.type)||i.some(U=>x3(U.type)))&&m.jsx(m.Fragment,{children:n("changeRoundness")}),(sC(e.activeTool.type)||i.some(U=>sC(U.type)))&&m.jsx(m.Fragment,{children:n("changeArrowType")}),(e.activeTool.type==="text"||i.some(ke))&&m.jsxs(m.Fragment,{children:[n("changeFontFamily"),n("changeFontSize"),(e.activeTool.type==="text"||Pte(i,t))&&n("changeTextAlign")]}),jte(i,t)&&n("changeVerticalAlign"),(n2(e.activeTool.type)||i.some(U=>n2(U.type)))&&m.jsx(m.Fragment,{children:n("changeArrowhead")}),n("changeOpacity"),m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.layers")}),m.jsxs("div",{className:"buttonList",children:[n("sendToBack"),n("sendBackward"),n("bringForward"),n("bringToFront")]})]}),g&&!a&&m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.align")}),m.jsxs("div",{className:"buttonList",children:[c?m.jsxs(m.Fragment,{children:[n("alignRight"),n("alignHorizontallyCentered"),n("alignLeft")]}):m.jsxs(m.Fragment,{children:[n("alignLeft"),n("alignHorizontallyCentered"),n("alignRight")]}),i.length>2&&n("distributeHorizontally"),m.jsx("div",{style:{flexBasis:"100%",height:0}}),m.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[n("alignTop"),n("alignVerticallyCentered"),n("alignBottom"),i.length>2&&n("distributeVertically")]})]})]}),!s&&i.length>0&&m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.actions")}),m.jsxs("div",{className:"buttonList",children:[!o.editor.isMobile&&n("duplicateSelection"),!o.editor.isMobile&&n("deleteSelectedElements"),n("group"),n("ungroup"),l&&n("hyperlink"),f&&n("cropEditor"),h&&n("toggleLinearEditor")]})]})]})},Wj=({activeTool:e,appState:t,app:n,UIOptions:r})=>{let[i,a]=I.useState(!1),s=e.type==="frame",o=e.type==="laser",c=e.type==="embeddable",{TTDDialogTriggerTunnel:d}=ki();return m.jsxs(m.Fragment,{children:[p7.map(({value:l,icon:h,key:f,numericKey:g,fillable:U},y)=>{var C;if(((C=r.tools)==null?void 0:C[l])===!1)return null;let v=D(`toolBar.${l}`),x=f&&bp(typeof f=="string"?f:f[0]),w=x?`${x} ${D("helpDialog.or")} ${g}`:`${g}`;return m.jsx(wt,{className:De("Shape",{fillable:U}),type:"radio",icon:h,checked:e.type===l,name:"editor-current-shape",title:`${bp(v)} — ${w}`,keyBindingLabel:g||x,"aria-label":bp(v),"aria-keyshortcuts":w,"data-testid":`toolbar-${l}`,onPointerDown:({pointerType:S})=>{!t.penDetected&&S==="pen"&&n.togglePenMode(!0)},onChange:({pointerType:S})=>{t.activeTool.type!==l&&Zt("toolbar",l,"ui"),l==="image"?n.setActiveTool({type:l,insertOnCanvasDirectly:S!=="mouse"}):n.setActiveTool({type:l})}},l)}),m.jsx("div",{className:"App-toolbar__divider"}),m.jsxs(ln,{open:i,children:[m.jsx(ln.Trigger,{className:De("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":s||c||o&&!n.props.isCollaborating}),onToggle:()=>a(!i),title:D("toolBar.extraTools"),children:BG}),m.jsxs(ln.Content,{onClickOutside:()=>a(!1),onSelect:()=>a(!1),className:"App-toolbar__extra-tools-dropdown",children:[m.jsx(ln.Item,{onSelect:()=>n.setActiveTool({type:"frame"}),icon:CI,shortcut:q.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:s,children:D("toolBar.frame")}),m.jsx(ln.Item,{onSelect:()=>n.setActiveTool({type:"embeddable"}),icon:FY,"data-testid":"toolbar-embeddable",selected:c,children:D("toolBar.embeddable")}),m.jsx(ln.Item,{onSelect:()=>n.setActiveTool({type:"laser"}),icon:_I,"data-testid":"toolbar-laser",selected:o,shortcut:q.K.toLocaleUpperCase(),children:D("toolBar.laser")}),m.jsx("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),n.props.aiEnabled!==!1&&m.jsx(d.Out,{}),m.jsx(ln.Item,{onSelect:()=>n.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:SI,"data-testid":"toolbar-embeddable",children:D("toolBar.mermaidToExcalidraw")}),n.props.aiEnabled!==!1&&n.plugins.diagramToCode&&m.jsx(m.Fragment,{children:m.jsxs(ln.Item,{onSelect:()=>n.onMagicframeToolSelect(),icon:kI,"data-testid":"toolbar-magicframe",children:[D("toolBar.magicframe"),m.jsx(ln.Item.Badge,{children:"AI"})]})})]})]})]})},Aue=({renderAction:e,zoom:t})=>m.jsx(Wi.Col,{gap:1,className:Bu.ZOOM_ACTIONS,children:m.jsxs(Wi.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),Lue=({renderAction:e,className:t})=>m.jsxs("div",{className:`undo-redo-buttons ${t}`,children:[m.jsx("div",{className:"undo-button-container",children:m.jsx(dd,{label:D("buttons.undo"),children:e("undo")})}),m.jsx("div",{className:"redo-button-container",children:m.jsxs(dd,{label:D("buttons.redo"),children:[" ",e("redo")]})})]}),Rue=({actionManager:e,showExitZenModeBtn:t})=>m.jsx("button",{type:"button",className:De("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(r8),children:D("buttons.exitZenMode")}),Due=({renderAction:e,className:t})=>m.jsx("div",{className:`finalize-button ${t}`,children:e("finalize",{size:"small"})}),I_=e=>{let t=I.useRef({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...n)=>t.current.userFn(...n)),t.current.stableFn},ZU=cr(null),jue=()=>{let[e,t]=Cn(ZU),n=ui();return e&&e==="clearCanvas"?m.jsx(jj,{onConfirm:()=>{n.executeAction(_p),t(null)},onCancel:()=>t(null),title:D("clearCanvasDialog.title"),children:m.jsxs("p",{className:"clear-canvas__content",children:[" ",D("alerts.clearReset")]})}):null},Xj={};OT(Xj,{toggleTheme:()=>Pue});var Pue={...C2,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(C2,"commandPalette")}},Vj=we({name:"copyElementLink",label:"labels.copyElementLink",icon:c7,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let i=ut(e,t);try{if(window.location){let a=ZA(i,t);return a?(await P1(r.props.generateLinkForSelection?r.props.generateLinkForSelection(a.id,a.type):qA(a.id,a.type)),{appState:{toast:{message:D("toast.elementLinkCopied"),closable:!0}},captureUpdate:se.EVENTUALLY}):{appState:t,elements:e,app:r,captureUpdate:se.EVENTUALLY}}}catch(a){console.error(a)}return{appState:t,elements:e,app:r,captureUpdate:se.EVENTUALLY}},predicate:(e,t)=>u2(ut(e,t))}),Nue=we({name:"linkToElement",label:"labels.linkToElement",icon:AI,perform:(e,t,n,r)=>{let i=ut(e,t);return i.length!==1||!u2(i)?{elements:e,appState:t,app:r,captureUpdate:se.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:ut(e,t)[0].id}},captureUpdate:se.IMMEDIATELY}},predicate:(e,t,n,r)=>{var a;let i=ut(e,t);return((a=t.openDialog)==null?void 0:a.name)!=="elementLinkSelector"&&i.length===1&&u2(i)},trackEvent:!1}),Oue=cr(null),Tn={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links"},Fue=e=>{switch(e){case Tn.app:return 1;case Tn.export:return 2;case Tn.editor:return 3;case Tn.tools:return 4;case Tn.elements:return 5;case Tn.links:return 6;default:return 10}},Eg=({shortcut:e,className:t,children:n})=>{let r=e.replace("++","+$").split("+");return m.jsxs("div",{className:De("shortcut",t),children:[r.map((i,a)=>m.jsx("div",{className:"shortcut-wrapper",children:m.jsx("div",{className:"shortcut-key",children:i==="$"?"+":i})},i)),m.jsx("div",{className:"shortcut-desc",children:n})]})},Yj=e=>!e.altKey&&e[q.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===q.P||e.key===q.SLASH);Object.assign(e=>{var r;let t=Hr(),n=Kn();return I.useEffect(()=>{let i=a=>{Yj(a)&&(a.preventDefault(),a.stopPropagation(),n(s=>{var c;let o=((c=s.openDialog)==null?void 0:c.name)==="commandPalette"?null:{name:"commandPalette"};return o&&Zt("command_palette","open","shortcut"),{openDialog:o}}))};return window.addEventListener("keydown",i,{capture:!0}),()=>window.removeEventListener("keydown",i,{capture:!0})},[n]),((r=t.openDialog)==null?void 0:r.name)!=="commandPalette"?null:m.jsx(Bue,{...e})},{defaultItems:Xj});function Bue({customCommandPaletteItems:e}){let t=Ms(),n=Hr(),r=Kn(),i=z1(),a=ui(),[s,o]=Cn(Oue),[c,d]=I.useState(null),l=I.useRef(null),h=HU({uiAppState:n,customCommandPaletteItems:e,appProps:i});I.useEffect(()=>{let{uiAppState:M,customCommandPaletteItems:_,appProps:R}=h,P=B=>{let G="";return B.label&&(typeof B.label=="function"?G=D(B.label(t.scene.getNonDeletedElements(),M,t)):G=D(B.label)),G},j=B=>typeof B.icon=="function"?B.icon(M,t.scene.getNonDeletedElements()):B.icon,N=[],F=(B,G,W)=>{let X={label:P(B),icon:j(B),category:G,shortcut:kr(B.name),keywords:B.keywords,predicate:B.predicate,viewMode:B.viewMode,perform:()=>{a.executeAction(B,"commandPalette")}};return W?W(X,B):X};if(M&&t.scene&&a){let B=[a.actions.group,a.actions.ungroup,a.actions.cut,a.actions.copy,a.actions.deleteSelectedElements,a.actions.wrapSelectionInFrame,a.actions.copyStyles,a.actions.pasteStyles,a.actions.bringToFront,a.actions.bringForward,a.actions.sendBackward,a.actions.sendToBack,a.actions.alignTop,a.actions.alignBottom,a.actions.alignLeft,a.actions.alignRight,a.actions.alignVerticallyCentered,a.actions.alignHorizontallyCentered,a.actions.duplicateSelection,a.actions.flipHorizontal,a.actions.flipVertical,a.actions.zoomToFitSelection,a.actions.zoomToFitSelectionInViewport,a.actions.increaseFontSize,a.actions.decreaseFontSize,a.actions.toggleLinearEditor,a.actions.cropEditor,Ij,Vj,Nue].map(H=>F(H,Tn.elements,(Z,V)=>({...Z,predicate:V.predicate?V.predicate:(te,ce,be,fe)=>ut(te,ce).length>0}))),G=[a.actions.toggleHandTool,a.actions.setFrameAsActiveTool].map(H=>F(H,Tn.tools)),W=[a.actions.undo,a.actions.redo,a.actions.zoomIn,a.actions.zoomOut,a.actions.resetZoom,a.actions.zoomToFit,a.actions.zenMode,a.actions.viewMode,a.actions.gridMode,a.actions.objectsSnapMode,a.actions.toggleShortcuts,a.actions.selectAll,a.actions.toggleElementLock,a.actions.unlockAllElements,a.actions.stats].map(H=>F(H,Tn.editor)),X=[a.actions.saveToActiveFile,a.actions.saveFileToDisk,a.actions.copyAsPng,a.actions.copyAsSvg].map(H=>F(H,Tn.export));N=[...B,...W,{label:P(_p),icon:j(_p),shortcut:kr(_p.name),category:Tn.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{Sa.set(ZU,"clearCanvas")}},{label:D("buttons.exportImage"),category:Tn.export,icon:UI,shortcut:kr("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{r({openDialog:{name:"imageExport"}})}},...X];let $=[{label:D("toolBar.library"),category:Tn.app,icon:a7,viewMode:!1,perform:()=>{M.openSidebar?r({openSidebar:null}):r({openSidebar:{name:ka.name,tab:ka.defaultTab}})}},{label:D("search.title"),category:Tn.app,icon:id,viewMode:!0,perform:()=>{a.executeAction(Gj)}},{label:D("labels.changeStroke"),keywords:["color","outline"],category:Tn.elements,icon:Rb,viewMode:!1,predicate:(H,Z)=>{let V=ut(H,Z);return V.length>0&&$j(Z,V)},perform:()=>{r(H=>({openMenu:H.openMenu==="shape"?null:"shape",openPopup:"elementStroke"}))}},{label:D("labels.changeBackground"),keywords:["color","fill"],icon:Rb,category:Tn.elements,viewMode:!1,predicate:(H,Z)=>{let V=ut(H,Z);return V.length>0&&zj(Z,V)},perform:()=>{r(H=>({openMenu:H.openMenu==="shape"?null:"shape",openPopup:"elementBackground"}))}},{label:D("labels.canvasBackground"),keywords:["color"],icon:Rb,category:Tn.editor,viewMode:!1,perform:()=>{r(H=>({openMenu:H.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...p7.reduce((H,Z)=>{var Ue;let{value:V,icon:te,key:ce,numericKey:be}=Z;if(((Ue=R.UIOptions.tools)==null?void 0:Ue[V])===!1)return H;let fe=ce&&bp(typeof ce=="string"?ce:ce[0])||be,Se={label:D(`toolBar.${V}`),category:Tn.tools,shortcut:fe,icon:te,keywords:["toolbar"],viewMode:!1,perform:({event:ye})=>{V==="image"?t.setActiveTool({type:V,insertOnCanvasDirectly:ye.type==="keydown"}):t.setActiveTool({type:V})}};return H.push(Se),H},[]),...G,{label:D("toolBar.lock"),category:Tn.tools,icon:M.activeTool.locked?s7:uU,shortcut:q.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${D("labels.textToDiagram")}...`,category:Tn.tools,icon:HG,viewMode:!1,predicate:R.aiEnabled,perform:()=>{r(H=>({...H,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${D("toolBar.mermaidToExcalidraw")}...`,category:Tn.tools,icon:SI,viewMode:!1,predicate:R.aiEnabled,perform:()=>{r(H=>({...H,openDialog:{name:"ttd",tab:"mermaid"}}))}}],Y=[...N,...$,..._||[]].map(H=>{var Z;return{...H,icon:H.icon||TI,order:H.order??Fue(H.category),haystack:`${M_(H.label.toLocaleLowerCase())} ${((Z=H.keywords)==null?void 0:Z.join(" "))||""}`}});d(Y),o(Y.find(H=>H.label===(s==null?void 0:s.label))??null)}},[h,t,a,d,s==null?void 0:s.label,o,r]);let[f,g]=I.useState(""),[U,y]=I.useState(null),[v,x]=I.useState({}),w=M=>{r({openDialog:null},M),g("")},C=(M,_)=>{var R;((R=n.openDialog)==null?void 0:R.name)==="commandPalette"&&(_.stopPropagation(),_.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),w(()=>{M.perform({actionManager:a,event:_}),o(M),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},S=I_(M=>M.viewMode===!1&&n.viewModeEnabled?!1:typeof M.predicate=="function"?M.predicate(t.scene.getNonDeletedElements(),n,i,t):M.predicate===void 0||M.predicate),T=I_(M=>{var j;let _=_c(M.target)||Yj(M)||M.key===q.ESCAPE;if(_&&M.key!==q.ARROW_UP&&M.key!==q.ARROW_DOWN&&M.key!==q.ENTER)return;let R=Object.values(v).flat(),P=s&&!f&&S(s);if(M.key===q.ARROW_UP){M.preventDefault();let N=R.findIndex(G=>G.label===(U==null?void 0:U.label));if(P){if(N===0){y(s);return}if(U===s){let G=R[R.length-1];G&&y(G);return}}let F;N===-1?F=R.length-1:F=N===0?R.length-1:(N-1)%R.length;let B=R[F];B&&y(B);return}if(M.key===q.ARROW_DOWN){M.preventDefault();let N=R.findIndex(G=>G.label===(U==null?void 0:U.label));if(P){if(!U||N===R.length-1){y(s);return}if(U===s){let G=R[0];G&&y(G);return}}let F=(N+1)%R.length,B=R[F];B&&y(B);return}if(M.key===q.ENTER&&U&&setTimeout(()=>{C(U,M)}),!_){if(M.stopPropagation(),/^[a-zA-Z0-9]$/.test(M.key)){(j=l==null?void 0:l.current)==null||j.focus();return}M.preventDefault()}});return I.useEffect(()=>(window.addEventListener("keydown",T,{capture:!0}),()=>window.removeEventListener("keydown",T,{capture:!0})),[T]),I.useEffect(()=>{if(!c)return;let M=j=>{let N={};for(let F of j)N[F.category]?N[F.category].push(F):N[F.category]=[F];return N},_=c.filter(S).sort((j,N)=>j.order-N.order),R=!f&&s&&S(s);if(!f){x(M(R?_.filter(j=>j.label!==(s==null?void 0:s.label)):_)),y(R?s:_[0]||null);return}let P=M_(f.toLocaleLowerCase().replace(/[<>_| -]/g,""));_=uoe.filter(P,_,{extract:j=>j.haystack}).sort((j,N)=>N.score-j.score).map(j=>j.original),x(M(_)),y(_[0]??null)},[f,c,S,s]),m.jsxs(Oa,{onCloseRequest:()=>w(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[m.jsx(Lv,{value:f,placeholder:D("commandPalette.search.placeholder"),onChange:M=>{g(M)},selectOnRender:!0,ref:l}),!t.device.viewport.isMobile&&m.jsxs("div",{className:"shortcuts-wrapper",children:[m.jsx(Eg,{shortcut:"↑↓",children:D("commandPalette.shortcuts.select")}),m.jsx(Eg,{shortcut:"↵",children:D("commandPalette.shortcuts.confirm")}),m.jsx(Eg,{shortcut:ue("Esc"),children:D("commandPalette.shortcuts.close")})]}),m.jsxs("div",{className:"commands",children:[s&&!f&&m.jsxs("div",{className:"command-category",children:[m.jsxs("div",{className:"command-category-title",children:[D("commandPalette.recents"),m.jsx("div",{className:"icon",style:{marginLeft:"6px"},children:WG})]}),m.jsx(A_,{command:s,isSelected:s.label===(U==null?void 0:U.label),onClick:M=>C(s,M),disabled:!S(s),onMouseMove:()=>y(s),showShortcut:!t.device.viewport.isMobile,appState:n})]}),Object.keys(v).length>0?Object.keys(v).map((M,_)=>m.jsxs("div",{className:"command-category",children:[m.jsx("div",{className:"command-category-title",children:M}),v[M].map(R=>m.jsx(A_,{command:R,isSelected:R.label===(U==null?void 0:U.label),onClick:P=>C(R,P),onMouseMove:()=>y(R),showShortcut:!t.device.viewport.isMobile,appState:n},R.label))]},M)):c?m.jsxs("div",{className:"no-match",children:[m.jsx("div",{className:"icon",children:id})," ",D("commandPalette.search.noMatch")]}):null]})]})}var A_=({command:e,isSelected:t,disabled:n,onMouseMove:r,onClick:i,showShortcut:a,appState:s})=>{let o=()=>{};return m.jsxs("div",{className:De("command-item",{"item-selected":t,"item-disabled":n}),ref:c=>{var d;t&&!n&&((d=c==null?void 0:c.scrollIntoView)==null||d.call(c,{block:"nearest"}))},onClick:n?o:i,onMouseMove:n?o:r,title:n?D("commandPalette.itemNotAvailable"):"",children:[m.jsxs("div",{className:"name",children:[e.icon&&m.jsx(XU,{icon:typeof e.icon=="function"?e.icon(s):e.icon}),e.label]}),a&&e.shortcut&&m.jsx(Eg,{shortcut:e.shortcut})]})},$ue=we({name:"toggleLinearEditor",category:Tn.elements,label:(e,t,n)=>{var r;return((r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0])==null?void 0:r.type)==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit"},keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&i.length===1&&rt(i[0])&&!Ie(i[0]))},perform(e,t,n,r){var s;let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],a=((s=t.editingLinearElement)==null?void 0:s.elementId)===i.id?null:new Me(i);return{appState:{...t,editingLinearElement:a},captureUpdate:se.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],i=D(r.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return m.jsx(wt,{type:"button",icon:iq,title:i,"aria-label":i,onClick:()=>t(null)})}}),Gj=we({name:"searchMenu",icon:id,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,n,r){var i,a;if(((i=t.openSidebar)==null?void 0:i.name)===ka.name&&t.openSidebar.tab===Mu){let s=(a=r.excalidrawContainerValue.container)==null?void 0:a.querySelector(`.${Bu.SEARCH_MENU_INPUT_WRAPPER} input`);return s!=null&&s.matches(":focus")?{appState:{...t,openSidebar:null},captureUpdate:se.EVENTUALLY}:(s==null||s.focus(),s==null||s.select(),!1)}return{appState:{...t,openSidebar:{name:ka.name,tab:Mu},openDialog:null},captureUpdate:se.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[q.CTRL_OR_CMD]&&e.key===q.F}),zue=we({name:"cropEditor",label:"helpDialog.cropStart",icon:JE,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,n,r){let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:i.id},captureUpdate:se.IMMEDIATELY}},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return!!(!t.croppingElementId&&i.length===1&&Lt(i[0]))},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=D("helpDialog.cropStart");return m.jsx(wt,{type:"button",icon:JE,title:r,"aria-label":r,onClick:()=>t(null)})}}),S2=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},L_=class sp{constructor(){z(this,"onHistoryChangedEmitter",new ns),z(this,"undoStack",[]),z(this,"redoStack",[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(t,n){let r=Hue.create(n,t);r.isEmpty()||(this.undoStack.push(r.inverse()),r.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new S2(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,n,r){return this.perform(t,n,r,()=>sp.pop(this.undoStack),i=>sp.push(this.redoStack,i,t))}redo(t,n,r){return this.perform(t,n,r,()=>sp.pop(this.redoStack),i=>sp.push(this.undoStack,i,t))}perform(t,n,r,i,a){try{let s=i();if(s===null)return;let o=t,c=n,d=!1;for(;s;){try{[o,c,d]=s.applyTo(o,c,r)}finally{a(s)}if(d)break;s=i()}return[o,c]}finally{this.onHistoryChangedEmitter.trigger(new S2(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(t){if(!t.length)return null;let n=t.pop();return n!==void 0?n:null}static push(t,n,r){let i=n.inverse().applyLatestChanges(r);return t.push(i)}},Hue=class Cg{constructor(t,n){this.appStateChange=t,this.elementsChange=n}static create(t,n){return new Cg(t,n)}inverse(){return new Cg(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(t,n,r){let[i,a]=this.elementsChange.applyTo(t,r.elements),[s,o]=this.appStateChange.applyTo(n,i);return[i,s,a||o]}applyLatestChanges(t){let n=this.elementsChange.applyLatestChanges(t);return Cg.create(this.appStateChange,n)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},qj=(e,t)=>{let[n,r]=I.useState(t);return I.useEffect(()=>{let i=e.on(a=>{r(a)});return()=>{i()}},[e]),n},Zj=(e,t,n)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let r=n();if(!r)return{captureUpdate:se.EVENTUALLY};let[i,a]=r,s=Array.from(i.values());return{appState:a,elements:s,captureUpdate:se.NEVER}}return{captureUpdate:se.EVENTUALLY}},Wue=(e,t)=>({name:"undo",label:"buttons.undo",icon:OE,trackEvent:{category:"history"},viewMode:!1,perform:(n,r,i,a)=>Zj(a,r,()=>e.undo(Qe(n),r,t.snapshot)),keyTest:n=>n[q.CTRL_OR_CMD]&&b3(n,q.Z)&&!n.shiftKey,PanelComponent:({updateData:n,data:r})=>{let{isUndoStackEmpty:i}=qj(e.onHistoryChangedEmitter,new S2(e.isUndoStackEmpty,e.isRedoStackEmpty));return m.jsx(wt,{type:"button",icon:OE,"aria-label":D("buttons.undo"),onClick:n,size:(r==null?void 0:r.size)||"medium",disabled:i,"data-testid":"button-undo"})}}),Xue=(e,t)=>({name:"redo",label:"buttons.redo",icon:FE,trackEvent:{category:"history"},viewMode:!1,perform:(n,r,i,a)=>Zj(a,r,()=>e.redo(Qe(n),r,t.snapshot)),keyTest:n=>n[q.CTRL_OR_CMD]&&n.shiftKey&&b3(n,q.Z)||BM&&n.ctrlKey&&!n.shiftKey&&b3(n,q.Y),PanelComponent:({updateData:n,data:r})=>{let{isRedoStackEmpty:i}=qj(e.onHistoryChangedEmitter,new S2(e.isUndoStackEmpty,e.isRedoStackEmpty));return m.jsx(wt,{type:"button",icon:FE,"aria-label":D("buttons.redo"),onClick:n,size:(r==null?void 0:r.size)||"medium",disabled:i,"data-testid":"button-redo"})}}),gy=(e,t,n,r,i,a)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,a))&&Zt(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${i.device.editor.isMobile?"mobile":"desktop"})`)}catch(s){console.error("error while logging action:",s)}},Vue=class{constructor(e,t,n,r){z(this,"actions",{}),z(this,"updater"),z(this,"getAppState"),z(this,"getElementsIncludingDeleted"),z(this,"app"),z(this,"renderAction",(i,a)=>{let s=this.app.props.UIOptions.canvasActions;if(this.actions[i]&&"PanelComponent"in this.actions[i]&&(!(i in s)||s[i])){let o=this.actions[i],c=o.PanelComponent;c.displayName="PanelComponent";let d=this.getElementsIncludingDeleted(),l=this.getAppState(),h=f=>{gy(o,"ui",l,d,this.app,f),this.updater(o.perform(this.getElementsIncludingDeleted(),this.getAppState(),f,this.app))};return m.jsx(c,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:h,appProps:this.app.props,app:this.app,data:a})}return null}),z(this,"isActionEnabled",i=>{let a=this.getElementsIncludingDeleted(),s=this.getAppState();return!i.predicate||i.predicate(a,s,this.app.props,this.app)}),this.updater=i=>{if(A1(i))i.then(a=>e(a));else return e(i)},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(t=>this.registerAction(t))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort((o,c)=>(c.keyPriority||0)-(o.keyPriority||0)).filter(o=>(o.name in t?t[o.name]:!0)&&o.keyTest&&o.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(n.length!==1)return n.length>1&&console.warn("Canceling as multiple actions match this shortcut",n),!1;let r=n[0];if(this.getAppState().viewModeEnabled&&r.viewMode!==!0)return!1;let i=this.getElementsIncludingDeleted(),a=this.getAppState();return gy(r,"keyboard",a,i,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(n[0].perform(i,a,null,this.app)),!0}executeAction(e,t="api",n=null){let r=this.getElementsIncludingDeleted(),i=this.getAppState();gy(e,t,i,r,this.app,n),this.updater(e.perform(r,i,n,this.app))}},R_=e=>{let t=Array.from(e.values());return{x:j_(t,n=>n.x)/t.length,y:j_(t,n=>n.y)/t.length}},D_=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),j_=(e,t)=>e.reduce((n,r)=>n+t(r),0),Yue=({children:e,left:t,top:n,onCloseRequest:r,fitInViewport:i=!1,offsetLeft:a=0,offsetTop:s=0,viewportWidth:o=window.innerWidth,viewportHeight:c=window.innerHeight})=>{let d=I.useRef(null);I.useEffect(()=>{let h=d.current;if(!h)return;h.contains(document.activeElement)||h.focus();let f=g=>{var U,y,v;if(g.key===q.TAB){let x=d3(h),{activeElement:w}=document,C=x.findIndex(S=>S===w);w===h?(g.shiftKey?(U=x[x.length-1])==null||U.focus():x[0].focus(),g.preventDefault(),g.stopImmediatePropagation()):C===0&&g.shiftKey?((y=x[x.length-1])==null||y.focus(),g.preventDefault(),g.stopImmediatePropagation()):C===x.length-1&&!g.shiftKey&&((v=x[0])==null||v.focus(),g.preventDefault(),g.stopImmediatePropagation())}};return h.addEventListener("keydown",f),()=>h.removeEventListener("keydown",f)},[]);let l=I.useRef(null);return I.useLayoutEffect(()=>{var h,f;if(i&&d.current&&n!=null&&t!=null){let g=d.current,{width:U,height:y}=g.getBoundingClientRect();if(((h=l.current)==null?void 0:h.top)===n&&((f=l.current)==null?void 0:f.left)===t)return;l.current={top:n,left:t},U>=o?(g.style.width=`${o}px`,g.style.left="0px",g.style.overflowX="scroll"):t+U-a>o?g.style.left=`${o-U-10}px`:g.style.left=`${t}px`,y>=c?(g.style.height=`${c-20}px`,g.style.top="10px",g.style.overflowY="scroll"):n+y-s>c?g.style.top=`${c-y}px`:g.style.top=`${n}px`}},[n,t,i,o,c,a,s]),I.useEffect(()=>{if(r){let h=f=>{var g;(g=d.current)!=null&&g.contains(f.target)||ar.unstable_batchedUpdates(()=>r(f))};return document.addEventListener("pointerdown",h,!1),()=>document.removeEventListener("pointerdown",h,!1)}},[r]),m.jsx("div",{className:"popover",ref:d,tabIndex:-1,children:e})},Xn="separator",Gue=xe.memo(({actionManager:e,items:t,top:n,left:r,onClose:i})=>{let a=H1(),s=KU(),o=t.reduce((c,d)=>(d&&(d===Xn||!d.predicate||d.predicate(s,a,e.app.props,e.app))&&c.push(d),c),[]);return m.jsx(Yue,{onCloseRequest:()=>{i()},top:n,left:r,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:m.jsx("ul",{className:"context-menu",onContextMenu:c=>c.preventDefault(),children:o.map((c,d)=>{var f;if(c===Xn)return!o[d-1]||o[d-1]===Xn?null:m.jsx("hr",{className:"context-menu-item-separator"},d);let l=c.name,h="";return c.label&&(typeof c.label=="function"?h=D(c.label(s,a,e.app)):h=D(c.label)),m.jsx("li",{"data-testid":l,onClick:()=>{i(()=>{e.executeAction(c,"contextMenu")})},children:m.jsxs("button",{type:"button",className:De("context-menu-item",{dangerous:l==="deleteSelectedElements",checkmark:(f=c.checked)==null?void 0:f.call(c,a)}),children:[m.jsx("div",{className:"context-menu-item__label",children:h}),m.jsx("kbd",{className:"context-menu-item__shortcut",children:l?kr(l):""})]})},d)})})})}),que=({children:e,onClose:t})=>{let[n,r]=I.useState(!!e),{container:i}=Is(),a=xe.useCallback(()=>{r(!1),t&&t(),i==null||i.focus()},[t,i]);return m.jsx(m.Fragment,{children:n&&m.jsx(Oa,{size:"small",onCloseRequest:a,title:D("errorDialog.title"),children:m.jsx("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},Kj=function({onChange:e,value:t,choices:n,name:r}){return m.jsx("div",{className:"RadioGroup",children:n.map(i=>m.jsxs("div",{className:De("RadioGroup__choice",{active:i.value===t}),title:i.ariaLabel,children:[m.jsx("input",{name:r,type:"radio",checked:i.value===t,onChange:()=>e(i.value),"aria-label":i.ariaLabel}),i.label]},String(i.value)))})},Dm=({title:e,name:t,checked:n,onChange:r,disabled:i=!1})=>m.jsx("div",{className:De("Switch",{toggled:n,disabled:i}),children:m.jsx("input",{name:t,id:t,title:e,type:"checkbox",checked:n,disabled:i,onChange:()=>r(!n),onKeyDown:a=>{a.key===" "&&r(!n)}})}),Tp=I.forwardRef(({children:e,icon:t,onClick:n,label:r,variant:i="filled",color:a="primary",size:s="medium",fullWidth:o,className:c,status:d},l)=>{let[h,f]=I.useState(!1),g=async y=>{let v=n==null?void 0:n(y);if(A1(v)){let x=window.setTimeout(()=>{f(!0)},50);try{await v}catch(w){if(w instanceof pU)console.warn(w);else throw w}finally{clearTimeout(x),f(!1)}}},U=h?"loading":d;return a=U==="success"?"success":a,m.jsx("button",{className:De("ExcButton",`ExcButton--color-${a}`,`ExcButton--variant-${i}`,`ExcButton--size-${s}`,`ExcButton--status-${U}`,{"ExcButton--fullWidth":o},c),onClick:g,type:"button","aria-label":r,ref:l,disabled:U==="loading"||U==="success",children:m.jsxs("div",{className:"ExcButton__contents",children:[U==="loading"?m.jsx(_o,{className:"ExcButton__statusIcon"}):U==="success"&&m.jsx("div",{className:"ExcButton__statusIcon",children:NG}),t&&m.jsx("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),i!=="icon"&&(e??r)]})})}),Zue=2e3,Kue=()=>{let[e,t]=I.useState(null),n=I.useRef(0),r=()=>{clearTimeout(n.current),t("success"),n.current=window.setTimeout(()=>{t(null)},Zue)},i=I.useCallback(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:i,onCopy:r}},Que="filter"in document.createElement("canvas").getContext("2d"),Jue=()=>m.jsxs("div",{children:[m.jsx("h3",{children:D("canvasError.cannotShowPreview")}),m.jsx("p",{children:m.jsx("span",{children:D("canvasError.canvasTooBig")})}),m.jsxs("em",{children:["(",D("canvasError.canvasTooBigTip"),")"]})]}),ehe=({appStateSnapshot:e,elementsSnapshot:t,files:n,actionManager:r,onExportImage:i,name:a})=>{let s=$n(t,e),[o,c]=I.useState(a),[d,l]=I.useState(s),[h,f]=I.useState(e.exportBackground),[g,U]=I.useState(e.exportWithDarkMode),[y,v]=I.useState(e.exportEmbedScene),[x,w]=I.useState(e.exportScale),C=I.useRef(null),[S,T]=I.useState(null),{onCopy:M,copyStatus:_,resetCopyStatus:R}=Kue();I.useEffect(()=>{R()},[o,h,g,x,y,R]);let{exportedElements:P,exportingFrame:j}=YU(t,e,d);return I.useEffect(()=>{let N=C.current;if(!N)return;let F=N.offsetWidth,B=N.offsetHeight;F&&MU({elements:P,appState:{...e,name:o,exportBackground:h,exportWithDarkMode:g,exportScale:x,exportEmbedScene:y},files:n,exportPadding:bh,maxWidthOrHeight:Math.max(F,B),exportingFrame:j}).then(G=>(T(null),s1(G).then(()=>{N.replaceChildren(G)}).catch(W=>{throw W.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(D("canvasError.canvasTooBig")):W}))).catch(G=>{console.error(G),T(G)})},[e,n,P,j,o,h,g,x,y]),m.jsxs("div",{className:"ImageExportModal",children:[m.jsx("h3",{children:D("imageExportDialog.header")}),m.jsxs("div",{className:"ImageExportModal__preview",children:[m.jsx("div",{className:"ImageExportModal__preview__canvas",ref:C,children:S&&m.jsx(Jue,{})}),m.jsx("div",{className:"ImageExportModal__preview__filename",children:!md&&m.jsx("input",{type:"text",className:"TextInput",value:o,style:{width:"30ch"},onChange:N=>{c(N.target.value),r.executeAction(Yce,"ui",N.target.value)}})})]}),m.jsxs("div",{className:"ImageExportModal__settings",children:[m.jsx("h3",{children:D("imageExportDialog.header")}),s&&m.jsx(Pf,{label:D("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:m.jsx(Dm,{name:"exportOnlySelected",checked:d,onChange:N=>{l(N)}})}),m.jsx(Pf,{label:D("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:m.jsx(Dm,{name:"exportBackgroundSwitch",checked:h,onChange:N=>{f(N),r.executeAction(qce,"ui",N)}})}),Que&&m.jsx(Pf,{label:D("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:m.jsx(Dm,{name:"exportDarkModeSwitch",checked:g,onChange:N=>{U(N),r.executeAction(Zce,"ui",N)}})}),m.jsx(Pf,{label:D("imageExportDialog.label.embedScene"),tooltip:D("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:m.jsx(Dm,{name:"exportEmbedSwitch",checked:y,onChange:N=>{v(N),r.executeAction(xj,"ui",N)}})}),m.jsx(Pf,{label:D("imageExportDialog.label.scale"),name:"exportScale",children:m.jsx(Kj,{name:"exportScale",value:x,onChange:N=>{w(N),r.executeAction(Gce,"ui",N)},choices:K8.map(N=>({value:N,label:`${N}×`}))})}),m.jsxs("div",{className:"ImageExportModal__settings__buttons",children:[m.jsx(Tp,{className:"ImageExportModal__settings__buttons__button",label:D("imageExportDialog.title.exportToPng"),onClick:()=>i(_b.png,P,{exportingFrame:j}),icon:QE,children:D("imageExportDialog.button.exportToPng")}),m.jsx(Tp,{className:"ImageExportModal__settings__buttons__button",label:D("imageExportDialog.title.exportToSvg"),onClick:()=>i(_b.svg,P,{exportingFrame:j}),icon:QE,children:D("imageExportDialog.button.exportToSvg")}),(B7||Xp)&&m.jsx(Tp,{className:"ImageExportModal__settings__buttons__button",label:D("imageExportDialog.title.copyPngToClipboard"),status:_,onClick:async()=>{await i(_b.clipboard,P,{exportingFrame:j}),M()},icon:c7,children:D("imageExportDialog.button.copyPngToClipboard")})]})]})]})},Pf=({label:e,children:t,tooltip:n,name:r})=>m.jsxs("div",{className:"ImageExportModal__settings__setting",title:e,children:[m.jsxs("label",{htmlFor:r,className:"ImageExportModal__settings__setting__label",children:[e,n&&m.jsx(dd,{label:n,long:!0,children:PG})]}),m.jsx("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),the=({elements:e,appState:t,files:n,actionManager:r,onExportImage:i,onCloseRequest:a,name:s})=>{let[{appStateSnapshot:o,elementsSnapshot:c}]=I.useState(()=>({appStateSnapshot:co(t),elementsSnapshot:co(e)}));return m.jsx(Oa,{onCloseRequest:a,size:"wide",title:!1,children:m.jsx(ehe,{elementsSnapshot:c,appStateSnapshot:o,files:n,actionManager:r,onExportImage:i,name:s})})},Qj=({children:e,side:t,className:n})=>m.jsx("div",{className:De("FixedSideContainer",`FixedSideContainer_side_${t}`,n),children:e}),Du=100,ju=100,P_=e=>{switch(e){case q.ARROW_UP:return"up";case q.ARROW_DOWN:return"down";case q.ARROW_RIGHT:return"right";case q.ARROW_LEFT:return"left";default:return"right"}},Jj=(e,t,n,r)=>{let i=[...n.values()].reduce((a,s)=>{var c;let o;if(Ie(s)&&(o=s[e==="predecessors"?"startBinding":"endBinding"])&&((c=s[e==="predecessors"?"endBinding":"startBinding"])==null?void 0:c.elementId)===t.id){let d=n.get(o.elementId);if(!d)return a;Tr(Ra(d),"not an ExcalidrawBindableElement");let l=e==="predecessors"?s.points[s.points.length-1]:[0,0],h=iA(t,as(t),[l[0]+s.x,l[1]+s.y]);a.push({relative:d,heading:h})}return a},[]);switch(r){case"up":return i.filter(a=>En(a.heading,ii)).map(a=>a.relative);case"down":return i.filter(a=>En(a.heading,sr)).map(a=>a.relative);case"right":return i.filter(a=>En(a.heading,xn)).map(a=>a.relative);case"left":return i.filter(a=>En(a.heading,ri)).map(a=>a.relative)}},l8=(e,t,n)=>Jj("successors",e,t,n),c8=(e,t,n)=>Jj("predecessors",e,t,n),nhe=(e,t,n)=>{let r=ju+e.width;if(n==="up"||n==="down"){let o=Du+e.height,c=e.x,d=e.x+e.width;if(t.every(l=>l.x+l.width<c||l.x>d))return{x:0,y:o*(n==="up"?-1:1)}}else if(n==="right"||n==="left"){let o=e.y,c=e.y+e.height;if(t.every(d=>d.y+d.height<o||d.y>c))return{x:(ju+e.width)*(n==="left"?-1:1),y:0}}if(n==="up"||n==="down"){let o=Du+e.height,c=(t.length,o),d=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*r:t.length/2*r*-1;return n==="up"?{x:d,y:c*-1}:{x:d,y:c}}let i=Du+e.height,a=(t.length,ju+e.width),s=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return n==="left"?{x:a*-1,y:s}:{x:a,y:s}},rhe=(e,t,n,r)=>{let i=l8(e,t,r),a=c8(e,t,r),s=nhe(e,[...i,...a],r),o=vs({type:e.type,x:e.x+s.x,y:e.y+s.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});Tr(dU(o),"not an ExcalidrawFlowchartNodeElement");let c=eP(e,o,t,r,n);return{nextNode:o,bindingArrow:c}},ihe=(e,t,n,r,i)=>{let a=[];for(let s=0;s<i;s++){let o,c;if(r==="left"||r==="right"){let h=Du*(i-1)+i*e.height,f=e.y+e.height/2-h/2,g=ju+e.width;r==="left"&&(g*=-1),o=e.x+g;let U=(Du+e.height)*s;c=f+U}else{let h=ju*(i-1)+i*e.width,f=e.x+e.width/2-h/2,g=Du+e.height;r==="up"&&(g*=-1),c=e.y+g;let U=(ju+e.width)*s;o=f+U}let d=vs({type:e.type,x:o,y:c,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});Tr(dU(d),"not an ExcalidrawFlowchartNodeElement");let l=eP(e,d,t,r,n);a.push(d),a.push(l)}return a},eP=(e,t,n,r,i)=>{let a,s;switch(r){case"up":{a=e.x+e.width/2,s=e.y-6;break}case"down":{a=e.x+e.width/2,s=e.y+e.height+6;break}case"right":{a=e.x+e.width+6,s=e.y+e.height/2;break}case"left":{a=e.x-6,s=e.y+e.height/2;break}}let o,c;switch(r){case"up":{o=t.x+t.width/2-a,c=t.y+t.height-s+6;break}case"down":{o=t.x+t.width/2-a,c=t.y-s-6;break}case"right":{o=t.x-a-6,c=t.y-s+t.height/2;break}case"left":{o=t.x+t.width-a+6,c=t.y-s+t.height/2;break}}let d=w7({type:"arrow",x:a,y:s,startArrowhead:null,endArrowhead:i.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[A(0,0),A(o,c)],elbowed:!0});bs(d,e,"start",n),bs(d,t,"end",n);let l=new Map;l.set(e.id,e),l.set(t.id,t),l.set(d.id,d),Me.movePoints(d,[{index:1,point:d.points[1]}]);let h=A7(d,qi(new Map([...n.entries(),[e.id,e],[t.id,t],[d.id,d]])),{points:d.points});return{...d,...h}},ahe=class{constructor(){z(this,"isExploring",!1),z(this,"sameLevelNodes",[]),z(this,"sameLevelIndex",0),z(this,"direction",null),z(this,"visitedNodes",new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,n){if(!Ra(e))return null;if(n!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&n===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let r=[...l8(e,t,n),...c8(e,t,n)];if(r.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=r,this.direction=n,this.visitedNodes.add(r[0].id),r[0].id;if(n===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let i=["up","right","down","left"].filter(a=>a!==n).map(a=>[...l8(e,t,a),...c8(e,t,a)]).flat().filter(a=>!this.visitedNodes.has(a.id));for(let a of i)if(!this.visitedNodes.has(a.id))return this.visitedNodes.add(a.id),this.isExploring=!0,this.direction=n,a.id}return null}},she=class{constructor(){z(this,"isCreatingChart",!1),z(this,"numberOfNodes",0),z(this,"direction","right"),z(this,"pendingNodes",null)}createNodes(e,t,n,r){if(r!==this.direction){let{nextNode:i,bindingArrow:a}=rhe(e,t,n,r);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=r,this.pendingNodes=[i,a]}else{this.numberOfNodes+=1;let i=ihe(e,t,n,r,this.numberOfNodes);this.isCreatingChart=!0,this.direction=r,this.pendingNodes=i}if(e.frameId){let i=t.get(e.frameId);Tr(i&&sI(i),"not an ExcalidrawFrameElement"),i&&this.pendingNodes.every(a=>N1([a],i,t)||Ol(a,i,t))&&(this.pendingNodes=this.pendingNodes.map(a=>he(a,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},ohe=(e,t)=>{var n,r;for(let[,i]of t)if(i.type==="arrow"&&(((n=i.startBinding)==null?void 0:n.elementId)===e.id||((r=i.endBinding)==null?void 0:r.elementId)===e.id))return!0;return!1},lhe=({appState:e,isMobile:t,device:n,app:r})=>{var l,h;let{activeTool:i,isResizing:a,isRotating:s,lastPointerDownWith:o}=e,c=e.multiElement!==null;if(((l=e.openSidebar)==null?void 0:l.name)===ka.name&&e.openSidebar.tab===Mu&&((h=e.searchMatches)!=null&&h.length))return D("hints.dismissSearch");if(e.openSidebar&&!n.editor.canFitSidebar)return null;if(ts(e))return D("hints.eraserRevert");if(i.type==="arrow"||i.type==="line")return c?D("hints.linearElementMulti"):i.type==="arrow"?D("hints.arrowTool",{arrowShortcut:ue("A")}):D("hints.linearElement");if(i.type==="freedraw")return D("hints.freeDraw");if(i.type==="text")return D("hints.text");if(i.type==="embeddable")return D("hints.embeddable");if(e.activeTool.type==="image"&&e.pendingImageElementId)return D("hints.placeImage");let d=r.scene.getSelectedElements(e);if(a&&o==="mouse"&&d.length===1){let f=d[0];return rt(f)&&f.points.length===2?D("hints.lockAngle"):Lt(f)?D("hints.resizeImage"):D("hints.resize")}if(s&&o==="mouse")return D("hints.rotate");if(d.length===1&&ke(d[0]))return D("hints.text_selected");if(e.editingTextElement)return D("hints.text_editing");if(e.croppingElementId)return D("hints.leaveCropEditor");if(d.length===1&&Lt(d[0]))return D("hints.enterCropEditor");if(i.type==="selection"){if(e.selectionElement&&!d.length&&!e.editingTextElement&&!e.editingLinearElement)return D("hints.deepBoxSelect");if(n1(r)&&e.selectedElementsAreBeingDragged)return D("hints.disableSnapping");if(!d.length&&!t)return D("hints.canvasPanning");if(d.length===1){if(rt(d[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?D("hints.lineEditor_pointSelected"):D("hints.lineEditor_nothingSelected"):D("hints.lineEditor_info");if(!e.newElement&&!e.selectedElementsAreBeingDragged&&zc(d[0]))return dU(d[0])?ohe(d[0],r.scene.getNonDeletedElementsMap())?[D("hints.bindTextToElement"),D("hints.createFlowchart")]:[D("hints.bindTextToElement"),D("hints.createFlowchart")]:D("hints.bindTextToElement")}}return null},tP=({appState:e,isMobile:t,device:n,app:r})=>{let i=lhe({appState:e,isMobile:t,device:n,app:r});if(!i)return null;let a=Array.isArray(i)?i.map(s=>ue(s).replace(/\. ?$/,"")).join(". "):ue(i);return m.jsx("div",{className:"HintViewer",children:m.jsx("span",{children:a})})},che="medium",N_={CHECKED:s7,UNCHECKED:uU},nP=e=>m.jsxs("label",{className:De("ToolIcon ToolIcon__lock",`ToolIcon_size_${che}`,{"is-mobile":e.isMobile}),title:`${e.title} — Q`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-lock"}),m.jsx("div",{className:"ToolIcon__icon",children:e.checked?N_.CHECKED:N_.UNCHECKED})]}),u1=({heading:e,children:t,...n})=>{let{id:r}=Is(),i=m.jsx("h2",{className:"visually-hidden",id:`${r}-${e}-title`,children:D(`headings.${e}`)});return m.jsx("section",{...n,"aria-labelledby":`${r}-${e}-title`,children:typeof t=="function"?t(i):m.jsxs(m.Fragment,{children:[i,t]})})},rs=4,Sl=6,dhe="rgba(0,0,0,0.3)",uhe=(e,t,n,r)=>{if(!e.length)return{horizontal:null,vertical:null};let[i,a,s,o]=Nt(e),c=t/r.zoom.value,d=n/r.zoom.value,l=t-c,h=n-d,f={top:parseInt(ym("sat"))||0,bottom:parseInt(ym("sab"))||0,left:parseInt(ym("sal"))||0,right:parseInt(ym("sar"))||0},g=c1().rtl,U=-r.scrollX+l/2+f.left,y=-r.scrollY+h/2+f.top,v=U+c-f.right,x=y+d-f.bottom,w=Math.min(i,U),C=Math.min(a,y),S=Math.max(s,v),T=Math.max(o,x);return{horizontal:U===w&&v===S?null:{x:Math.max(f.left,rs)+(U-w)/(S-w)*t,y:n-Sl-Math.max(rs,f.bottom),width:(v-U)/(S-w)*t-Math.max(rs*2,f.left+f.right),height:Sl},vertical:y===C&&x===T?null:{x:g?Math.max(f.left,rs):t-Sl-Math.max(f.right,rs),y:(y-C)/(T-C)*n+Math.max(f.top,rs),width:Sl,height:(x-y)/(T-C)*n-Math.max(rs*2,f.top+f.bottom)}}},O_=(e,t,n)=>{let[r,i]=[e.horizontal,e.vertical].map(a=>a!=null&&a.x<=t&&t<=a.x+a.width&&a.y<=n&&n<=a.y+a.height);return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},hhe="medium",rP=e=>e.penDetected?m.jsxs("label",{className:De("ToolIcon ToolIcon__penMode",`ToolIcon_size_${hhe}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),m.jsx("div",{className:"ToolIcon__icon",children:jY})]}):null,iP=e=>m.jsx(wt,{className:De("Shape",{fillable:!1}),type:"radio",icon:EI,name:"editor-current-shape",checked:e.checked,title:`${e.title} — H`,keyBindingLabel:e.isMobile?void 0:q.H.toLocaleUpperCase(),"aria-label":`${e.title} — H`,"aria-keyshortcuts":q.H,"data-testid":"toolbar-hand",onChange:()=>{var t;return(t=e.onChange)==null?void 0:t.call(e)}}),fhe=({appState:e,elements:t,actionManager:n,setAppState:r,onLockToggle:i,onHandToolToggle:a,onPenModeToggle:s,renderTopRightUI:o,renderCustomStats:c,renderSidebars:d,device:l,renderWelcomeScreen:h,UIOptions:f,app:g})=>{var C,S;let{WelcomeScreenCenterTunnel:U,MainMenuTunnel:y,DefaultSidebarTriggerTunnel:v}=ki(),x=()=>m.jsxs(Qj,{side:"top",className:"App-top-bar",children:[h&&m.jsx(U.Out,{}),m.jsx(u1,{heading:"shapes",children:T=>{var M;return m.jsx(Wi.Col,{gap:4,align:"center",children:m.jsxs(Wi.Row,{gap:1,className:"App-toolbar-container",children:[m.jsxs(Ia,{padding:1,className:"App-toolbar App-toolbar--mobile",children:[T,m.jsx(Wi.Row,{gap:1,children:m.jsx(Wj,{appState:e,activeTool:e.activeTool,UIOptions:f,app:g})})]}),o&&o(!0,e),m.jsxs("div",{className:"mobile-misc-tools-container",children:[!e.viewModeEnabled&&((M=e.openDialog)==null?void 0:M.name)!=="elementLinkSelector"&&m.jsx(v.Out,{}),m.jsx(rP,{checked:e.penMode,onChange:()=>s(null),title:D("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),m.jsx(nP,{checked:e.activeTool.locked,onChange:i,title:D("toolBar.lock"),isMobile:!0}),m.jsx(iP,{checked:zu(e),onChange:()=>a(),title:D("toolBar.hand"),isMobile:!0})]})]})})}}),m.jsx(tP,{appState:e,isMobile:!0,device:l,app:g})]}),w=()=>{var T;return e.viewModeEnabled||((T=e.openDialog)==null?void 0:T.name)==="elementLinkSelector"?m.jsx("div",{className:"App-toolbar-content",children:m.jsx(y.Out,{})}):m.jsxs("div",{className:"App-toolbar-content",children:[m.jsx(y.Out,{}),n.renderAction("toggleEditMenu"),n.renderAction(e.multiElement?"finalize":"duplicateSelection"),n.renderAction("deleteSelectedElements"),m.jsxs("div",{children:[n.renderAction("undo"),n.renderAction("redo")]})]})};return m.jsxs(m.Fragment,{children:[d(),!e.viewModeEnabled&&((C=e.openDialog)==null?void 0:C.name)!=="elementLinkSelector"&&x(),m.jsx("div",{className:"App-bottom-bar",style:{marginBottom:Sl+rs*2,marginLeft:Sl+rs*2,marginRight:Sl+rs*2},children:m.jsxs(Ia,{padding:0,children:[e.openMenu==="shape"&&!e.viewModeEnabled&&((S=e.openDialog)==null?void 0:S.name)!=="elementLinkSelector"&&J7(e,t)?m.jsx(u1,{className:"App-mobile-menu",heading:"selectedShapeActions",children:m.jsx(Hj,{appState:e,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:n.renderAction,app:g})}):null,m.jsxs("footer",{className:"App-toolbar",children:[w(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&m.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(T=>({...e1(t,T)}))},children:D("buttons.scrollBackToContent")})]})]})})]})},F_=e=>{let t=I.useRef(null),[n,r]=I.useState(null);return I.useLayoutEffect(()=>{if(!e.spreadsheet)return;let i=Zne(e.chartType,e.spreadsheet,0,0);r(i);let a,s=t.current;return(async()=>{var o;return a=await T7(i,{exportBackground:!1,viewBackgroundColor:or.white},null,{skipInliningFonts:!0}),(o=a.querySelector(".style-fonts"))==null||o.remove(),s.replaceChildren(),s.appendChild(a),e.selected&&s.parentNode.focus()})(),()=>{s.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),m.jsx("button",{type:"button",className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:m.jsx("div",{ref:t})})},phe=({setAppState:e,appState:t,onClose:n})=>{let{onInsertElements:r}=Ms(),i=xe.useCallback(()=>{n&&n()},[n]),a=(s,o)=>{r(o),Zt("paste","chart",s),e({currentChartType:s,pasteDialog:{shown:!1,data:null}})};return m.jsx(Oa,{size:"small",onCloseRequest:i,title:D("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:m.jsxs("div",{className:"container",children:[m.jsx(F_,{chartType:"bar",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="bar",onClick:a}),m.jsx(F_,{chartType:"line",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="line",onClick:a})]})})},mhe=()=>m.jsxs("div",{className:"HelpDialog__header",children:[m.jsxs("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:NE}),D("helpDialog.documentation")]}),m.jsxs("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:NE}),D("helpDialog.blog")]}),m.jsxs("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:gI}),D("helpDialog.github")]}),m.jsxs("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:nq}),"YouTube"]})]}),ghe=e=>m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:e.title}),m.jsx("div",{className:"HelpDialog__islands-container",children:e.children})]}),Uy=e=>m.jsxs("div",{className:`HelpDialog__island ${e.className}`,children:[m.jsx("h4",{className:"HelpDialog__island-title",children:e.caption}),m.jsx("div",{className:"HelpDialog__island-content",children:e.children})]});function*Uhe(e,t){let n=!0;for(let r of e)n||(yield t),n=!1,yield r}var bhe=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),Re=({label:e,shortcuts:t,isOr:n=!0})=>{let r=t.map(i=>(i.endsWith("++")?[...i.slice(0,-2).split("+"),"+"]:i.split("+")).map(a=>m.jsx(yhe,{children:bhe(a)},a)));return m.jsxs("div",{className:"HelpDialog__shortcut",children:[m.jsx("div",{children:e}),m.jsx("div",{className:"HelpDialog__key-container",children:[...Uhe(r,n?D("helpDialog.or"):null)]})]})},yhe=e=>m.jsx("kbd",{className:"HelpDialog__key",...e}),vhe=({onClose:e})=>{let t=xe.useCallback(()=>{e&&e()},[e]);return m.jsx(m.Fragment,{children:m.jsxs(Oa,{onCloseRequest:t,title:D("helpDialog.title"),className:"HelpDialog",children:[m.jsx(mhe,{}),m.jsxs(ghe,{title:D("helpDialog.shortcuts"),children:[m.jsxs(Uy,{className:"HelpDialog__island--tools",caption:D("helpDialog.tools"),children:[m.jsx(Re,{label:D("toolBar.hand"),shortcuts:[q.H]}),m.jsx(Re,{label:D("toolBar.selection"),shortcuts:[q.V,q[1]]}),m.jsx(Re,{label:D("toolBar.rectangle"),shortcuts:[q.R,q[2]]}),m.jsx(Re,{label:D("toolBar.diamond"),shortcuts:[q.D,q[3]]}),m.jsx(Re,{label:D("toolBar.ellipse"),shortcuts:[q.O,q[4]]}),m.jsx(Re,{label:D("toolBar.arrow"),shortcuts:[q.A,q[5]]}),m.jsx(Re,{label:D("toolBar.line"),shortcuts:[q.L,q[6]]}),m.jsx(Re,{label:D("toolBar.freedraw"),shortcuts:[q.P,q[7]]}),m.jsx(Re,{label:D("toolBar.text"),shortcuts:[q.T,q[8]]}),m.jsx(Re,{label:D("toolBar.image"),shortcuts:[q[9]]}),m.jsx(Re,{label:D("toolBar.eraser"),shortcuts:[q.E,q[0]]}),m.jsx(Re,{label:D("toolBar.frame"),shortcuts:[q.F]}),m.jsx(Re,{label:D("toolBar.laser"),shortcuts:[q.K]}),m.jsx(Re,{label:D("labels.eyeDropper"),shortcuts:[q.I,"Shift+S","Shift+G"]}),m.jsx(Re,{label:D("helpDialog.editLineArrowPoints"),shortcuts:[ue("CtrlOrCmd+Enter")]}),m.jsx(Re,{label:D("helpDialog.editText"),shortcuts:[ue("Enter")]}),m.jsx(Re,{label:D("helpDialog.textNewLine"),shortcuts:[ue("Enter"),ue("Shift+Enter")]}),m.jsx(Re,{label:D("helpDialog.textFinish"),shortcuts:[ue("Esc"),ue("CtrlOrCmd+Enter")]}),m.jsx(Re,{label:D("helpDialog.curvedArrow"),shortcuts:["A",D("helpDialog.click"),D("helpDialog.click"),D("helpDialog.click")],isOr:!1}),m.jsx(Re,{label:D("helpDialog.curvedLine"),shortcuts:["L",D("helpDialog.click"),D("helpDialog.click"),D("helpDialog.click")],isOr:!1}),m.jsx(Re,{label:D("helpDialog.cropStart"),shortcuts:[D("helpDialog.doubleClick"),ue("Enter")],isOr:!0}),m.jsx(Re,{label:D("helpDialog.cropFinish"),shortcuts:[ue("Enter"),ue("Escape")],isOr:!0}),m.jsx(Re,{label:D("toolBar.lock"),shortcuts:[q.Q]}),m.jsx(Re,{label:D("helpDialog.preventBinding"),shortcuts:[ue("CtrlOrCmd")]}),m.jsx(Re,{label:D("toolBar.link"),shortcuts:[ue("CtrlOrCmd+K")]})]}),m.jsxs(Uy,{className:"HelpDialog__island--view",caption:D("helpDialog.view"),children:[m.jsx(Re,{label:D("buttons.zoomIn"),shortcuts:[ue("CtrlOrCmd++")]}),m.jsx(Re,{label:D("buttons.zoomOut"),shortcuts:[ue("CtrlOrCmd+-")]}),m.jsx(Re,{label:D("buttons.resetZoom"),shortcuts:[ue("CtrlOrCmd+0")]}),m.jsx(Re,{label:D("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),m.jsx(Re,{label:D("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),m.jsx(Re,{label:D("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),m.jsx(Re,{label:D("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),m.jsx(Re,{label:D("buttons.zenMode"),shortcuts:[ue("Alt+Z")]}),m.jsx(Re,{label:D("buttons.objectsSnapMode"),shortcuts:[ue("Alt+S")]}),m.jsx(Re,{label:D("labels.toggleGrid"),shortcuts:[ue("CtrlOrCmd+'")]}),m.jsx(Re,{label:D("labels.viewMode"),shortcuts:[ue("Alt+R")]}),m.jsx(Re,{label:D("labels.toggleTheme"),shortcuts:[ue("Alt+Shift+D")]}),m.jsx(Re,{label:D("stats.fullTitle"),shortcuts:[ue("Alt+/")]}),m.jsx(Re,{label:D("search.title"),shortcuts:[kr("searchMenu")]}),m.jsx(Re,{label:D("commandPalette.title"),shortcuts:Xp?[kr("commandPalette")]:[kr("commandPalette"),kr("commandPalette",1)]})]}),m.jsxs(Uy,{className:"HelpDialog__island--editor",caption:D("helpDialog.editor"),children:[m.jsx(Re,{label:D("helpDialog.createFlowchart"),shortcuts:[ue("CtrlOrCmd+Arrow Key")],isOr:!0}),m.jsx(Re,{label:D("helpDialog.navigateFlowchart"),shortcuts:[ue("Alt+Arrow Key")],isOr:!0}),m.jsx(Re,{label:D("labels.moveCanvas"),shortcuts:[ue(`Space+${D("helpDialog.drag")}`),ue(`Wheel+${D("helpDialog.drag")}`)],isOr:!0}),m.jsx(Re,{label:D("buttons.clearReset"),shortcuts:[ue("CtrlOrCmd+Delete")]}),m.jsx(Re,{label:D("labels.delete"),shortcuts:[ue("Delete")]}),m.jsx(Re,{label:D("labels.cut"),shortcuts:[ue("CtrlOrCmd+X")]}),m.jsx(Re,{label:D("labels.copy"),shortcuts:[ue("CtrlOrCmd+C")]}),m.jsx(Re,{label:D("labels.paste"),shortcuts:[ue("CtrlOrCmd+V")]}),m.jsx(Re,{label:D("labels.pasteAsPlaintext"),shortcuts:[ue("CtrlOrCmd+Shift+V")]}),m.jsx(Re,{label:D("labels.selectAll"),shortcuts:[ue("CtrlOrCmd+A")]}),m.jsx(Re,{label:D("labels.multiSelect"),shortcuts:[ue(`Shift+${D("helpDialog.click")}`)]}),m.jsx(Re,{label:D("helpDialog.deepSelect"),shortcuts:[ue(`CtrlOrCmd+${D("helpDialog.click")}`)]}),m.jsx(Re,{label:D("helpDialog.deepBoxSelect"),shortcuts:[ue(`CtrlOrCmd+${D("helpDialog.drag")}`)]}),(B7||Xp)&&m.jsx(Re,{label:D("labels.copyAsPng"),shortcuts:[ue("Shift+Alt+C")]}),m.jsx(Re,{label:D("labels.copyStyles"),shortcuts:[ue("CtrlOrCmd+Alt+C")]}),m.jsx(Re,{label:D("labels.pasteStyles"),shortcuts:[ue("CtrlOrCmd+Alt+V")]}),m.jsx(Re,{label:D("labels.sendToBack"),shortcuts:[ue(gs?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),m.jsx(Re,{label:D("labels.bringToFront"),shortcuts:[ue(gs?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),m.jsx(Re,{label:D("labels.sendBackward"),shortcuts:[ue("CtrlOrCmd+[")]}),m.jsx(Re,{label:D("labels.bringForward"),shortcuts:[ue("CtrlOrCmd+]")]}),m.jsx(Re,{label:D("labels.alignTop"),shortcuts:[ue("CtrlOrCmd+Shift+Up")]}),m.jsx(Re,{label:D("labels.alignBottom"),shortcuts:[ue("CtrlOrCmd+Shift+Down")]}),m.jsx(Re,{label:D("labels.alignLeft"),shortcuts:[ue("CtrlOrCmd+Shift+Left")]}),m.jsx(Re,{label:D("labels.alignRight"),shortcuts:[ue("CtrlOrCmd+Shift+Right")]}),m.jsx(Re,{label:D("labels.duplicateSelection"),shortcuts:[ue("CtrlOrCmd+D"),ue(`Alt+${D("helpDialog.drag")}`)]}),m.jsx(Re,{label:D("helpDialog.toggleElementLock"),shortcuts:[ue("CtrlOrCmd+Shift+L")]}),m.jsx(Re,{label:D("buttons.undo"),shortcuts:[ue("CtrlOrCmd+Z")]}),m.jsx(Re,{label:D("buttons.redo"),shortcuts:BM?[ue("CtrlOrCmd+Y"),ue("CtrlOrCmd+Shift+Z")]:[ue("CtrlOrCmd+Shift+Z")]}),m.jsx(Re,{label:D("labels.group"),shortcuts:[ue("CtrlOrCmd+G")]}),m.jsx(Re,{label:D("labels.ungroup"),shortcuts:[ue("CtrlOrCmd+Shift+G")]}),m.jsx(Re,{label:D("labels.flipHorizontal"),shortcuts:[ue("Shift+H")]}),m.jsx(Re,{label:D("labels.flipVertical"),shortcuts:[ue("Shift+V")]}),m.jsx(Re,{label:D("labels.showStroke"),shortcuts:[ue("S")]}),m.jsx(Re,{label:D("labels.showBackground"),shortcuts:[ue("G")]}),m.jsx(Re,{label:D("labels.showFonts"),shortcuts:[ue("Shift+F")]}),m.jsx(Re,{label:D("labels.decreaseFontSize"),shortcuts:[ue("CtrlOrCmd+Shift+<")]}),m.jsx(Re,{label:D("labels.increaseFontSize"),shortcuts:[ue("CtrlOrCmd+Shift+>")]})]})]})]})})},xhe=4,whe=8,Ehe=({shouldWrap:e,children:t,username:n})=>e?m.jsx(dd,{label:n||"Unknown user",children:t}):m.jsx(m.Fragment,{children:t}),by=({actionManager:e,collaborator:t,socketId:n,withName:r=!1,shouldWrapWithTooltip:i=!1,isBeingFollowed:a})=>{let s={socketId:n,collaborator:t,withName:r,isBeingFollowed:a},o=e.renderAction("goToCollaborator",s);return m.jsx(Ehe,{username:t.username,shouldWrap:i,children:o},n)},Che=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],aP=xe.memo(({className:e,mobile:t,collaborators:n,userToFollow:r})=>{let i=ui(),a=new Map;n.forEach((U,y)=>{let v=U.id||y;a.set(v,{...U,socketId:y})});let s=Array.from(a.values()).filter(U=>{var y;return(y=U.username)==null?void 0:y.trim()}),[o,c]=xe.useState(""),d=s.filter(U=>{var y;return(y=U.username)==null?void 0:y.toLowerCase().includes(o)}),l=xe.useRef(null);I.useLayoutEffect(()=>{if(l.current){let U=v=>{let x=Math.max(1,Math.min(8,Math.floor(v/38)));f(x)};if(U(l.current.clientWidth),!s3)return;let y=new ResizeObserver(v=>{for(let x of v){let{width:w}=x.contentRect;U(w)}});return y.observe(l.current),()=>{y.disconnect()}}},[]);let[h,f]=xe.useState(xhe),g=s.slice(0,h-1).map(U=>by({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===r}));return t?m.jsx("div",{className:De("UserList UserList_mobile",e),children:s.map(U=>by({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===r}))}):m.jsx("div",{className:"UserList__wrapper",ref:l,children:m.jsxs("div",{className:De("UserList",e),style:{"--max-avatars":h},children:[g,s.length>h-1&&m.jsxs(OU,{children:[m.jsxs(FU,{className:"UserList__more",children:["+",s.length-h+1]}),m.jsx(Uv,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:m.jsxs(Ia,{padding:2,children:[s.length>=whe&&m.jsx(uj,{placeholder:D("quickSearch.placeholder"),onChange:c}),m.jsx(hj,{className:"dropdown-menu UserList__collaborators",placeholder:D("userList.empty"),children:d.length>0?[m.jsx("div",{className:"hint",children:D("userList.hint.text")}),d.map(U=>by({actionManager:i,collaborator:U,socketId:U.socketId,withName:!0,isBeingFollowed:U.socketId===r}))]:[]}),m.jsx(_D,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let n=t.collaborators.keys();for(let[r,i]of e.collaborators){let a=t.collaborators.get(r);if(!a||r!==n.next().value||!pr(i,a,Che))return!1}return!0}),B_=({children:e,color:t})=>m.jsx("div",{className:"Card",style:{"--card-color":t==="primary"?"var(--color-primary)":or[t][7],"--card-color-darker":t==="primary"?"var(--color-primary-darker)":or[t][8],"--card-color-darkest":t==="primary"?"var(--color-primary-darkest)":or[t][9]},children:e}),She=({elements:e,appState:t,setAppState:n,files:r,actionManager:i,exportOpts:a,canvas:s,onCloseRequest:o})=>{let{onExportToBackend:c}=a;return m.jsx("div",{className:"ExportDialog ExportDialog--json",children:m.jsxs("div",{className:"ExportDialog-cards",children:[a.saveFileToDisk&&m.jsxs(B_,{color:"lime",children:[m.jsx("div",{className:"Card-icon",children:YY}),m.jsx("h2",{children:D("exportDialog.disk_title")}),m.jsxs("div",{className:"Card-details",children:[D("exportDialog.disk_details"),!md&&i.renderAction("changeProjectName")]}),m.jsx(wt,{className:"Card-button",type:"button",title:D("exportDialog.disk_button"),"aria-label":D("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(wj,"ui")}})]}),c&&m.jsxs(B_,{color:"pink",children:[m.jsx("div",{className:"Card-icon",children:p3}),m.jsx("h2",{children:D("exportDialog.link_title")}),m.jsx("div",{className:"Card-details",children:D("exportDialog.link_details")}),m.jsx(wt,{className:"Card-button",type:"button",title:D("exportDialog.link_button"),"aria-label":D("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{Zt("export","link",`ui (${JV()})`),await c(e,t,r),o()}catch(d){n({errorMessage:d.message})}}})]}),a.renderCustomUI&&a.renderCustomUI(e,t,r,s)]})})},_he=({elements:e,appState:t,files:n,actionManager:r,exportOpts:i,canvas:a,setAppState:s})=>{var c;let o=xe.useCallback(()=>{s({openDialog:null})},[s]);return m.jsx(m.Fragment,{children:((c=t.openDialog)==null?void 0:c.name)==="jsonExport"&&m.jsx(Oa,{onCloseRequest:o,title:D("buttons.export"),children:m.jsx(She,{elements:e,appState:t,setAppState:s,files:n,actionManager:r,onCloseRequest:o,exportOpts:i,canvas:a})})})},khe=e=>m.jsx("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${D("helpDialog.title")} — ?`,"aria-label":D("helpDialog.title"),children:o7}),sP=({appState:e,actionManager:t,showExitZenModeBtn:n,renderWelcomeScreen:r})=>{let{FooterCenterTunnel:i,WelcomeScreenHelpHintTunnel:a}=ki(),s=Zn(),o=!e.viewModeEnabled&&e.multiElement&&s.isTouchScreen;return m.jsxs("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[m.jsx("div",{className:De("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:m.jsx(Wi.Col,{gap:2,children:m.jsxs(u1,{heading:"canvasActions",children:[m.jsx(Aue,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&m.jsx(Lue,{renderAction:t.renderAction,className:De("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),o&&m.jsx(Due,{renderAction:t.renderAction,className:De("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),m.jsx(i.Out,{}),m.jsx("div",{className:De("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:m.jsxs("div",{style:{position:"relative"},children:[r&&m.jsx(a.Out,{}),m.jsx(khe,{onClick:()=>t.executeAction(Mv)})]})}),m.jsx(Rue,{actionManager:t,showExitZenModeBtn:n})]})},The=sP;sP.displayName="Footer";var oP=xe.createContext({}),lP=({children:e,className:t})=>{let n=Zn(),r=I.useContext(oP),i=!!(n.editor.canFitSidebar&&r.shouldRenderDockButton);return m.jsxs("div",{className:De("sidebar__header",t),"data-testid":"sidebar-header",children:[e,m.jsxs("div",{className:"sidebar__header__buttons",children:[i&&m.jsx(dd,{label:D("labels.sidebarLock"),children:m.jsx(ah,{onSelect:()=>{var a;return(a=r.onDock)==null?void 0:a.call(r,!r.docked)},selected:!!r.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":D("labels.sidebarLock"),children:SY})}),m.jsx(ah,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:r.onCloseRequest,"aria-label":D("buttons.close"),children:xh})]})]})};lP.displayName="SidebarHeader";var cP=({name:e,tab:t,icon:n,title:r,children:i,onToggle:a,className:s,style:o})=>{var l;let c=Kn(),d=Hr();return m.jsxs("label",{title:r,className:"sidebar-trigger__label-element",children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:h=>{var g;(g=document.querySelector(".layer-ui__wrapper"))==null||g.classList.remove("animate");let f=h.target.checked;c({openSidebar:f?{name:e,tab:t}:null}),a==null||a(f)},checked:((l=d.openSidebar)==null?void 0:l.name)===e,"aria-label":r,"aria-keyshortcuts":"0"}),m.jsxs("div",{className:De("sidebar-trigger",s),style:o,children:[n&&m.jsx("div",{children:n}),i&&m.jsx("div",{className:"sidebar-trigger__label",children:i})]})]})};cP.displayName="SidebarTrigger";var dP=({children:e,...t})=>m.jsx(XD,{className:"sidebar-triggers",...t,children:e});dP.displayName="SidebarTabTriggers";var uP=({children:e,tab:t,onSelect:n,...r})=>m.jsx(VD,{value:t,asChild:!0,onSelect:n,children:m.jsx("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...r,children:e})});uP.displayName="SidebarTabTrigger";var hP=({children:e,...t})=>{let n=Hr(),r=Kn();if(!n.openSidebar)return null;let{name:i}=n.openSidebar;return m.jsx(WD,{className:"sidebar-tabs-root",value:n.openSidebar.tab,onValueChange:a=>r(s=>({...s,openSidebar:{...s.openSidebar,name:i,tab:a}})),...t,children:e})};hP.displayName="SidebarTabs";var fP=({tab:e,children:t,...n})=>m.jsx(YD,{...n,value:e,"data-testid":e,children:t});fP.displayName="SidebarTab";var Rv=cr(!1),pP=I.forwardRef(({name:e,children:t,onDock:n,docked:r,className:i,...a},s)=>{dt.DEV&&n&&r==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let o=Kn(),c=$U(Rv);I.useLayoutEffect(()=>(c(!!r),()=>{c(!1)}),[c,r]);let d=I.useRef({});d.current.onCloseRequest=()=>{o({openSidebar:null})},d.current.onDock=g=>n==null?void 0:n(g),d.current=rg(d.current,{docked:r,shouldRenderDockButton:!!n&&r!=null});let l=I.useRef(null);I.useImperativeHandle(s,()=>l.current);let h=Zn(),f=I.useCallback(()=>{document.querySelector(".Dialog")||o({openSidebar:null})},[o]);return Ev(l,I.useCallback(g=>{g.target.closest(".sidebar-trigger")||(!r||!h.editor.canFitSidebar)&&f()},[f,r,h.editor.canFitSidebar])),I.useEffect(()=>{let g=U=>{U.key===q.ESCAPE&&(!r||!h.editor.canFitSidebar)&&f()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[f,r,h.editor.canFitSidebar]),m.jsx(Ia,{...a,className:De("sidebar",{"sidebar--docked":r},i),ref:l,children:m.jsx(oP.Provider,{value:d.current,children:t})})});pP.displayName="SidebarInner";var Ja=Object.assign(I.forwardRef((e,t)=>{var o;let n=Hr(),{onStateChange:r}=e,i=I.useRef(n.openSidebar);I.useEffect(()=>{var c,d,l,h,f;(!n.openSidebar&&((c=i==null?void 0:i.current)==null?void 0:c.name)===e.name||((d=n.openSidebar)==null?void 0:d.name)===e.name&&((l=i==null?void 0:i.current)==null?void 0:l.name)!==e.name||((h=i.current)==null?void 0:h.name)===e.name)&&n.openSidebar!==i.current&&(r==null||r(((f=n.openSidebar)==null?void 0:f.name)!==e.name?null:n.openSidebar)),i.current=n.openSidebar},[n.openSidebar,r,e.name]);let[a,s]=I.useState(!1);return I.useLayoutEffect(()=>(s(!0),()=>s(!1)),[]),a&&((o=n.openSidebar)==null?void 0:o.name)===e.name?I.createElement(pP,{...e,ref:t,key:e.name}):null}),{Header:lP,TabTriggers:dP,TabTrigger:uP,Tabs:hP,Tab:fP,Trigger:cP});Ja.displayName="Sidebar";var mP={};OT(mP,{ChangeCanvasBackground:()=>_P,ClearCanvas:()=>CP,CommandPalette:()=>xP,Export:()=>kP,Help:()=>EP,LiveCollaborationTrigger:()=>MP,LoadScene:()=>bP,SaveAsImage:()=>vP,SaveToActiveFile:()=>yP,SearchMenu:()=>wP,Socials:()=>TP,ToggleTheme:()=>SP});var gP=cr({active:!1});async function Mhe({title:e,description:t,actionLabel:n,color:r}){return new Promise(i=>{Sa.set(gP,{active:!0,onConfirm:()=>i(!0),onClose:()=>i(!1),onReject:()=>i(!1),title:e,description:t,actionLabel:n,color:r})})}var UP=({value:e,shortcut:t,onChange:n,choices:r,children:i,name:a})=>{let s=Zn();return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[m.jsx("label",{className:"dropdown-menu-item__text",htmlFor:a,children:i}),m.jsx(Kj,{name:a,value:e,onChange:n,choices:r})]}),t&&!s.editor.isMobile&&m.jsx("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};UP.displayName="DropdownMenuItemContentRadio";var Ihe=UP,bP=()=>{let{t:e}=Ar(),t=ui(),n=KU();return t.isActionEnabled(n8)?m.jsx(na,{icon:l7,onSelect:async()=>{(!n.length||await Mhe({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:m.jsx(us,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:r=>m.jsx("strong",{children:r}),br:()=>m.jsx("br",{})})}))&&t.executeAction(n8)},"data-testid":"load-button",shortcut:kr("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};bP.displayName="LoadScene";var yP=()=>{let{t:e}=Ar(),t=ui();return t.isActionEnabled(p_)?m.jsx(na,{shortcut:kr("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(p_),icon:WY,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};yP.displayName="SaveToActiveFile";var vP=()=>{let e=Kn(),{t}=Ar();return m.jsx(na,{icon:UI,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:kr("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};vP.displayName="SaveAsImage";var xP=e=>{let t=Kn(),{t:n}=Ar();return m.jsx(na,{icon:TI,"data-testid":"command-palette-button",onSelect:()=>{Zt("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:kr("commandPalette"),"aria-label":n("commandPalette.title"),className:e==null?void 0:e.className,children:n("commandPalette.title")})};xP.displayName="CommandPalette";var wP=e=>{let{t}=Ar(),n=ui();return m.jsx(na,{icon:id,"data-testid":"search-menu-button",onSelect:()=>{n.executeAction(Gj)},shortcut:kr("searchMenu"),"aria-label":t("search.title"),className:e==null?void 0:e.className,children:t("search.title")})};wP.displayName="SearchMenu";var EP=()=>{let{t:e}=Ar(),t=ui();return m.jsx(na,{"data-testid":"help-menu-item",icon:o7,onSelect:()=>t.executeAction(Mv),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};EP.displayName="Help";var CP=()=>{let{t:e}=Ar(),t=$U(ZU);return ui().isActionEnabled(_p)?m.jsx(na,{icon:rd,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};CP.displayName="ClearCanvas";var SP=e=>{let{t}=Ar(),n=Hr(),r=ui(),i=kr("toggleTheme");return r.isActionEnabled(C2)?e!=null&&e.allowSystemTheme?m.jsx(Ihe,{name:"theme",value:e.theme,onChange:a=>e.onSelect(a),choices:[{value:yt.LIGHT,label:f3,ariaLabel:`${t("buttons.lightMode")} - ${i}`},{value:yt.DARK,label:h3,ariaLabel:`${t("buttons.darkMode")} - ${i}`},{value:"system",label:tq,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):m.jsx(na,{onSelect:a=>{if(a.preventDefault(),e==null?void 0:e.onSelect)e.onSelect(n.theme===yt.DARK?yt.LIGHT:yt.DARK);else return r.executeAction(C2)},icon:n.theme===yt.DARK?f3:h3,"data-testid":"toggle-dark-mode",shortcut:i,"aria-label":n.theme===yt.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:n.theme===yt.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};SP.displayName="ToggleTheme";var _P=()=>{let{t:e}=Ar(),t=Hr(),n=ui(),r=z1();return t.viewModeEnabled||!r.UIOptions.canvasActions.changeViewBackgroundColor?null:m.jsxs("div",{style:{marginTop:"0.5rem"},children:[m.jsx("div",{"data-testid":"canvas-background-label",style:{fontSize:".75rem",marginBottom:".5rem"},children:e("labels.canvasBackground")}),m.jsx("div",{style:{padding:"0 0.625rem"},children:n.renderAction("changeViewBackgroundColor")})]})};_P.displayName="ChangeCanvasBackground";var kP=()=>{let{t:e}=Ar(),t=Kn();return m.jsx(na,{icon:hU,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};kP.displayName="Export";var TP=()=>{let{t:e}=Ar();return m.jsxs(m.Fragment,{children:[m.jsx(wg,{icon:gI,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),m.jsx(wg,{icon:zY,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),m.jsx(wg,{icon:$Y,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};TP.displayName="Socials";var MP=({onSelect:e,isCollaborating:t})=>{let{t:n}=Ar();return m.jsx(na,{"data-testid":"collab-button",icon:vI,className:De({"active-collab":t}),onSelect:e,children:n("labels.liveCollaboration")})};MP.displayName="LiveCollaborationTrigger";var B1=(e,t)=>{let n=cr(0),r=i=>{let{tunnelsJotai:{useAtom:a}}=ki(),[,s]=a(n),o=I.useRef({preferHost:!1,counter:0});return I.useLayoutEffect(()=>{let c=o.current;return s(d=>{let l=d+1;return c.counter=l,l}),()=>{s(d=>{let l=d-1;return c.counter=l,l||(c.preferHost=!1),l})}},[s]),i.__fallback||(o.current.preferHost=!0),!o.current.counter&&i.__fallback&&o.current.preferHost||o.current.counter>1&&i.__fallback?null:m.jsx(t,{...i})};return r.displayName=e,r},Ahe=Object.assign(B1("MainMenu",({children:e,onSelect:t})=>{var o;let{MainMenuTunnel:n}=ki(),r=Zn(),i=Hr(),a=Kn(),s=r.editor.isMobile?void 0:()=>a({openMenu:null});return m.jsx(n.In,{children:m.jsxs(ln,{open:i.openMenu==="canvas",children:[m.jsx(ln.Trigger,{onToggle:()=>{a({openMenu:i.openMenu==="canvas"?null:"canvas"})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:mI}),m.jsxs(ln.Content,{onClickOutside:s,onSelect:cU(t,()=>{a({openMenu:null})}),children:[e,r.editor.isMobile&&i.collaborators.size>0&&m.jsxs("fieldset",{className:"UserList-Wrapper",children:[m.jsx("legend",{children:D("labels.collaborators")}),m.jsx(aP,{mobile:!0,collaborators:i.collaborators,userToFollow:((o=i.userToFollow)==null?void 0:o.socketId)||null})]})]})]})})}),{Trigger:ln.Trigger,Item:ln.Item,ItemLink:ln.ItemLink,ItemCustom:ln.ItemCustom,Group:ln.Group,Separator:ln.Separator,DefaultItems:mP}),Jt=Ahe,Dv=({title:e,children:t,actionLabel:n,onClick:r})=>m.jsxs("div",{className:"OverwriteConfirm__Actions__Action",children:[m.jsx("h4",{children:e}),m.jsx("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),m.jsx(Tp,{variant:"outlined",color:"muted",label:n,size:"large",fullWidth:!0,onClick:r})]}),Lhe=()=>{let{t:e}=Ar(),t=ui(),n=Kn();return m.jsx(Dv,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(xj,"ui",!0),n({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},Rhe=()=>{let{t:e}=Ar(),t=ui();return m.jsx(Dv,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(wj,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},$_=Object.assign(({children:e})=>m.jsx("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:Lhe,SaveToDisk:Rhe}),yy=Object.assign(B1("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=ki(),[n,r]=Cn(gP);if(!n.active)return null;let i=()=>{n.onClose(),r(s=>({...s,active:!1}))},a=()=>{n.onConfirm(),r(s=>({...s,active:!1}))};return m.jsx(t.In,{children:m.jsx(Oa,{onCloseRequest:i,title:!1,size:916,children:m.jsxs("div",{className:"OverwriteConfirm",children:[m.jsx("h3",{children:n.title}),m.jsxs("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${n.color}`,children:[m.jsx("div",{className:"OverwriteConfirm__Description__icon",children:OG}),m.jsx("div",{children:n.description}),m.jsx("div",{className:"OverwriteConfirm__Description__spacer"}),m.jsx(Tp,{color:n.color,size:"large",label:n.actionLabel,onClick:a})]}),m.jsx($_,{children:e})]})})})}),{Actions:$_,Action:Dv}),Dhe=cr(""),IP=cr(null),jhe=350,Phe=()=>{let e=Ms(),t=Kn(),n=I.useRef(null),[r,i]=Cn(Dhe),a=r.trim(),[s,o]=I.useState(!1),[c,d]=I.useState({nonce:null,items:[]}),l=I.useRef(null),h=I.useRef(void 0),[f,g]=Cn(IP),U=e.scene.getNonDeletedElementsMap();I.useEffect(()=>{s||(a!==l.current||e.scene.getSceneNonce()!==h.current)&&(l.current=null,z_(a,e,(C,S)=>{d({nonce:ys(),items:C}),l.current=a,h.current=e.scene.getSceneNonce(),t({searchMatches:C.map(T=>({id:T.textElement.id,focus:!1,matchedLines:T.matchedLines}))})}))},[s,a,U,e,t,g,h]);let y=()=>{c.items.length>0&&g(C=>C===null?0:(C+1)%c.items.length)},v=()=>{c.items.length>0&&g(C=>C===null?0:C-1<0?c.items.length-1:C-1)};I.useEffect(()=>{t(C=>({searchMatches:C.searchMatches.map((S,T)=>T===f?{...S,focus:!0}:{...S,focus:!1})}))},[f,t]),I.useEffect(()=>{var C,S,T,M;if(c.items.length>0&&f!==null){let _=c.items[f];if(_){let R=e.state.zoom.value,P=Ei({text:_.searchQuery,x:_.textElement.x+(((C=_.matchedLines[0])==null?void 0:C.offsetX)??0),y:_.textElement.y+(((S=_.matchedLines[0])==null?void 0:S.offsetY)??0),width:(T=_.matchedLines[0])==null?void 0:T.width,height:(M=_.matchedLines[0])==null?void 0:M.height,fontSize:_.textElement.fontSize,fontFamily:_.textElement.fontFamily}),j=14,N=_.textElement.fontSize,F=N*R<j;if(!mg([P],e.canvas.width/window.devicePixelRatio,e.canvas.height/window.devicePixelRatio,{offsetLeft:e.state.offsetLeft,offsetTop:e.state.offsetTop,scrollX:e.state.scrollX,scrollY:e.state.scrollY,zoom:e.state.zoom},e.scene.getNonDeletedElementsMap(),e.getEditorUIOffsets())||F){let B;F?N>=j?B={fitToContent:!0}:B={fitToViewport:!0,maxZoom:hs(j/N,1)}:B={fitToContent:!0},e.scrollToContent(P,{animate:!0,duration:300,...B,canvasOffsets:e.getEditorUIOffsets()})}}}},[f,c,e]),I.useEffect(()=>()=>{g(null),l.current=null,h.current=void 0,t({searchMatches:[]}),o(!1)},[t,g]);let x=HU({goToNextItem:y,goToPreviousItem:v,searchMatches:c});I.useEffect(()=>un(window,"keydown",S=>{var T,M,_;if(S.key===q.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){S.preventDefault(),S.stopPropagation(),t({openSidebar:null});return}S[q.CTRL_OR_CMD]&&S.key===q.F&&(S.preventDefault(),S.stopPropagation(),(T=n.current)!=null&&T.matches(":focus")?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),(M=n.current)==null||M.focus(),(_=n.current)==null||_.select())),S.target instanceof HTMLElement&&S.target.closest(".layer-ui__search")&&x.searchMatches.items.length&&(S.key===q.ENTER&&(S.stopPropagation(),x.goToNextItem()),S.key===q.ARROW_UP?(S.stopPropagation(),x.goToPreviousItem()):S.key===q.ARROW_DOWN&&(S.stopPropagation(),x.goToNextItem()))},{capture:!0,passive:!1}),[t,x,e]);let w=`${c.items.length} ${c.items.length===1?D("search.singleResult"):D("search.multipleResults")}`;return m.jsxs("div",{className:"layer-ui__search",children:[m.jsx("div",{className:"layer-ui__search-header",children:m.jsx(Lv,{className:Bu.SEARCH_MENU_INPUT_WRAPPER,value:r,ref:n,placeholder:D("search.placeholder"),icon:id,onChange:C=>{i(C),o(!0);let S=C.trim();z_(S,e,(T,M)=>{d({nonce:ys(),items:T}),g(M),l.current=S,h.current=e.scene.getSceneNonce(),t({searchMatches:T.map(_=>({id:_.textElement.id,focus:!1,matchedLines:_.matchedLines}))}),o(!1)})},selectOnRender:!0})}),m.jsxs("div",{className:"layer-ui__search-count",children:[c.items.length>0&&m.jsxs(m.Fragment,{children:[f!==null&&f>-1?m.jsxs("div",{children:[f+1," / ",w]}):m.jsx("div",{children:w}),m.jsxs("div",{className:"result-nav",children:[m.jsx(ah,{onSelect:()=>{y()},className:"result-nav-btn",children:II}),m.jsx(ah,{onSelect:()=>{v()},className:"result-nav-btn",children:cq})]})]}),c.items.length===0&&a&&l.current&&m.jsx("div",{style:{margin:"1rem auto"},children:D("search.noMatch")})]}),m.jsx(Bhe,{matches:c,onItemClick:g,focusIndex:f,searchQuery:a})]})},Nhe=e=>{let t=[e.preview.moreBefore?"...":"",e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?"...":""];return m.jsx("div",{tabIndex:-1,className:De("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:n=>{e.highlighted&&(n==null||n.scrollIntoView({behavior:"auto",block:"nearest"}))},children:m.jsx("div",{className:"preview-text",children:t.flatMap((n,r)=>m.jsx(I.Fragment,{children:r===2?m.jsx("b",{children:n}):n},r))})})},Ohe=e=>m.jsx("div",{className:"layer-ui__search-result-container",children:e.matches.items.map((t,n)=>m.jsx(Nhe,{searchQuery:e.searchQuery,preview:t.preview,highlighted:n===e.focusIndex,onClick:()=>e.onItemClick(n)},t.textElement.id+t.index))}),Fhe=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,Bhe=I.memo(Ohe,Fhe),$he=(e,t,n)=>{let r=e.slice(0,t),i=r.split(/\s+/),a=r.endsWith(" "),s=i.length-2-1-(a?0:1),o=i.slice(s<=0?0:s).join(" ")+(a?" ":""),c=20;o=o.length>c?o.slice(-c):o;let d=e.slice(t+n.length),l=d.split(/\s+/),h=!d.startsWith(" "),f=h?6:5,g=(h?"":" ")+l.slice(0,f).join(" ");return{indexInSearchQuery:o.length,previewText:o+n+g,moreBefore:s>0,moreAfter:l.length>f}},zhe=(e,t)=>{let n=e.split(`
|
|
151
|
+
`),r=[],i=0;for(let a=0;a<n.length;a++){let s=n[a],o=n[a+1];if(o){let c=t.indexOf(o,i);if(c>s.length+i){let d=c-(s.length+i);for(;d>0;)s+=" ",d--}}r.push(s),i=i+s.length}return r.join(`
|
|
152
|
+
`)},Hhe=(e,t,n)=>{let r=zhe(e.text,e.originalText).split(`
|
|
153
|
+
`),i=[],a=0,s=0;for(let l of r){let h=a,f=h+l.length-1;i.push({line:l,startIndex:h,endIndex:f,lineNumber:s}),a=f+1,s++}let o=n,c=e.originalText.slice(n,n+t.length),d=[];for(let l of i){if(c==="")break;if(o>=l.startIndex&&o<=l.endIndex){let h=l.endIndex+1-o,f=l.line.slice(0,o-l.startIndex),g=c.slice(0,h);c=c.slice(h);let U=Mr(f,$t(e),e.lineHeight);if(f===""&&(U.width=0),e.textAlign!=="left"&&l.line.length>0){let C=Mr(l.line,$t(e),e.lineHeight),S=e.textAlign==="center"?(e.width-C.width)/2:e.width-C.width;U.width+=S}let{width:y,height:v}=Mr(g,$t(e),e.lineHeight),x=U.width,w=l.lineNumber*U.height;d.push({offsetX:x,offsetY:w,width:y,height:v}),o+=h}}return d},Whe=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),z_=Dle((e,t,n)=>{if(!e||e===""){n([],null);return}let r=t.scene.getNonDeletedElements().filter(c=>ke(c));r.sort((c,d)=>c.y-d.y);let i=[],a=new RegExp(Whe(e),"gi");for(let c of r){let d=null,l=c.originalText;for(;(d=a.exec(l))!==null;){let h=$he(l,d.index,e),f=Hhe(c,e,d.index);f.length>0&&i.push({textElement:c,searchQuery:e,preview:h,index:d.index,matchedLines:f})}}let s=new Set(t.visibleElements.map(c=>c.id)),o=i.findIndex(c=>s.has(c.textElement.id))??null;n(i,o)},jhe),AP=B1("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=ki();return m.jsx(t.In,{children:m.jsx(Ja.Trigger,{...e,className:"default-sidebar-trigger",name:ka.name})})});AP.displayName="DefaultSidebarTrigger";var LP=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=ki();return m.jsx(t.In,{children:e})};LP.displayName="DefaultTabTriggers";var H_=Object.assign(B1("DefaultSidebar",({children:e,className:t,onDock:n,docked:r,...i})=>{var d;let a=Hr(),s=Kn(),{DefaultSidebarTabTriggersTunnel:o}=ki(),c=((d=a.openSidebar)==null?void 0:d.tab)===Mu;return I.createElement(Ja,{...i,name:"default",key:"default",className:De("default-sidebar",t),docked:c||(r??a.defaultSidebarDockedPreference),onDock:c||n===!1||!n&&r!=null?void 0:cU(n,l=>{s({defaultSidebarDockedPreference:l})})},m.jsxs(Ja.Tabs,{children:[m.jsx(Ja.Header,{children:m.jsxs(Ja.TabTriggers,{children:[m.jsx(Ja.TabTrigger,{tab:Mu,children:id}),m.jsx(Ja.TabTrigger,{tab:Wg,children:a7}),m.jsx(o.Out,{})]})}),m.jsx(Ja.Tab,{tab:Wg,children:m.jsx(bue,{})}),m.jsx(Ja.Tab,{tab:Mu,children:m.jsx(Phe,{})}),e]}))}),{Trigger:AP,TabTriggers:LP}),Xhe="small",Vhe=e=>m.jsxs("label",{className:De("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${Xhe}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-LaserPointer"}),m.jsx("div",{className:"ToolIcon__icon",children:_I})]}),Yhe=({canvasRef:e,setError:t})=>{let n=e.current;if(!n)return;let r=n.parentElement;r&&(r.style.background="",t(null),n.replaceChildren())},RP=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:n,setError:r,data:i})=>{let a=e.current,s=a==null?void 0:a.parentElement;if(!(!a||!s)){if(!n){Yhe({canvasRef:e,setError:r});return}try{let o=await t.api,c;try{c=await o.parseMermaidToExcalidraw(n)}catch{c=await o.parseMermaidToExcalidraw(n.replace(/"/g,"'"))}let{elements:d,files:l}=c;r(null),i.current={elements:f1(d,{regenerateIds:!0}),files:l};let h=await MU({elements:i.current.elements,files:i.current.files,exportPadding:bh,maxWidthOrHeight:Math.max(s.offsetWidth,s.offsetHeight)*window.devicePixelRatio});try{await s1(h)}catch(f){throw f.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(D("canvasError.canvasTooBig")):f}s.style.background="var(--default-bg-color)",a.replaceChildren(h)}catch(o){throw s.style.background="var(--default-bg-color)",n&&r(o),o}}},jv=e=>{Vc.set(mp.MERMAID_TO_EXCALIDRAW,e)},DP=({app:e,data:t,text:n,shouldSaveMermaidDataToStorage:r})=>{let{elements:i,files:a}=t.current;i.length&&(e.addElementsFromPasteOrLibrary({elements:i,files:a,position:"center",fitToContent:!0}),e.setOpenDialog(null),r&&n&&jv(n))},jP=({children:e})=>m.jsx("div",{className:"ttd-dialog-panels",children:e}),_2=({label:e,children:t,panelAction:n,panelActionDisabled:r=!1,onTextSubmitInProgess:i,renderTopRight:a,renderSubmitShortcut:s,renderBottomRight:o})=>m.jsxs("div",{className:"ttd-dialog-panel",children:[m.jsxs("div",{className:"ttd-dialog-panel__header",children:[m.jsx("label",{children:e}),a==null?void 0:a()]}),t,m.jsxs("div",{className:De("ttd-dialog-panel-button-container",{invisible:!n}),style:{display:"flex",alignItems:"center"},children:[m.jsxs(ah,{className:"ttd-dialog-panel-button",onSelect:n?n.action:()=>{},disabled:r||i,children:[m.jsxs("div",{className:De({invisible:i}),children:[n==null?void 0:n.label,(n==null?void 0:n.icon)&&m.jsx("span",{children:n.icon})]}),i&&m.jsx(_o,{})]}),!r&&!i&&(s==null?void 0:s()),o==null?void 0:o()]})]}),PP=({input:e,placeholder:t,onChange:n,onKeyboardSubmit:r})=>{let i=I.useRef(null),a=I.useRef(r);return a.current=r,I.useEffect(()=>{if(!a.current)return;let s=i.current;if(s){let o=c=>{var d;c[q.CTRL_OR_CMD]&&c.key===q.ENTER&&(c.preventDefault(),(d=a.current)==null||d.call(a))};return s.addEventListener("keydown",o),()=>{s.removeEventListener("keydown",o)}}},[]),m.jsx("textarea",{className:"ttd-dialog-input",onChange:n,value:e,placeholder:t,autoFocus:!0,ref:i})},Ghe=({error:e})=>m.jsxs("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:["Error! ",m.jsx("p",{children:e})]}),NP=({error:e,canvasRef:t,loaded:n})=>m.jsxs("div",{className:"ttd-dialog-output-wrapper",children:[e&&m.jsx(Ghe,{error:e.message}),n?m.jsx("div",{ref:t,style:{opacity:e?"0.15":1},className:"ttd-dialog-output-canvas-container"}):m.jsx(_o,{size:"2rem"})]}),OP=()=>m.jsxs("div",{className:"ttd-dialog-submit-shortcut",children:[m.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:ue("CtrlOrCmd")}),m.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:ue("Enter")})]}),qhe=`flowchart TD
|
|
154
|
+
A[Christmas] -->|Get money| B(Go shopping)
|
|
155
|
+
B --> C{Let me think}
|
|
156
|
+
C -->|One| D[Laptop]
|
|
157
|
+
C -->|Two| E[iPhone]
|
|
158
|
+
C -->|Three| F[Car]`,W_=Wu(jv,300),Zhe=({mermaidToExcalidrawLib:e})=>{let[t,n]=I.useState(()=>Vc.get(mp.MERMAID_TO_EXCALIDRAW)||qhe),r=I.useDeferredValue(t.trim()),[i,a]=I.useState(null),s=I.useRef(null),o=I.useRef({elements:[],files:null}),c=Ms();I.useEffect(()=>{RP({canvasRef:s,data:o,mermaidToExcalidrawLib:e,setError:a,mermaidDefinition:r}).catch(l=>{nI()&&console.error("Failed to parse mermaid definition",l)}),W_(r)},[r,e]),I.useEffect(()=>()=>{W_.flush()},[]);let d=()=>{DP({app:c,data:o,text:t,shouldSaveMermaidDataToStorage:!0})};return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"ttd-dialog-desc",children:m.jsx(us,{i18nKey:"mermaid.description",flowchartLink:l=>m.jsx("a",{href:"https://mermaid.js.org/syntax/flowchart.html",children:l}),sequenceLink:l=>m.jsx("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",children:l}),classLink:l=>m.jsx("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",children:l})})}),m.jsxs(jP,{children:[m.jsx(_2,{label:D("mermaid.syntax"),children:m.jsx(PP,{input:t,placeholder:"Write Mermaid diagram defintion here...",onChange:l=>n(l.target.value),onKeyboardSubmit:()=>{d()}})}),m.jsx(_2,{label:D("mermaid.preview"),panelAction:{action:()=>{d()},label:D("mermaid.button"),icon:sg},renderSubmitShortcut:()=>m.jsx(OP,{}),children:m.jsx(NP,{canvasRef:s,loaded:e.loaded,error:i})})]})]})},Khe=Zhe,FP=e=>{let t=Kn(),n=I.useRef(null),r=I.useRef(0);return m.jsx(WD,{ref:n,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:i=>{var s;if(!i)return;let a=(s=n.current)==null?void 0:s.closest(".Modal__content");if(a){let o=a.offsetHeight||0;o>r.current&&(r.current=o,a.style.minHeight=`min(${r.current}px, 100%)`)}e.dialog==="ttd"&&iI(["text-to-diagram","mermaid"],i)&&t({openDialog:{name:e.dialog,tab:i}})},children:e.children})};FP.displayName="TTDDialogTabs";var Qhe=FP,BP=({children:e,...t})=>m.jsx(XD,{className:"ttd-dialog-triggers",...t,children:e});BP.displayName="TTDDialogTabTriggers";var d8=({children:e,tab:t,onSelect:n,...r})=>m.jsx(VD,{value:t,asChild:!0,onSelect:n,children:m.jsx("button",{type:"button",className:"ttd-dialog-tab-trigger",...r,children:e})});d8.displayName="TTDDialogTabTrigger";var u8=({tab:e,children:t,...n})=>m.jsx(YD,{...n,value:e,children:t});u8.displayName="TTDDialogTab";var vy=3,ou=1e3,Jhe=cr(null),efe=cr(null),tfe=e=>{var n;let t=Hr();return((n=t.openDialog)==null?void 0:n.name)!=="ttd"?null:m.jsx(nfe,{...e,tab:t.openDialog.tab})},nfe=B1("TTDDialogBase",({tab:e,...t})=>{let n=Ms(),r=Kn(),i=I.useRef(null),[a,s]=Cn(efe),[o,c]=I.useState((a==null?void 0:a.prompt)??""),d=o.trim(),l=M=>{c(M.target.value),s(_=>({generatedResponse:(_==null?void 0:_.generatedResponse)??null,prompt:M.target.value}))},[h,f]=I.useState(!1),[g,U]=Cn(Jhe),y=async()=>{if(d.length>ou||d.length<vy||h||(g==null?void 0:g.rateLimitRemaining)===0||"__fallback"in t){d.length<vy&&T(new Error(`Prompt is too short (min ${vy} characters)`)),d.length>ou&&T(new Error(`Prompt is too long (max ${ou} characters)`));return}try{f(!0),Zt("ai","generate","ttd");let{generatedResponse:M,error:_,rateLimit:R,rateLimitRemaining:P}=await t.onTextSubmit(d);if(typeof M=="string"&&s(j=>({generatedResponse:M,prompt:(j==null?void 0:j.prompt)??null})),gp(R)&&gp(P)&&U({rateLimit:R,rateLimitRemaining:P}),_){T(_);return}if(!M){T(new Error("Generation failed"));return}try{await RP({canvasRef:i,data:C,mermaidToExcalidrawLib:x,setError:T,mermaidDefinition:M}),Zt("ai","mermaid parse success","ttd")}catch(j){console.info(`%cTTD mermaid render errror: ${j.message}`,"color: red"),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
159
|
+
TTD mermaid definition render errror: ${j.message}`,"color: yellow"),Zt("ai","mermaid parse failed","ttd"),T(new Error("Generated an invalid diagram :(. You may also try a different prompt."))}}catch(M){let _=M.message;(!_||_==="Failed to fetch")&&(_="Request failed"),T(new Error(_))}finally{f(!1)}},v=I.useRef(y);v.current=y;let[x,w]=I.useState({loaded:!1,api:ge(()=>import("./index-HkUXslJy.js").then(M=>M.N),[],import.meta.url)});I.useEffect(()=>{(async()=>(await x.api,w(M=>({...M,loaded:!0}))))()},[x.api]);let C=I.useRef({elements:[],files:null}),[S,T]=I.useState(null);return m.jsx(Oa,{className:"ttd-dialog",onCloseRequest:()=>{n.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:m.jsxs(Qhe,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?m.jsx("p",{className:"dialog-mermaid-title",children:D("mermaid.title")}):m.jsxs(BP,{children:[m.jsx(d8,{tab:"text-to-diagram",children:m.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[D("labels.textToDiagram"),m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"1px 6px",marginLeft:"10px",fontSize:10,borderRadius:"12px",background:"var(--color-promo)",color:"var(--color-surface-lowest)"},children:"AI Beta"})]})}),m.jsx(d8,{tab:"mermaid",children:"Mermaid"})]}),m.jsx(u8,{className:"ttd-dialog-content",tab:"mermaid",children:m.jsx(Khe,{mermaidToExcalidrawLib:x})}),!("__fallback"in t)&&m.jsxs(u8,{className:"ttd-dialog-content",tab:"text-to-diagram",children:[m.jsx("div",{className:"ttd-dialog-desc",children:"Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar."}),m.jsxs(jP,{children:[m.jsx(_2,{label:D("labels.prompt"),panelAction:{action:y,label:"Generate",icon:sg},onTextSubmitInProgess:h,panelActionDisabled:d.length>ou||(g==null?void 0:g.rateLimitRemaining)===0,renderTopRight:()=>g?m.jsxs("div",{className:"ttd-dialog-rate-limit",style:{fontSize:12,marginLeft:"auto",color:g.rateLimitRemaining===0?"var(--color-danger)":void 0},children:[g.rateLimitRemaining," requests left today"]}):null,renderSubmitShortcut:()=>m.jsx(OP,{}),renderBottomRight:()=>{if(typeof(a==null?void 0:a.generatedResponse)=="string")return m.jsxs("div",{className:"excalidraw-link",style:{marginLeft:"auto",fontSize:14},onClick:()=>{typeof(a==null?void 0:a.generatedResponse)=="string"&&(jv(a.generatedResponse),r({openDialog:{name:"ttd",tab:"mermaid"}}))},children:["View as Mermaid",m.jsx(XU,{icon:sg})]});let M=d.length/ou;return M>.8?m.jsxs("div",{style:{marginLeft:"auto",fontSize:12,fontFamily:"monospace",color:M>1?"var(--color-danger)":void 0},children:["Length: ",d.length,"/",ou]}):null},children:m.jsx(PP,{onChange:l,input:o,placeholder:"Describe what you want to see...",onKeyboardSubmit:()=>{v.current()}})}),m.jsx(_2,{label:"Preview",panelAction:{action:()=>{console.info("Panel action clicked"),DP({app:n,data:C})},label:"Insert",icon:sg},children:m.jsx(NP,{canvasRef:i,error:S,loaded:x.loaded})})]})]})]})})}),rfe=.01,ko=(e,t)=>!(t==="height"&&ke(e)||t==="width"&&ke(e)||t==="angle"&&Ke(e)),Cr=(e,t)=>{let n=e+t/2;return n-n%t},k2=(e,t,n)=>Object.keys(e).map(r=>({original:(n??t).get(r),latest:t.get(r)})).filter(r=>r.original!==void 0&&r.latest!==void 0),h1=(e,t,n,r,i,a,s,o=!0)=>{let c=r.get(n.id);if(!c)return;let[d,l]=[n.x+n.width/2,n.y+n.height/2],[h,f]=oe(A(n.x,n.y),A(d,l),n.angle),g=e-h,U=t-f,[y,v]=oe(A(e,t),A(d+g,l+U),-n.angle);he(c,{x:y,y:v},o),h8(c,r,i,a);let x=ct(n,s);if(x){let w=r.get(x.id);w&&he(w,{x:x.x+g,y:x.y+U},o)}},Pv=(e,t)=>{let n=Hc(t).map(r=>en(e,r).reduce((i,a)=>(i[a.id]=!0,i),{}));return e.filter(r=>!Zu(r)).forEach(r=>{n.push({[r.id]:!0})}),n},h8=(e,t,n,r,i)=>{rt(e)?i2([e],t,n,r,!0,[],i==null?void 0:i.zoom):ci(e,t,i)},ife=({label:e,icon:t,dragInputCallback:n,value:r,elements:i,editable:a=!0,shouldKeepAspectRatio:s,property:o,scene:c,appState:d,sensitivity:l=1})=>{let h=Ms(),f=I.useRef(null),g=I.useRef(null),[U,y]=I.useState(r.toString()),v=I.useRef(null);v.current||(v.current={originalAppState:co(d),originalElements:i,lastUpdatedValue:U,updatePending:!1}),I.useEffect(()=>{let C=r.toString();y(C),v.current.lastUpdatedValue=C},[r]);let x=(C,S,T)=>{if(!v.current.updatePending)return!1;v.current.updatePending=!1;let M=Number(C);if(isNaN(M)){y(r.toString());return}let _=Number(M.toFixed(2)),R=Number(r);(isNaN(R)||Math.abs(_-R)>=rfe)&&(v.current.lastUpdatedValue=C,n({accumulatedChange:0,instantChange:0,originalElements:S,originalElementsMap:h.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:s,shouldChangeByStepSize:!1,scene:c,nextValue:_,property:o,originalAppState:T,setInputValue:P=>y(String(P))}),h.syncActionResult({captureUpdate:se.IMMEDIATELY}))},w=I.useRef({});return w.current.handleInputValue=x,I.useEffect(()=>{let C=f.current,S=w.current;return()=>{var M;let T=C==null?void 0:C.value;T&&((M=S.handleInputValue)==null||M.call(S,T,v.current.originalElements,v.current.originalAppState)),window.removeEventListener("pointermove",S.onPointerMove,!1),window.removeEventListener("pointerup",S.onPointerUp,!1)}},[a]),a?m.jsxs("div",{className:De("drag-input-container",!a&&"disabled"),"data-testid":e,children:[m.jsx("div",{className:"drag-input-label",ref:g,onPointerDown:C=>{if(f.current&&a){document.body.classList.add("excalidraw-cursor-resize"),Number(f.current.value);let S=null,T=h.scene.getNonDeletedElements().reduce((F,B)=>(F.set(B.id,Ud(B)),F),new Map),M=i.map(F=>T.get(F.id)),_=co(d),R=0,P=0,j=F=>{if(S&&T!==null&&M!==null){let B=F.clientX-S.x;B!==0&&(P+=B,Math.abs(P)>=l&&(P=Math.sign(P)*Math.floor(Math.abs(P)/l),R+=P,n({accumulatedChange:R,instantChange:P,originalElements:M,originalElementsMap:T,shouldKeepAspectRatio:s,shouldChangeByStepSize:F.shiftKey,property:o,scene:c,originalAppState:_,setInputValue:G=>y(String(G))}),P=0))}S={x:F.clientX,y:F.clientY}},N=()=>{window.removeEventListener("pointermove",j,!1),h.syncActionResult({captureUpdate:se.IMMEDIATELY}),S=null,R=0,P=0,M=null,T=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener("pointerup",N,!1)};w.current.onPointerMove=j,w.current.onPointerUp=N,window.addEventListener("pointermove",j,!1),window.addEventListener("pointerup",N,!1)}},onPointerEnter:()=>{g.current&&(g.current.style.cursor="ew-resize")},children:t?m.jsx(XU,{icon:t}):e}),m.jsx("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:C=>{if(a){let S=C.target;S instanceof HTMLInputElement&&C.key===q.ENTER&&(x(S.value,i,d),h.focusContainer())}},ref:f,value:U,onChange:C=>{v.current.updatePending=!0,y(C.target.value)},onFocus:C=>{C.target.select(),v.current.originalElements=i,v.current.originalAppState=co(d)},onBlur:C=>{U?a&&x(C.target.value,v.current.originalElements,v.current.originalAppState):y(r.toString())},disabled:!a})]}):null},Lo=ife,X_=10,afe=e=>e.type==="image",sfe=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldKeepAspectRatio:r,shouldChangeByStepSize:i,nextValue:a,property:s,originalAppState:o,instantChange:c,scene:d})=>{let l=d.getNonDeletedElementsMap(),h=t[0],f=l.get(h.id);if(h&&f){let g=r||afe(h),U=h.width/h.height;if(o.croppingElementId===h.id){let C=l.get(h.id);if(!C||!Lt(C)||!C.crop)return;let S=C.crop,T={...S},M=C.scale[0]===-1,_=C.scale[1]===-1,{width:R,height:P}=bo(C),j=S.naturalWidth/R,N=S.naturalHeight/P,F=M?S.width+S.x:S.naturalWidth-S.x,B=_?S.height+S.y:S.naturalHeight-S.y,G=nr*j,W=nr*N;if(a!==void 0){if(s==="width"){let Z=a*j,V=mt(Z,G,F);T={...T,width:V,x:M?S.x+S.width-V:S.x}}else if(s==="height"){let Z=a*N,V=mt(Z,W,B);T={...T,height:V,y:_?S.y+S.height-V:S.y}}he(C,{crop:T,width:T.width/(S.naturalWidth/R),height:T.height/(S.naturalHeight/P)});return}let X=s==="width"?c:0,$=s==="height"?c:0,Y=mt(S.width+X,G,F),H=mt(S.height+$,G,B);T={...S,x:M?S.x+S.width-Y:S.x,y:_?S.y+S.height-H:S.y,width:Y,height:H},he(C,{crop:T,width:T.width/(S.naturalWidth/R),height:T.height/(S.naturalHeight/P)});return}if(a!==void 0){let C=Math.max(s==="width"?a:g?a*U:h.width,Bi),S=Math.max(s==="height"?a:g?a/U:h.height,Bi);a1(C,S,f,h,l,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:g});return}let y=s==="width"?e:0,v=s==="height"?e:0,x=Math.max(0,h.width+y);s==="width"&&(i?x=Cr(x,X_):x=Math.round(x));let w=Math.max(0,h.height+v);s==="height"&&(i?w=Cr(w,X_):w=Math.round(w)),g&&(s==="width"?w=Math.round(x/U*100)/100:x=Math.round(w*U*100)/100),w=Math.max(Bi,w),x=Math.max(Bi,x),a1(x,w,f,h,l,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:g})}},ofe=({property:e,element:t,scene:n,appState:r})=>{let i=hs(e==="width"?t.width:t.height,2);if(r.croppingElementId&&r.croppingElementId===t.id&&Lt(t)&&t.crop){let{width:a,height:s}=bo(t);if(e==="width"){let o=a/t.crop.naturalWidth;i=hs(t.crop.width*o,2)}if(e==="height"){let o=s/t.crop.naturalHeight;i=hs(t.crop.height*o,2)}}return m.jsx(Lo,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:sfe,value:i,editable:ko(t,e),scene:n,appState:r,property:e})},V_=ofe,lfe=15,cfe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),o=t[0];if(o&&!Ie(o)){let c=a.get(o.id);if(!c)return;if(r!==void 0){let U=Bc(r);he(c,{angle:U}),h8(c,a,s,i);let y=ct(c,a);y&&!ht(c)&&he(y,{angle:U});return}let d=Math.round(M1(o.angle)*100)/100,l=Math.round(e),h=(d+l)%360;n&&(h=Cr(h,lfe)),h=h<0?h+360:h;let f=Bc(h);he(c,{angle:f}),h8(c,a,s,i);let g=ct(c,a);g&&!ht(c)&&he(g,{angle:f})}},dfe=({element:e,scene:t,appState:n,property:r})=>m.jsx(Lo,{label:"A",icon:wI,value:Math.round(M1(e.angle)%360*100)/100,elements:[e],dragInputCallback:cfe,editable:ko(e,"angle"),scene:t,appState:n,property:r}),ufe=dfe,Y_=4,hfe=4,ffe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),s=t[0];if(s){let o=a.get(s.id);if(!o||!ke(o))return;let c;if(r!==void 0)c=Math.max(Math.round(r),Y_);else if(s.type==="text"){let d=Math.round(s.fontSize),l=Math.round(e);c=Math.max(d+l,Y_),n&&(c=Cr(c,hfe))}c&&(he(o,{fontSize:c}),Fr(o,i.getContainerElement(o),i.getNonDeletedElementsMap()))}},pfe=({element:e,scene:t,appState:n,property:r})=>{let i=ke(e)?e:Ki(e)?ct(e,t.getNonDeletedElementsMap()):null;return i?m.jsx(Lo,{label:"F",value:Math.round(i.fontSize*10)/10,elements:[i],dragInputCallback:ffe,icon:fU,appState:n,scene:t,property:r}):null},mfe=pfe,lu=10,gfe=(e,t,n,r)=>{let i=r.x-e,a=r.y-t,s=r.width*n,o=r.height*n,c=e+i*n,d=t+a*n;return{width:s,height:o,x:c,y:d,...K7(r,s,o,!1),...ke(r)?{fontSize:r.fontSize*n}:{}}},Ufe=(e,t,n,r,i,a,s,o)=>{let c=gfe(e,t,r,a);he(i,c,!1);let d=ct(a,o);if(d){let l=d.fontSize*r;ci(i,s,{newSize:{width:c.width,height:c.height}});let h=s.get(d.id);h&&ke(h)&&(he(h,{fontSize:l},!1),j1(i,s,n==="width"?"e":"s",!0))}},G_=(e,t,n,r,i,a,s,o,c,d)=>{a==="width"?t=Math.round(e/r*100)/100:e=Math.round(t*r*100)/100;let l=t/n;for(let h=0;h<o.length;h++){let f=o[h],g=s[h];Ufe(i[0],i[1],a,l,g,f,c,d)}},bfe=({accumulatedChange:e,originalElements:t,originalElementsMap:n,originalAppState:r,shouldChangeByStepSize:i,nextValue:a,scene:s,property:o})=>{let c=s.getNonDeletedElementsMap(),d=Pv(t,r);if(a!==void 0){for(let f of d){let g=k2(f,c,n);if(g.length>1){let U=g.map(P=>P.latest),y=g.map(P=>P.original),[v,x,w,C]=Nt(y),S=w-v,T=C-x,M=S/T,_=Math.max(Bi,o==="width"?Math.max(0,a):S),R=Math.max(Bi,o==="height"?Math.max(0,a):T);G_(_,R,T,M,A(v,x),o,U,y,c,n)}else{let[U]=g,y=U==null?void 0:U.latest,v=U==null?void 0:U.original;if(y&&v&&ko(y,o)){let x=o==="width"?Math.max(0,a):y.width;o==="width"&&(i?x=Cr(x,lu):x=Math.round(x));let w=o==="height"?Math.max(0,a):y.height;o==="height"&&(i?w=Cr(w,lu):w=Math.round(w)),x=Math.max(Bi,x),w=Math.max(Bi,w),a1(x,w,y,v,c,n,o==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate();return}let l=o==="width"?e:0,h=o==="height"?e:0;for(let f of d){let g=k2(f,c,n);if(g.length>1){let U=g.map(P=>P.latest),y=g.map(P=>P.original),[v,x,w,C]=Nt(y),S=w-v,T=C-x,M=S/T,_=Math.max(0,S+l);o==="width"&&(i?_=Cr(_,lu):_=Math.round(_));let R=Math.max(0,T+h);o==="height"&&(i?R=Cr(R,lu):R=Math.round(R)),_=Math.max(Bi,_),R=Math.max(Bi,R),G_(_,R,T,M,A(v,x),o,U,y,c,n)}else{let[U]=g,y=U==null?void 0:U.latest,v=U==null?void 0:U.original;if(y&&v&&ko(y,o)){let x=Math.max(0,v.width+l);o==="width"&&(i?x=Cr(x,lu):x=Math.round(x));let w=Math.max(0,v.height+h);o==="height"&&(i?w=Cr(w,lu):w=Math.round(w)),x=Math.max(Bi,x),w=Math.max(Bi,w),a1(x,w,y,v,c,n,o==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate()},yfe=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:i,appState:a})=>{let s=I.useMemo(()=>r.map(d=>{let l=k2(d,n);if(l.length>1){let[f,g,U,y]=Nt(l.map(v=>v.latest));return Math.round((e==="width"?U-f:y-g)*100)/100}let[h]=l;return Math.round((e==="width"?h.latest.width:h.latest.height)*100)/100}),[n,r,e]),o=new Set(s).size===1?Math.round(s[0]*100)/100:"Mixed",c=s.length>0;return m.jsx(Lo,{label:e==="width"?"W":"H",elements:t,dragInputCallback:bfe,value:o,editable:c,appState:a,property:e,scene:i})},q_=yfe,vfe=15,xfe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,property:i,scene:a})=>{let s=a.getNonDeletedElementsMap(),o=t.map(d=>s.get(d.id)).filter(d=>d&&!Zu(d)&&ko(d,i)),c=t.filter(d=>!Zu(d)&&ko(d,i));if(r!==void 0){let d=Bc(r);for(let l of o){if(!l)continue;he(l,{angle:d},!1);let h=ct(l,s);h&&!ht(l)&&he(h,{angle:d},!1)}a.triggerUpdate();return}for(let d=0;d<o.length;d++){let l=o[d];if(!l)continue;let h=c[d],f=Math.round(M1(h.angle)*100)/100,g=Math.round(e),U=(f+g)%360;n&&(U=Cr(U,vfe)),U=U<0?U+360:U;let y=Bc(U);he(l,{angle:y},!1);let v=ct(l,s);v&&!ht(l)&&he(v,{angle:y},!1)}a.triggerUpdate()},wfe=({elements:e,scene:t,appState:n,property:r})=>{let i=e.filter(c=>!Zu(c)&&ko(c,"angle")),a=i.map(c=>Math.round(M1(c.angle)%360*100)/100),s=new Set(a).size===1?a[0]:"Mixed",o=i.some(c=>ko(c,"angle"));return m.jsx(Lo,{label:"A",icon:wI,value:s,elements:e,dragInputCallback:xfe,editable:o,appState:n,scene:t,property:r})},Efe=wfe,Z_=4,Cfe=4,Sfe=(e,t)=>e.reduce((n,r)=>{if(!r||Zu(r))return n;if(ke(r))return n.push(r),n;if(Ki(r)){let i=ct(r,t);if(i)return n.push(i),n}return n},[]),_fe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),s=t.map(c=>a.get(c.id)),o;if(r){o=Math.max(Math.round(r),Z_);for(let c of s)he(c,{fontSize:o},!1),Fr(c,i.getContainerElement(c),a,!1);i.triggerUpdate()}else{let c=t;for(let d=0;d<s.length;d++){let l=s[d],h=c[d],f=Math.round(h.fontSize),g=Math.round(e),U=Math.max(f+g,Z_);n&&(U=Cr(U,Cfe)),he(l,{fontSize:U},!1),Fr(l,i.getContainerElement(l),a,!1)}i.triggerUpdate()}},kfe=({elements:e,scene:t,appState:n,property:r,elementsMap:i})=>{let a=Sfe(e,i);if(!a.length)return null;let s=a.map(d=>Math.round(d.fontSize*10)/10),o=new Set(s).size===1?s[0]:"Mixed",c=s.length>0;return m.jsx(Lo,{label:"F",icon:fU,elements:a,dragInputCallback:_fe,value:o,editable:c,scene:t,property:r,appState:n})},Tfe=kfe,K_=10,Mfe=({accumulatedChange:e,instantChange:t,originalElements:n,originalElementsMap:r,shouldChangeByStepSize:i,nextValue:a,property:s,scene:o,originalAppState:c})=>{let d=o.getNonDeletedElementsMap(),l=o.getNonDeletedElements(),h=n[0],[f,g]=[h.x+h.width/2,h.y+h.height/2],[U,y]=oe(A(h.x,h.y),A(f,g),h.angle);if(c.croppingElementId===h.id){let S=d.get(h.id);if(!S||!Lt(S)||!S.crop)return;let T=S.crop,M=T,_=S.scale[0]===-1,R=S.scale[1]===-1,{width:P,height:j}=bo(S);if(a!==void 0){if(s==="x"){let B=a*(T.naturalWidth/P);_?M={...T,x:mt(T.naturalWidth-B-T.width,0,T.naturalWidth-T.width)}:M={...T,x:mt(a*(T.naturalWidth/P),0,T.naturalWidth-T.width)}}s==="y"&&(M={...T,y:mt(a*(T.naturalHeight/j),0,T.naturalHeight-T.height)}),he(S,{crop:M});return}let N=(s==="x"?t:0)*(_?-1:1),F=(s==="y"?t:0)*(R?-1:1);M={...T,x:mt(T.x+N,0,T.naturalWidth-T.width),y:mt(T.y+F,0,T.naturalHeight-T.height)},he(S,{crop:M});return}if(a!==void 0){h1(s==="x"?a:U,s==="y"?a:y,h,d,l,o,r);return}let v=s==="x"?e:0,x=s==="y"?e:0,w=s==="x"?Math.round(i?Cr(h.x+v,K_):U+v):U,C=s==="y"?Math.round(i?Cr(h.y+x,K_):y+x):y;h1(w,C,h,d,l,o,r)},Ife=({property:e,element:t,elementsMap:n,scene:r,appState:i})=>{let[a,s]=oe(A(t.x,t.y),A(t.x+t.width/2,t.y+t.height/2),t.angle),o=hs(e==="x"?a:s,2);if(i.croppingElementId===t.id&&Lt(t)&&t.crop){let c=Uee(t);c&&(o=hs(e==="x"?c.x:c.y,2))}return m.jsx(Lo,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:Mfe,scene:r,value:o,property:e,appState:i})},Q_=Ife,Afe=10,Lfe=(e,t,n,r,i,a,s,o)=>{for(let c=0;c<r.length;c++){let d=i[c],[l,h]=[d.x+d.width/2,d.y+d.height/2],[f,g]=oe(A(d.x,d.y),A(l,h),d.angle),U=e==="x"?Math.round(f+t):f,y=e==="y"?Math.round(g+n):g;h1(U,y,d,a,r,o,s,!1)}},Rfe=(e,t,n,r,i,a,s)=>{let[o,c,,]=Nt(n),d=e-o,l=t-c;for(let h=0;h<n.length;h++){let f=n[h],g=r.get(f.id);if(g&&(!ke(g)||!g.containerId)){let[U,y]=[g.x+g.width/2,g.y+g.height/2],[v,x]=oe(A(g.x,g.y),A(U,y),g.angle);h1(v+d,x+l,f,r,i,s,a,!1)}}},Dfe=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldChangeByStepSize:r,nextValue:i,property:a,scene:s,originalAppState:o})=>{var h,f;let c=s.getNonDeletedElementsMap(),d=s.getNonDeletedElements();if(i!==void 0){for(let g of Pv(t,o)){let U=k2(g,c,n);if(U.length>1){let[y,v,,]=Nt(U.map(x=>x.latest));Rfe(a==="x"?i:y,a==="y"?i:v,U.map(x=>x.original),c,d,n,s)}else{let y=(h=U[0])==null?void 0:h.original,v=(f=U[0])==null?void 0:f.latest;if(y&&v&&ko(v,a)){let[x,w]=[y.x+y.width/2,y.y+y.height/2],[C,S]=oe(A(y.x,y.y),A(x,w),y.angle);h1(a==="x"?i:C,a==="y"?i:S,y,c,d,s,n,!1)}}}s.triggerUpdate();return}let l=r?Cr(e,Afe):e;Lfe(a,a==="x"?l:0,a==="y"?l:0,t,t,c,n,s),s.triggerUpdate()},jfe=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:i,appState:a})=>{let s=I.useMemo(()=>r.map(c=>{let d=Object.keys(c).map(y=>n.get(y)).filter(y=>y!==void 0);if(d.length>1){let[y,v]=Nt(d);return Math.round((e==="x"?y:v)*100)/100}let[l]=d,[h,f]=[l.x+l.width/2,l.y+l.height/2],[g,U]=oe(A(l.x,l.y),A(h,f),l.angle);return Math.round((e==="x"?g:U)*100)/100}),[r,n,e]),o=new Set(s).size===1?s[0]:"Mixed";return m.jsx(Lo,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:Dfe,value:o,property:e,scene:i,appState:a})},J_=jfe,ek=5,Pfe=({property:e,scene:t,appState:n,setAppState:r})=>m.jsx(Lo,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:i,instantChange:a,shouldChangeByStepSize:s,setInputValue:o})=>{r(c=>{let d;return i?d=i:a&&(d=s?Cr(c.gridStep+ek*Math.sign(a),ek):c.gridStep+a),d?(d=UA(d),o(d),{gridStep:d}):(o(c.gridStep),null)})},scene:t,value:n.gridStep,property:e,appState:n}),Nfe=Pfe,Ofe=50,Nv=e=>{let t=H1(),n=e.app.scene.getSceneNonce()||1,r=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),i=n1(e.app);return m.jsx(Ffe,{...e,appState:t,sceneNonce:n,selectedElements:r,gridModeEnabled:i})},Qt=({children:e,columns:t=1,heading:n,style:r,...i})=>m.jsx("div",{className:De("exc-stats__row",{"exc-stats__row--heading":n}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...r},...i,children:e});Qt.displayName="StatsRow";var T2=({children:e,order:t,style:n,...r})=>m.jsx("div",{className:"exc-stats__rows",style:{order:t,...n},...r,children:e});T2.displayName="StatsRows";Nv.StatsRow=Qt;Nv.StatsRows=T2;var Ffe=I.memo(({app:e,onClose:t,renderCustomStats:n,selectedElements:r,appState:i,sceneNonce:a,gridModeEnabled:s})=>{let o=e.scene,c=o.getNonDeletedElements(),d=o.getNonDeletedElementsMap(),l=Kn(),h=r.length===1?r[0]:null,f=r.length>1?r:null,g=i.croppingElementId&&Lt(h),U=g?bo(h):null,[y,v]=I.useState({width:0,height:0}),x=I.useMemo(()=>_1(S=>{let T=Nt(S);v({width:Math.round(T[2])-Math.round(T[0]),height:Math.round(T[3])-Math.round(T[1])})},Ofe),[]);I.useEffect(()=>{x(c)},[a,c,x]),I.useEffect(()=>()=>x.cancel(),[x]);let w=I.useMemo(()=>Pv(r,i),[r,i]),C=I.useMemo(()=>pL(r),[r]);return m.jsx("div",{className:"exc-stats",children:m.jsxs(Ia,{padding:3,children:[m.jsxs("div",{className:"title",children:[m.jsx("h2",{children:D("stats.title")}),m.jsx("div",{className:"close",onClick:t,children:xh})]}),m.jsxs(e8,{label:m.jsx("h3",{children:D("stats.generalStats")}),open:!!(i.stats.panels&bu.generalStats),openTrigger:()=>l(S=>({stats:{open:!0,panels:S.stats.panels^bu.generalStats}})),children:[m.jsxs(T2,{children:[m.jsx(Qt,{heading:!0,children:D("stats.scene")}),m.jsxs(Qt,{columns:2,children:[m.jsx("div",{children:D("stats.shapes")}),m.jsx("div",{children:c.length})]}),m.jsxs(Qt,{columns:2,children:[m.jsx("div",{children:D("stats.width")}),m.jsx("div",{children:y.width})]}),m.jsxs(Qt,{columns:2,children:[m.jsx("div",{children:D("stats.height")}),m.jsx("div",{children:y.height})]}),s&&m.jsxs(m.Fragment,{children:[m.jsx(Qt,{heading:!0,children:"Canvas"}),m.jsx(Qt,{children:m.jsx(Nfe,{property:"gridStep",scene:o,appState:i,setAppState:l})})]})]}),n==null?void 0:n(c,i)]}),!C&&r.length>0&&m.jsx("div",{id:"elementStats",style:{marginTop:12},children:m.jsx(e8,{label:m.jsx("h3",{children:D("stats.elementProperties")}),open:!!(i.stats.panels&bu.elementProperties),openTrigger:()=>l(S=>({stats:{open:!0,panels:S.stats.panels^bu.elementProperties}})),children:m.jsxs(T2,{children:[h&&m.jsxs(m.Fragment,{children:[g&&m.jsx(Qt,{heading:!0,children:D("labels.unCroppedDimension")}),i.croppingElementId&&Lt(h)&&U&&m.jsxs(Qt,{columns:2,children:[m.jsx("div",{children:D("stats.width")}),m.jsx("div",{children:hs(U.width,2)})]}),i.croppingElementId&&Lt(h)&&U&&m.jsxs(Qt,{columns:2,children:[m.jsx("div",{children:D("stats.height")}),m.jsx("div",{children:hs(U.height,2)})]}),m.jsx(Qt,{heading:!0,"data-testid":"stats-element-type",children:i.croppingElementId?D("labels.imageCropping"):D(`element.${h.type}`)}),m.jsx(Qt,{children:m.jsx(Q_,{element:h,property:"x",elementsMap:d,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(Q_,{element:h,property:"y",elementsMap:d,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(V_,{property:"width",element:h,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(V_,{property:"height",element:h,scene:o,appState:i})}),!Ie(h)&&m.jsx(Qt,{children:m.jsx(ufe,{property:"angle",element:h,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(mfe,{property:"fontSize",element:h,scene:o,appState:i})})]}),f&&m.jsxs(m.Fragment,{children:[wA(f)&&m.jsx(Qt,{heading:!0,children:D("element.group")}),m.jsxs(Qt,{columns:2,style:{margin:"0.3125rem 0"},children:[m.jsx("div",{children:D("stats.shapes")}),m.jsx("div",{children:r.length})]}),m.jsx(Qt,{children:m.jsx(J_,{property:"x",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(J_,{property:"y",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(q_,{property:"width",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(q_,{property:"height",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(Efe,{property:"angle",elements:f,scene:o,appState:i})}),m.jsx(Qt,{children:m.jsx(Tfe,{property:"fontSize",elements:f,scene:o,appState:i,elementsMap:d})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),Bfe=({sourceElementId:e,onClose:t,elementsMap:n,appState:r,generateLinkForSelection:i=qA})=>{var h;let a=((h=n.get(e))==null?void 0:h.link)??null,[s,o]=I.useState(a),[c,d]=I.useState(!1);I.useEffect(()=>{let f=ut(n,r),g=a;if(f.length>0&&i){let U=ZA(f,r);U&&(g=vi(i(U.id,U.type)))}o(g)},[n,r,r.selectedElementIds,a,i]);let l=I.useCallback(()=>{var f;if(s&&s!==((f=n.get(e))==null?void 0:f.link)){let g=n.get(e);g&&he(g,{link:s})}if(!s&&c&&e){let g=n.get(e);g&&he(g,{link:null})}t==null||t()},[e,s,n,c,t]);return I.useEffect(()=>{let f=g=>{var U,y;((U=r.openDialog)==null?void 0:U.name)==="elementLinkSelector"&&g.key===q.ENTER&&l(),((y=r.openDialog)==null?void 0:y.name)==="elementLinkSelector"&&g.key===q.ESCAPE&&(t==null||t())};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[r,t,l]),m.jsxs("div",{className:"ElementLinkDialog",children:[m.jsxs("div",{className:"ElementLinkDialog__header",children:[m.jsx("h2",{children:D("elementLink.title")}),m.jsx("p",{children:D("elementLink.desc")})]}),m.jsxs("div",{className:"ElementLinkDialog__input",children:[m.jsx(Lv,{value:s??"",onChange:f=>{c||d(!0),o(f)},onKeyDown:f=>{f.key===q.ENTER&&l()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),a&&s&&m.jsx(wt,{type:"button",title:D("buttons.remove"),"aria-label":D("buttons.remove"),label:D("buttons.remove"),onClick:()=>{o(null),d(!0)},className:"ElementLinkDialog__remove",icon:rd})]}),m.jsxs("div",{className:"ElementLinkDialog__actions",children:[m.jsx(ih,{label:D("buttons.cancel"),onClick:()=>{t==null||t()},style:{marginRight:10}}),m.jsx(ih,{label:D("buttons.confirm"),onClick:l,actionType:"primary"})]})]})},$fe=Bfe,zfe=({UIOptions:e})=>m.jsxs(Jt,{__fallback:!0,children:[m.jsx(Jt.DefaultItems.LoadScene,{}),m.jsx(Jt.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&m.jsx(Jt.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&m.jsx(Jt.DefaultItems.SaveAsImage,{}),m.jsx(Jt.DefaultItems.SearchMenu,{}),m.jsx(Jt.DefaultItems.Help,{}),m.jsx(Jt.DefaultItems.ClearCanvas,{}),m.jsx(Jt.Separator,{}),m.jsx(Jt.Group,{title:"Excalidraw links",children:m.jsx(Jt.DefaultItems.Socials,{})}),m.jsx(Jt.Separator,{}),m.jsx(Jt.DefaultItems.ToggleTheme,{}),m.jsx(Jt.DefaultItems.ChangeCanvasBackground,{})]}),Hfe=()=>m.jsxs(yy,{__fallback:!0,children:[m.jsx(yy.Actions.SaveToDisk,{}),m.jsx(yy.Actions.ExportToImage,{})]}),Wfe=({actionManager:e,appState:t,files:n,setAppState:r,elements:i,canvas:a,onLockToggle:s,onHandToolToggle:o,onPenModeToggle:c,showExitZenModeBtn:d,renderTopRightUI:l,renderCustomStats:h,UIOptions:f,onExportImage:g,renderWelcomeScreen:U,children:y,app:v,isCollaborating:x,generateLinkForSelection:w})=>{var X,$,Y;let C=Zn(),S=Iue(),T=S.tunnelsJotai.Provider,[M,_]=Cn(WU),R=()=>f.canvasActions.export?m.jsx(_he,{elements:i,appState:t,files:n,actionManager:e,exportOpts:f.canvasActions.export,canvas:a,setAppState:r}):null,P=()=>{var H;return!f.canvasActions.saveAsImage||((H=t.openDialog)==null?void 0:H.name)!=="imageExport"?null:m.jsx(the,{elements:i,appState:t,files:n,actionManager:e,onExportImage:g,onCloseRequest:()=>r({openDialog:null}),name:v.getName()})},j=()=>m.jsxs("div",{style:{position:"relative"},children:[m.jsx(S.MainMenuTunnel.Out,{}),U&&m.jsx(S.WelcomeScreenMenuHintTunnel.Out,{})]}),N=()=>m.jsx(u1,{heading:"selectedShapeActions",className:De("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:m.jsx(Ia,{className:Bu.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:m.jsx(Hj,{appState:t,elementsMap:v.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:v})})}),F=()=>{var V,te,ce,be,fe;let H=J7(t,i),Z=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&((V=t.openDialog)==null?void 0:V.name)!=="elementLinkSelector";return m.jsx(Qj,{side:"top",children:m.jsxs("div",{className:"App-menu App-menu_top",children:[m.jsxs(Wi.Col,{gap:6,className:De("App-menu_top__left"),children:[j(),H&&N()]}),!t.viewModeEnabled&&((te=t.openDialog)==null?void 0:te.name)!=="elementLinkSelector"&&m.jsx(u1,{heading:"shapes",className:"shapes-section",children:Se=>m.jsxs("div",{style:{position:"relative"},children:[U&&m.jsx(S.WelcomeScreenToolbarHintTunnel.Out,{}),m.jsx(Wi.Col,{gap:4,align:"start",children:m.jsxs(Wi.Row,{gap:1,className:De("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[m.jsxs(Ia,{padding:1,className:De("App-toolbar",{"zen-mode":t.zenModeEnabled}),children:[m.jsx(tP,{appState:t,isMobile:C.editor.isMobile,device:C,app:v}),Se,m.jsxs(Wi.Row,{gap:1,children:[m.jsx(rP,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>c(null),title:D("toolBar.penMode"),penDetected:t.penDetected}),m.jsx(nP,{checked:t.activeTool.locked,onChange:s,title:D("toolBar.lock")}),m.jsx("div",{className:"App-toolbar__divider"}),m.jsx(iP,{checked:zu(t),onChange:()=>o(),title:D("toolBar.hand"),isMobile:!0}),m.jsx(Wj,{appState:t,activeTool:t.activeTool,UIOptions:f,app:v})]})]}),x&&m.jsx(Ia,{style:{marginLeft:8,alignSelf:"center",height:"fit-content"},children:m.jsx(Vhe,{title:D("toolBar.laser"),checked:t.activeTool.type===Yn.laser,onChange:()=>v.setActiveTool({type:Yn.laser}),isMobile:!0})})]})})]})}),m.jsxs("div",{className:De("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&m.jsx(aP,{collaborators:t.collaborators,userToFollow:((ce=t.userToFollow)==null?void 0:ce.socketId)||null}),l==null?void 0:l(C.editor.isMobile,t),!t.viewModeEnabled&&((be=t.openDialog)==null?void 0:be.name)!=="elementLinkSelector"&&(!G||((fe=t.openSidebar)==null?void 0:fe.name)!==ka.name)&&m.jsx(S.DefaultSidebarTriggerTunnel.Out,{}),Z&&m.jsx(Nv,{app:v,onClose:()=>{e.executeAction(i8)},renderCustomStats:h})]})]})})},B=()=>m.jsx(H_,{__fallback:!0,onDock:H=>{Zt("sidebar",`toggleDock (${H?"dock":"undock"})`,`(${C.editor.isMobile?"mobile":"desktop"})`)}}),G=qD(Rv),W=m.jsxs(m.Fragment,{children:[y,m.jsx(zfe,{UIOptions:f}),m.jsx(H_.Trigger,{__fallback:!0,icon:a7,title:bp(D("toolBar.library")),onToggle:H=>{H&&Zt("sidebar",`${ka.name} (open)`,`button (${C.editor.isMobile?"mobile":"desktop"})`)},tab:ka.defaultTab,children:D("toolBar.library")}),m.jsx(Hfe,{}),((X=t.openDialog)==null?void 0:X.name)==="ttd"&&m.jsx(tfe,{__fallback:!0}),t.isLoading&&m.jsx(QD,{delay:250}),t.errorMessage&&m.jsx(que,{onClose:()=>r({errorMessage:null}),children:t.errorMessage}),M&&!C.editor.isMobile&&m.jsx(Ece,{colorPickerType:M.colorPickerType,onCancel:()=>{_(null)},onChange:(H,Z,V,{altKey:te})=>{var ce;if(!(H!=="elementBackground"&&H!=="elementStroke"))if(V.length){for(let be of V)he(be,{[te&&M.swapPreviewOnAlt?H==="elementBackground"?"strokeColor":"backgroundColor":H==="elementBackground"?"backgroundColor":"strokeColor"]:Z},!1),gn.delete(be);(ce=wo.getScene(V[0]))==null||ce.triggerUpdate()}else r(H==="elementBackground"?{currentItemBackgroundColor:Z}:{currentItemStrokeColor:Z})},onSelect:(H,Z)=>{var V;_(te=>te!=null&&te.keepOpenOnAlt&&Z.altKey?te:null),(V=M==null?void 0:M.onSelect)==null||V.call(M,H,Z)}}),(($=t.openDialog)==null?void 0:$.name)==="help"&&m.jsx(vhe,{onClose:()=>{r({openDialog:null})}}),m.jsx(jue,{}),((Y=t.openDialog)==null?void 0:Y.name)==="elementLinkSelector"&&m.jsx($fe,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{r({openDialog:null})},elementsMap:v.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:w}),m.jsx(S.OverwriteConfirmDialogTunnel.Out,{}),P(),R(),t.pasteDialog.shown&&m.jsx(phe,{setAppState:r,appState:t,onClose:()=>r({pasteDialog:{shown:!1,data:null}})}),C.editor.isMobile&&m.jsx(fhe,{app:v,appState:t,elements:i,actionManager:e,renderJSONExportDialog:R,renderImageExportDialog:P,setAppState:r,onLockToggle:s,onHandToolToggle:o,onPenModeToggle:c,renderTopRightUI:l,renderCustomStats:h,renderSidebars:B,device:C,renderWelcomeScreen:U,UIOptions:f}),!C.editor.isMobile&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"layer-ui__wrapper",style:t.openSidebar&&G&&C.editor.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[U&&m.jsx(S.WelcomeScreenCenterTunnel.Out,{}),F(),m.jsx(The,{appState:t,actionManager:e,showExitZenModeBtn:d,renderWelcomeScreen:U}),t.scrolledOutside&&m.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(H=>({...e1(i,H)}))},children:D("buttons.scrollBackToContent")})]}),B()]})]});return m.jsx(lj.Provider,{value:t,children:m.jsx(T,{children:m.jsx(Bj.Provider,{value:S,children:W})})})},tk=e=>{let{suggestedBindings:t,startBoundElement:n,cursorButton:r,scrollX:i,scrollY:a,...s}=e;return s},Xfe=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:n,appState:r,...i}=e,{canvas:a,appState:s,...o}=t;return pr(tk(r),tk(s),{selectedElementIds:pr,selectedGroupIds:pr})&&pr(i,o)},Vfe=xe.memo(Wfe,Xfe),Yfe=5e3,Gfe=({message:e,onClose:t,closable:n=!1,duration:r=Yfe,style:i})=>{let a=I.useRef(0),s=r!==1/0,o=I.useCallback(()=>{s&&(a.current=window.setTimeout(()=>t(),r))},[t,r,s]);return I.useEffect(()=>{if(s)return o(),()=>clearTimeout(a.current)},[o,e,r,s]),m.jsxs("div",{className:"Toast",onMouseEnter:s?()=>clearTimeout(a==null?void 0:a.current):void 0,onMouseLeave:s?o:void 0,style:i,children:[m.jsx("p",{className:"Toast__message",children:e}),n&&m.jsx(wt,{icon:xh,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},nk=we({name:"viewMode",label:"labels.viewMode",paletteName:"Toggle view mode",icon:d7,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:se.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,n)=>typeof n.viewModeEnabled>"u",keyTest:e=>!e[q.CTRL_OR_CMD]&&e.altKey&&e.code===_t.R}),$P=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length===1&&Ke(n[0])},qfe=we({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t).at(0)||null;if(Ke(i)){let a=ws(Gt(e),i.id).filter(s=>!(s.type==="text"&&s.containerId));return{elements:e,appState:{...t,selectedElementIds:a.reduce((s,o)=>(s[o.id]=!0,s),{})},captureUpdate:se.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:se.EVENTUALLY}},predicate:(e,t,n,r)=>$P(t,r)}),Zfe=we({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t).at(0)||null;return Ke(i)?{elements:uL(e,i),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:se.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:se.EVENTUALLY}},predicate:(e,t,n,r)=>$P(t,r)});we({name:"updateFrameRendering",label:"labels.updateFrameRendering",viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:se.EVENTUALLY}),checked:e=>e.frameRendering.enabled});we({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:CI,viewMode:!1,perform:(e,t,n,r)=>{let i=Ln(t,{type:"frame"});return Qa(r.interactiveCanvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Ln(t,{type:"frame"})},captureUpdate:se.EVENTUALLY}},keyTest:e=>!e[q.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===q.F});var Kfe=we({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=ut(e,t);return i.length>0&&!i.some(a=>Ke(a))},perform:(e,t,n,r)=>{let i=ut(e,t),[a,s,o,c]=Nt(i,r.scene.getNonDeletedElementsMap()),d=16,l=x7({x:a-d,y:s-d,width:o-a+d*2,height:c-s+d*2});if(t.editingGroupId){let h=en(i,t.editingGroupId);for(let f of h){let g=f.groupIds.indexOf(t.editingGroupId);he(f,{groupIds:f.groupIds.slice(0,g)},!1)}}return{elements:wp([...r.scene.getElementsIncludingDeleted(),l],i,l,t),appState:{selectedElementIds:{[l.id]:!0}},captureUpdate:se.IMMEDIATELY}}}),Qfe=()=>m.jsxs("div",{"data-testid":"brave-measure-text-error",children:[m.jsx("p",{children:m.jsx(us,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>m.jsx("span",{style:{fontWeight:600},children:e})})}),m.jsx("p",{children:m.jsx(us,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>m.jsx("span",{style:{fontWeight:600},children:e})})}),m.jsx("p",{children:m.jsx(us,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>m.jsx("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),m.jsx("p",{children:m.jsx(us,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>m.jsx("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>m.jsxs("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),Jfe=Qfe,jm={width:100,height:0},_l=100,epe=(e,t,n)=>{let r=Ei({x:0,y:0,textAlign:Yp.CENTER,verticalAlign:yi.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:r.id})}),Fr(r,e,n),[e,r]},rk=(e,t,n,r,i)=>{let a,s;if(Object.assign(e,{startBinding:(e==null?void 0:e.startBinding)||null,endBinding:e.endBinding||null}),t){let l=(t==null?void 0:t.width)??_l,h=(t==null?void 0:t.height)??_l,f;t.id&&(f=r.getElement(t.id),f||console.error(`No element for start binding with id ${t.id} found`));let g=t.x||e.x-l,U=t.y||e.y-h/2,y=f?f.type:t.type;if(y){if(y==="text"){let v="";f&&f.type==="text"?v=f.text:t.type==="text"&&(v=t.text),v||console.error(`No text found for start binding text element for ${e.id}`),a=Ei({x:g,y:U,type:"text",...f,...t,text:v}),Object.assign(a,{x:t.x||e.x-a.width,y:t.y||e.y-a.height/2})}else switch(y){case"rectangle":case"ellipse":case"diamond":{a=vs({x:g,y:U,width:l,height:h,...f,...t,type:y});break}default:td(e,`Unhandled element start type "${t.type}"`,!0)}bs(e,a,"start",i)}}if(n){let l=(n==null?void 0:n.height)??_l,h=(n==null?void 0:n.width)??_l,f;n.id&&(f=r.getElement(n.id),f||console.error(`No element for end binding with id ${n.id} found`));let g=n.x||e.x+e.width,U=n.y||e.y-l/2,y=f?f.type:n.type;if(y){if(y==="text"){let v="";f&&f.type==="text"?v=f.text:n.type==="text"&&(v=n.text),v||console.error(`No text found for end binding text element for ${e.id}`),s=Ei({x:g,y:U,type:"text",...f,...n,text:v}),Object.assign(s,{y:n.y||e.y-s.height/2})}else switch(y){case"rectangle":case"ellipse":case"diamond":{s=vs({x:g,y:U,width:h,height:l,...f,...n,type:y});break}default:td(e,`Unhandled element end type "${y}"`,!0)}bs(e,s,"end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:a,endBoundElement:s};let o=e.points.length-1,c=.5,d=co(e.points);return e.points[o][0]>e.points[o-1][0]&&(d[0][0]=c,d[o][0]-=c),e.points[o][0]<e.points[o-1][0]&&(d[0][0]=-c,d[o][0]+=c),e.points[o][1]>e.points[o-1][1]&&(d[0][1]=c,d[o][1]-=c),e.points[o][1]<e.points[o-1][1]&&(d[0][1]=-c,d[o][1]+=c),Object.assign(e,{points:d}),{linearElement:e,startBoundElement:a,endBoundElement:s}},tpe=class{constructor(){z(this,"excalidrawElements",new Map),z(this,"add",e=>{e&&this.excalidrawElements.set(e.id,e)}),z(this,"getElements",()=>xo(Array.from(this.excalidrawElements.values()))),z(this,"getElementsMap",()=>qi(Qe(this.getElements()))),z(this,"getElement",e=>this.excalidrawElements.get(e))}},f1=(e,t)=>{var o,c,d;if(!e)return[];let n=co(e),r=new tpe,i=new Map,a=new Map;for(let l of n){let h,f=l.id;switch((t==null?void 0:t.regenerateIds)!==!1&&Object.assign(l,{id:Qi()}),l.type){case"rectangle":case"ellipse":case"diamond":{let g=(o=l==null?void 0:l.label)!=null&&o.text&&l.width===void 0?0:(l==null?void 0:l.width)||_l,U=(c=l==null?void 0:l.label)!=null&&c.text&&l.height===void 0?0:(l==null?void 0:l.height)||_l;h=vs({...l,width:g,height:U});break}case"line":{let g=l.width||jm.width,U=l.height||jm.height;h=Wc({width:g,height:U,points:[A(0,0),A(g,U)],...l});break}case"arrow":{let g=l.width||jm.width,U=l.height||jm.height;h=w7({width:g,height:U,endArrowhead:"arrow",points:[A(0,0),A(g,U)],...l,type:"arrow"}),Object.assign(h,qu(h.points));break}case"text":{let g=(l==null?void 0:l.fontFamily)||Xl,U=(l==null?void 0:l.fontSize)||Mo,y=(l==null?void 0:l.lineHeight)||ad(g),v=l.text??"",x=Vu(v),w=Mr(x,$t({fontFamily:g,fontSize:U}),y);h=Ei({width:w.width,height:w.height,fontFamily:g,fontSize:U,...l});break}case"image":{h=RA({width:(l==null?void 0:l.width)||_l,height:(l==null?void 0:l.height)||_l,...l});break}case"frame":{h=x7({x:0,y:0,...l});break}case"magicframe":{h=S3({x:0,y:0,...l});break}case"freedraw":case"iframe":case"embeddable":{h=l;break}default:h=l,td(l,`Unhandled element type "${l.type}"`,!0)}r.getElement(h.id)?console.error(`Duplicate id found for ${h.id}`):(r.add(h),i.set(h.id,l),f&&a.set(f,h.id))}let s=r.getElementsMap();for(let[l,h]of i){let f=r.getElement(l);switch(h.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if((d=h.label)!=null&&d.text){let[g,U]=epe(f,h==null?void 0:h.label,s);if(r.add(g),r.add(U),ht(g)){let y=h.type==="arrow"?h==null?void 0:h.start:void 0,v=h.type==="arrow"?h==null?void 0:h.end:void 0;if(y&&y.id){let S=a.get(y.id);S&&Object.assign(y,{id:S})}if(v&&v.id){let S=a.get(v.id);S&&Object.assign(v,{id:S})}let{linearElement:x,startBoundElement:w,endBoundElement:C}=rk(g,y,v,r,s);g=x,r.add(x),r.add(w),r.add(C)}}else switch(h.type){case"arrow":{let{start:g,end:U}=h;if(g&&g.id){let w=a.get(g.id);Object.assign(g,{id:w})}if(U&&U.id){let w=a.get(U.id);Object.assign(U,{id:w})}let{linearElement:y,startBoundElement:v,endBoundElement:x}=rk(f,g,U,r,s);r.add(y),r.add(v),r.add(x);break}}break}}}for(let[l,h]of i){if(h.type!=="frame"&&h.type!=="magicframe")continue;let f=r.getElement(l);if(!f)throw new Error(`Excalidraw element with id ${l} doesn't exist`);let g=[];h.children.forEach(_=>{var j;let R=a.get(_);if(!R)throw new Error(`Element with ${_} wasn't mapped correctly`);let P=r.getElement(R);if(!P)throw new Error(`Frame element with id ${R} doesn't exist`);Object.assign(P,{frameId:f.id}),(j=P==null?void 0:P.boundElements)==null||j.forEach(N=>{let F=r.getElement(N.id);if(!F)throw new Error(`Bound element with id ${N.id} doesn't exist`);Object.assign(F,{frameId:f.id}),g.push(F)}),g.push(P)});let[U,y,v,x]=Nt(g),w=10;U=U-w,y=y-w,v=v+w,x=x+w;let C=(f==null?void 0:f.x)||U,S=(f==null?void 0:f.y)||y,T=(f==null?void 0:f.width)||v-U,M=(f==null?void 0:f.height)||x-y;Object.assign(f,{x:C,y:S,width:T,height:M}),nI()&&h.children.length&&(f!=null&&f.x||f!=null&&f.y||f!=null&&f.width||f!=null&&f.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return r.getElements()},yn=e=>t=>{ar.unstable_batchedUpdates(e,t)},xy=e=>lU(t=>{ar.unstable_batchedUpdates(e,t)}),Ov=(()=>{let e;try{let n=I.version.split(".");e=Number(n[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn("Excalidraw: render throttling is disabled on React versions < 18.")),!1):!1})(),npe="#ff6b6b",rpe="#ff0000",ik=1,ak=2,ipe=(e,t)=>{if(!t.snapLines.length)return;let n=t.theme===yt.LIGHT||t.zenModeEnabled?npe:rpe,r=(t.zenModeEnabled?ik*1.5:ik)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let i of t.snapLines)i.type==="pointer"?(e.lineWidth=r,e.strokeStyle=n,spe(i,e,t)):i.type==="gap"?(e.lineWidth=r,e.strokeStyle=n,ope(i.points[0],i.points[1],i.direction,t,e)):i.type==="points"&&(e.lineWidth=r,e.strokeStyle=n,ape(i,e,t));e.restore()},ape=(e,t,n)=>{if(!n.zenModeEnabled){let r=e.points[0],i=e.points[e.points.length-1];Oi(r,i,t)}for(let r of e.points)zP(r,n,t)},spe=(e,t,n)=>{zP(e.points[0],n,t),n.zenModeEnabled||Oi(e.points[0],e.points[1],t)},zP=([e,t],n,r)=>{r.save();let i=(n.zenModeEnabled?ak*1.5:ak)/n.zoom.value;r.beginPath(),r.moveTo(e-i,t-i),r.lineTo(e+i,t+i),r.moveTo(e+i,t-i),r.lineTo(e-i,t+i),r.stroke(),r.restore()},Oi=(e,t,n)=>{n.beginPath(),n.lineTo(e[0],e[1]),n.lineTo(t[0],t[1]),n.stroke()},ope=(e,t,n,r,i)=>{let a=8/r.zoom.value,s=a/2,o=a/4;if(n==="horizontal"){let c=[(e[0]+t[0])/2,e[1]];r.zenModeEnabled||Oi(A(e[0],e[1]-a),A(e[0],e[1]+a),i),Oi(A(c[0]-o,c[1]-s),A(c[0]-o,c[1]+s),i),Oi(A(c[0]+o,c[1]-s),A(c[0]+o,c[1]+s),i),r.zenModeEnabled||(Oi(A(t[0],t[1]-a),A(t[0],t[1]+a),i),Oi(e,t,i))}else{let c=[e[0],(e[1]+t[1])/2];r.zenModeEnabled||Oi(A(e[0]-a,e[1]),A(e[0]+a,e[1]),i),Oi(A(c[0]-s,c[1]-o),A(c[0]+s,c[1]-o),i),Oi(A(c[0]-s,c[1]+o),A(c[0]+s,c[1]+o),i),r.zenModeEnabled||(Oi(A(t[0]-a,t[1]),A(t[0]+a,t[1]),i),Oi(e,t,i))}},lpe=(e,t)=>{Tr(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:n}=t.selectedLinearElement;Tr(n,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),HP(n,e,t),e.restore()},cpe=(e,t,n)=>{var o,c;let{elementId:r,hoverPointIndex:i}=t.selectedLinearElement;if((c=(o=t.editingLinearElement)==null?void 0:o.selectedPointsIndices)!=null&&c.includes(i))return;let a=Me.getElement(r,n);if(!a)return;let s=Me.getPointAtIndexGlobalCoordinates(a,i,n);e.save(),e.translate(t.scrollX,t.scrollY),HP(s,e,t),e.restore()},HP=(e,t,n)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",kU(t,e[0],e[1],Me.POINT_HANDLE_SIZE/n.zoom.value,!1)},$1=(e,t,n,r,i,a,s,o,c=!1,d=0)=>{e.save(),e.translate(a,s),e.rotate(o),c&&e.fillRect(t-a,n-s,r,i),d&&e.roundRect?(e.beginPath(),e.roundRect(t-a,n-s,r,i,d),e.stroke(),e.closePath()):e.strokeRect(t-a,n-s,r,i),e.restore()},dpe=(e,t,n,r,i,a)=>{e.save(),e.translate(r,i),e.rotate(a),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},wy=(e,t,n,r,i,a=!1)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",i?e.fillStyle="rgba(134, 131, 226, 0.9)":a&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),kU(e,n[0],n[1],r/t.zoom.value,!a)},upe=(e,t,n,r,i,a)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,a,0,Math.PI*2),e.stroke()},hpe=(e,t,n,r)=>{let[i,a,s,o]=it(t,n),c=s-i,d=o-a;e.strokeStyle="rgba(0,0,0,.05)";let l=r.value<1?r.value:1;e.lineWidth=b7/l;let h=e.lineWidth/2+y7,f=Ta(Math.min(t.width,t.height),t);switch(t.type){case"rectangle":case"text":case"image":case"iframe":case"embeddable":case"frame":case"magicframe":$1(e,i-h,a-h,c+h*2,d+h*2,i+c/2,a+d/2,t.angle,void 0,f);break;case"diamond":let g=Math.hypot(c,d),U=h*g/d,y=h*g/c;dpe(e,c+U*2,d+y*2,i+c/2,a+d/2,t.angle);break;case"ellipse":upe(e,c+h*2,d+h*2,i+c/2,a+d/2,t.angle);break}},fpe=(e,t,n,r)=>{let[i,a,s]=t,o=D1(s,s.width,s.height,r);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",(a==="both"?[0,-1]:a==="start"?[0]:[-1]).forEach(c=>{let[d,l]=Me.getPointAtIndexGlobalCoordinates(i,c,n);kU(e,d,l,o)})},WP=(e,t,n)=>{let{angle:r,x1:i,y1:a,x2:s,y2:o,selectionColors:c,cx:d,cy:l,dashed:h,activeEmbeddable:f}=n,g=s-i,U=o-a,y=(n.padding??Jc*2)/t.zoom.value,v=8/t.zoom.value,x=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(f?4:1)/t.zoom.value;let w=c.length;for(let C=0;C<w;++C)e.strokeStyle=c[C],h&&e.setLineDash([v,x+(v+x)*(w-1)]),e.lineDashOffset=(v+x)*C,$1(e,i-y,a-y,g+y*2,U+y*2,d,l,r);e.restore()},ppe=(e,t,n,r)=>{let i=Array.isArray(n)?fpe:hpe;e.save(),e.translate(t.scrollX,t.scrollY),i(e,n,r,t.zoom),e.restore()},mpe=(e,t,n,r)=>{let[i,a,s,o]=it(n,r),c=s-i,d=o-a;e.strokeStyle="rgb(0,118,255)",e.lineWidth=pn.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),$1(e,i,a,c,d,i+c/2,a+d/2,n.angle,!1,pn.radius/t.zoom.value),e.restore()},gpe=(e,t,n)=>{let r=n.filter(o=>o.groupIds.length===0),i=n.filter(o=>o.groupIds.length>0),a=o=>{let[c,d,l,h]=Nt(o);return{angle:0,x1:c,x2:l,y1:d,y2:h,selectionColors:["rgb(0,118,255)"],dashed:!1,cx:c+(l-c)/2,cy:d+(h-d)/2,activeEmbeddable:!1}},s=o=>{let c=en(n,o);return a(c)};Object.entries(xA(i,t)).filter(([o,c])=>c).map(([o,c])=>o).map(o=>s(o)).concat(r.map(o=>a([o]))).forEach(o=>WP(e,t,o))},Ey=(e,t,n,r)=>{var o;if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let i=Me.getPointsGlobalCoordinates(n,r),{POINT_HANDLE_SIZE:a}=Me,s=t.editingLinearElement?a:a/2;if(i.forEach((c,d)=>{var h,f;if(Ie(n)&&d!==0&&d!==i.length-1)return;let l=!!((f=(h=t.editingLinearElement)==null?void 0:h.selectedPointsIndices)!=null&&f.includes(d));wy(e,t,c,s,l)}),Ie(n)){let c=((o=n.fixedSegments)==null?void 0:o.map(d=>d.index))||[];i.slice(0,-1).forEach((d,l)=>{Me.isSegmentTooShort(n,i[l+1],i[l],l,t.zoom)||wy(e,t,A((d[0]+i[l+1][0])/2,(d[1]+i[l+1][1])/2),a/2,!1,!c.includes(l+1))})}else Me.getEditorMidPoints(n,r,t).filter((c,d,l)=>c!==null&&!(Ie(n)&&(d===0||d===l.length-1))).forEach(c=>{(t.editingLinearElement||i.length===2)&&wy(e,t,c,a/2,!1,!0)});e.restore()},sk=(e,t,n,r,i)=>{Object.keys(r).forEach(a=>{let s=r[a];if(s!==void 0){let[o,c,d,l]=s;e.save(),e.lineWidth=1/n.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),a==="rotation"?kU(e,o+d/2,c+l/2,d/2):e.roundRect?(e.beginPath(),e.roundRect(o,c,d,l,2/n.zoom.value),e.fill(),e.stroke()):$1(e,o,c,d,l,o+d/2,c+l/2,i,!0),e.restore()}})},Upe=(e,t,n,r,i)=>{let[a,s,,,o,c]=it(r,i),d=3,l=20,h=d/n.zoom.value,f=h/2,g=o-a+h,U=c-s+h,y=Math.min(l/n.zoom.value,g),v=Math.min(l/n.zoom.value,U);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=h,[[[-g,-U],[0,f],[y,f],[f,0],[f,v]],[[g-f,-U],[f,f],[-y+f,f],[0,0],[0,v]],[[-g,U],[0,-f],[y,-f],[f,0],[f,-v]],[[g-f,U],[f,-f],[-y+f,-f],[0,0],[0,-v]]].forEach(x=>{let[[w,C],[S,T],[M,_],[R,P],[j,N]]=x;e.save(),e.translate(o,c),e.rotate(r.angle),e.beginPath(),e.moveTo(w+S,C+T),e.lineTo(w+M,C+_),e.stroke(),e.beginPath(),e.moveTo(w+R,C+P),e.lineTo(w+j,C+N),e.stroke(),e.restore()}),e.restore()},bpe=(e,t,n,r)=>{t.save();let i=Jc*2/n.zoom.value,a=e.width+i*2,s=e.height+i*2,o=e.x+a/2,c=e.y+s/2,d=-(a/2+i),l=-(s/2+i);t.translate(o+n.scrollX,c+n.scrollY),t.rotate(e.angle),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(d,l,a,s),t.restore()},XP=({canvas:e,elementsMap:t,visibleElements:n,selectedElements:r,allElementsMap:i,scale:a,appState:s,renderConfig:o,device:c})=>{var y,v,x;if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[d,l]=_7(e,a),h=k7({canvas:e,scale:a,normalizedWidth:d,normalizedHeight:l});h.save(),h.scale(s.zoom.value,s.zoom.value);let f;if(n.forEach(w=>{var C;((C=s.editingLinearElement)==null?void 0:C.elementId)===w.id&&w&&(f=w)}),f&&Ey(h,s,f,t),s.selectionElement&&!s.isCropping)try{wee(s.selectionElement,h,s,o.selectionColor)}catch(w){console.error(w)}if(s.editingTextElement&&ke(s.editingTextElement)){let w=i.get(s.editingTextElement.id);w&&!w.autoResize&&bpe(w,h,s,o.selectionColor)}s.isBindingEnabled&&s.suggestedBindings.filter(w=>w!=null).forEach(w=>{ppe(h,s,w,t)}),s.frameToHighlight&&mpe(h,s,s.frameToHighlight,t),s.elementsToHighlight&&gpe(h,s,s.elementsToHighlight);let g=r.some(w=>Ke(w));if(r.length===1&&((y=s.editingLinearElement)==null?void 0:y.elementId)===r[0].id&&Ey(h,s,r[0],t),Ie(r[0])&&s.selectedLinearElement&&s.selectedLinearElement.segmentMidPointHoveredCoords?lpe(h,s):s.selectedLinearElement&&s.selectedLinearElement.hoverPointIndex>=0&&!(Ie(r[0])&&s.selectedLinearElement.hoverPointIndex>0&&s.selectedLinearElement.hoverPointIndex<r[0].points.length-1)&&cpe(h,s,t),!s.multiElement&&!s.editingLinearElement){let w=vL(r,s),C=r.length===1&&rt(r[0]);C&&((v=s.selectedLinearElement)==null?void 0:v.elementId)===r[0].id&&!r[0].locked&&Ey(h,s,r[0],t);let S=o.selectionColor||or.black;if(w){let T=Qe(r),M=[];for(let R of t.values()){let P=[],j=o.remoteSelectedElementIds.get(R.id);if(C&&Ie(R)&&(R.startBinding||R.endBinding)||(T.has(R.id)&&!yA(s,R)&&P.push(S),j&&P.push(...j.map(N=>qU(N,s.collaborators.get(N))))),P.length){let[N,F,B,G,W,X]=it(R,t,!0);M.push({angle:R.angle,x1:N,y1:F,x2:B,y2:G,selectionColors:P,dashed:!!j,cx:W,cy:X,activeEmbeddable:((x=s.activeEmbeddable)==null?void 0:x.element)===R&&s.activeEmbeddable.state==="active",padding:R.id===s.croppingElementId||Lt(R)?0:void 0})}}let _=R=>{let P=en(t,R),[j,N,F,B]=Nt(P);M.push({angle:0,x1:j,x2:F,y1:N,y2:B,selectionColors:[or.black],dashed:!0,cx:j+(F-j)/2,cy:N+(B-N)/2,activeEmbeddable:!1})};for(let R of Hc(s))_(R);s.editingGroupId&&_(s.editingGroupId),M.forEach(R=>WP(h,s,R))}if(h.save(),h.translate(s.scrollX,s.scrollY),r.length===1){h.fillStyle=or.white;let T=yL(r[0],s.zoom,t,"mouse",Ep(c));if(!s.viewModeEnabled&&w&&!ke(s.editingTextElement)&&!s.croppingElementId&&sk(h,o,s,T,r[0].angle),s.croppingElementId&&!s.isCropping){let M=t.get(s.croppingElementId);M&&Lt(M)&&Upe(h,o,s,M,t)}}else if(r.length>1&&!s.isRotating){let T=Jc*2/s.zoom.value;h.fillStyle=or.white;let[M,_,R,P]=Nt(r),j=h.getLineDash();h.setLineDash([2/s.zoom.value]);let N=h.lineWidth;h.lineWidth=1/s.zoom.value,h.strokeStyle=S,$1(h,M-T,_-T,R-M+T*2,P-_+T*2,(M+R)/2,(_+P)/2,0),h.lineWidth=N,h.setLineDash(j);let F=Z7([M,_,R,P,(M+R)/2,(_+P)/2],0,s.zoom,"mouse",g?{...Ep(c),rotation:!0}:Ep(c));r.some(B=>!B.locked)&&sk(h,o,s,F,0)}h.restore()}s.searchMatches.forEach(({id:w,focus:C,matchedLines:S})=>{let T=t.get(w);if(T&&ke(T)){let[M,_,,,R,P]=it(T,t,!0);h.save(),s.theme===yt.LIGHT?C?h.fillStyle="rgba(255, 124, 0, 0.4)":h.fillStyle="rgba(255, 226, 0, 0.4)":C?h.fillStyle="rgba(229, 82, 0, 0.4)":h.fillStyle="rgba(99, 52, 0, 0.4)",h.translate(s.scrollX,s.scrollY),h.translate(R,P),h.rotate(T.angle),S.forEach(j=>{h.fillRect(M+j.offsetX-R,_+j.offsetY-P,j.width,j.height)}),h.restore()}}),ipe(h,s),h.restore(),ide({context:h,renderConfig:o,appState:s,normalizedWidth:d,normalizedHeight:l});let U;return o.renderScrollbars&&(U=uhe(n,d,l,s),h.save(),h.fillStyle=dhe,h.strokeStyle="rgba(255,255,255,0.8)",[U.horizontal,U.vertical].forEach(w=>{w&&Cj(h,w.x,w.y,w.width,w.height,Sl/2)}),h.restore()),{scrollBars:U,atLeastOneVisibleElement:n.length>0,elementsMap:t}},VP=lU(e=>{var n;let t=XP(e);(n=e.callback)==null||n.call(e,t)},{trailing:!0}),ype=(e,t)=>{if(t){VP(e);return}let n=XP(e);return e.callback(n),n},vpe=e=>{let t=I.useRef(!1);return I.useEffect(()=>{var c;if(!t.current){t.current=!0;return}let n=new Map,r=new Map,i=new Map,a=new Map,s=new Map;e.appState.collaborators.forEach((d,l)=>{if(d.selectedElementIds)for(let h of Object.keys(d.selectedElementIds))i.has(h)||i.set(h,[]),i.get(h).push(l);!d.pointer||d.pointer.renderCursor===!1||(d.username&&a.set(l,d.username),d.userState&&s.set(l,d.userState),r.set(l,xa({sceneX:d.pointer.x,sceneY:d.pointer.y},e.appState)),n.set(l,d.button))});let o=((c=e.containerRef)==null?void 0:c.current)&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";ype({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:r,remotePointerButton:n,remoteSelectedElementIds:i,remotePointerUsernames:a,remotePointerUserStates:s,selectionColor:o,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},Ov())}),m.jsx("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?Ot.GRAB:Ot.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:D("labels.drawingCanvas")})},ok=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),xpe=(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:pr(ok(e.appState),ok(t.appState)),wpe=xe.memo(vpe,xpe),Epe=e=>{let t=I.useRef(null),n=I.useRef(!1);return I.useEffect(()=>{let r=t.current;if(!r)return;let i=e.canvas;n.current||(n.current=!0,r.replaceChildren(i),i.classList.add("excalidraw__canvas","static"));let a=`${e.appState.width}px`,s=`${e.appState.height}px`;i.style.width!==a&&(i.style.width=a),i.style.height!==s&&(i.style.height=s);let o=e.appState.width*e.scale,c=e.appState.height*e.scale;i.width!==o&&(i.width=o),i.height!==c&&(i.height=c),JA({canvas:i,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},Ov())}),m.jsx("div",{className:"excalidraw__canvas-wrapper",ref:t})},lk=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),Cpe=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:pr(lk(e.appState),lk(t.appState))&&pr(e.renderConfig,t.renderConfig),Spe=xe.memo(Epe,Cpe),ck=class{constructor(e){z(this,"scene"),z(this,"getRenderableElements",(()=>{let t=({elementsMap:r,zoom:i,offsetLeft:a,offsetTop:s,scrollX:o,scrollY:c,height:d,width:l})=>{let h=[];for(let f of r.values())p2(f,l,d,{zoom:i,offsetLeft:a,offsetTop:s,scrollX:o,scrollY:c},r)&&h.push(f);return h},n=({elements:r,editingTextElement:i,newElementId:a,pendingImageElementId:s})=>{let o=qi(new Map);for(let c of r)Lt(c)&&s===c.id||a!==c.id&&(!i||i.type!=="text"||c.id!==i.id)&&o.set(c.id,c);return o};return eY(({zoom:r,offsetLeft:i,offsetTop:a,scrollX:s,scrollY:o,height:c,width:d,editingTextElement:l,newElementId:h,pendingImageElementId:f,sceneNonce:g})=>{let U=this.scene.getNonDeletedElements(),y=n({elements:U,editingTextElement:l,newElementId:h,pendingImageElementId:f}),v=t({elementsMap:y,zoom:r,offsetLeft:i,offsetTop:a,scrollX:s,scrollY:o,height:c,width:d});return{elementsMap:y,visibleElements:v}})})()),this.scene=e}destroy(){VP.cancel(),QA.cancel(),this.getRenderableElements.clear()}},_pe=({trails:e})=>{let t=I.useRef(null);return I.useEffect(()=>{if(t.current)for(let n of e)n.start(t.current);return()=>{for(let n of e)n.stop()}},e),m.jsx("div",{className:"SVGLayer",children:m.jsx("svg",{ref:t})})},kpe=5,Tpe=(e,t,n)=>{let[r,i]=it(e,n),{x:a,y:s}=xa({sceneX:r+e.width,sceneY:i},t),o=a-t.offsetLeft+10,c=s-t.offsetTop;return{x:o,y:c}},dk=({children:e,element:t,elementsMap:n})=>{let r=H1();if(r.contextMenu||r.newElement||r.resizingElement||r.isRotating||r.openMenu||r.viewModeEnabled)return null;let{x:i,y:a}=Tpe(t,r,n);return m.jsx("div",{className:"excalidraw-canvas-buttons",style:{top:`${a}px`,left:`${i}px`,padding:kpe},children:e})},Mpe="small",Cy=e=>m.jsxs("label",{className:De("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${Mpe}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),m.jsx("div",{className:"ToolIcon__icon",children:e.icon})]}),Ipe=({height:e,width:t,userToFollow:n,onDisconnect:r})=>m.jsx("div",{className:"follow-mode",style:{width:t,height:e},children:m.jsxs("div",{className:"follow-mode__badge",children:[m.jsxs("div",{className:"follow-mode__badge__label",children:["Following"," ",m.jsx("span",{className:"follow-mode__badge__username",title:n.username,children:n.username})]}),m.jsx("button",{type:"button",onClick:r,className:"follow-mode__disconnect-btn",children:xh})]})}),Ape=Ipe,Lpe=class{constructor(){z(this,"targets",new WeakMap),z(this,"rafIds",new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let n=this.targets.get(e);if(!n)return;let r=this.onFrame(n,t);!n.stopped&&!r?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},f8=class{constructor(e,t,n){this.animationFrameHandler=e,this.app=t,this.options=n,z(this,"currentTrail"),z(this,"pastTrails",[]),z(this,"container"),z(this,"trailElement"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(kt,"path")}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let n=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[n-1][0]===e&&this.currentTrail.originalPoints[n-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){var e;this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&((e=this.container)==null||e.removeChild(this.trailElement))}startPath(e,t){this.currentTrail=new w2(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let n of this.pastTrails)e.push(this.drawTrail(n,this.app.state));if(this.currentTrail){let n=this.drawTrail(this.currentTrail,this.app.state);e.push(n)}this.pastTrails=this.pastTrails.filter(n=>n.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(" ").trim();this.trailElement.setAttribute("d",t),this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let n=e.getStrokeOutline(e.options.size/t.zoom.value).map(([r,i])=>{let a=xa({sceneX:r,sceneY:i},t);return[a.x,a.y]});return tY(n,!0)}},Rpe=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,z(this,"localTrail"),z(this,"collabTrails",new Map),z(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new f8(e,t,{...this.getTrailOptions(),fill:()=>nV})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),n=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min($c(n),$c(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let n;this.collabTrails.has(e)?n=this.collabTrails.get(e):(n=new f8(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>{var r;return((r=t.pointer)==null?void 0:r.laserColor)||qU(e,t)}}),n.start(this.container),this.collabTrails.set(e,n)),t.pointer&&t.pointer.tool==="laser"&&(t.button==="down"&&!n.hasCurrentTrail&&n.startPath(t.pointer.x,t.pointer.y),t.button==="down"&&n.hasCurrentTrail&&!n.hasLastPoint(t.pointer.x,t.pointer.y)&&n.addPointToPath(t.pointer.x,t.pointer.y),t.button==="up"&&n.hasCurrentTrail&&(n.addPointToPath(t.pointer.x,t.pointer.y),n.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},Dpe=(e,t,n,r,i,a)=>{let{zoom:s}=r,o=180*n/Math.PI,c=e*(s.value-1)/2,d=t*(s.value-1)/2;return e>i&&s.value!==1&&(c=i*(s.value-1)/2),t>a&&s.value!==1&&(d=a*(s.value-1)/2),`translate(${c}px, ${d}px) scale(${s.value}) rotate(${o}deg)`},jpe=({id:e,onChange:t,onSubmit:n,getViewportCoords:r,element:i,canvas:a,excalidrawContainer:s,app:o,autoSelect:c=!0})=>{let d=(W,X)=>{if(!X.style.fontFamily||!X.style.fontSize)return!1;let $=X.style.fontFamily.replace(/"/g,"");return Hu({fontFamily:W.fontFamily})!==$||`${W.fontSize}px`!==X.style.fontSize},l=()=>{var Z;let W=o.state,X=(Z=wo.getScene(i))==null?void 0:Z.getElement(e);if(!X)return;let{textAlign:$,verticalAlign:Y}=X,H=o.scene.getNonDeletedElementsMap();if(X&&ke(X)){let V=X.x,te=X.y,ce=lr(X,o.scene.getNonDeletedElementsMap()),be=X.width,fe=X.height,Se=X.width,Ue=X.height;if(ce&&X.containerId){if(ht(ce)){let Tt=Me.getBoundTextElementPosition(ce,X,H);V=Tt.x,te=Tt.y}let Pe=d(X,h),bt;if(Pe?bt=s2(ce.id,ce.height):(bt=Qu[ce.id],bt||(bt=s2(ce.id,ce.height))),Se=vo(ce,X),Ue=SU(ce,X),!ht(ce)&&fe>Ue){let Tt=od(fe,ce.type);he(ce,{height:Tt});return}else if(!ht(ce)&&ce.height>bt.height&&fe<Ue){let Tt=od(fe,ce.type);he(ce,{height:Tt})}else{let{y:Tt}=CU(ce,X,H);te=Tt}}let[ye,je]=r(V,te),Le=h.selectionStart,de=h.selectionEnd,Te=h.value.length;if(Le===de&&de!==Te){let Pe=Te-de;h.selectionStart=h.value.length-Pe,h.selectionEnd=h.value.length-Pe}ce?be+=.5:(Se=(W.width-8-ye)/W.zoom.value,be=Math.min(be,Se)),fe*=1.05;let qe=$t(X),Ut=(W.height-je)/W.zoom.value;Object.assign(h.style,{font:qe,lineHeight:X.lineHeight,width:`${be}px`,height:`${fe}px`,left:`${ye}px`,top:`${je}px`,transform:Dpe(be,fe,Dte(X,ce),W,Se,Ut),textAlign:$,verticalAlign:Y,color:X.strokeColor,opacity:X.opacity/100,filter:"var(--theme-filter)",maxHeight:`${Ut}px`}),h.scrollTop=0,go()&&(h.style.fontFamily=Hu(X)),he(X,{x:V,y:te})}},h=document.createElement("textarea");h.dir="auto",h.tabIndex=0,h.dataset.type="wysiwyg",h.wrap="off",h.classList.add("excalidraw-wysiwyg");let f="pre",g="normal";(tn(i)||!i.autoResize)&&(f="pre-wrap",g="break-word"),Object.assign(h.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:g,whiteSpace:f,overflowWrap:"break-word",boxSizing:"content-box"}),h.value=i.originalText,l(),t&&(h.onpaste=async W=>{let X=await lL(W,!0);if(!X.text)return;let $=Vu(X.text);if(!$)return;let Y=lr(i,o.scene.getNonDeletedElementsMap()),H=$t({fontSize:o.state.currentItemFontSize,fontFamily:o.state.currentItemFontFamily});if(Y){let Z=ct(Y,o.scene.getNonDeletedElementsMap()),V=gd(`${h.value}${$}`,H,vo(Y,Z)),te=r7(V,H);h.style.width=`${te}px`}},h.oninput=()=>{let W=Vu(h.value);if(h.value!==W){let X=h.selectionStart;h.value=W,h.selectionStart=X,h.selectionEnd=X}t(h.value)}),h.onkeydown=W=>{if(!W.shiftKey&&d_.keyTest(W))W.preventDefault(),o.actionManager.executeAction(d_),l();else if(!W.shiftKey&&u_.keyTest(W))W.preventDefault(),o.actionManager.executeAction(u_),l();else if(!W.shiftKey&&h_.keyTest(W))W.preventDefault(),o.actionManager.executeAction(h_),l();else if(o_.keyTest(W))o.actionManager.executeAction(o_);else if(l_.keyTest(W))o.actionManager.executeAction(l_);else if(W.key===q.ESCAPE)W.preventDefault(),T=!0,M();else if(W.key===q.ENTER&&W[q.CTRL_OR_CMD]){if(W.preventDefault(),W.isComposing||W.keyCode===229)return;T=!0,M()}else if(W.key===q.TAB||W[q.CTRL_OR_CMD]&&(W.code===_t.BRACKET_LEFT||W.code===_t.BRACKET_RIGHT)){if(W.preventDefault(),W.isComposing)return;W.shiftKey||W.code===_t.BRACKET_LEFT?w():x(),h.dispatchEvent(new Event("input"))}};let U=4,y=" ".repeat(U),v=new RegExp(`^ {1,${U}}`),x=()=>{let{selectionStart:W,selectionEnd:X}=h,$=C(),Y=h.value;$.forEach(H=>{let Z=Y.slice(0,H),V=Y.slice(H);Y=`${Z}${y}${V}`}),h.value=Y,h.selectionStart=W+U,h.selectionEnd=X+U*$.length},w=()=>{let{selectionStart:W,selectionEnd:X}=h,$=C(),Y=[],H=h.value;$.forEach(Z=>{let V=H.slice(Z,Z+U).match(v);if(V){let te=H.slice(0,Z),ce=H.slice(Z+V[0].length);H=`${te}${ce}`,Y.push(Z)}}),h.value=H,Y.length&&(W>Y[Y.length-1]?h.selectionStart=Math.max(W-U,Y[Y.length-1]):h.selectionStart=W,h.selectionEnd=Math.max(h.selectionStart,X-U*Y.length))},C=()=>{let{selectionStart:W,selectionEnd:X,value:$}=h,Y=$.slice(0,W).match(/[^\n]*$/)[0].length;return W=W-Y,$.slice(W,X).split(`
|
|
160
|
+
`).reduce((H,Z,V,te)=>H.concat(V?H[V-1]+te[V-1].length+1:W),[]).reverse()},S=W=>{W.target instanceof HTMLCanvasElement&&(W.preventDefault(),W.stopPropagation())},T=!1,M=()=>{var $,Y;if(B)return;B=!0,_();let W=($=wo.getScene(i))==null?void 0:$.getElement(i.id);if(!W)return;let X=lr(W,o.scene.getNonDeletedElementsMap());if(X){if(h.value.trim()){let H=yo(X);!H||H!==i.id?he(X,{boundElements:(X.boundElements||[]).concat({type:"text",id:i.id})}):ht(X)&&LU(X)}else he(X,{boundElements:(Y=X.boundElements)==null?void 0:Y.filter(H=>!ke(H))});Fr(W,X,o.scene.getNonDeletedElementsMap())}n({viaKeyboard:T,nextOriginalText:h.value})},_=()=>{h.onblur=null,h.oninput=null,h.onkeydown=null,G&&G.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("wheel",S,!0),window.removeEventListener("pointerdown",j),window.removeEventListener("pointerup",R),window.removeEventListener("blur",M),window.removeEventListener("beforeunload",M),N(),F(),h.remove()},R=W=>{window.removeEventListener("pointerup",R);let X=W==null?void 0:W.target,$=X instanceof HTMLElement&&X.classList.contains("properties-trigger");setTimeout(()=>{h.onblur=M,$||h.focus()})},P=()=>{h.onblur=null,window.addEventListener("pointerup",R),window.addEventListener("blur",M)},j=W=>{let X=W==null?void 0:W.target;if(W.button===hl.WHEEL){X instanceof HTMLTextAreaElement&&(W.preventDefault(),o.handleCanvasPanUsingWheelOrSpaceDrag(W)),P();return}let $=X instanceof HTMLElement&&X.classList.contains("properties-trigger");(W.target instanceof HTMLElement||W.target instanceof SVGElement)&&W.target.closest(`.${Bu.SHAPE_ACTIONS_MENU}, .${Bu.ZOOM_ACTIONS}`)&&!_c(W.target)||$?P():W.target instanceof HTMLCanvasElement&&!go()&&requestAnimationFrame(()=>{M()})},N=o.scene.onUpdate(()=>{var W;l(),(W=document.activeElement)!=null&&W.closest(".properties-content")||h.focus()}),F=o.onScrollChangeEmitter.on(()=>{l()}),B=!1;c&&h.select(),R();let G=null;a&&"ResizeObserver"in window?(G=new window.ResizeObserver(()=>{l()}),G.observe(a)):window.addEventListener("resize",l),h.onpointerdown=W=>W.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",j,{capture:!0})}),window.addEventListener("beforeunload",M),s==null||s.querySelector(".excalidraw-textEditorContainer").appendChild(h)},Ppe=we({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=ut(e,t);return i.length===1&&ke(i[0])&&!i[0].autoResize},perform:(e,t,n,r)=>{let i=ut(e,t);return{appState:t,elements:e.map(a=>{if(a.id===i[0].id&&ke(a)){let s=Mr(a.originalText,$t(a),a.lineHeight);return lt(a,{autoResize:!0,width:s.width,height:s.height,text:a.originalText})}return a}),captureUpdate:se.IMMEDIATELY}}}),Npe=e=>{let t=["flowchart","graph","sequenceDiagram","classDiagram","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","C4Context","mindmap","timeline","zenuml","sankey","xychart","block"];return new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${t.map(n=>`\\s*${n}(-beta)?`).join("|")})\\b`).test(e.trim())},YP=({canvas:e,rc:t,newElement:n,elementsMap:r,allElementsMap:i,scale:a,appState:s,renderConfig:o})=>{if(e){let[c,d]=_7(e,a),l=k7({canvas:e,scale:a,normalizedWidth:c,normalizedHeight:d});l.save(),l.scale(s.zoom.value,s.zoom.value),n&&n.type!=="selection"?Ec(n,r,i,t,l,o,s):l.clearRect(0,0,c,d)}},Ope=lU(e=>{YP(e)},{trailing:!0}),Fpe=(e,t)=>{if(t){Ope(e);return}YP(e)},Bpe=e=>{let t=I.useRef(null);return I.useEffect(()=>{t.current&&Fpe({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},Ov())}),m.jsx("canvas",{className:"excalidraw__canvas",style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},$pe=Bpe,GP=xe.createContext(null),qP=xe.createContext(null),ZP={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},Fv=xe.createContext(ZP);Fv.displayName="DeviceContext";var Bv=xe.createContext({container:null,id:null});Bv.displayName="ExcalidrawContainerContext";var $v=xe.createContext([]);$v.displayName="ExcalidrawElementsContext";var zv=xe.createContext({...Us(),width:0,height:0,offsetLeft:0,offsetTop:0});zv.displayName="ExcalidrawAppStateContext";var Hv=xe.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});Hv.displayName="ExcalidrawSetAppStateContext";var Wv=xe.createContext(null);Wv.displayName="ExcalidrawActionManagerContext";var Ms=()=>I.useContext(GP),z1=()=>I.useContext(qP),Zn=()=>I.useContext(Fv),Is=()=>I.useContext(Bv),KU=()=>I.useContext($v),H1=()=>I.useContext(zv),Kn=()=>I.useContext(Hv),ui=()=>I.useContext(Wv),Nf=!1,Sy=0,Uc=!1,Of=!1,_y=!1,ky={horizontal:null,vertical:null},cl=0,Ff=!1,Ty=new Map,Pm=!1,uk=0,hk=!1,bc=null,It={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},zpe=class KP extends xe.Component{constructor(t){super(t),z(this,"canvas"),z(this,"interactiveCanvas",null),z(this,"rc"),z(this,"unmounted",!1),z(this,"actionManager"),z(this,"device",ZP),z(this,"excalidrawContainerRef",xe.createRef()),z(this,"scene"),z(this,"fonts"),z(this,"renderer"),z(this,"visibleElements"),z(this,"resizeObserver"),z(this,"nearestScrollableContainer"),z(this,"library"),z(this,"libraryItemsFromStorage"),z(this,"id"),z(this,"store"),z(this,"history"),z(this,"excalidrawContainerValue"),z(this,"files",{}),z(this,"imageCache",new Map),z(this,"iFrameRefs",new Map),z(this,"embedsValidationStatus",new Map),z(this,"initializedEmbeds",new Set),z(this,"elementsPendingErasure",new Set),z(this,"flowChartCreator",new she),z(this,"flowChartNavigator",new ahe),z(this,"hitLinkElement"),z(this,"lastPointerDownEvent",null),z(this,"lastPointerUpEvent",null),z(this,"lastPointerMoveEvent",null),z(this,"lastPointerMoveCoords",null),z(this,"lastViewportPosition",{x:0,y:0}),z(this,"animationFrameHandler",new Lpe),z(this,"laserTrails",new Rpe(this.animationFrameHandler,this)),z(this,"eraserTrail",new f8(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:l=>{let h=Math.max(0,1-(performance.now()-l.pressure)/200),f=(10-Math.min(10,l.totalLength-l.currentIndex))/10;return Math.min($c(f),$c(h))},fill:()=>this.state.theme===yt.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"})),z(this,"onChangeEmitter",new ns),z(this,"onPointerDownEmitter",new ns),z(this,"onPointerUpEmitter",new ns),z(this,"onUserFollowEmitter",new ns),z(this,"onScrollChangeEmitter",new ns),z(this,"missingPointerEventCleanupEmitter",new ns),z(this,"onRemoveEventListenersEmitter",new ns),z(this,"getEffectiveGridSize",()=>n1(this)?this.state.gridSize:null),z(this,"updateEmbedValidationStatus",(l,h)=>{this.embedsValidationStatus.set(l.id,h),gn.delete(l)}),z(this,"updateEmbeddables",()=>{let l=new Set,h=!1;this.scene.getNonDeletedElements().filter(f=>{if(ti(f)){if(l.add(f.id),!this.embedsValidationStatus.has(f.id)){h=!0;let g=ug(f.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(f,g)}}else Ul(f)&&l.add(f.id);return!1}),h&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((f,g)=>{l.has(g)||this.iFrameRefs.delete(g)})}),z(this,"getFrameNameDOMId",l=>`${this.id}-frame-name-${l.id}`),z(this,"frameNameBoundsCache",{get:l=>{let h=this.frameNameBoundsCache._cache.get(l.id);if(!h||h.zoom!==this.state.zoom.value||h.versionNonce!==l.versionNonce){let f=document.getElementById(this.getFrameNameDOMId(l));if(f){let g=f.getBoundingClientRect(),U=qt({clientX:g.x,clientY:g.y},this.state),y=qt({clientX:g.right,clientY:g.bottom},this.state);return h={x:U.x,y:U.y,width:y.x-U.x,height:y.y-U.y,angle:0,zoom:this.state.zoom.value,versionNonce:l.versionNonce},this.frameNameBoundsCache._cache.set(l.id,h),h}return null}return h},_cache:new Map}),z(this,"resetEditingFrame",l=>{var h;l&&he(l,{name:((h=l.name)==null?void 0:h.trim())||null}),this.setState({editingFrame:null})}),z(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let l=this.state.theme===yt.DARK;return this.scene.getNonDeletedFramesLikes().map(h=>{if(!p2(h,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===h.id&&this.resetEditingFrame(h),null;let{x:f,y:g}=xa({sceneX:h.x,sceneY:h.y},this.state),U=6,y,v=fL(h);if(h.id===this.state.editingFrame){let x=v;y=m.jsx("input",{autoFocus:!0,value:x,onChange:w=>{he(h,{name:w.target.value})},onFocus:w=>w.target.select(),onBlur:()=>this.resetEditingFrame(h),onKeyDown:w=>{(w.key===q.ESCAPE||w.key===q.ENTER)&&this.resetEditingFrame(h)},style:{background:this.state.viewBackgroundColor,filter:l?Z8:"none",zIndex:2,border:"none",display:"block",padding:`${U}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:"14px",transform:`translate(-${U}px, ${U}px)`,color:"var(--color-gray-80)",overflow:"hidden",maxWidth:`${document.body.clientWidth-f-U}px`},size:x.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else y=v;return m.jsx("div",{id:this.getFrameNameDOMId(h),style:{position:"absolute",bottom:`${this.state.height+pn.nameOffsetY-g+this.state.offsetTop}px`,left:`${f-this.state.offsetLeft}px`,zIndex:2,fontSize:pn.nameFontSize,color:l?pn.nameColorDarkTheme:pn.nameColorLightTheme,lineHeight:pn.nameLineHeight,width:"max-content",maxWidth:`${h.width}px`,overflow:h.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:Ot.MOVE,pointerEvents:this.state.viewModeEnabled?eu.disabled:eu.enabled},onPointerDown:x=>this.handleCanvasPointerDown(x),onWheel:x=>this.handleWheel(x),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:h.id})},children:y},h.id)})}),z(this,"focusContainer",()=>{var l;(l=this.excalidrawContainerRef.current)==null||l.focus()}),z(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),z(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),z(this,"onInsertElements",l=>{this.addElementsFromPasteOrLibrary({elements:l,position:"center",files:null})}),z(this,"onExportImage",async(l,h,f)=>{Zt("export",l,"ui");let g=await GU(l,h,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:f.exportingFrame}).catch(eI).catch(U=>{console.error(U),this.setState({errorMessage:U.message})});this.state.exportEmbedScene&&g&&ev(g)&&this.setState({fileHandle:g})}),z(this,"magicGenerations",new Map),z(this,"updateMagicGeneration",({frameElement:l,data:h})=>{h.status==="pending"?he(l,{customData:{generationData:void 0}},!1):he(l,{customData:{generationData:h}},!1),this.magicGenerations.set(l.id,h),this.triggerRender()}),z(this,"plugins",{}),z(this,"onMagicframeToolSelect",()=>{let l=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(l.length===0)this.setActiveTool({type:Yn.magicframe}),Zt("ai","tool-select (empty-selection)","d2c");else{let h=l.length===1&&ag(l[0])&&l[0];if(!h&&l.some(g=>Ke(g)||g.frameId)){this.setActiveTool({type:Yn.magicframe});return}Zt("ai","tool-select (existing selection)","d2c");let f;if(h)f=h;else{let[g,U,y,v]=Nt(l),x=50;f=S3({...pn,x:g-x,y:U-x,width:y-g+x*2,height:v-U+x*2,opacity:100,locked:!1}),this.scene.insertElement(f);for(let w of l)he(w,{frameId:f.id});this.setState({selectedElementIds:{[f.id]:!0}})}this.onMagicFrameGenerate(f,"upstream")}}),z(this,"openEyeDropper",({type:l})=>{Sa.set(WU,{swapPreviewOnAlt:!0,colorPickerType:l==="stroke"?"elementStroke":"elementBackground",onSelect:(h,f)=>{let g=l==="background"&&f.altKey||l==="stroke"&&!f.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?g?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:h},captureUpdate:se.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:h},captureUpdate:se.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(U=>this.state.selectedElementIds[U.id]?lt(U,{[g?"strokeColor":"backgroundColor"]:h}):U),captureUpdate:se.IMMEDIATELY})},keepOpenOnAlt:!1})}),z(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),z(this,"syncActionResult",yn(l=>{var g,U,y,v,x,w;if(this.unmounted||l===!1)return;l.captureUpdate===se.NEVER?this.store.shouldUpdateSnapshot():l.captureUpdate===se.IMMEDIATELY&&this.store.shouldCaptureIncrement();let h=!1,f=null;if(l.elements&&(this.scene.replaceAllElements(l.elements),h=!0),l.files&&(this.addMissingFiles(l.files,l.replaceFiles),this.addNewImagesToImageCache()),l.appState||f||this.state.contextMenu){let C=((g=l==null?void 0:l.appState)==null?void 0:g.viewModeEnabled)||!1,S=((U=l==null?void 0:l.appState)==null?void 0:U.zenModeEnabled)||!1,T=((y=l==null?void 0:l.appState)==null?void 0:y.theme)||this.props.theme||yt.LIGHT,M=((v=l==null?void 0:l.appState)==null?void 0:v.name)??this.state.name,_=((x=l==null?void 0:l.appState)==null?void 0:x.errorMessage)??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(C=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(S=this.props.zenModeEnabled),f=((w=l.appState)==null?void 0:w.editingTextElement)||null,l.elements&&f&&l.elements.forEach(R=>{(f==null?void 0:f.id)===R.id&&f!==R&&D3(R)&&ke(R)&&(f=R)}),f!=null&&f.isDeleted&&(f=null),this.setState(R=>{let P=l.appState||{};return{...R,...P,contextMenu:null,editingTextElement:f,viewModeEnabled:C,zenModeEnabled:S,theme:T,name:M,errorMessage:_}}),h=!0}!h&&l.captureUpdate!==se.EVENTUALLY&&this.scene.triggerUpdate()})),z(this,"onBlur",yn(()=>{Uc=!1,this.setState({isBindingEnabled:!0})})),z(this,"onUnload",()=>{this.onBlur()}),z(this,"disableEvent",l=>{l.preventDefault()}),z(this,"resetHistory",()=>{this.history.clear()}),z(this,"resetStore",()=>{this.store.clear()}),z(this,"resetScene",yn(l=>{this.scene.replaceAllElements([]),this.setState(h=>({...Us(),isLoading:l!=null&&l.resetLoadingState?!1:h.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),z(this,"initializeScene",async()=>{var f;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async g=>{if(!g.files.length)return;let U=g.files[0],y=await U.getFile();this.loadFileToCanvas(new File([y],y.name||"",{type:y.type}),U)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let l=null;try{typeof this.props.initialData=="function"?l=await this.props.initialData()||null:l=await this.props.initialData||null,l!=null&&l.libraryItems&&this.library.updateLibrary({libraryItems:l.libraryItems,merge:!0}).catch(g=>{console.error(g)})}catch(g){console.error(g),l={appState:{errorMessage:g.message||"Encountered an error during importing or restoring scene data"}}}let h=TU(l,null,null,{repairBindings:!0});h.appState={...h.appState,theme:this.props.theme||h.appState.theme,openSidebar:((f=h.appState)==null?void 0:f.openSidebar)||this.state.openSidebar,activeTool:h.appState.activeTool.type==="image"?{...h.appState.activeTool,type:"selection"}:h.appState.activeTool,isLoading:!1,toast:this.state.toast},l!=null&&l.scrollToContent&&(h.appState={...h.appState,...e1(h.elements,{...h.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...h,captureUpdate:se.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(g=>{this.fonts.onLoaded(g)}),xp(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),z(this,"isMobileBreakpoint",(l,h)=>l<fV||h<mV&&l<pV),z(this,"refreshViewportBreakpoints",()=>{if(!this.excalidrawContainerRef.current)return;let{clientWidth:l,clientHeight:h}=document.body,f=this.device.viewport,g=rg(f,{isLandscape:l>h,isMobile:this.isMobileBreakpoint(l,h)});return f!==g?(this.device={...this.device,viewport:g},!0):!1}),z(this,"refreshEditorBreakpoints",()=>{let l=this.excalidrawContainerRef.current;if(!l)return;let{width:h,height:f}=l.getBoundingClientRect(),g=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:gV,U=this.device.editor,y=rg(U,{isMobile:this.isMobileBreakpoint(h,f),canFitSidebar:h>g});return U!==y?(this.device={...this.device,editor:y},!0):!1}),z(this,"onResize",yn(()=>{this.scene.getElementsIncludingDeleted().forEach(l=>gn.delete(l)),this.refreshViewportBreakpoints(),this.updateDOMRect(),s3||this.refreshEditorBreakpoints(),this.setState({})})),z(this,"onFullscreenChange",()=>{var l;!document.fullscreenElement&&((l=this.state.activeEmbeddable)==null?void 0:l.state)==="active"&&this.setState({activeEmbeddable:null})}),z(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:l,scrollBars:h,elementsMap:f})=>{h&&(ky=h);let g=this.state.editingTextElement?!1:!l&&f.size>0;this.state.scrolledOutside!==g&&this.setState({scrolledOutside:g}),this.scheduleImageRefresh()}),z(this,"onScroll",Wu(()=>{let{offsetTop:l,offsetLeft:h}=this.getCanvasOffsets();this.setState(f=>f.offsetLeft===h&&f.offsetTop===l?null:{offsetTop:l,offsetLeft:h})},uV)),z(this,"onCut",yn(l=>{var h;!((h=this.excalidrawContainerRef.current)!=null&&h.contains(document.activeElement))||_c(l.target)||(this.actionManager.executeAction(b_,"keyboard",l),l.preventDefault(),l.stopPropagation())})),z(this,"onCopy",yn(l=>{var h;!((h=this.excalidrawContainerRef.current)!=null&&h.contains(document.activeElement))||_c(l.target)||(this.actionManager.executeAction(xg,"keyboard",l),l.preventDefault(),l.stopPropagation())})),z(this,"onTouchStart",l=>{if($M&&l.preventDefault(),!Nf){Nf=!0,clearTimeout(Sy),Sy=window.setTimeout(KP.resetTapTwice,cV);return}if(Nf&&l.touches.length===1){let h=l.touches[0];this.handleCanvasDoubleClick({clientX:h.clientX,clientY:h.clientY}),Nf=!1,clearTimeout(Sy)}l.touches.length===2&&this.setState({selectedElementIds:At({},this.state),activeEmbeddable:null})}),z(this,"onTouchEnd",l=>{this.resetContextMenuTimer(),l.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:At(this.state.previousSelectedElementIds,this.state)}):It.pointers.clear()}),z(this,"pasteFromClipboard",yn(async l=>{var C,S;let h=!!Pm,f=document.activeElement,g=(C=this.excalidrawContainerRef.current)==null?void 0:C.contains(f);if(l&&!g)return;let U=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(l&&(!(U instanceof HTMLCanvasElement)||_c(f)))return;let{x:y,y:v}=qt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),x=(S=l==null?void 0:l.clipboardData)==null?void 0:S.files[0],w=await lL(l,h);if(!x&&!h){if(w.mixedContent)return this.addElementsFromMixedContentPaste(w.mixedContent,{isPlainPaste:h,sceneX:y,sceneY:v});if(w.text){let T=w.text.trim();T.startsWith("<svg")&&T.endsWith("</svg>")&&(x=lS(T))}}if(Xc(x)&&!w.spreadsheet){if(!this.isToolSupported("image")){this.setState({errorMessage:D("errors.imageToolNotSupported")});return}let T=this.createImageElement({sceneX:y,sceneY:v});this.insertImageElement(T,x),this.initializeImageDimensions(T),this.setState({selectedElementIds:At({[T.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(w,l)===!1)return}catch(T){console.error(T)}if(w.errorMessage)this.setState({errorMessage:w.errorMessage});else if(w.spreadsheet&&!h)this.setState({pasteDialog:{data:w.spreadsheet,shown:!0}});else if(w.elements){let T=w.programmaticAPI?f1(w.elements):w.elements;this.addElementsFromPasteOrLibrary({elements:T,files:w.files||null,position:"cursor",retainSeed:h})}else if(w.text){if(w.text&&Npe(w.text)){let _=await ge(()=>import("./index-HkUXslJy.js").then(R=>R.N),[],import.meta.url);try{let{elements:R,files:P}=await _.parseMermaidToExcalidraw(w.text),j=f1(R,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:j,files:P,position:"cursor"});return}catch(R){console.warn(`parsing pasted text as mermaid definition failed: ${R.message}`)}}let T=aI(w.text).split(/\n+/).map(_=>_.trim()).filter(Boolean),M=T.map(_=>cne(_)).filter(_=>{var R;return ug(_,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(_)||((R=wu(_))==null?void 0:R.type)==="video")});if(!Pm&&M.length>0&&M.length===T.length){let _=[];for(let R of M){let P=_[_.length-1],j=this.insertEmbeddableElement({sceneX:P?P.x+P.width+20:y,sceneY:v,link:vi(R)});j&&_.push(j)}_.length&&this.setState({selectedElementIds:Object.fromEntries(_.map(R=>[R.id,!0]))});return}this.addTextFromPaste(w.text,h)}this.setActiveTool({type:"selection"}),l==null||l.preventDefault()})),z(this,"addElementsFromPasteOrLibrary",l=>{var W,X;let h=N7(l.elements,null,void 0),[f,g,U,y]=Nt(h),v=Er(f,U)/2,x=Er(g,y)/2,w=typeof l.position=="object"?l.position.clientX:l.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,C=typeof l.position=="object"?l.position.clientY:l.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x:S,y:T}=qt({clientX:w,clientY:C},this.state),M=S-v,_=T-x,[R,P]=Pn(M,_,this.getEffectiveGridSize()),j=PA(h.map($=>lt($,{x:$.x+R-f,y:$.y+P-g})),{randomizeSeed:!l.retainSeed}),N=this.scene.getElementsIncludingDeleted(),F=[...N,...j];F=((X=(W=this.props).onDuplicate)==null?void 0:X.call(W,F,N))||F,xs(F,Qe(j));let B=this.getTopLayerFrameAtSceneCoords({x:S,y:T});if(B){let $=yre(j,B);wp(F,$,B,this.state)}this.scene.replaceAllElements(F),j.forEach($=>{if(ke($)&&tn($)){let Y=lr($,this.scene.getElementsMapIncludingDeleted());Fr($,Y,this.scene.getElementsMapIncludingDeleted())}}),ZX&&uo.loadElementsFonts(j).then($=>{this.fonts.onLoaded($)}),l.files&&this.addMissingFiles(l.files),this.store.shouldCaptureIncrement();let G=Y7(j);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&Sa.get(Rv)?this.state.openSidebar:null,...Pr({editingGroupId:null,selectedElementIds:G.reduce(($,Y)=>(tn(Y)||($[Y.id]=!0),$),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{l.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:"selection"}),l.fitToContent&&this.scrollToContent(j,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),z(this,"setAppState",(l,h)=>{this.setState(l,h)}),z(this,"removePointer",l=>{cl&&this.resetContextMenuTimer(),It.pointers.delete(l.pointerId)}),z(this,"toggleLock",(l="ui")=>{this.state.activeTool.locked||Zt("toolbar","toggleLock",`${l} (${this.device.editor.isMobile?"mobile":"desktop"})`),this.setState(h=>({activeTool:{...h.activeTool,...Ln(this.state,h.activeTool.locked?{type:"selection"}:h.activeTool),locked:!h.activeTool.locked}}))}),z(this,"updateFrameRendering",l=>{this.setState(h=>{let f=typeof l=="function"?l(h.frameRendering):l;return{frameRendering:{enabled:(f==null?void 0:f.enabled)??h.frameRendering.enabled,clip:(f==null?void 0:f.clip)??h.frameRendering.clip,name:(f==null?void 0:f.name)??h.frameRendering.name,outline:(f==null?void 0:f.outline)??h.frameRendering.outline}}})}),z(this,"togglePenMode",l=>{this.setState(h=>({penMode:l??!h.penMode,penDetected:!0}))}),z(this,"onHandToolToggle",()=>{this.actionManager.executeAction(Hce)}),z(this,"zoomCanvas",l=>{this.setState({...Nc({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:lo(l)},this.state)})}),z(this,"cancelInProgressAnimation",null),z(this,"scrollToContent",(l=this.scene.getNonDeletedElements(),h)=>{var v;if(typeof l=="string"){let x;if(xp(l)?x=gne(l):x=l,x){let w=this.scene.getElementsFromId(x);w!=null&&w.length?this.scrollToContent(w,{fitToContent:(h==null?void 0:h.fitToContent)??!0,animate:(h==null?void 0:h.animate)??!0}):xp(l)&&this.setState({toast:{message:D("elementLink.notFound"),duration:3e3,closable:!0}})}return}(v=this.cancelInProgressAnimation)==null||v.call(this);let f=Array.isArray(l)?l:[l],g=this.state.zoom,U=this.state.scrollX,y=this.state.scrollY;if(h!=null&&h.fitToContent||h!=null&&h.fitToViewport){let{appState:x}=VU({canvasOffsets:h.canvasOffsets,targetElements:f,appState:this.state,fitToViewport:!!(h!=null&&h.fitToViewport),viewportZoomFactor:h==null?void 0:h.viewportZoomFactor,minZoom:h==null?void 0:h.minZoom,maxZoom:h==null?void 0:h.maxZoom});g=x.zoom,U=x.scrollX,y=x.scrollY}else{let x=e1(f,this.state);U=x.scrollX,y=x.scrollY}if(h!=null&&h.animate){let x=this.state.scrollX,w=this.state.scrollY,C=this.state.zoom.value,S=$V({fromValues:{scrollX:x,scrollY:w,zoom:C},toValues:{scrollX:U,scrollY:y,zoom:g.value},interpolateValue:(T,M,_,R)=>{if(R==="zoom")return T*Math.pow(M/T,$c(_))},onStep:({scrollX:T,scrollY:M,zoom:_})=>{this.setState({scrollX:T,scrollY:M,zoom:{value:_}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:(h==null?void 0:h.duration)??500});this.cancelInProgressAnimation=()=>{S(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:U,scrollY:y,zoom:g})}),z(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),z(this,"translateCanvas",l=>{var h;(h=this.cancelInProgressAnimation)==null||h.call(this),this.maybeUnfollowRemoteUser(),this.setState(l)}),z(this,"setToast",l=>{this.setState({toast:l})}),z(this,"restoreFileFromShare",async()=>{try{let l=await caches.open("web-share-target"),h=await l.match("shared-file");if(h){let f=await h.blob(),g=new File([f],f.name||"",{type:f.type});this.loadFileToCanvas(g,null),await l.delete("shared-file"),window.history.replaceState(null,QX,window.location.pathname)}}catch(l){this.setState({errorMessage:l.message})}}),z(this,"addFiles",yn(l=>{let{addedFiles:h}=this.addMissingFiles(l);this.clearImageShapeCache(h),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),z(this,"addMissingFiles",(l,h=!1)=>{let f=h?{}:{...this.files},g={},U=Array.isArray(l)?l:Object.values(l);for(let y of U)if(!f[y.id]&&(g[y.id]=y,f[y.id]=y,y.mimeType===Be.svg))try{let v=Vre(RC(Gre(y.dataURL)),Be.svg);y.dataURL!==v&&(y.version=(y.version??1)+1,y.dataURL=v)}catch(v){console.error(v)}return this.files=f,{addedFiles:g}}),z(this,"updateScene",yn(l=>{let h=xo(l.elements??[]);if(l.captureUpdate&&l.captureUpdate!==se.EVENTUALLY){let f=this.store.snapshot.appState,g=this.store.snapshot.elements,U=l.appState?Object.assign({},f,l.appState):f,y=l.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),Qe(h)):g;l.captureUpdate===se.IMMEDIATELY?this.store.captureIncrement(y,U):l.captureUpdate===se.NEVER&&this.store.updateSnapshot(y,U)}l.appState&&this.setState(l.appState),l.elements&&this.scene.replaceAllElements(h),l.collaborators&&this.setState({collaborators:l.collaborators})})),z(this,"triggerRender",l=>{l===!0?this.scene.triggerUpdate():this.setState({})}),z(this,"toggleSidebar",({name:l,tab:h,force:f})=>{var y,v;let g;f===void 0?g=((y=this.state.openSidebar)==null?void 0:y.name)===l&&((v=this.state.openSidebar)==null?void 0:v.tab)===h?null:l:g=f?l:null;let U=g?{name:g}:null;return U&&h&&(U.tab=h),this.setState({openSidebar:U}),!!g}),z(this,"updateCurrentCursorPosition",yn(l=>{this.lastViewportPosition.x=l.clientX,this.lastViewportPosition.y=l.clientY})),z(this,"getEditorUIOffsets",()=>{var U,y,v,x,w,C,S,T,M,_;let l=((x=(v=(y=(U=this.excalidrawContainerRef)==null?void 0:U.current)==null?void 0:y.querySelector(".App-toolbar"))==null?void 0:v.getBoundingClientRect())==null?void 0:x.bottom)??0,h=(S=(C=(w=this.excalidrawContainerRef)==null?void 0:w.current)==null?void 0:C.querySelector(".sidebar"))==null?void 0:S.getBoundingClientRect(),f=(_=(M=(T=this.excalidrawContainerRef)==null?void 0:T.current)==null?void 0:M.querySelector(".App-menu__left"))==null?void 0:_.getBoundingClientRect(),g=16;return c1().rtl?{top:l+g,right:Math.max(this.state.width-((f==null?void 0:f.left)??this.state.width),0)+g,bottom:g,left:Math.max((h==null?void 0:h.right)??0,0)+g}:{top:l+g,right:Math.max(this.state.width-((h==null?void 0:h.left)??this.state.width)+g,0),bottom:g,left:Math.max((f==null?void 0:f.right)??0,0)+g}}),z(this,"onKeyDown",yn(l=>{var U,y;if("Proxy"in window&&(!l.shiftKey&&/^[A-Z]$/.test(l.key)||l.shiftKey&&/^[a-z]$/.test(l.key))&&(l=new Proxy(l,{get(v,x){let w=v[x];return typeof w=="function"?w.bind(v):x==="key"?l.shiftKey?v.key.toUpperCase():v.key.toLowerCase():w}})),!c3(l.target)){if((l.key===q.ESCAPE||l.key===q.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let v=ut(this.scene.getNonDeletedElementsMap(),this.state);if(v.length===1&&Lt(v[0])&&l.key===q.ENTER){this.startImageCropping(v[0]);return}if(l.key===q.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let x=Jf(l.key);if(l[q.CTRL_OR_CMD]&&x&&!l.shiftKey){l.preventDefault();let w=ut(this.scene.getNonDeletedElementsMap(),this.state);w.length===1&&dU(w[0])&&this.flowChartCreator.createNodes(w[0],this.scene.getNonDeletedElementsMap(),this.state,P_(l.key)),(U=this.flowChartCreator.pendingNodes)!=null&&U.length&&!mg(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(l.altKey){let w=ut(this.scene.getNonDeletedElementsMap(),this.state);if(w.length===1&&x){l.preventDefault();let C=this.flowChartNavigator.exploreByDirection(w[0],this.scene.getNonDeletedElementsMap(),P_(l.key));if(C){this.setState(T=>({selectedElementIds:At({[C]:!0},T)}));let S=this.scene.getNonDeletedElementsMap().get(C);S&&!mg([S],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(S,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(l[q.CTRL_OR_CMD]&&l.key===q.P&&!l.shiftKey&&!l.altKey){this.setToast({message:D("commandPalette.shortcutHint",{shortcut:kr("commandPalette")})}),l.preventDefault();return}if(l[q.CTRL_OR_CMD]&&l.key.toLowerCase()===q.V&&(Pm=l.shiftKey,clearTimeout(uk),uk=window.setTimeout(()=>{Pm=!1},100)),l[q.CTRL_OR_CMD]&&_c(l.target)&&(l.code===_t.MINUS||l.code===_t.EQUAL)){l.preventDefault();return}if(_c(l.target)&&l.key!==q.ESCAPE||Jf(l.key)&&c3(l.target))return;if(l.key===q.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(l.key.toLowerCase()===q.E&&l.shiftKey&&l[q.CTRL_OR_CMD]){l.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(l.key===q.PAGE_UP||l.key===q.PAGE_DOWN){let v=(l.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;l.key===q.PAGE_DOWN&&(v=-v),l.shiftKey?this.translateCanvas(x=>({scrollX:x.scrollX+v})):this.translateCanvas(x=>({scrollY:x.scrollY+v}))}if(((y=this.state.openDialog)==null?void 0:y.name)==="elementLinkSelector"||this.actionManager.handleKeyDown(l)||this.state.viewModeEnabled)return;if(l[q.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),Jf(l.key)){let v=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),x=v.find(Ie),w=new Set;v.filter(Ie).filter(M=>{let _=M.startBinding&&!v.some(P=>{var j;return P.id===((j=M.startBinding)==null?void 0:j.elementId)}),R=M.endBinding&&!v.some(P=>{var j;return P.id===((j=M.endBinding)==null?void 0:j.elementId)});return _||R}).forEach(M=>w.add(M.id)),v=v.filter(M=>!w.has(M.id));let C=this.getEffectiveGridSize()&&(l.shiftKey?wE:this.getEffectiveGridSize())||(l.shiftKey?eV:wE),S=0,T=0;l.key===q.ARROW_LEFT?S=-C:l.key===q.ARROW_RIGHT?S=C:l.key===q.ARROW_UP?T=-C:l.key===q.ARROW_DOWN&&(T=C),v.forEach(M=>{he(M,{x:M.x+S,y:M.y+T},!1),ci(M,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:v})}),this.setState({suggestedBindings:Fb(v.filter(M=>M.id!==(x==null?void 0:x.id)||C!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),l.preventDefault()}else if(l.key===q.ENTER){let v=this.scene.getSelectedElements(this.state);if(v.length===1){let x=v[0];if(l[q.CTRL_OR_CMD])rt(x)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==v[0].id)&&(this.store.shouldCaptureIncrement(),Ie(x)||this.setState({editingLinearElement:new Me(x)}));else if(ke(x)||Ote(x)){let w;ke(x)||(w=x);let C=Bb(x,this.state,this.scene.getNonDeletedElementsMap()),S=C.x,T=C.y;this.startTextEditing({sceneX:S,sceneY:T,container:w}),l.preventDefault();return}else Ke(x)&&this.setState({editingFrame:x.id})}}else if(!l.ctrlKey&&!l.altKey&&!l.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let v=cee(l.key);v?(this.state.activeTool.type!==v&&Zt("toolbar",v,`keyboard (${this.device.editor.isMobile?"mobile":"desktop"})`),v==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(x=>({currentItemArrowType:x.currentItemArrowType===ir.sharp?ir.round:x.currentItemArrowType===ir.round?ir.elbow:ir.sharp})),this.setActiveTool({type:v}),l.stopPropagation()):l.key===q.Q&&(this.toggleLock("keyboard"),l.stopPropagation())}if(l.key===q.SPACE&&It.pointers.size===0&&(Uc=!0,Bt(this.interactiveCanvas,Ot.GRAB),l.preventDefault()),(l.key===q.G||l.key===q.S)&&!l.altKey&&!l[q.CTRL_OR_CMD]){let v=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!v.length)return;l.key===q.G&&(Gu(this.state.activeTool.type)||v.some(x=>Gu(x.type)))&&(this.setState({openPopup:"elementBackground"}),l.stopPropagation()),l.key===q.S&&(this.setState({openPopup:"elementStroke"}),l.stopPropagation())}if(!l[q.CTRL_OR_CMD]&&l.shiftKey&&l.key.toLowerCase()===q.F){let v=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!v.length)return;(this.state.activeTool.type==="text"||v.find(x=>ke(x)||ct(x,this.scene.getNonDeletedElementsMap())))&&(l.preventDefault(),this.setState({openPopup:"fontFamily"}))}if(l.key===q.K&&!l.altKey&&!l[q.CTRL_OR_CMD]){this.state.activeTool.type==="laser"?this.setActiveTool({type:"selection"}):this.setActiveTool({type:"laser"});return}l[q.CTRL_OR_CMD]&&(l.key===q.BACKSPACE||l.key===q.DELETE)&&Sa.set(ZU,"clearCanvas");let h=l.key.toLocaleLowerCase(),f=h===q.S&&l.shiftKey,g=l.key===q.I||h===q.G&&l.shiftKey;(f||g)&&this.openEyeDropper({type:f?"stroke":"background"})})),z(this,"onKeyUp",yn(l=>{var h,f,g,U;if(l.key===q.SPACE&&(this.state.viewModeEnabled||((h=this.state.openDialog)==null?void 0:h.name)==="elementLinkSelector"?Bt(this.interactiveCanvas,Ot.GRAB):this.state.activeTool.type==="selection"?ma(this.interactiveCanvas):(Qa(this.interactiveCanvas,this.state),this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),Uc=!1),!l[q.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),Jf(l.key)&&(i2(this.scene.getSelectedElements(this.state).filter(rt),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,jc(this.state),((f=this.state.selectedLinearElement)==null?void 0:f.selectedPointsIndices)??[],this.state.zoom),this.setState({suggestedBindings:[]})),l.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:se.IMMEDIATELY})),!l[q.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){(g=this.flowChartCreator.pendingNodes)!=null&&g.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let y=(U=this.flowChartCreator.pendingNodes)==null?void 0:U[0];y&&(this.setState(v=>({selectedElementIds:At({[y.id]:!0},v)})),mg([y],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(y,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:se.IMMEDIATELY})}})),z(this,"isToolSupported",l=>{var h;return((h=this.props.UIOptions.tools)==null?void 0:h[l])!==!1}),z(this,"setActiveTool",l=>{if(!this.isToolSupported(l.type)){console.warn(`"${l.type}" tool is disabled via "UIOptions.canvasActions.tools.${l.type}"`);return}let h=Ln(this.state,l);h.type==="hand"?Bt(this.interactiveCanvas,Ot.GRAB):Uc||Qa(this.interactiveCanvas,{...this.state,activeTool:h}),FV(document.activeElement)&&this.focusContainer(),e7(h.type)||this.setState({suggestedBindings:[]}),h.type==="image"&&this.onImageAction({insertOnCanvasDirectly:(l.type==="image"&&l.insertOnCanvasDirectly)??!1}),this.setState(f=>{let g={snapLines:f.snapLines.length?[]:f.snapLines,originSnapOffset:null,activeEmbeddable:null};return h.type==="freedraw"&&this.store.shouldCaptureIncrement(),h.type!=="selection"?{...f,activeTool:h,selectedElementIds:At({},f),selectedGroupIds:At({},f),editingGroupId:null,multiElement:null,...g}:{...f,activeTool:h,...g}})}),z(this,"setOpenDialog",l=>{this.setState({openDialog:l})}),z(this,"setCursor",l=>{Bt(this.interactiveCanvas,l)}),z(this,"resetCursor",()=>{ma(this.interactiveCanvas)}),z(this,"isTouchScreenMultiTouchGesture",()=>It.pointers.size>=2),z(this,"getName",()=>this.state.name||this.props.name||`${D("labels.untitled")}-${IE()}`),z(this,"onGestureStart",yn(l=>{l.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:At({},this.state),activeEmbeddable:null}),It.initialScale=this.state.zoom.value})),z(this,"onGestureChange",yn(l=>{if(l.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let h=It.initialScale;h&&this.setState(f=>({...Nc({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:lo(h*l.scale)},f)}))})),z(this,"onGestureEnd",yn(l=>{l.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:At(this.state.previousSelectedElementIds,this.state)}),It.initialScale=null})),z(this,"startTextEditing",({sceneX:l,sceneY:h,insertAtParentCenter:f=!0,container:g,autoEdit:U=!0})=>{let y=!1,v=f&&this.getTextWysiwygSnappedToCenterPosition(l,h,this.state,g);g&&v&&(ct(g,this.scene.getNonDeletedElementsMap())||(y=!0));let x=null,w=this.scene.getSelectedElements(this.state);w.length===1?ke(w[0])?x=w[0]:g?x=ct(w[0],this.scene.getNonDeletedElementsMap()):x=this.getTextElementAtPosition(l,h):x=this.getTextElementAtPosition(l,h);let C=(x==null?void 0:x.fontFamily)||this.state.currentItemFontFamily,S=(x==null?void 0:x.lineHeight)||ad(C),T=this.state.currentItemFontSize;if(!x&&y&&g&&!ht(g)){let R=uI($t({fontSize:T,fontFamily:C}),S),P=hI(T,S),j=Math.max(g.height,P),N=Math.max(g.width,R);he(g,{height:j,width:N}),l=g.x+N/2,h=g.y+j/2,v&&(v=this.getTextWysiwygSnappedToCenterPosition(l,h,this.state,g))}let M=this.getTopLayerFrameAtSceneCoords({x:l,y:h}),_=x||Ei({x:v?v.elementCenterX:l,y:v?v.elementCenterY:h,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:"",fontSize:T,fontFamily:C,textAlign:v?"center":this.state.currentItemTextAlign,verticalAlign:v?yi.MIDDLE:$g,containerId:y?g==null?void 0:g.id:void 0,groupIds:(g==null?void 0:g.groupIds)??[],lineHeight:S,angle:(g==null?void 0:g.angle)??0,frameId:M?M.id:null});if(!x&&y&&g&&he(g,{boundElements:(g.boundElements||[]).concat({type:"text",id:_.id})}),this.setState({editingTextElement:_}),!x)if(g&&y){let R=this.scene.getElementIndex(g.id);this.scene.insertElementAtIndex(_,R+1)}else this.scene.insertElement(_);U||x||g?this.handleTextWysiwyg(_,{isExistingElement:!!x}):this.setState({newElement:_,multiElement:null})}),z(this,"startImageCropping",l=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:l.id})}),z(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),z(this,"handleCanvasDoubleClick",l=>{if(this.state.multiElement||this.state.activeTool.type!=="selection")return;let h=this.scene.getSelectedElements(this.state),{x:f,y:g}=qt(l,this.state);if(h.length===1&&rt(h[0])){if(l[q.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==h[0].id)&&!Ie(h[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new Me(h[0])});return}else if(this.state.selectedLinearElement&&Ie(h[0])){let U=Me.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:f,y:g},this.state,this.scene.getNonDeletedElementsMap()),y=U?Me.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,U,this.scene.getNonDeletedElementsMap()):-1;if(y&&y>-1){this.store.shouldCaptureIncrement(),Me.deleteFixedSegment(h[0],y);let v=Me.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:f,y:g},this.state,this.scene.getNonDeletedElementsMap()),x=v?Me.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,v,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:x,value:U,added:!1}},segmentMidPointHoveredCoords:v}});return}}}if(h.length===1&&Lt(h[0])){this.startImageCropping(h[0]);return}if(ma(this.interactiveCanvas),Hc(this.state).length>0){let U=this.getElementAtPosition(f,g),y=U&>e(U,this.state.selectedGroupIds);if(y){this.store.shouldCaptureIncrement(),this.setState(v=>({...v,...Pr({editingGroupId:y,selectedElementIds:{[U.id]:!0}},this.scene.getNonDeletedElements(),v,this)}));return}}if(ma(this.interactiveCanvas),!l[q.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let U=this.getElementAtPosition(f,g);if(Hi(U)){this.setState({activeEmbeddable:{element:U,state:"active"}});return}let y=this.getTextBindableContainerAtPosition(f,g);if(y&&(Ki(y)||!Ea(y.backgroundColor)||pu({x:f,y:g,element:y,shape:ro(y,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let v=Bb(y,this.state,this.scene.getNonDeletedElementsMap());f=v.x,g=v.y}this.startTextEditing({sceneX:f,sceneY:g,insertAtParentCenter:!l.altKey,container:y})}}),z(this,"getElementLinkAtPosition",(l,h)=>{let f=this.scene.getNonDeletedElements(),g=-1;for(let U=f.length-1;U>=0;U--){let y=f[U];if(h&&y.id===h.id&&(g=U),y.link&&U>=g&&$b(y,this.scene.getNonDeletedElementsMap(),this.state,A(l.x,l.y),this.device.editor.isMobile))return y}}),z(this,"redirectToLink",(l,h)=>{let f=Rt(A(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),A(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||f>wc)return;let g=qt(this.lastPointerDownEvent,this.state),U=this.scene.getNonDeletedElementsMap(),y=$b(this.hitLinkElement,U,this.state,A(g.x,g.y),this.device.editor.isMobile),v=qt(this.lastPointerUpEvent,this.state),x=$b(this.hitLinkElement,U,this.state,A(v.x,v.y),this.device.editor.isMobile);if(y&&x){C_();let w=this.hitLinkElement.link;if(w){w=vi(w);let C;if(this.props.onLinkOpen&&(C=rI("excalidraw-link",l.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:w},C)),!(C!=null&&C.defaultPrevented)){let S=_A(w)?"_self":"_blank",T=window.open(void 0,S);T&&(T.opener=null,T.location=w)}}}}),z(this,"getTopLayerFrameAtSceneCoords",l=>{let h=this.scene.getNonDeletedElementsMap(),f=this.scene.getNonDeletedFramesLikes().filter(g=>qC(l,g,h));return f.length?f[f.length-1]:null}),z(this,"handleCanvasPointerMove",l=>{var C,S,T,M,_,R;this.savePointer(l.clientX,l.clientY,this.state.cursorButton),this.lastPointerMoveEvent=l.nativeEvent,It.pointers.has(l.pointerId)&&It.pointers.set(l.pointerId,{x:l.clientX,y:l.clientY});let h=It.initialScale;if(It.pointers.size===2&&It.lastCenter&&h&&It.initialDistance){let P=R_(It.pointers),j=P.x-It.lastCenter.x,N=P.y-It.lastCenter.y;It.lastCenter=P;let F=D_(Array.from(It.pointers.values())),B=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:F/It.initialDistance,G=B?lo(h*B):this.state.zoom.value;this.setState(W=>{let X=Nc({viewportX:P.x,viewportY:P.y,nextZoom:G},W);this.translateCanvas({zoom:X.zoom,scrollX:X.scrollX+2*(j/G),scrollY:X.scrollY+2*(N/G),shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else It.lastCenter=It.initialDistance=It.initialScale=null;if(Uc||Of||_y||zu(this.state))return;let f=O_(ky,l.clientX-this.state.offsetLeft,l.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(f?ma(this.interactiveCanvas):Qa(this.interactiveCanvas,this.state));let g=qt(l,this.state),{x:U,y}=g;if(!this.state.newElement&&Ite(this.state.activeTool.type)){let{originOffset:P,snapLines:j}=Mte(this.scene.getNonDeletedElements(),this,{x:U,y},l,this.scene.getNonDeletedElementsMap());this.setState(N=>{let F=Mf(N.snapLines,j),B=N.originSnapOffset?Mf(N.originSnapOffset,P):P;return N.snapLines===F&&N.originSnapOffset===B?null:{snapLines:F,originSnapOffset:B}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(P=>P.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let P=Me.handlePointerMove(l,U,y,this,this.scene.getNonDeletedElementsMap());P&&P!==this.state.editingLinearElement&&ar.flushSync(()=>{this.setState({editingLinearElement:P})}),(P==null?void 0:P.lastUncommittedPoint)!=null?this.maybeSuggestBindingAtCursor(g,P.elbowed):ar.flushSync(()=>{this.setState({suggestedBindings:[]})})}if(oI(this.state.activeTool.type)){let{newElement:P}=this.state;ls(P,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(P,[g],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(g,!1)}if(this.state.multiElement){let{multiElement:P}=this.state,{x:j,y:N}=P,{points:F,lastCommittedPoint:B}=P,G=F[F.length-1];if(Qa(this.interactiveCanvas,this.state),G===B)Rt(A(U-j,y-N),G)>=ng?he(P,{points:[...F,A(U-j,y-N)]},!1):Bt(this.interactiveCanvas,Ot.POINTER);else if(F.length>2&&B&&Rt(A(U-j,y-N),B)<ng)Bt(this.interactiveCanvas,Ot.POINTER),he(P,{points:F.slice(0,-1)},!1);else{let[W,X]=Pn(U,y,l[q.CTRL_OR_CMD]||Ie(P)?null:this.getEffectiveGridSize()),[$,Y]=(P==null?void 0:P.lastCommittedPoint)??[0,0],H=W-j-$,Z=X-N-Y;yp(l)&&({width:H,height:Z}=L3($+j,Y+N,W,X)),Uo(F,this.state.zoom.value)&&Bt(this.interactiveCanvas,Ot.POINTER),he(P,{points:[...F.slice(0,-1),A($+H,Y+Z)]},!1,{isDragging:!0}),this.triggerRender(!1)}return}if(l.buttons||this.state.activeTool.type!=="selection"&&this.state.activeTool.type!=="text"&&this.state.activeTool.type!=="eraser")return;let v=this.scene.getNonDeletedElements(),x=this.scene.getSelectedElements(this.state);if(x.length===1&&!f&&!this.state.editingLinearElement){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,y),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&((C=this.state.openDialog)==null?void 0:C.name)!=="elementLinkSelector"&&!(x.length===1&&Ie(x[0]))){let P=nS(v,this.state,U,y,this.state.zoom,l.pointerType,this.scene.getNonDeletedElementsMap(),this.device);if(P&&P.transformHandleType){Bt(this.interactiveCanvas,iS(P));return}}}else if(x.length>1&&!f&&((S=this.state.openDialog)==null?void 0:S.name)!=="elementLinkSelector"){let P=rS(Nt(x),U,y,this.state.zoom,l.pointerType,this.device);if(P){Bt(this.interactiveCanvas,iS({transformHandleType:P}));return}}let w=this.getElementAtPosition(g.x,g.y);this.hitLinkElement=this.getElementLinkAtPosition(g,w),!ts(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?(Bt(this.interactiveCanvas,Ot.POINTER),xde(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(C_(),w&&(w.link||ti(w))&&this.state.selectedElementIds[w.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?Bt(this.interactiveCanvas,ke(w)?Ot.TEXT:Ot.CROSSHAIR):this.state.viewModeEnabled?Bt(this.interactiveCanvas,Ot.GRAB):((T=this.state.openDialog)==null?void 0:T.name)==="elementLinkSelector"?Bt(this.interactiveCanvas,Ot.AUTO):f?Bt(this.interactiveCanvas,Ot.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,y):l[q.CTRL_OR_CMD]?Bt(this.interactiveCanvas,Ot.AUTO):(w||this.isHittingCommonBoundingBoxOfSelectedElements(g,x))&&!(w!=null&&w.locked)&&(w&&Hi(w)&&this.isIframeLikeElementCenter(w,l,U,y)?(Bt(this.interactiveCanvas,Ot.POINTER),this.setState({activeEmbeddable:{element:w,state:"hover"}})):(!w||!Ie(w))&&(Bt(this.interactiveCanvas,Ot.MOVE),((M=this.state.activeEmbeddable)==null?void 0:M.state)==="hover"&&this.setState({activeEmbeddable:null})))),((_=this.state.openDialog)==null?void 0:_.name)==="elementLinkSelector"&&w?this.setState(P=>({hoveredElementIds:Mf(P.hoveredElementIds,Pr({editingGroupId:P.editingGroupId,selectedElementIds:{[w.id]:!0}},this.scene.getNonDeletedElements(),P,this).selectedElementIds)})):((R=this.state.openDialog)==null?void 0:R.name)==="elementLinkSelector"&&!w&&this.setState(P=>({hoveredElementIds:Mf(P.hoveredElementIds,{})})))}),z(this,"handleEraser",(l,h,f)=>{this.eraserTrail.addPointToPath(f.x,f.y);let g=!1,U=new Set,y=this.scene.getNonDeletedElements(),v=T=>{var M;for(let _ of T){if(_.locked)return;if(l.altKey?this.elementsPendingErasure.delete(_.id)&&(g=!0):this.elementsPendingErasure.has(_.id)||(g=!0,this.elementsPendingErasure.add(_.id)),g&&((M=_.groupIds)==null?void 0:M.length)){let R=_.groupIds.at(-1);if(!U.has(R)){U.add(R);let P=en(y,R);for(let j of P)l.altKey?this.elementsPendingErasure.delete(j.id):this.elementsPendingErasure.add(j.id)}}}},x=Rt(A(h.lastCoords.x,h.lastCoords.y),A(f.x,f.y)),w=this.getElementHitThreshold(),C={...h.lastCoords},S=0;for(;S<=x;){let T=this.getElementsAtPosition(C.x,C.y);if(v(T),S===x)break;S=Math.min(S+w,x);let M=S/x,_=(1-M)*C.x+M*f.x,R=(1-M)*C.y+M*f.y;C.x=_,C.y=R}if(h.lastCoords.x=f.x,h.lastCoords.y=f.y,g){for(let T of this.scene.getNonDeletedElements())tn(T)&&(this.elementsPendingErasure.has(T.id)||this.elementsPendingErasure.has(T.containerId))&&(l.altKey?(this.elementsPendingErasure.delete(T.id),this.elementsPendingErasure.delete(T.containerId)):(this.elementsPendingErasure.add(T.id),this.elementsPendingErasure.add(T.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),z(this,"handleTouchMove",l=>{Ff=!0}),z(this,"handleCanvasPointerDown",l=>{var w,C,S;let h=l.target;if(h.setPointerCapture&&h.setPointerCapture(l.pointerId),this.maybeCleanupAfterMissingPointerUp(l.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(T=>({searchMatches:T.searchMatches.map(M=>({...M,focus:!1}))})),Sa.set(IP,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(l),l.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let T=this.state.newElement;this.updateScene({...T.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(M=>M.id!==T.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:At(Object.keys(this.state.selectedElementIds).filter(M=>M!==T.id).reduce((M,_)=>(M[_]=this.state.selectedElementIds[_],M),{}),this.state)},captureUpdate:((w=this.state.openDialog)==null?void 0:w.name)==="elementLinkSelector"?se.EVENTUALLY:se.NEVER});return}let f=document.getSelection();if(f!=null&&f.anchorNode&&f.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(l),!this.state.penDetected&&l.pointerType==="pen"&&this.setState(T=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&["pen","touch"].includes(l.pointerType)&&(this.device=rg(this.device,{isTouchScreen:!0})),Of||(this.lastPointerDownEvent=l,this.handleCanvasPanUsingWheelOrSpaceDrag(l)))return;if(this.setState({lastPointerDownWith:l.pointerType,cursorButton:"down"}),this.savePointer(l.clientX,l.clientY,"down"),l.button===hl.ERASER&&this.state.activeTool.type!==Yn.eraser){this.setState({activeTool:Ln(this.state,{type:Yn.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(l);let T=()=>{M(),_==null||_(),ts(this.state)&&this.setState({activeTool:Ln(this.state,{...this.state.activeTool.lastActiveTool||{type:Yn.selection},lastActiveToolBeforeEraser:null})})},M=un(window,"pointerup",T,{once:!0}),_;requestAnimationFrame(()=>{_=this.missingPointerEventCleanupEmitter.once(T)})});return}if(l.button!==hl.MAIN&&l.button!==hl.TOUCH&&l.button!==hl.ERASER||It.pointers.size>1)return;let g=this.initialPointerDownState(l);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(l,g)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(l),this.handleSelectionOnPointerDown(l,g))||!(!this.state.penMode||l.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="text")this.handleTextOnPointerDown(l,g);else if(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")this.handleLinearElementOnPointerDown(l,this.state.activeTool.type,g);else if(this.state.activeTool.type==="image"){Bt(this.interactiveCanvas,Ot.CROSSHAIR);let T=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!T)return;this.setState({newElement:T,pendingImageElementId:null,multiElement:null});let{x:M,y:_}=qt(l,this.state),R=this.getTopLayerFrameAtSceneCoords({x:M,y:_});he(T,{x:M,y:_,frameId:R?R.id:null})}else this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(l,this.state.activeTool.type,g):this.state.activeTool.type==="custom"?Qa(this.interactiveCanvas,this.state):this.state.activeTool.type===Yn.frame||this.state.activeTool.type===Yn.magicframe?this.createFrameElementOnPointerDown(g,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(g.lastCoords.x,g.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,g);(S=(C=this.props)==null?void 0:C.onPointerDown)==null||S.call(C,this.state.activeTool,g),this.onPointerDownEmitter.trigger(this.state.activeTool,g,l),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(g.lastCoords.x,g.lastCoords.y);let U=this.onPointerMoveFromPointerDownHandler(g),y=this.onPointerUpFromPointerDownHandler(g),v=this.onKeyDownFromPointerDownHandler(g),x=this.onKeyUpFromPointerDownHandler(g);this.missingPointerEventCleanupEmitter.once(T=>y(T||l.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener("pointermove",U),window.addEventListener("pointerup",y),window.addEventListener("keydown",v),window.addEventListener("keyup",x),g.eventListeners.onMove=U,g.eventListeners.onUp=y,g.eventListeners.onKeyUp=x,g.eventListeners.onKeyDown=v)}),z(this,"handleCanvasPointerUp",l=>{var g;this.removePointer(l),this.lastPointerUpEvent=l;let h=qt({clientX:l.clientX,clientY:l.clientY},this.state),f=l.timeStamp-(((g=this.lastPointerDownEvent)==null?void 0:g.timeStamp)??0);if(this.device.editor.isMobile&&f<300){let U=this.getElementAtPosition(h.x,h.y);if(Hi(U)&&this.isIframeLikeElementCenter(U,l,h.x,h.y)){this.handleEmbeddableCenterClick(U);return}}if(this.device.isTouchScreen){let U=this.getElementAtPosition(h.x,h.y);this.hitLinkElement=this.getElementLinkAtPosition(h,U)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?f<300&&Hi(this.hitLinkElement)&&!GA(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,A(h.x,h.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(l,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),z(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",l=>{l.pointerType==="touch"&&(Ff=!1,cl?Ff=!0:cl=window.setTimeout(()=>{cl=0,Ff||this.handleCanvasContextMenu(l)},dV))}),z(this,"resetContextMenuTimer",()=>{clearTimeout(cl),cl=0,Ff=!1}),z(this,"maybeCleanupAfterMissingPointerUp",l=>{bc==null||bc(),this.missingPointerEventCleanupEmitter.trigger(l).clear()}),z(this,"handleCanvasPanUsingWheelOrSpaceDrag",l=>{if(!(It.pointers.size<=1&&(l.button===hl.WHEEL||l.button===hl.MAIN&&Uc||zu(this.state)||this.state.viewModeEnabled)))return!1;Of=!0,this.focusContainer(),this.state.editingTextElement||l.preventDefault();let h=!1,f=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);Bt(this.interactiveCanvas,Ot.GRABBING);let{clientX:g,clientY:U}=l,y=xy(x=>{let w=g-x.clientX,C=U-x.clientY;if(g=x.clientX,U=x.clientY,f&&!h&&(Math.abs(w)>1||Math.abs(C)>1)){h=!0;let S=M=>{document.body.removeEventListener("paste",S),M.stopPropagation()},T=()=>{setTimeout(()=>{document.body.removeEventListener("paste",S),window.removeEventListener("pointerup",T)},100)};document.body.addEventListener("paste",S),window.addEventListener("pointerup",T)}this.translateCanvas({scrollX:this.state.scrollX-w/this.state.zoom.value,scrollY:this.state.scrollY-C/this.state.zoom.value})}),v=yn(bc=()=>{bc=null,Of=!1,Uc||(this.state.viewModeEnabled?Bt(this.interactiveCanvas,Ot.GRAB):Qa(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(l.clientX,l.clientY,"up"),window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",v),window.removeEventListener("blur",v),y.flush()});return window.addEventListener("blur",v),window.addEventListener("pointermove",y,{passive:!0}),window.addEventListener("pointerup",v),!0}),z(this,"clearSelectionIfNotUsingSelection",()=>{this.state.activeTool.type!=="selection"&&this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),z(this,"handleSelectionOnPointerDown",(l,h)=>{var f;if(this.state.activeTool.type==="selection"){let g=this.scene.getNonDeletedElements(),U=this.scene.getNonDeletedElementsMap(),y=this.scene.getSelectedElements(this.state);if(y.length===1&&!this.state.editingLinearElement&&!Ie(y[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let v=nS(g,this.state,h.origin.x,h.origin.y,this.state.zoom,l.pointerType,this.scene.getNonDeletedElementsMap(),this.device);v!=null&&(v.transformHandleType==="rotation"?(this.setState({resizingElement:v.element}),h.resize.handleType=v.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:v.element}),h.resize.handleType=v.transformHandleType))}else y.length>1&&(h.resize.handleType=rS(Nt(y),h.origin.x,h.origin.y,this.state.zoom,l.pointerType,this.device));if(h.resize.handleType)h.resize.isResizing=!0,h.resize.offset=wa(Are(h.resize.handleType,y,U,h.origin.x,h.origin.y)),y.length===1&&rt(y[0])&&y[0].points.length===2&&(h.resize.arrowDirection=Lre(h.resize.handleType,y[0]));else{if(this.state.selectedLinearElement){let w=this.state.editingLinearElement||this.state.selectedLinearElement,C=Me.handlePointerDown(l,this,this.store,h.origin,w,this.scene);if(C.hitElement&&(h.hit.element=C.hitElement),C.linearElementEditor&&(this.setState({selectedLinearElement:C.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:C.linearElementEditor})),C.didAddPoint)return!0}if(h.hit.element=h.hit.element??this.getElementAtPosition(h.origin.x,h.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(h.origin,h.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&((f=h.hit.element)==null?void 0:f.id)!==this.state.croppingElementId&&this.finishImageCropping(),h.hit.element&&this.getElementLinkAtPosition({x:h.origin.x,y:h.origin.y},h.hit.element))return!1;h.hit.allHitElements=this.getElementsAtPosition(h.origin.x,h.origin.y);let v=h.hit.element,x=h.hit.allHitElements.some(w=>this.isASelectedElement(w));if((v===null||!x)&&!l.shiftKey&&!h.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(v),this.state.editingLinearElement)this.setState({selectedElementIds:At({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(v!=null){if(l[q.CTRL_OR_CMD])return this.state.selectedElementIds[v.id]||(h.hit.wasAddedToSelection=!0),this.setState(w=>({...mte(w,v),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[v.id]||(this.state.editingGroupId&&!t1(v,this.state.editingGroupId)&&this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!x&&!h.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(w=>{var T;let C={...w.selectedElementIds,[v.id]:!0},S=[];if(Object.keys(w.selectedElementIds).forEach(M=>{let _=this.scene.getElement(M);_&&S.push(_)}),Ke(v))ws(S,v.id).forEach(M=>{delete C[M.id]});else if(v.frameId)C[v.frameId]&&delete C[v.id];else{let M=v.groupIds,_=new Set(M.flatMap(R=>en(this.scene.getNonDeletedElements(),R)).filter(R=>Ke(R)).map(R=>R.id));_.size>0&&S.forEach(R=>{R.frameId&&_.has(R.frameId)&&(delete C[R.id],R.groupIds.flatMap(P=>en(this.scene.getNonDeletedElements(),P)).forEach(P=>{delete C[P.id]}))})}return((T=w.openDialog)==null?void 0:T.name)==="elementLinkSelector"&&(v.groupIds.some(M=>w.selectedGroupIds[M])||(C={[v.id]:!0})),{...Pr({editingGroupId:w.editingGroupId,selectedElementIds:C},this.scene.getNonDeletedElements(),w,this),showHyperlinkPopup:v.link||ti(v)?"info":!1}}),h.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),z(this,"handleTextOnPointerDown",(l,h)=>{if(this.state.editingTextElement)return;let f=h.origin.x,g=h.origin.y,U=this.getElementAtPosition(f,g,{includeBoundTextElement:!0}),y=this.getTextBindableContainerAtPosition(f,g);Ki(U)&&(y=U,f=U.x+U.width/2,g=U.y+U.height/2),this.startTextEditing({sceneX:f,sceneY:g,insertAtParentCenter:!l.altKey,container:y,autoEdit:!1}),ma(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:Ln(this.state,{type:"selection"})})}),z(this,"handleFreeDrawElementOnPointerDown",(l,h,f)=>{let[g,U]=Pn(f.origin.x,f.origin.y,null),y=this.getTopLayerFrameAtSceneCoords({x:g,y:U}),v=l.pressure===.5,x=Gte({type:h,x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:null,simulatePressure:v,locked:!1,frameId:y?y.id:null,points:[A(0,0)],pressures:v?[]:[l.pressure]});this.scene.insertElement(x),this.setState(C=>{let S={...C.selectedElementIds};return delete S[x.id],{selectedElementIds:At(S,C)}});let w=Ca(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:x,startBoundElement:w,suggestedBindings:[]})}),z(this,"insertIframeElement",({sceneX:l,sceneY:h,width:f,height:g})=>{var x;let[U,y]=Pn(l,h,(x=this.lastPointerDownEvent)!=null&&x[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=Xte({type:"iframe",x:U,y,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("iframe"),opacity:this.state.currentItemOpacity,locked:!1,width:f,height:g});return this.scene.insertElement(v),v}),z(this,"insertEmbeddableElement",({sceneX:l,sceneY:h,link:f})=>{var x;let[g,U]=Pn(l,h,(x=this.lastPointerDownEvent)!=null&&x[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=wu(f);if(!y)return;y.error instanceof URIError&&this.setToast({message:D("toast.unrecognizedLinkFormat"),closable:!0});let v=wC({type:"embeddable",x:g,y:U,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("embeddable"),opacity:this.state.currentItemOpacity,locked:!1,width:y.intrinsicSize.w,height:y.intrinsicSize.h,link:f});return this.scene.insertElement(v),v}),z(this,"createImageElement",({sceneX:l,sceneY:h,addToFrameUnderCursor:f=!0})=>{var v;let[g,U]=Pn(l,h,(v=this.lastPointerDownEvent)!=null&&v[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=f?this.getTopLayerFrameAtSceneCoords({x:g,y:U}):null;return RA({type:"image",x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:y?y.id:null})}),z(this,"handleLinearElementOnPointerDown",(l,h,f)=>{if(this.state.multiElement){let{multiElement:g}=this.state;if(g.type==="line"&&Uo(g.points,this.state.zoom.value)){he(g,{lastCommittedPoint:g.points[g.points.length-1]}),this.actionManager.executeAction(fa);return}if(Ie(g)&&g.points.length>1){he(g,{lastCommittedPoint:g.points[g.points.length-1]}),this.actionManager.executeAction(fa);return}let{x:U,y,lastCommittedPoint:v}=g;if(g.points.length>1&&v&&Rt(A(f.origin.x-U,f.origin.y-y),v)<ng){this.actionManager.executeAction(fa);return}this.setState(x=>({selectedElementIds:At({...x.selectedElementIds,[g.id]:!0},x)})),he(g,{lastCommittedPoint:g.points[g.points.length-1]}),Bt(this.interactiveCanvas,Ot.POINTER)}else{let[g,U]=Pn(f.origin.x,f.origin.y,l[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=this.getTopLayerFrameAtSceneCoords({x:g,y:U}),{currentItemStartArrowhead:v,currentItemEndArrowhead:x}=this.state,[w,C]=h==="arrow"?[v,x]:[null,null],S=h==="arrow"?w7({type:h,x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemArrowType===ir.round?{type:Bn.PROPORTIONAL_RADIUS}:null,startArrowhead:w,endArrowhead:C,locked:!1,frameId:y?y.id:null,elbowed:this.state.currentItemArrowType===ir.elbow,fixedSegments:this.state.currentItemArrowType===ir.elbow?[]:null}):Wc({type:h,x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemRoundness==="round"?{type:Bn.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:y?y.id:null});this.setState(M=>{let _={...M.selectedElementIds};return delete _[S.id],{selectedElementIds:At(_,M)}}),he(S,{points:[...S.points,A(0,0)]});let T=Ca(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Ie(S),Ie(S));this.scene.insertElement(S),this.setState({newElement:S,startBoundElement:T,suggestedBindings:[]})}}),z(this,"createGenericElementOnPointerDown",(l,h)=>{var x;let[f,g]=Pn(h.origin.x,h.origin.y,(x=this.lastPointerDownEvent)!=null&&x[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U=this.getTopLayerFrameAtSceneCoords({x:f,y:g}),y={x:f,y:g,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.getCurrentItemRoundness(l),locked:!1,frameId:U?U.id:null},v;l==="embeddable"?v=wC({type:"embeddable",...y}):v=vs({type:l,...y}),v.type==="selection"?this.setState({selectionElement:v}):(this.scene.insertElement(v),this.setState({multiElement:null,newElement:v}))}),z(this,"createFrameElementOnPointerDown",(l,h)=>{var v;let[f,g]=Pn(l.origin.x,l.origin.y,(v=this.lastPointerDownEvent)!=null&&v[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U={x:f,y:g,opacity:this.state.currentItemOpacity,locked:!1,...pn},y=h===Yn.magicframe?S3(U):x7(U);this.scene.insertElement(y),this.setState({multiElement:null,newElement:y})}),z(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),z(this,"eraseElements",()=>{let l=!1,h=this.scene.getElementsIncludingDeleted().map(f=>this.elementsPendingErasure.has(f.id)||f.frameId&&this.elementsPendingErasure.has(f.frameId)||tn(f)&&this.elementsPendingErasure.has(f.containerId)?(l=!0,lt(f,{isDeleted:!0})):f);this.elementsPendingErasure=new Set,l&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(h))}),z(this,"initializeImage",async({imageFile:l,imageElement:h,showCursorImagePreview:f=!1})=>{var x,w,C,S,T;if(!Xc(l))throw new Error(D("errors.unsupportedFileType"));let g=l.type;if(Bt(this.interactiveCanvas,"wait"),g===Be.svg)try{l=lS(RC(await l.text()),l.name)}catch(M){throw console.warn(M),new Error(D("errors.svgImageInsertError"))}let U=await(((w=(x=this.props).generateIdForFile)==null?void 0:w.call(x,l))||Xre(l));if(!U)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(D("errors.imageInsertError"));if(!((C=this.files[U])!=null&&C.dataURL)){try{l=await j3(l,{maxWidthOrHeight:UV})}catch(M){console.error("Error trying to resizing image file on insertion",M)}if(l.size>CE)throw new Error(D("errors.fileTooBig",{maxSize:`${Math.trunc(CE/1024/1024)}MB`}))}if(f){let M=(S=this.files[U])==null?void 0:S.dataURL,_=M&&Yre(M);this.setImagePreviewCursor(_||l)}let y=((T=this.files[U])==null?void 0:T.dataURL)||await oS(l),v=he(h,{fileId:U},!1);return new Promise(async(M,_)=>{var R;try{this.addMissingFiles([{mimeType:g,id:U,dataURL:y,created:Date.now(),lastRetrieved:Date.now()}]);let P=this.imageCache.get(U);P||(this.addNewImagesToImageCache(),await this.updateImageCache([v])),(P==null?void 0:P.image)instanceof Promise&&await P.image,this.state.pendingImageElementId!==v.id&&((R=this.state.newElement)==null?void 0:R.id)!==v.id&&this.initializeImageDimensions(v,!0),M(v)}catch(P){console.error(P),_(new Error(D("errors.imageInsertError")))}finally{f||ma(this.interactiveCanvas)}})}),z(this,"insertImageElement",async(l,h,f)=>{if(!this.isToolSupported("image")){this.setState({errorMessage:D("errors.imageToolNotSupported")});return}this.scene.insertElement(l);try{return await this.initializeImage({imageFile:h,imageElement:l,showCursorImagePreview:f})}catch(g){return he(l,{isDeleted:!0}),this.actionManager.executeAction(fa),this.setState({errorMessage:g.message||D("errors.imageInsertError")}),null}}),z(this,"setImagePreviewCursor",async l=>{let h;try{h=await j3(l,{maxWidthOrHeight:96})}catch(g){throw g.cause==="UNSUPPORTED"?new Error(D("errors.unsupportedFileType")):g}let f=await oS(h);if(l.type===Be.svg){let g=await HA(f),U=Math.min(g.height,96),y=U*(g.width/g.height);y>96&&(y=96,U=y*(g.height/g.width));let v=document.createElement("canvas");v.height=U,v.width=y,v.getContext("2d").drawImage(g,0,0,y,U),f=v.toDataURL(Be.svg)}this.state.pendingImageElementId&&Bt(this.interactiveCanvas,`url(${f}) 4 4, auto`)}),z(this,"onImageAction",async({insertOnCanvasDirectly:l})=>{try{let h=this.state.width/2+this.state.offsetLeft,f=this.state.height/2+this.state.offsetTop,{x:g,y:U}=qt({clientX:h,clientY:f},this.state),y=await C7({description:"Image",extensions:Object.keys($u)}),v=this.createImageElement({sceneX:g,sceneY:U,addToFrameUnderCursor:!1});l?(this.insertImageElement(v,y),this.initializeImageDimensions(v),this.setState({selectedElementIds:At({[v.id]:!0},this.state)},()=>{this.actionManager.executeAction(fa)})):this.setState({pendingImageElementId:v.id},()=>{this.insertImageElement(v,y,!0)})}catch(h){h.name!=="AbortError"?console.error(h):console.warn(h),this.setState({pendingImageElementId:null,newElement:null,activeTool:Ln(this.state,{type:"selection"})},()=>{this.actionManager.executeAction(fa)})}}),z(this,"initializeImageDimensions",(l,h=!1)=>{var g;let f=zi(l)&&((g=this.imageCache.get(l.fileId))==null?void 0:g.image);if(!f||f instanceof Promise){if(l.width<wc/this.state.zoom.value&&l.height<wc/this.state.zoom.value){let U=100/this.state.zoom.value;he(l,{x:l.x-U/2,y:l.y-U/2,width:U,height:U})}return}if(h||l.width<wc/this.state.zoom.value&&l.height<wc/this.state.zoom.value){let U=Math.max(this.state.height-120,160),y=Math.min(U,Math.floor(this.state.height*.5)/this.state.zoom.value),v=Math.min(f.naturalHeight,y),x=v*(f.naturalWidth/f.naturalHeight),w=l.x+l.width/2-x/2,C=l.y+l.height/2-v/2;he(l,{x:w,y:C,width:x,height:v,crop:null})}}),z(this,"updateImageCache",async(l,h=this.files)=>{let{updatedFiles:f,erroredFiles:g}=await WA({imageCache:this.imageCache,fileIds:l.map(U=>U.fileId),files:h});if(f.size||g.size)for(let U of l)f.has(U.fileId)&&gn.delete(U);return g.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(U=>zi(U)&&g.has(U.fileId)?lt(U,{status:"error"}):U)),{updatedFiles:f,erroredFiles:g}}),z(this,"addNewImagesToImageCache",async(l=XA(this.scene.getNonDeletedElements()),h=this.files)=>{let f=l.filter(g=>!g.isDeleted&&!this.imageCache.has(g.fileId));if(f.length){let{updatedFiles:g}=await this.updateImageCache(f,h);g.size&&this.scene.triggerUpdate()}}),z(this,"scheduleImageRefresh",_1(()=>{this.addNewImagesToImageCache()},lV)),z(this,"updateBindingEnabledOnPointerMove",l=>{let h=Wee(l);this.state.isBindingEnabled!==h&&this.setState({isBindingEnabled:h})}),z(this,"maybeSuggestBindingAtCursor",(l,h)=>{let f=Ca(l,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,h);this.setState({suggestedBindings:f!=null?[f]:[]})}),z(this,"maybeSuggestBindingsForLinearElementAtCoords",(l,h,f)=>{if(!h.length)return;let g=h.reduce((U,y)=>{let v=Ca(y,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Ie(l),Ie(l));return v!=null&&!uA(l,f==null?void 0:f.id,v)&&U.push(v),U},[]);this.setState({suggestedBindings:g})}),z(this,"handleInteractiveCanvasRef",l=>{var h,f;l!==null?(this.interactiveCanvas=l,this.interactiveCanvas.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener("touchend",this.onTouchEnd)):((h=this.interactiveCanvas)==null||h.removeEventListener("touchstart",this.onTouchStart),(f=this.interactiveCanvas)==null||f.removeEventListener("touchend",this.onTouchEnd))}),z(this,"handleAppOnDrop",async l=>{var v,x,w,C;let{file:h,fileHandle:f}=await Zre(l),{x:g,y:U}=qt(l,this.state);try{if(Xc(h)&&this.isToolSupported("image")){if((h==null?void 0:h.type)===Be.png||(h==null?void 0:h.type)===Be.svg)try{let T=await TL(h,this.state,this.scene.getElementsIncludingDeleted(),f);this.syncActionResult({...T,appState:{...T.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:se.IMMEDIATELY});return}catch(T){if(T.name!=="EncodingError")throw new Error(D("alerts.couldNotLoadInvalidFile"))}let S=this.createImageElement({sceneX:g,sceneY:U});this.insertImageElement(S,h),this.initializeImageDimensions(S),this.setState({selectedElementIds:At({[S.id]:!0},this.state)});return}}catch(S){return this.setState({isLoading:!1,errorMessage:S.message})}let y=l.dataTransfer.getData(Be.excalidrawlib);if(y&&typeof y=="string"){try{let S=ML(y);this.addElementsFromPasteOrLibrary({elements:Rj(S),position:l,files:null})}catch(S){this.setState({errorMessage:S.message})}return}if(h&&await this.loadFileToCanvas(h,f),(x=(v=l.dataTransfer)==null?void 0:v.types)==null?void 0:x.includes("text/plain")){let S=(w=l.dataTransfer)==null?void 0:w.getData("text");if(S&&ug(S,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(S)||((C=wu(S))==null?void 0:C.type)==="video")){let T=this.insertEmbeddableElement({sceneX:g,sceneY:U,link:vi(S)});T&&this.setState({selectedElementIds:{[T.id]:!0}})}}}),z(this,"loadFileToCanvas",async(l,h)=>{l=await tv(l);try{let f=this.scene.getElementsIncludingDeleted(),g;try{g=await kL(l,this.state,f,h)}catch(U){let y=U instanceof Dc;if(y&&U.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:D("errors.imageToolNotSupported")});return}let v=D(y?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:v})}if(!g)return;g.type===Be.excalidraw?(xo(f.concat(g.data.elements)),this.store.updateSnapshot(Qe(f),this.state),this.setState({isLoading:!0}),this.syncActionResult({...g.data,appState:{...g.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:se.IMMEDIATELY})):g.type===Be.excalidrawlib&&await this.library.updateLibrary({libraryItems:l,merge:!0,openLibraryMenu:!0}).catch(U=>{console.error(U),this.setState({errorMessage:D("errors.importLibraryError")})})}catch(f){this.setState({isLoading:!1,errorMessage:f.message})}}),z(this,"handleCanvasContextMenu",l=>{if(l.preventDefault(),("pointerType"in l.nativeEvent&&l.nativeEvent.pointerType==="touch"||"pointerType"in l.nativeEvent&&l.nativeEvent.pointerType==="pen"&&l.button!==hl.SECONDARY)&&this.state.activeTool.type!=="selection")return;let{x:h,y:f}=qt(l,this.state),g=this.getElementAtPosition(h,f,{preferSelected:!0,includeLockedElements:!0}),U=this.scene.getSelectedElements(this.state),y=this.isHittingCommonBoundingBoxOfSelectedElements({x:h,y:f},U),v=g||y?"element":"canvas",x=this.excalidrawContainerRef.current,{top:w,left:C}=x.getBoundingClientRect(),S=l.clientX-C,T=l.clientY-w;Zt("contextMenu","openContextMenu",v),this.setState({...g&&!this.state.selectedElementIds[g.id]?{...this.state,...Pr({editingGroupId:this.state.editingGroupId,selectedElementIds:{[g.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:rt(g)?new Me(g):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:T,left:S,items:this.getContextMenuItems(v)}})})}),z(this,"maybeDragNewGenericElement",(l,h,f=!0)=>{var M,_,R;let g=this.state.selectionElement,U=l.lastCoords;if(g&&this.state.activeTool.type!=="eraser"){sS({newElement:g,elementType:this.state.activeTool.type,originX:l.origin.x,originY:l.origin.y,x:U.x,y:U.y,width:Er(l.origin.x,U.x),height:Er(l.origin.y,U.y),shouldMaintainAspectRatio:If(h),shouldResizeFromCenter:Nb(h),zoom:this.state.zoom.value,informMutation:f});return}let y=this.state.newElement;if(!y)return;let[v,x]=Pn(U.x,U.y,h[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w=zi(y)&&((M=this.imageCache.get(y.fileId))==null?void 0:M.image),C=w&&!(w instanceof Promise)?w.width/w.height:null;this.maybeCacheReferenceSnapPoints(h,[y]);let{snapOffset:S,snapLines:T}=Tte(y,this,h,{x:l.originInGrid.x+(((_=this.state.originSnapOffset)==null?void 0:_.x)??0),y:l.originInGrid.y+(((R=this.state.originSnapOffset)==null?void 0:R.y)??0)},{x:v-l.originInGrid.x,y:x-l.originInGrid.y},this.scene.getNonDeletedElementsMap());v+=S.x,x+=S.y,this.setState({snapLines:T}),sS({newElement:y,elementType:this.state.activeTool.type,originX:l.originInGrid.x,originY:l.originInGrid.y,x:v,y:x,width:Er(l.originInGrid.x,v),height:Er(l.originInGrid.y,x),shouldMaintainAspectRatio:Lt(y)?!If(h):If(h),shouldResizeFromCenter:Nb(h),zoom:this.state.zoom.value,widthAspectRatio:C,originOffset:this.state.originSnapOffset,informMutation:f}),this.setState({newElement:y}),(this.state.activeTool.type===Yn.frame||this.state.activeTool.type===Yn.magicframe)&&this.setState({elementsToHighlight:fg(this.scene.getNonDeletedElements(),y,this.state,this.scene.getNonDeletedElementsMap())})}),z(this,"maybeHandleCrop",(l,h)=>{var x;if(!this.state.croppingElementId)return!1;let f=l.resize.handleType,g=l.lastCoords,[U,y]=Pn(g.x-l.resize.offset.x,g.y-l.resize.offset.y,h[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(f&&v&&Lt(v)){let w=l.originalElements.get(v.id),C=zi(v)&&((x=this.imageCache.get(v.fileId))==null?void 0:x.image);if(w&&Lt(w)&&C&&!(C instanceof Promise)){let[S,T]=Pn(g.x,g.y,h[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),M={x:S-l.originInGrid.x,y:T-l.originInGrid.y};this.maybeCacheReferenceSnapPoints(h,[v]);let{snapOffset:_,snapLines:R}=vC([v],[w],this,h,M,f);he(v,fee(v,f,C.naturalWidth,C.naturalHeight,U+_.x,y+_.y,h.shiftKey?w.width/w.height:void 0)),ci(v,this.scene.getNonDeletedElementsMap(),{newSize:{width:v.width,height:v.height}}),this.setState({isCropping:f&&f!=="rotation",snapLines:R})}return!0}return!1}),z(this,"maybeHandleResize",(l,h)=>{let f=this.scene.getSelectedElements(this.state),g=f.filter(C=>Ke(C)),U=l.resize.handleType;if(g.length>0&&U==="rotation"||f.length===1&&Ie(f[0])||this.state.croppingElementId)return!1;this.setState({isResizing:U&&U!=="rotation",isRotating:U==="rotation",activeEmbeddable:null});let y=l.lastCoords,[v,x]=Pn(y.x-l.resize.offset.x,y.y-l.resize.offset.y,h[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w=new Map;if(g.forEach(C=>{ws(this.scene.getNonDeletedElements(),C.id).forEach(S=>{w.set(C.id+S.id,{x:S.x-C.x,y:S.y-C.y})})}),!this.state.selectedElementsAreBeingDragged){let[C,S]=Pn(y.x,y.y,h[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),T={x:C-l.originInGrid.x,y:S-l.originInGrid.y},M=[...l.originalElements.values()];this.maybeCacheReferenceSnapPoints(h,f);let{snapOffset:_,snapLines:R}=vC(f,ut(M,this.state),this,h,T,U);v+=_.x,x+=_.y,this.setState({snapLines:R})}if(kre(l.originalElements,U,f,this.scene.getElementsMapIncludingDeleted(),this.scene,yp(h),Nb(h),f.some(C=>Lt(C))?!If(h):If(h),v,x,l.resize.center.x,l.resize.center.y)){let C=Fb(f,this.scene.getNonDeletedElementsMap(),this.state.zoom),S=new Set;return g.forEach(T=>{fg(this.scene.getNonDeletedElements(),T,this.state,this.scene.getNonDeletedElementsMap()).forEach(M=>S.add(M))}),this.setState({elementsToHighlight:[...S],suggestedBindings:C}),!0}return!1}),z(this,"getContextMenuItems",l=>{let h=[];return h.push(v_,y_),l==="canvas"?this.state.viewModeEnabled?[...h,w_,r8,nk,i8]:[U_,Xn,v_,y_,x_,Xn,ice,Sde,Xn,w_,hde,r8,nk,i8]:(h.push(x_),this.state.viewModeEnabled?[xg,...h]:[Xn,b_,xg,U_,Xn,qfe,Zfe,Kfe,Xn,zue,Xn,...h,Xn,Kce,Qce,Xn,ede,Ppe,fde,pde,Ude,tde,Xn,ade,Xn,ece,tce,nce,rce,Xn,cde,dde,Xn,$ue,Xn,Ij,Vj,Xn,lce,Cde,Xn,JD])}),z(this,"handleWheel",yn(l=>{if(!(l.target instanceof HTMLCanvasElement||l.target instanceof HTMLTextAreaElement||l.target instanceof HTMLIFrameElement)){l[q.CTRL_OR_CMD]&&l.preventDefault();return}if(l.preventDefault(),Of)return;let{deltaX:h,deltaY:f}=l;if(l.metaKey||l.ctrlKey){let g=Math.sign(f),U=sU*100,y=Math.abs(f),v=f;y>U&&(v=U*g);let x=this.state.zoom.value-v/100;x+=Math.log10(Math.max(1,this.state.zoom.value))*-g*Math.min(1,y/20),this.translateCanvas(w=>({...Nc({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:lo(x)},w),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(l.shiftKey){this.translateCanvas(({zoom:g,scrollX:U})=>({scrollX:U-(f||h)/g.value}));return}this.translateCanvas(({zoom:g,scrollX:U,scrollY:y})=>({scrollX:U-h/g.value,scrollY:y-f/g.value}))})),z(this,"savePointer",(l,h,f)=>{var v,x;if(!l||!h)return;let{x:g,y:U}=qt({clientX:l,clientY:h},this.state),y={x:g,y:U,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};(x=(v=this.props).onPointerUpdate)==null||x.call(v,{pointer:y,button:f,pointersMap:It.pointers})}),z(this,"resetShouldCacheIgnoreZoomDebounced",Wu(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),z(this,"updateDOMRect",l=>{var h;if((h=this.excalidrawContainerRef)!=null&&h.current){let f=this.excalidrawContainerRef.current,{width:g,height:U,left:y,top:v}=f.getBoundingClientRect(),{width:x,height:w,offsetTop:C,offsetLeft:S}=this.state;if(g===x&&U===w&&y===S&&v===C){l&&l();return}this.setState({width:g,height:U,offsetLeft:y,offsetTop:v},()=>{l&&l()})}}),z(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})});let n=Us(),{excalidrawAPI:r,viewModeEnabled:i=!1,zenModeEnabled:a=!1,gridModeEnabled:s=!1,objectsSnapModeEnabled:o=!1,theme:c=n.theme,name:d=`${D("labels.untitled")}-${IE()}`}=t;if(this.state={...n,theme:c,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:i,zenModeEnabled:a,objectsSnapModeEnabled:o,gridModeEnabled:s??n.gridModeEnabled,name:d,width:window.innerWidth,height:window.innerHeight},this.id=H8(),this.library=new jde(this),this.actionManager=new Vue(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new wo,this.canvas=document.createElement("canvas"),this.rc=Wl.canvas(this.canvas),this.renderer=new ck(this.scene),this.visibleElements=[],this.store=new ene,this.history=new L_,r){let l={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:h=>{this.actionManager.registerAction(h)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:h=>this.onChangeEmitter.on(h),onPointerDown:h=>this.onPointerDownEmitter.on(h),onPointerUp:h=>this.onPointerUpEmitter.on(h),onScrollChange:h=>this.onScrollChangeEmitter.on(h),onUserFollow:h=>this.onUserFollowEmitter.on(h)};typeof r=="function"?r(l):console.error("excalidrawAPI should be a function!")}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new uo(this.scene),this.history=new L_,this.actionManager.registerAll(C3),this.actionManager.registerAction(Wue(this.history,this.store)),this.actionManager.registerAction(Xue(this.history,this.store))}onWindowMessage(t){if(t.origin!=="https://player.vimeo.com"&&t.origin!=="https://www.youtube.com")return;let n=null;try{n=JSON.parse(t.data)}catch{}if(n)switch(t.origin){case"https://player.vimeo.com":if(n.method==="paused"){let r=null,i=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!i)break;for(let a of i)a.contentWindow===t.source&&(r=a.contentWindow);r==null||r.postMessage(JSON.stringify({method:n.value?"play":"pause",value:!0}),"*")}break;case"https://www.youtube.com":if(n.event==="infoDelivery"&&n.info&&n.id&&typeof n.info.playerState=="number"){let r=n.id,i=n.info.playerState;Object.values(mm).includes(i)&&Ty.set(r,i)}break}}cacheEmbeddableRef(t,n){n&&this.iFrameRefs.set(t.id,n)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleEmbeddableCenterClick(t){var r,i,a,s;if(((r=this.state.activeEmbeddable)==null?void 0:r.element)===t&&((i=this.state.activeEmbeddable)==null?void 0:i.state)==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:t,state:"active"},selectedElementIds:{[t.id]:!0},newElement:null,selectionElement:null})},100),Ul(t)))return;let n=this.getHTMLIFrameElement(t);if(n!=null&&n.contentWindow){if(n.src.includes("youtube")){let o=Ty.get(t.id);switch(o||(Ty.set(t.id,mm.UNSTARTED),n.contentWindow.postMessage(JSON.stringify({event:"listening",id:t.id}),"*")),o){case mm.PLAYING:case mm.BUFFERING:(a=n.contentWindow)==null||a.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:(s=n.contentWindow)==null||s.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}n.src.includes("player.vimeo.com")&&n.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*")}}isIframeLikeElementCenter(t,n,r,i){var a,s;return t&&!n.altKey&&!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&(((a=this.state.activeEmbeddable)==null?void 0:a.element)!==t||((s=this.state.activeEmbeddable)==null?void 0:s.state)==="hover"||!this.state.activeEmbeddable)&&r>=t.x+t.width/3&&r<=t.x+2*t.width/3&&i>=t.y+t.height/3&&i<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,n=this.state.width,r=this.state.height,i=this.scene.getNonDeletedElements().filter(a=>ti(a)&&this.embedsValidationStatus.get(a.id)===!0||Ul(a));return m.jsx(m.Fragment,{children:i.map(a=>{var g,U,y,v,x,w,C,S,T;let{x:s,y:o}=xa({sceneX:a.x,sceneY:a.y},this.state),c=p2(a,n,r,this.state,this.scene.getNonDeletedElementsMap()),d=this.initializedEmbeds.has(a.id);if(c&&!d&&this.initializedEmbeds.add(a.id),!(c||d))return null;let l;if(Ul(a)){l=null;let M=(((g=a.customData)==null?void 0:g.generationData)??this.magicGenerations.get(a.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(M.status==="done"){let _=M.html;l={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>_}}else if(M.status==="pending")l={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>vp(`
|
|
161
|
+
<style>
|
|
162
|
+
html, body {
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: 100%;
|
|
165
|
+
color: ${this.state.theme===yt.DARK?"white":"black"};
|
|
166
|
+
}
|
|
167
|
+
body {
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
gap: 1rem;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.Spinner {
|
|
176
|
+
display: flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
margin-left: auto;
|
|
180
|
+
margin-right: auto;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.Spinner svg {
|
|
184
|
+
animation: rotate 1.6s linear infinite;
|
|
185
|
+
transform-origin: center center;
|
|
186
|
+
width: 40px;
|
|
187
|
+
height: 40px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.Spinner circle {
|
|
191
|
+
stroke: currentColor;
|
|
192
|
+
animation: dash 1.6s linear 0s infinite;
|
|
193
|
+
stroke-linecap: round;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@keyframes rotate {
|
|
197
|
+
100% {
|
|
198
|
+
transform: rotate(360deg);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@keyframes dash {
|
|
203
|
+
0% {
|
|
204
|
+
stroke-dasharray: 1, 300;
|
|
205
|
+
stroke-dashoffset: 0;
|
|
206
|
+
}
|
|
207
|
+
50% {
|
|
208
|
+
stroke-dasharray: 150, 300;
|
|
209
|
+
stroke-dashoffset: -200;
|
|
210
|
+
}
|
|
211
|
+
100% {
|
|
212
|
+
stroke-dasharray: 1, 300;
|
|
213
|
+
stroke-dashoffset: -280;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
217
|
+
<div class="Spinner">
|
|
218
|
+
<svg
|
|
219
|
+
viewBox="0 0 100 100"
|
|
220
|
+
>
|
|
221
|
+
<circle
|
|
222
|
+
cx="50"
|
|
223
|
+
cy="50"
|
|
224
|
+
r="46"
|
|
225
|
+
stroke-width="8"
|
|
226
|
+
fill="none"
|
|
227
|
+
stroke-miter-limit="10"
|
|
228
|
+
/>
|
|
229
|
+
</svg>
|
|
230
|
+
</div>
|
|
231
|
+
<div>Generating...</div>
|
|
232
|
+
`)};else{let _;M.code==="ERR_GENERATION_INTERRUPTED"?_="Generation was interrupted...":_=M.message||"Generation failed",l={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>vp(`
|
|
233
|
+
<style>
|
|
234
|
+
html, body {
|
|
235
|
+
height: 100%;
|
|
236
|
+
}
|
|
237
|
+
body {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
color: ${pt.red[3]};
|
|
243
|
+
}
|
|
244
|
+
h1, h3 {
|
|
245
|
+
margin-top: 0;
|
|
246
|
+
margin-bottom: 0.5rem;
|
|
247
|
+
}
|
|
248
|
+
</style>
|
|
249
|
+
<h1>Error!</h1>
|
|
250
|
+
<h3>${_}</h3>
|
|
251
|
+
`)}}}else l=wu(kA(a.link||""));let h=((U=this.state.activeEmbeddable)==null?void 0:U.element)===a&&((y=this.state.activeEmbeddable)==null?void 0:y.state)==="active",f=((v=this.state.activeEmbeddable)==null?void 0:v.element)===a&&((x=this.state.activeEmbeddable)==null?void 0:x.state)==="hover";return m.jsx("div",{className:De("excalidraw__embeddable-container",{"is-hovered":f}),style:{transform:c?`translate(${s-this.state.offsetLeft}px, ${o-this.state.offsetTop}px) scale(${t})`:"none",display:c?"block":"none",opacity:QI(a,di(a,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,((w=this.state.openDialog)==null?void 0:w.name)==="elementLinkSelector"?YM:1),"--embeddable-radius":`${Ta(Math.min(a.width,a.height),a)}px`},children:m.jsxs("div",{className:"excalidraw__embeddable-container__inner",style:{width:c?`${a.width}px`:0,height:c?`${a.height}px`:0,transform:c?`rotate(${a.angle}rad)`:"none",pointerEvents:h?eu.enabled:eu.disabled},children:[f&&m.jsx("div",{className:"excalidraw__embeddable-hint",children:D("buttons.embeddableInteractionButton")}),m.jsx("div",{className:"excalidraw__embeddable__outer",style:{padding:`${a.strokeWidth}px`},children:(ti(a)?(S=(C=this.props).renderEmbeddable)==null?void 0:S.call(C,a,this.state):null)??m.jsx("iframe",{ref:M=>this.cacheEmbeddableRef(a,M),className:"excalidraw__embeddable",srcDoc:(l==null?void 0:l.type)==="document"?l.srcdoc(this.state.theme):void 0,src:(l==null?void 0:l.type)!=="document"?(l==null?void 0:l.link)??"":void 0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade",title:"Excalidraw Embedded Content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sandbox:`${(T=l==null?void 0:l.sandbox)!=null&&T.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},a.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){var l,h,f,g,U,y,v,x;let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:n,renderCustomStats:r}=this.props,i=this.scene.getSceneNonce(),{elementsMap:a,visibleElements:s}=this.renderer.getRenderableElements({sceneNonce:i,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:(l=this.state.newElement)==null?void 0:l.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=s;let o=this.scene.getNonDeletedElementsMap(),c="setPointerCapture"in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type==="laser"&&this.state.cursorButton==="down",d=t[0];return m.jsx("div",{className:De("excalidraw excalidraw-container",{"excalidraw--view-mode":this.state.viewModeEnabled||((h=this.state.openDialog)==null?void 0:h.name)==="elementLinkSelector","excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":c?eu.disabled:eu.enabled,"--right-sidebar-width":"302px"},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:m.jsx(GP.Provider,{value:this,children:m.jsx(qP.Provider,{value:this.props,children:m.jsx(Bv.Provider,{value:this.excalidrawContainerValue,children:m.jsx(Fv.Provider,{value:this.device,children:m.jsx(Hv.Provider,{value:this.setAppState,children:m.jsx(zv.Provider,{value:this.state,children:m.jsxs($v.Provider,{value:this.scene.getNonDeletedElements(),children:[m.jsxs(Wv.Provider,{value:this.actionManager,children:[m.jsx(Vfe,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:c1().code,renderTopRightUI:n,renderCustomStats:r,showExitZenModeBtn:typeof((f=this.props)==null?void 0:f.zenModeEnabled)>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type==="selection"&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),m.jsx("div",{className:"excalidraw-textEditorContainer"}),m.jsx("div",{className:"excalidraw-contextMenuContainer"}),m.jsx("div",{className:"excalidraw-eye-dropper-container"}),m.jsx(_pe,{trails:[this.laserTrails,this.eraserTrail]}),t.length===1&&((g=this.state.openDialog)==null?void 0:g.name)!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&m.jsx(vde,{element:d,elementsMap:o,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},d.id),this.props.aiEnabled!==!1&&t.length===1&&ag(d)&&m.jsx(dk,{element:d,elementsMap:a,children:m.jsx(Cy,{title:D("labels.convertToCode"),icon:kI,checked:!1,onChange:()=>this.onMagicFrameGenerate(d,"button")})}),t.length===1&&Ul(d)&&((y=(U=d.customData)==null?void 0:U.generationData)==null?void 0:y.status)==="done"&&m.jsxs(dk,{element:d,elementsMap:a,children:[m.jsx(Cy,{title:D("labels.copySource"),icon:c7,checked:!1,onChange:()=>this.onIframeSrcCopy(d)}),m.jsx(Cy,{title:"Enter fullscreen",icon:$G,checked:!1,onChange:()=>{let w=this.getHTMLIFrameElement(d);if(w)try{w.requestFullscreen(),this.setState({activeEmbeddable:{element:d,state:"active"},selectedElementIds:{[d.id]:!0},newElement:null,selectionElement:null})}catch(C){console.warn(C),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.toast!==null&&m.jsx(Gfe,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&m.jsx(Gue,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:w=>{this.setState({contextMenu:null},()=>{this.focusContainer(),w==null||w()})}}),m.jsx(Spe,{canvas:this.canvas,rc:this.rc,elementsMap:a,allElementsMap:o,visibleElements:s,sceneNonce:i,selectionNonce:(v=this.state.selectionElement)==null?void 0:v.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:n1(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&m.jsx($pe,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:a,allElementsMap:o,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),m.jsx(wpe,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:a,visibleElements:s,allElementsMap:o,selectedElements:t,sceneNonce:i,selectionNonce:(x=this.state.selectionElement)==null?void 0:x.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&m.jsx(Ape,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,n){var s;let r=(s=this.plugins.diagramToCode)==null?void 0:s.generate;if(!r){this.setState({errorMessage:"No diagram to code plugin found"});return}let i=V7(this.scene.getNonDeletedElements(),t).filter(o=>!ag(o));if(!i.length){n==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),Zt("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let a=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(a){this.updateMagicGeneration({frameElement:a,data:{status:"pending"}}),this.setState({selectedElementIds:{[a.id]:!0}}),Zt("ai","generate (start)","d2c");try{let{html:o}=await r({frame:t,children:i});if(Zt("ai","generate (success)","d2c"),!o.trim()){this.updateMagicGeneration({frameElement:a,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let c=o.includes("<!DOCTYPE html>")&&o.includes("</html>")?o.slice(o.indexOf("<!DOCTYPE html>"),o.indexOf("</html>")+7):o;this.updateMagicGeneration({frameElement:a,data:{status:"done",html:c}})}catch(o){Zt("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:a,data:{status:"error",code:"ERR_OAI",message:o.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){var n,r;((r=(n=t.customData)==null?void 0:n.generationData)==null?void 0:r.status)==="done"&&(P1(t.customData.generationData.html),this.setToast({message:"copied to clipboard",closable:!1,duration:1500}))}clearImageShapeCache(t){let n=t??this.files;this.scene.getNonDeletedElements().forEach(r=>{zi(r)&&n[r.fileId]&&(this.imageCache.delete(r.fileId),gn.delete(r))})}async componentDidMount(){var t;this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,(dt.MODE===si.TEST||dt.DEV)&&(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...n)=>this.setState(...n)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})),this.store.onStoreIncrementEmitter.on(n=>{this.history.record(n.elementsChange,n.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),go()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),s3&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),(t=this.resizeObserver)==null||t.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),KX()&&!oY()&&this.setState({errorMessage:m.jsx(Jfe,{})})}componentWillUnmount(){var t,n;(t=window.launchQueue)==null||t.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new wo,this.fonts=new uo(this.scene),this.renderer=new ck(this.scene),this.files={},this.imageCache.clear(),(n=this.resizeObserver)==null||n.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),gn.destroy(),eo.destroy(),clearTimeout(cl),$n.clearCache(),Pr.clearCache(),cl=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(un(document,"keydown",this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(un(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),un(window,"message",this.onWindowMessage,!1),un(document,"pointerup",this.removePointer,{passive:!1}),un(document,"copy",this.onCopy,{passive:!1}),un(document,"keyup",this.onKeyUp,{passive:!0}),un(document,"pointermove",this.updateCurrentCursorPosition,{passive:!1}),un(document.fonts,"loadingdone",t=>{let n=t.fontfaces;this.fonts.onLoaded(n)},{passive:!1}),un(document,"gesturestart",this.onGestureStart,!1),un(document,"gesturechange",this.onGestureChange,!1),un(document,"gestureend",this.onGestureEnd,!1),un(window,"focus",()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(un(document,"fullscreenchange",this.onFullscreenChange,{passive:!1}),un(document,"paste",this.pasteFromClipboard,{passive:!1}),un(document,"cut",this.onCut,{passive:!1}),un(window,"resize",this.onResize,!1),un(window,"unload",this.onUnload,!1),un(window,"blur",this.onBlur,!1),un(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),un(this.excalidrawContainerRef.current,"dragover",this.disableEvent,!1),un(this.excalidrawContainerRef.current,"drop",this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(un(YV(this.excalidrawContainerRef.current),"scroll",this.onScroll,{passive:!1})))}componentDidUpdate(t,n){var o,c,d,l,h,f,g,U,y,v;this.updateEmbeddables();let r=this.scene.getElementsIncludingDeleted(),i=this.scene.getElementsMapIncludingDeleted(),a=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!r.length&&this.setState({showWelcomeScreen:!0}),t.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),n.userToFollow&&!this.state.collaborators.has(n.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(n.zoom.value!==this.state.zoom.value||n.scrollX!==this.state.scrollX||n.scrollY!==this.state.scrollY)&&((c=(o=this.props)==null?void 0:o.onScrollChange)==null||c.call(o,this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),n.userToFollow!==this.state.userToFollow&&(n.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:n.userToFollow,action:"UNFOLLOW"}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:"FOLLOW"})),Object.keys(this.state.selectedElementIds).length&&ts(this.state)&&this.setState({activeTool:Ln(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&n.theme!==this.state.theme&&IA(this.interactiveCanvas,this.state.theme),n.activeTool.type==="selection"&&this.state.activeTool.type!=="selection"&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),t.langCode!==this.props.langCode&&this.updateLanguage(),ts(n)&&!ts(this.state)&&this.eraserTrail.endPath(),t.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),n.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(((d=n.openDialog)==null?void 0:d.name)==="elementLinkSelector"||((l=this.state.openDialog)==null?void 0:l.name)==="elementLinkSelector")&&((h=n.openDialog)==null?void 0:h.name)!==((f=this.state.openDialog)==null?void 0:f.name)&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),t.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),t.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),(g=this.excalidrawContainerRef.current)==null||g.classList.toggle("theme--dark",this.state.theme===yt.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(fa)}),(U=this.state.editingTextElement)!=null&&U.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:s}=n;n.activeTool!==this.state.activeTool&&s!=null&&jc(this.state)&&ls(s,!1)&&w3(s,this.state,wa(Me.getPointAtIndexGlobalCoordinates(s,-1,a)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(i,this.state),this.state.isLoading||((v=(y=this.props).onChange)==null||v.call(y,r,this.state,this.files),this.onChangeEmitter.trigger(r,this.state,this.files))}static resetTapTwice(){Nf=!1}async addElementsFromMixedContentPaste(t,{isPlainPaste:n,sceneX:r,sceneY:i}){if(!n&&t.some(a=>a.type==="imageUrl")&&this.isToolSupported("image")){let a=t.filter(h=>h.type==="imageUrl").map(h=>h.value),s=await Promise.all(a.map(async h=>{try{return{file:await qre(h)}}catch(f){let g=f.message;return f.cause==="FETCH_ERROR"?g=D("errors.failedToFetchImage"):f.cause==="UNSUPPORTED"&&(g=D("errors.unsupportedFileType")),{errorMessage:g}}})),o=i,c=!1,d={};for(let h of s)if(h.file){let f=this.createImageElement({sceneX:r,sceneY:o}),g=await this.insertImageElement(f,h.file);g&&(c||(c=!0,o-=g.height/2),he(g,{y:o},!1),o=f.y+f.height+25,d[f.id]=!0)}this.setState({selectedElementIds:At(d,this.state)});let l=s.find(h=>!!h.errorMessage);l&&l.errorMessage&&this.setState({errorMessage:l.errorMessage})}else{let a=t.filter(s=>s.type==="text");a.length&&this.addTextFromPaste(a.map(s=>s.value).join(`
|
|
252
|
+
|
|
253
|
+
`),n)}}addTextFromPaste(t,n=!1){let{x:r,y:i}=qt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),a={x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:t,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:T1,verticalAlign:$g,locked:!1},s=$t({fontSize:a.fontSize,fontFamily:a.fontFamily}),o=ad(a.fontFamily),[c,,d]=Fee(this.state),l=Math.max(Math.min((d-c)*.5,800),200),h=10,f=i,g=n?[t]:t.split(`
|
|
254
|
+
`),U=g.reduce((y,v,x)=>{var C;let w=Vu(v).trim();if(w.length){let S=this.getTopLayerFrameAtSceneCoords({x:r,y:f}),T=Mr(w,s,o),M=T.width>l,_=M?gd(w,s,l):w;T=M?Mr(_,s,o):T;let R=r-T.width/2,P=f-T.height/2,j=Ei({...a,x:R,y:P,text:_,originalText:w,lineHeight:o,autoResize:!M,frameId:S?S.id:null});y.push(j),f+=j.height+h}else(C=g[x-1])!=null&&C.trim()&&(f+=L1(a.fontSize,o)+h);return y},[]);U.length!==0&&(this.scene.insertElements(U),this.setState({selectedElementIds:At(Object.fromEntries(U.map(y=>[y.id,!0])),this.state)}),!n&&U.length>1&&hk===!1&&!this.device.editor.isMobile&&(this.setToast({message:D("toast.pasteAsSingleElement",{shortcut:ue("CtrlOrCmd+Shift+V")}),duration:5e3}),hk=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(t,{isExistingElement:n=!1}){let r=this.scene.getElementsMapIncludingDeleted(),i=(a,s)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(o=>o.id===t.id&&ke(o)?lt(o,{originalText:a,isDeleted:s??o.isDeleted,...LA(o,lr(o,r),r,a)}):o)])};jpe({id:t.id,canvas:this.canvas,getViewportCoords:(a,s)=>{let{x:o,y:c}=xa({sceneX:a,sceneY:s},this.state);return[o-this.state.offsetLeft,c-this.state.offsetTop]},onChange:yn(a=>{i(a,!1),D3(t)&&ci(t,this.scene.getNonDeletedElementsMap())}),onSubmit:yn(({viaKeyboard:a,nextOriginalText:s})=>{let o=!s.trim();if(i(s,o),!o&&a){let c=t.containerId?t.containerId:t.id;ar.flushSync(()=>{this.setState(d=>({selectedElementIds:At({...d.selectedElementIds,[c]:!0},d)}))})}o&&mA(this.scene.getNonDeletedElements(),[t]),(!o||n)&&this.store.shouldCaptureIncrement(),ar.flushSync(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&Qa(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),i(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,n){let r=this.getElementAtPosition(t,n,{includeBoundTextElement:!0});return r&&ke(r)&&!r.isDeleted?r:null}getElementAtPosition(t,n,r){let i=this.getElementsAtPosition(t,n,r==null?void 0:r.includeBoundTextElement,r==null?void 0:r.includeLockedElements);if(i.length>1){if(r!=null&&r.preferSelected){for(let s=i.length-1;s>-1;s--)if(this.state.selectedElementIds[i[s].id])return i[s]}let a=i[i.length-1];return pu({x:t,y:n,element:a,shape:ro(a,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:Ke(a)?this.frameNameBoundsCache.get(a):null})?a:i[i.length-2]}return i.length===1?i[0]:null}getElementsAtPosition(t,n,r=!1,i=!1){let a=[],s=this.scene.getNonDeletedElementsMap();return(r&&i?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(o=>(i||!o.locked)&&(r||!(ke(o)&&o.containerId)))).filter(o=>this.hitElement(t,n,o)).filter(o=>{let c=di(o,s);return c&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?qC({x:t,y:n},c,s):!0}).filter(o=>Ul(o)?(a.push(o),!1):!0).concat(a)}getElementHitThreshold(){return iV/this.state.zoom.value}hitElement(t,n,r,i=!0){if(i&&this.state.selectedElementIds[r.id]&&vL([r],this.state)){let a=HJ(r,this.scene.getNonDeletedElementsMap(),Lt(r)?0:this.getElementHitThreshold());if(t2(A(t,n),a))return!0}return HI(t,n,XI(r,this.scene.getNonDeletedElementsMap()))?!0:pu({x:t,y:n,element:r,shape:ro(r,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:Ke(r)?this.frameNameBoundsCache.get(r):null})}getTextBindableContainerAtPosition(t,n){let r=this.scene.getNonDeletedElements(),i=this.scene.getSelectedElements(this.state);if(i.length===1)return zc(i[0],!1)?i[0]:null;let a=null;for(let s=r.length-1;s>=0;--s){if(r[s].isDeleted)continue;let[o,c,d,l]=it(r[s],this.scene.getNonDeletedElementsMap());if(ht(r[s])&&pu({x:t,y:n,element:r[s],shape:ro(r[s],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){a=r[s];break}else if(o<t&&t<d&&c<n&&n<l){a=r[s];break}}return zc(a,!1)?a:null}handleHoverSelectedLinearElement(t,n,r){let i=this.scene.getNonDeletedElementsMap(),a=Me.getElement(t.elementId,i);if(a)if(this.state.selectedLinearElement){let s=-1,o=null;pu({x:n,y:r,element:a,shape:ro(a,this.scene.getNonDeletedElementsMap())})?(s=Me.getPointIndexUnderCursor(a,i,this.state.zoom,n,r),o=Me.getSegmentMidpointHitCoords(t,{x:n,y:r},this.state,this.scene.getNonDeletedElementsMap()),(Ie(a)?s===0||s===a.points.length-1:s>=0)||o?Bt(this.interactiveCanvas,Ot.POINTER):this.hitElement(n,r,a)&&Bt(this.interactiveCanvas,Ot.MOVE)):this.hitElement(n,r,a)&&(!Ie(a)||!(a.startBinding||a.endBinding))&&Bt(this.interactiveCanvas,Ot.MOVE),this.state.selectedLinearElement.hoverPointIndex!==s&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:s}}),Me.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,o)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:o}})}else Bt(this.interactiveCanvas,Ot.AUTO)}updateGestureOnPointerDown(t){It.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),It.pointers.size===2&&(It.lastCenter=R_(It.pointers),It.initialScale=this.state.zoom.value,It.initialDistance=D_(Array.from(It.pointers.values())))}initialPointerDownState(t){let n=qt(t,this.state),r=this.scene.getSelectedElements(this.state),[i,a,s,o]=Nt(r),c=r.findIndex(Ie)===0;return{origin:n,withCmdOrCtrl:t[q.CTRL_OR_CMD],originInGrid:wa(Pn(n.x,n.y,t[q.CTRL_OR_CMD]||c?null:this.getEffectiveGridSize())),scrollbars:O_(ky,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...n},originalElements:this.scene.getNonDeletedElements().reduce((d,l)=>(d.set(l.id,Ud(l)),d),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(s+i)/2,y:(o+a)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(n,r)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,n){if(!(n.scrollbars.isOverEither&&!this.state.multiElement))return!1;_y=!0,n.lastCoords.x=t.clientX,n.lastCoords.y=t.clientY;let r=xy(a=>{a.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(a,n)}),i=yn(()=>{bc=null,_y=!1,Qa(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",i),r.flush()});return bc=i,window.addEventListener("pointermove",r),window.addEventListener("pointerup",i),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,n){if(n.length<2)return!1;let r=this.getElementHitThreshold(),[i,a,s,o]=Nt(n);return t.x>i-r&&t.x<s+r&&t.y>a-r&&t.y<o+r}getCurrentItemRoundness(t){return this.state.currentItemRoundness==="round"?{type:vh(t)?Bn.ADAPTIVE_RADIUS:Bn.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(t,n,r=!1){Pl({event:t,app:this,selectedElements:n})&&(r||!eo.getReferenceSnapPoints())&&eo.setReferenceSnapPoints(Cte(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(t,n,r=!1){Pl({event:t,app:this,selectedElements:n})&&(r||!eo.getVisibleGaps())&&eo.setVisibleGaps(Ete(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(t){return yn(n=>{this.maybeHandleResize(t,n)||this.maybeDragNewGenericElement(t,n)})}onKeyUpFromPointerDownHandler(t){return yn(n=>{n.key===q.ALT&&n.preventDefault(),!this.maybeHandleResize(t,n)&&this.maybeDragNewGenericElement(t,n)})}onPointerMoveFromPointerDownHandler(t){return xy(n=>{var l,h,f,g,U,y;if(((l=this.state.openDialog)==null?void 0:l.name)==="elementLinkSelector")return;let r=qt(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[v,x]=Pn(r.x,r.y,n[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(w<0){let S=Me.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:v,y:x},this.state,this.scene.getNonDeletedElementsMap());w=S?Me.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,S,this.scene.getNonDeletedElementsMap()):-1}let C=Me.moveFixedSegment(this.state.selectedLinearElement,w,v,x,this.scene.getNonDeletedElementsMap());ar.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:C.segmentMidPointHoveredCoords,pointerDownState:C.pointerDownState}})});return}let i=this.lastPointerMoveCoords??t.origin;if(this.lastPointerMoveCoords=r,t.drag.offset===null&&(t.drag.offset=wa(Fre(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(n.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(n,t))return;if(ts(this.state)){this.handleEraser(n,t,r);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(r.x,r.y);let[a,s]=Pn(r.x,r.y,n[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!t.drag.hasOccurred&&(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")&&Rt(A(r.x,r.y),A(t.origin.x,t.origin.y))<wc)return;if(t.resize.isResizing&&(t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeHandleCrop(t,n)||this.maybeHandleResize(t,n)))return!0;let o=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let v=this.state.editingLinearElement||this.state.selectedLinearElement;if(Me.shouldAddMidpoint(this.state.selectedLinearElement,r,this.state,o)){let x=Me.addMidpoint(this.state.selectedLinearElement,r,this,!n[q.CTRL_OR_CMD],o);if(!x)return;ar.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:x.pointerDownState,selectedPointsIndices:x.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:x.pointerDownState,selectedPointsIndices:x.selectedPointsIndices}})});return}else if(v.pointerDownState.segmentMidpoint.value!==null&&!v.pointerDownState.segmentMidpoint.added)return;if(Me.handlePointDragging(n,this,r.x,r.y,(x,w)=>{this.maybeSuggestBindingsForLinearElementAtCoords(x,w)},v,this.scene)){t.lastCoords.x=r.x,t.lastCoords.y=r.y,t.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let c=t.hit.allHitElements.some(v=>this.isASelectedElement(v)),d=this.state.editingLinearElement&&n.shiftKey&&this.state.editingLinearElement.elementId===((h=t.hit.element)==null?void 0:h.id);if((c||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!d){let v=this.scene.getSelectedElements(this.state);if(v.every(S=>S.locked))return;let x=v.find(S=>Ke(S)),w=this.getTopLayerFrameAtSceneCoords(r),C=w&&!x?w:null;if(this.state.frameToHighlight!==C&&ar.flushSync(()=>{this.setState({frameToHighlight:C})}),t.drag.hasOccurred=!0,v.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&((f=this.state.activeEmbeddable)==null?void 0:f.state)!=="active"){let S={x:r.x-t.origin.x,y:r.y-t.origin.y},T=[...t.originalElements.values()],M=n.shiftKey;if(M){let P=Math.abs(S.x),j=Math.abs(S.y),N=M&&P<j,F=M&&P>j;N&&(S.x=0),F&&(S.y=0)}if(this.state.croppingElementId){let P=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(P&&Lt(P)&&P.crop!==null&&t.hit.element===P){let j=P.crop,N=zi(P)&&((g=this.imageCache.get(P.fileId))==null?void 0:g.image);if(N&&!(N instanceof Promise)){let F=wn(hr(r.x-i.x,r.y-i.y),Math.max(this.state.zoom.value,2)),[B,G,W,X,$,Y]=it(P,o),H=Fe(oe(A(B,G),A($,Y),P.angle)),Z=Fe(oe(A(W,G),A($,Y),P.angle)),V=Fe(oe(A(B,X),A($,Y),P.angle)),te=_r(Yg(Z,H)),ce=_r(Yg(V,H)),be=hr(_E(F,te),_E(F,ce)),fe={...j,x:mt(j.x-be[0]*Math.sign(P.scale[0]),0,N.naturalWidth-j.width),y:mt(j.y-be[1]*Math.sign(P.scale[1]),0,N.naturalHeight-j.height)};he(P,{crop:fe});return}}}this.maybeCacheVisibleGaps(n,v),this.maybeCacheReferenceSnapPoints(n,v);let{snapOffset:_,snapLines:R}=Ste(T,S,this,n,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:R}),this.state.editingFrame||Nre(t,v,S,this.scene,_,n[q.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(v.length!==1||!Ie(v[0]))&&this.setState({suggestedBindings:Fb(v,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),n.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let P=[],j=[],N=new Map,F=new Map,B=t.hit.element,G=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map($=>$.id)),W=this.scene.getElementsIncludingDeleted();for(let $ of W){let Y=G.has($.id)||$.id===(B==null?void 0:B.id)&&t.hit.wasAddedToSelection;if(Math.abs($.x)>1e7||Math.abs($.x)>1e7||Math.abs($.width)>1e7||Math.abs($.height)>1e7){console.error("Alt+dragging element in scene with invalid dimensions",$.x,$.y,$.width,$.height,Y);return}if(Y){let H=jA(this.state.editingGroupId,N,$);if(Math.abs(H.x)>1e7||Math.abs(H.x)>1e7||Math.abs(H.width)>1e7||Math.abs(H.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",H.x,H.y,H.width,H.height);return}let Z=t.originalElements.get($.id);if(Math.abs(Z.x)>1e7||Math.abs(Z.x)>1e7||Math.abs(Z.width)>1e7||Math.abs(Z.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",Z.x,Z.y,Z.width,Z.height);return}he(H,{x:Z.x,y:Z.y}),t.originalElements.set(H.id,H),P.push(H),j.push($),F.set($.id,H.id)}else P.push($)}let X=[...P,...j];X=((y=(U=this.props).onDuplicate)==null?void 0:y.call(U,X,W))||X,xs(X,Qe(j)),SA(P,j,F),pA(X,j,F,"duplicatesServeAsOld"),cL(X,j,F),this.scene.replaceAllElements(X),this.maybeCacheVisibleGaps(n,v,!0),this.maybeCacheReferenceSnapPoints(n,v,!0)}return}}if(this.state.selectionElement)t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeDragNewGenericElement(t,n);else{let v=this.state.newElement;if(!v)return;if(v.type==="freedraw"){let x=v.points,w=r.x-v.x,C=r.y-v.y,S=x.length>0&&x[x.length-1];if(!(S&&S[0]===w&&S[1]===C)){let T=v.simulatePressure?v.pressures:[...v.pressures,n.pressure];he(v,{points:[...x,A(w,C)],pressures:T},!1),this.setState({newElement:v})}}else if(rt(v)){t.drag.hasOccurred=!0;let x=v.points,w=a-v.x,C=s-v.y;yp(n)&&x.length===2&&({width:w,height:C}=L3(v.x,v.y,r.x,r.y)),x.length===1?he(v,{points:[...x,A(w,C)]},!1):(x.length===2||x.length>1&&Ie(v))&&he(v,{points:[...x.slice(0,-1),A(w,C)]},!1,{isDragging:!0}),this.setState({newElement:v}),ls(v,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(v,[r],this.state.startBoundElement)}else t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeDragNewGenericElement(t,n,!1)}if(this.state.activeTool.type==="selection"){t.boxSelection.hasOccurred=!0;let v=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)Me.handleBoxSelection(n,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let x=!0;!n.shiftKey&&$n(v,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(C=>Pr({...C,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),C,this)):x=!1);let w=this.state.selectionElement?G7(v,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(C=>{let S={...x&&C.selectedElementIds,...w.reduce((T,M)=>(T[M.id]=!0,T),{})};return t.hit.element&&(w.length?delete S[t.hit.element.id]:S[t.hit.element.id]=!0),C=x?C:{...C,selectedGroupIds:{},editingGroupId:null},{...Pr({editingGroupId:C.editingGroupId,selectedElementIds:S},this.scene.getNonDeletedElements(),C,this),selectedLinearElement:w.length===1&&rt(w[0])?new Me(w[0]):null,showHyperlinkPopup:w.length===1&&(w[0].link||ti(w[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,n){if(n.scrollbars.isOverHorizontal){let r=t.clientX,i=r-n.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-i/this.state.zoom.value}),n.lastCoords.x=r,!0}if(n.scrollbars.isOverVertical){let r=t.clientY,i=r-n.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-i/this.state.zoom.value}),n.lastCoords.y=r,!0}return!1}onPointerUpFromPointerDownHandler(t){return yn(n=>{var y,v,x,w,C,S,T,M,_,R,P,j;this.removePointer(n),t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:r,resizingElement:i,croppingElementId:a,multiElement:s,activeTool:o,isResizing:c,isRotating:d,isCropping:l}=this.state;this.setState(N=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:Mf(N.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,eo.setReferenceSnapPoints(null),eo.setVisibleGaps(null),this.savePointer(n.clientX,n.clientY,"up"),this.setState({selectedElementsAreBeingDragged:!1});let h=this.scene.getNonDeletedElementsMap();if(t.drag.hasOccurred&&((v=(y=t.hit)==null?void 0:y.element)!=null&&v.id)){let N=h.get(t.hit.element.id);Ra(N)&&((x=N.boundElements)==null||x.filter(F=>F.type==="arrow").map(F=>h.get(F.id)).filter(F=>Ie(F)).forEach(F=>{F&&he(F,{},!0)}))}if(this.state.editingLinearElement)if(!t.boxSelection.hasOccurred&&((C=(w=t.hit)==null?void 0:w.element)==null?void 0:C.id)!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(fa);else{let N=Me.handlePointerUp(n,this.state.editingLinearElement,this.state,this.scene);N!==this.state.editingLinearElement&&this.setState({editingLinearElement:N,suggestedBindings:[]})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let N=Me.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());N&&he(N,{},!0)}if(((T=(S=t.hit)==null?void 0:S.element)==null?void 0:T.id)!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let N=Me.handlePointerUp(n,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:F,endBindingElement:B}=N,G=this.scene.getElement(N.elementId);ls(G)&&bU(G,F,B,h,this.scene),N!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...N,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener("pointermove",t.eventListeners.onMove),window.removeEventListener("pointerup",t.eventListeners.onUp),window.removeEventListener("keydown",t.eventListeners.onKeyDown),window.removeEventListener("keyup",t.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),(_=(M=this.props)==null?void 0:M.onPointerUp)==null||_.call(M,o,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,n),(r==null?void 0:r.type)==="freedraw"){let N=qt(n,this.state),F=r.points,B=N.x-r.x,G=N.y-r.y;B===F[0][0]&&G===F[0][1]&&(G+=1e-4,B+=1e-4);let W=r.simulatePressure?[]:[...r.pressures,n.pressure];he(r,{points:[...F,A(B,G)],pressures:W,lastCommittedPoint:A(B,G)}),this.actionManager.executeAction(fa);return}if(Lt(r)){let N=r;try{this.initializeImageDimensions(N),this.setState({selectedElementIds:At({[N.id]:!0},this.state)},()=>{this.actionManager.executeAction(fa)})}catch(F){console.error(F),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter(B=>B.id!==N.id)),this.actionManager.executeAction(fa)}return}if(rt(r)){r.points.length>1&&this.store.shouldCaptureIncrement();let N=qt(n,this.state);!t.drag.hasOccurred&&r&&!s?(he(r,{points:[...r.points,A(N.x-r.x,N.y-r.y)]}),this.setState({multiElement:r,newElement:r})):t.drag.hasOccurred&&!s&&(jc(this.state)&&ls(r,!1)&&w3(r,this.state,N,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),o.locked?this.setState(F=>({newElement:null})):(ma(this.interactiveCanvas),this.setState(F=>({newElement:null,activeTool:Ln(this.state,{type:"selection"}),selectedElementIds:At({...F.selectedElementIds,[r.id]:!0},F),selectedLinearElement:new Me(r)}))),this.scene.triggerUpdate());return}if(ke(r)){let N=t7($t({fontSize:r.fontSize,fontFamily:r.fontFamily}),r.lineHeight);r.width<N&&he(r,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(r,{isExistingElement:!0})}if(o.type!=="selection"&&r&&th(r)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(N=>N.id!==r.id),appState:{newElement:null},captureUpdate:se.NEVER});return}if(Ke(r)){let N=Ure(this.scene.getElementsIncludingDeleted(),r,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(wp(this.scene.getElementsMapIncludingDeleted(),N,r,this.state))}if(r&&(he(r,UL(r)),this.scene.triggerUpdate()),t.drag.hasOccurred){let N=qt(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let F=this.scene.getElement(this.state.selectedLinearElement.elementId);if(F!=null&&F.frameId){let B=di(F,h);B&&F&&(Ol(F,B,this.scene.getNonDeletedElementsMap())||(he(F,{groupIds:[]}),IU([F],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let F=this.getTopLayerFrameAtSceneCoords(N),B=this.scene.getSelectedElements(this.state),G=this.scene.getElementsMapIncludingDeleted(),W=X=>{if(X.length>0){for(let $ of X){let Y=$.groupIds.indexOf(this.state.editingGroupId);he($,{groupIds:$.groupIds.slice(0,Y)},!1)}G.forEach($=>{$.groupIds.length&&en(G,$.groupIds[$.groupIds.length-1]).length<2&&he($,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if(F&&!this.state.selectedElementIds[F.id]){let X=B.filter($=>$.frameId!==F.id&&f2($,G,this.state));this.state.editingGroupId&&W(X),G=wp(G,X,F,this.state)}else if(!F&&this.state.editingGroupId){let X=B.filter($=>$.frameId&&!f2($,G,this.state));W(X)}G=eh(G,this.state,this),this.scene.replaceAllElements(G)}}if(i&&this.store.shouldCaptureIncrement(),i&&th(i)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(N=>N.id!==i.id),captureUpdate:se.NEVER}),t.resize.isResizing){let N=eh(this.scene.getElementsIncludingDeleted(),this.state,this),F=this.scene.getSelectedElements(this.state).filter(B=>Ke(B));for(let B of F)N=hL(N,fg(this.scene.getElementsIncludingDeleted(),B,this.state,h),B,this);this.scene.replaceAllElements(N)}let f=t.hit.element;((R=this.state.selectedLinearElement)==null?void 0:R.elementId)!==(f==null?void 0:f.id)&&rt(f)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new Me(f)}),(!a||a&&(!f&&!l||f&&f.id!==a))&&this.finishImageCropping();let g=this.lastPointerDownEvent,U=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(ts(this.state)&&g&&U){if(this.eraserTrail.endPath(),Rt(A(g.clientX,g.clientY),A(U.clientX,U.clientY))===0){let N=qt({clientX:U.clientX,clientY:U.clientY},this.state);this.getElementsAtPosition(N.x,N.y).forEach(F=>this.elementsPendingErasure.add(F.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(f&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!t.boxSelection.hasOccurred)&&(n.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[f.id]?yA(this.state,f)?this.setState(N=>{let F={...N.selectedElementIds};for(let B of f.groupIds.flatMap(G=>en(this.scene.getNonDeletedElements(),G)))delete F[B.id];return{selectedGroupIds:{...N.selectedElementIds,...f.groupIds.map(B=>({[B]:!1})).reduce((B,G)=>({...B,...G}),{})},selectedElementIds:At(F,N)}}):(P=this.state.selectedLinearElement)!=null&&P.isDragging||this.setState(N=>{let F={...N.selectedElementIds};delete F[f.id];let B=ut(this.scene.getNonDeletedElements(),{selectedElementIds:F});return{...Pr({editingGroupId:N.editingGroupId,selectedElementIds:F},this.scene.getNonDeletedElements(),N,this),selectedLinearElement:B.length===1&&rt(B[0])?new Me(B[0]):N.selectedLinearElement}}):f.frameId&&this.state.selectedElementIds[f.frameId]?this.setState(N=>{var B;let F={...N.selectedElementIds,[f.id]:!0};return delete F[f.frameId],(((B=this.scene.getElement(f.frameId))==null?void 0:B.groupIds)??[]).flatMap(G=>en(this.scene.getNonDeletedElements(),G)).forEach(G=>{delete F[G.id]}),{...Pr({editingGroupId:N.editingGroupId,selectedElementIds:F},this.scene.getNonDeletedElements(),N,this),showHyperlinkPopup:f.link||ti(f)?"info":!1}}):this.setState(N=>({selectedElementIds:At({...N.selectedElementIds,[f.id]:!0},N)})):this.setState(N=>{var F;return{...Pr({editingGroupId:N.editingGroupId,selectedElementIds:{[f.id]:!0}},this.scene.getNonDeletedElements(),N,this),selectedLinearElement:rt(f)&&((F=N.selectedLinearElement)==null?void 0:F.elementId)!==f.id?new Me(f):N.selectedLinearElement}})),!(f&&Ie(f))&&!t.drag.hasOccurred&&!this.state.isResizing&&(f&&ree({x:t.origin.x,y:t.origin.y,element:f,shape:ro(f,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:Ke(f)?this.frameNameBoundsCache.get(f):null},h)||!f&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),Bt(this.interactiveCanvas,Ot.AUTO);return}if(!o.locked&&o.type!=="freedraw"&&r&&this.setState(N=>({selectedElementIds:At({...N.selectedElementIds,[r.id]:!0},N),showHyperlinkPopup:ti(r)&&!r.link?"editor":N.showHyperlinkPopup})),(o.type!=="selection"||$n(this.scene.getNonDeletedElements(),this.state)||!pr(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),t.drag.hasOccurred||c||d||l){let N=this.scene.getSelectedElements(this.state).filter(rt);i2(N,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,jc(this.state),((j=this.state.selectedLinearElement)==null?void 0:j.selectedPointsIndices)??[],this.state.zoom)}if(o.type==="laser"){this.laserTrails.endPath();return}!o.locked&&o.type!=="freedraw"?(ma(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:Ln(this.state,{type:"selection"})})):this.setState({newElement:null,suggestedBindings:[]}),f&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&&It.pointers.size<=1&&Hi(f)&&this.isIframeLikeElementCenter(f,this.lastPointerUpEvent,t.origin.x,t.origin.y)&&this.handleEmbeddableCenterClick(f)})}clearSelection(t){this.setState(n=>({selectedElementIds:At({},n),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:n.editingGroupId&&t!=null&&t1(t,n.editingGroupId)?n.editingGroupId:null})),this.setState({selectedElementIds:At({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(t,n,r,i){if(i){let a=i.x+i.width/2,s=i.y+i.height/2,o=Bb(i,r,this.scene.getNonDeletedElementsMap());if(o&&(a=o.x,s=o.y),Math.hypot(t-a,n-s)<tV){let{x:c,y:d}=xa({sceneX:a,sceneY:s},r);return{viewportX:c,viewportY:d,elementCenterX:a,elementCenterY:s}}}}getCanvasOffsets(){var t;if((t=this.excalidrawContainerRef)!=null&&t.current){let n=this.excalidrawContainerRef.current,{left:r,top:i}=n.getBoundingClientRect();return{offsetLeft:r,offsetTop:i}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){let t=xv.find(n=>n.code===this.props.langCode)||Ch;await ZD(t),this.setAppState({})}},Hpe=()=>{(dt.MODE===si.TEST||dt.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene.getElementsIncludingDeleted()},set(e){var t;return(t=this.app)==null?void 0:t.scene.replaceAllElements(xo(e))}},scene:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene}}}))};Hpe();var Wpe=zpe,Xpe=()=>{Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML="",this.append(...e)})},Vpe=Xpe,Ype=()=>m.jsx("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:m.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),Gpe=()=>m.jsxs("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[m.jsx("path",{d:"M429.27 96.74c2.47-1.39 4.78-3.02 6.83-4.95 1.43-1.35 2.73-2.86 3.81-4.51-.66.9-1.4 1.77-2.23 2.59-2.91 2.84-5.72 5.09-8.42 6.87h.01ZM343.6 69.36c.33 3.13.58 6.27.79 9.4.09 1.37.18 2.75.25 4.12-.12-4.46-.27-8.93-.5-13.39-.11-2.08-.24-4.16-.4-6.24-.06 1.79-.11 3.85-.13 6.11h-.01ZM378.47 98.34c.01-.37.07-1.13.01-6.51-.11 1.9-.22 3.81-.31 5.71-.07 1.42-.22 2.91-.16 4.35.39.03.78.07 1.17.1-.92-.85-.76-2.01-.72-3.66l.01.01ZM344.09 86.12c-.09-2.41-.22-4.83-.39-7.24v12.21c.15-.05.32-.09.47-.14.05-1.61-.03-3.23-.09-4.83h.01ZM440.69 66.79c-.22-.34-.45-.67-.69-.99-3.71-4.87-9.91-7.14-15.65-8.55-1.05-.26-2.12-.49-3.18-.71 2.29.59 4.48 1.26 6.64 2.02 7.19 2.54 10.57 5.41 12.88 8.23ZM305.09 72.46l1.2 3.6c.84 2.53 1.67 5.06 2.46 7.61.24.78.5 1.57.73 2.36.22-.04.44-.08.67-.12a776.9 776.9 0 0 1-5.01-13.57c-.02.04-.03.09-.05.13v-.01ZM345.49 90.25v.31c1.48-.42 3.05-.83 4.66-1.2-1.56.25-3.12.52-4.66.89ZM371.02 90.22c0-.57-.04-1.14-.11-1.71-.06-.02-.12-.04-.19-.05-.21-.05-.43-.08-.65-.11.42.16.74.88.95 1.87ZM398.93 54.23c-.13 0-.27-.01-.4-.02l.03.4c.11-.15.23-.27.37-.38ZM401.57 62.28v-.15c-1.22-.24-2.86-.61-3.23-1.25-.09-.15-.18-.51-.27-.98-.09.37-.2.73-.33 1.09 1.24.56 2.52.98 3.83 1.29ZM421.73 88.68c-2.97 1.65-6.28 3.12-9.69 3.68v.18c4.72-.14 11.63-3.85 16.33-8.38-2.04 1.75-4.33 3.24-6.63 4.53l-.01-.01ZM411.28 80.92c-.05-1.2-.09-2.4-.15-3.6-.21 5.66-.46 11.38-.47 14.51.24-.02.48-.04.71-.07.15-3.61.05-7.23-.09-10.83v-.01Z",transform:"translate(-144.023 -51.76)"}),m.jsx("path",{d:"M425.38 67.41c-3.5-1.45-7.19-2.57-14.06-3.62.09 1.97.06 4.88-.03 8.12.03.04.06.09.06.15.19 1.36.28 2.73.37 4.1.25 3.77.39 7.55.41 11.33 0 1.38-.01 2.76-.07 4.13 1.4-.25 2.78-.65 4.12-1.15 4.07-1.5 7.94-3.78 11.28-6.54 2.33-1.92 5.13-4.49 5.88-7.58.63-3.53-2.45-6.68-7.97-8.96l.01.02ZM411.35 92.53v-.06l-.34.03c.11.01.22.03.34.03ZM314.26 64.06c-.23-.59-.47-1.17-.7-1.75.57 1.62 1.11 3.25 1.6 4.9l.15.54 2.35 6.05c.32.82.66 1.64.98 2.46-1.38-4.1-2.83-8.17-4.39-12.2h.01ZM156.82 103.07c-.18.13-.38.23-.58.33 1.32-.03 2.66-.2 3.93-.34.86-.09 1.72-.22 2.58-.33-2.12.1-4.12.17-5.94.34h.01ZM210.14 68.88s.03.04.05.07c.18-.31.39-.64.58-.96-.21.3-.42.6-.64.89h.01ZM201.65 82.8c-.5.77-1.02 1.56-1.49 2.37 1.11-1.55 2.21-3.1 3.2-4.59-.23.23-.49.51-.75.79-.32.47-.65.95-.96 1.43ZM194.03 98.66c-.33-.4-.65-.84-1.05-1.17-.24-.2-.07-.49.17-.56-.23-.26-.42-.5-.63-.75 1.51-2.55 3.93-5.87 6.4-9.28-.17-.08-.29-.28-.2-.49.04-.09.09-.17.13-.26-1.21 1.78-2.42 3.55-3.61 5.33-.87 1.31-1.74 2.64-2.54 4-.29.5-.63 1.04-.87 1.61.81.65 1.63 1.27 2.47 1.88-.09-.11-.18-.21-.27-.32v.01ZM307.79 82.93c-1-3.17-2.05-6.32-3.1-9.48-1.62 4.08-3.69 9.17-6.16 15.19 3.32-1.04 6.77-1.87 10.27-2.5-.32-1.08-.67-2.15-1.01-3.21ZM149.5 80.7c.05-1.71.04-3.43 0-5.14-.1 2.26-.16 4.51-.22 6.77-.02.73-.03 1.46-.04 2.19.14-1.27.2-2.55.24-3.82h.02ZM228.98 98.3c.39 1.25.91 3.03.94 3.91.06-.03.12-.07.17-.1.08-1.29-.55-2.65-1.11-3.81ZM307.72 53.36c.81.5 1.53 1.04 2.07 1.49-.38-.8-.78-1.58-1.21-2.35-.17.03-.34.06-.51.11-.43.12-.86.26-1.29.41.35-.01.53.1.94.34ZM283.69 96.14c3.91-7.25 6.89-13.35 8.88-18.15l1.1-2.66c-1.27 2.64-2.56 5.27-3.83 7.9-1.53 3.15-3.06 6.31-4.58 9.47-.87 1.81-1.76 3.62-2.54 5.47.04.02.07.04.11.07.05.05.1.09.15.14.05-.73.27-1.48.71-2.24ZM289.92 103.23s-.04.01-.05.03c0-.02.04-.03.05-.04.05-.05.11-.1.16-.15l.21-.21c-.55 0-1.5-.27-2.55-.72.4.26.8.51 1.22.74.24.13.48.26.73.37.05.02.1.03.14.05a.27.27 0 0 1 .08-.07h.01ZM269.23 68.49c-.39-.19-.82-.48-1.33-.87-3.06-1.56-6.31-2.78-9.36-2.35-3.5.49-5.7 1.11-7.74 2.44 5.71-2.6 12.82-2.07 18.44.79l-.01-.01ZM177.87 53.69l1.06.03c-.96-.22-2-.25-2.89-.3-4.95-.26-9.99.33-14.86 1.19-2.44.43-4.88.95-7.28 1.59 9.09-1.76 15.69-2.77 23.97-2.51ZM219.85 55.51c-.18.12-.36.27-.56.45-.45.53-.86 1.11-1.26 1.66-1.91 2.61-3.71 5.31-5.57 7.95l-.12.18 8.05-10.11c-.18-.05-.36-.1-.55-.13h.01ZM510.71 54.1c.12-.15.29-.3.53-.45.69-.4 3.72-.63 5.87-.74-.36-.02-.73-.04-1.09-.05-1.84-.03-3.67.09-5.49.35.05.3.12.59.18.88v.01ZM510.76 86.02c1.37-3.07 2.49-6.27 3.57-9.46.55-1.64 1.12-3.3 1.6-4.97-1.59 4.01-3.67 9.14-6.2 15.3.24-.08.5-.14.74-.22.1-.22.19-.44.29-.65ZM566.95 75.76c.11-.02.23.03.31.11-.05-.13-.09-.26-.14-.39-.05.09-.11.18-.17.28ZM511.33 86.41c3.08-.89 6.24-1.62 9.46-2.14-1.51-3.98-2.98-7.96-4.39-11.87-.05.15-.09.31-.14.46-1.02 3.32-2.15 6.61-3.39 9.85-.48 1.25-.98 2.49-1.53 3.7h-.01ZM578.24 74.45c.11-.44.23-.87.35-1.31-.31.7-.64 1.39-.97 2.08.09.21.19.4.28.61.12-.46.23-.92.35-1.38h-.01ZM520.62 53.11c-.09 0-.18-.01-.28-.02.38.34.29 1.08.93 2.53l6.65 17.15c2.2 5.68 4.69 11.36 7.41 16.87l1.06 2.17c-2.95-7.05-5.92-14.08-8.87-21.13-1.58-3.79-3.16-7.59-4.7-11.4-.78-1.92-1.73-3.89-2.25-5.91-.03-.1 0-.19.04-.26h.01ZM578.78 77.87c1.45-5.77 3.07-10.43 3.58-13.36.05-.34.16-.88.31-1.55-.67 1.79-1.37 3.56-2.08 5.33-.12.43-.23.86-.35 1.29-.65 2.43-1.29 4.86-1.9 7.3.14.33.29.65.43 1l.01-.01ZM545.3 94.66c.02-.44.03-.83.05-1.12.02-1.01.05-2.02.11-3.02.03-6.66-.46-14.33-1.46-22.8-.13-.42-.27-1.24-.56-2.89 0-.02 0-.04-.01-.06.62 6.61.95 13.25 1.32 19.87.17 3.08.33 6.16.52 9.23.02.25.03.52.04.78l-.01.01ZM580.77 102.81c.13.2.27.38.37.49.27-.11.53-.22.8-.32-.43.09-.82.05-1.17-.16v-.01ZM530.48 104.07h.33c-.36-.13-.71-.32-1.04-.56.14.24.3.47.45.7.06-.08.14-.13.26-.13v-.01ZM542.63 58.82c.06.23.11.47.15.71.14-.33.36-.62.7-.86-.28.05-.57.11-.85.15ZM583.81 57.87c.15-.7.29-1.41.42-2.11-.14.45-.28.9-.42 1.34-.46 1.44-.89 2.89-1.31 4.34.44-1.19.88-2.37 1.31-3.57ZM523.62 91.48c-4.66 1.17-9.05 2.89-14.02 5.27 4.65-1.84 9.48-3.29 14.28-4.63-.09-.22-.17-.41-.26-.64ZM460.64 78.3c-.04-2.9-.11-5.81-.28-8.71-.1-1.68-.17-3.43-.5-5.09-.07.02-.14.03-.2.05.3 6.54.45 12.17.51 17.12.17-.07.34-.14.51-.2 0-1.06-.01-2.11-.03-3.17h-.01ZM470.63 63.24c-3.38-.26-6.81.32-10.1 1.1.41 2.01.47 4.14.57 6.18.18 3.55.25 7.11.27 10.67 3.31-1.38 6.5-3.12 9.3-5.35 1.96-1.56 3.86-3.41 5.02-5.66.73-1.41 1.19-3.22.26-4.65-1.09-1.7-3.46-2.14-5.32-2.29ZM460.29 63.68c1-.24 2.01-.46 3.04-.65-1.15.16-2.37.38-3.71.69v.13c.07-.02.15-.04.22-.05.11-.13.3-.18.45-.11v-.01ZM457.24 100.96c.43-.03.86-.07 1.29-.11.14-.49.27-.99.38-1.49-.44.7-1 1.23-1.67 1.6ZM482.88 104.98c-.18.23-.36.38-.55.47.14.09.27.19.4.28a70.76 70.76 0 0 0 4.37-4.63c.76-.89 1.52-1.81 2.19-2.77-.3-.27-.61-.53-.92-.79-.07 1.94-4.62 6.32-5.49 7.45v-.01Z",transform:"translate(-144.023 -51.76)"}),m.jsx("path",{d:"M474.36 63.31c-.4-.16-.84-.27-1.29-.37 1.56.42 3.08 1.22 3.76 2.74.62 1.4.32 2.95-.28 4.32.7-1.22.94-2.34.74-3.47-.24-1.33-1.19-2.54-2.93-3.21v-.01ZM477.34 89.18c-1.2-.81-2.4-1.62-3.6-2.42-.14.1-.26.19-.4.29 1.4.67 2.73 1.39 4 2.13ZM465.88 93.85c.37.25.74.5 1.1.75.46.32.92.65 1.38.97-1.57-1.2-2.01-1.61-2.49-1.72h.01ZM574.92 90.06c-2.28-5.21-4.93-11.13-5.67-12.26-.1-.15-1.57-3.01-1.63-3.08 0 0-.01.02-.02.02.4 1.37 1.09 2.69 1.65 3.99 2.14 4.95 4.36 9.86 6.67 14.73.6 1.26 1.21 2.52 1.83 3.78-.75-2.01-1.64-4.45-2.83-7.18ZM448.73 65.29c.1.2.22.38.34.57.22-.02.43-.06.65-.08v-.08c-.14-.05-.25 0-.99-.41ZM460.16 94.81c-.02.31-.06.59-.1.89-.03 1.71-.33 3.43-.79 5.07.15-.02.3-.03.45-.05.01-.04.02-.08.03-.11.09-.34.15-.69.2-1.03.17-1.07.25-2.16.33-3.24.05-.69.08-1.39.12-2.08-.27.1-.27.26-.24.57v-.02Z",transform:"translate(-144.023 -51.76)"}),m.jsx("path",{d:"m328.67 98.12-3.22-6.58c-1.29-2.63-2.53-5.29-3.72-7.97-.25-.85-.52-1.69-.79-2.53-.81-2.57-1.67-5.12-2.55-7.67-1.92-5.53-3.9-11.08-6.32-16.41-.72-1.58-1.46-3.44-2.63-4.79-.03-.17-.16-.29-.34-.36a.282.282 0 0 0-.23-.04c-.06-.01-.12 0-.18.01-.74.06-1.5.38-2.19.61-2.22.77-4.4 1.64-6.63 2.38-.03-.08-.06-.16-.09-.25-.15-.42-.82-.24-.67.19.03.09.07.19.1.28l-.18.06c-.36.11-.28.6 0 .68.18 1.18.63 2.36.98 3.49.03.09.06.17.08.26-.08.23-.17.46-.24.64-.37.98-.79 1.94-1.21 2.9-1.27 2.89-2.62 5.75-3.98 8.6-3.18 6.67-6.44 13.31-9.64 19.97-1.08 2.25-2.2 4.5-3.15 6.81-.13.32.24.5.5.37 1.34 1.33 2.84 2.5 4.4 3.57.65.44 1.31.87 2.01 1.24.4.22.86.48 1.33.5.24.01.35-.19.33-.37.11-.1.21-.21.28-.28.41-.41.81-.84 1.2-1.26.85-.92 1.69-1.87 2.5-2.84 6.31-2.34 12.6-4.31 18.71-5.84 2.14 5.3 3.43 8.43 3.97 9.58.55 1.05 1.15 1.88 1.82 2.52 1.32.56 6.96-.03 9.23-1.96.87-1.28 1.19-2.67.93-4.15-.09-.5-.22-.95-.4-1.33l-.01-.03Zm-20.09-45.61c.43.77.83 1.56 1.21 2.35-.54-.45-1.27-.99-2.07-1.49-.42-.24-.6-.35-.94-.34.43-.15.85-.29 1.29-.41.17-.05.34-.08.51-.11Zm-25.86 45.66c.78-1.85 1.67-3.66 2.54-5.47 1.51-3.16 3.05-6.31 4.58-9.47 1.28-2.63 2.56-5.26 3.83-7.9l-1.1 2.66c-1.99 4.79-4.97 10.9-8.88 18.15-.43.76-.66 1.51-.71 2.24-.05-.05-.1-.09-.15-.14a.259.259 0 0 0-.11-.07Zm6.24 4.71c-.42-.23-.82-.48-1.22-.74 1.05.45 2 .72 2.55.72l-.21.21c-.05.05-.11.1-.16.15-.01.01-.04.03-.05.04 0-.02.03-.02.05-.03a.27.27 0 0 0-.08.07c-.05-.02-.1-.03-.14-.05-.25-.1-.49-.24-.73-.37h-.01Zm15.73-29.43c1.05 3.15 2.1 6.31 3.1 9.48.34 1.06.69 2.13 1.01 3.21-3.5.63-6.95 1.46-10.27 2.5 2.48-6.03 4.54-11.11 6.16-15.19Zm4.79 12.57c-.23-.79-.49-1.58-.73-2.36-.79-2.54-1.63-5.08-2.46-7.61l-1.2-3.6c.02-.04.04-.09.05-.13 1.6 4.45 3.28 9 5.01 13.57l-.67.12v.01Zm5.83-18.27-.15-.54c-.49-1.64-1.03-3.28-1.6-4.9.23.58.47 1.17.7 1.75 1.56 4.03 3.01 8.1 4.39 12.2-.33-.82-.67-1.64-.98-2.46l-2.35-6.05h-.01ZM390.43 79.37c-.13-10.43-.22-17.5-.24-19.97-.24-1.6.21-2.88-.65-3.65-.14-.13-.32-.23-.52-.32h.03c.45 0 .45-.69 0-.7-1.75-.03-3.5-.04-5.25-.14-1.38-.08-2.76-.21-4.15-.31-.07 0-.12.01-.17.04-.21-.07-.47.03-.45.31l.03.45c-.11.14-.19.3-.22.5-.21 1.26-.32 13.67-.36 23.59-.32 5.79-.67 11.57-.97 17.36-.09 1.73-.29 3.54-.21 5.3-.39.02-.38.64.04.69v.12c.05.44.74.45.7 0v-.06c1.1.09 2.2.21 3.3.3 1.14.19 2.44.2 3.29.17 1.73-.05 2.92-.05 3.8-.37.45-.05.9-.11 1.35-.17.44-.06.25-.73-.19-.67h-.01c.24-.32.45-.72.62-1.25.66-1.84.41-6.36.34-11.33l-.13-9.9.02.01Zm-12.26 18.17c.09-1.91.2-3.81.31-5.71.06 5.38 0 6.14-.01 6.51-.05 1.65-.21 2.81.72 3.66-.39-.04-.78-.07-1.17-.1-.06-1.44.09-2.93.16-4.35l-.01-.01ZM588.97 53.85c-2.06-.25-3.17-.51-3.76-.6a.3.3 0 0 1 .04-.08c.22-.39-.39-.75-.6-.35-.56 1.02-.9 2.19-1.26 3.29-.61 1.88-1.17 3.78-1.72 5.68-.63 2.19-1.24 4.39-1.83 6.59-.81 2.03-1.67 4.05-2.61 6.03-1.7-3.64-3.11-6.04-4.03-7.57-2.26-3.74-2.85-5.48-3.57-6.08l.31-.09c.43-.12.25-.8-.19-.67-1.06.3-2.12.6-3.17.95-.93.32-1.85.69-2.76 1.07-.13.05-.19.16-.22.27-.04.02-.08.05-.11.07-.04-.06-.07-.12-.11-.18a.354.354 0 0 0-.48-.12c-.16.09-.22.32-.13.48l.33.54c0 .09.02.18.06.28.51 1.16.78 1.38.72 1.47-2.42 3.44-5.41 7.86-6.2 9.1-1.27 1.97-2.01 3.14-2.45 3.84l-.91-6.56-.43-4.1c-.19-1.85-.37-3.23-.53-4.13-.19-1.1-.3-2.15-.45-3.16-.2-1.36-.29-2.06-.47-2.42h.04c.45.02.45-.68 0-.7-3.43-.16-6.81.94-10.17 1.48-.24-.22-.73-.04-.58.32.24.59.33 1.25.43 1.87.17 1.06.29 2.13.4 3.2.32 3.09.53 6.2.74 9.3.44 6.75.77 13.51 1.17 20.26.11 1.95.13 3.96.46 5.89.05.3.37.31.55.14.74 1.71 2.87 1.27 6.13 1.27 1.34 0 2.39.04 2.99-.11.02.32.48.53.63.18 3.61-8.26 7.41-16.46 12.05-24.2.03-.05.04-.1.05-.15.3.73.64 1.45.94 2.16.97 2.26 1.97 4.52 2.98 6.76 2.26 5.03 4.54 10.07 7.09 14.96.47.9.94 1.79 1.47 2.65.2.32.4.67.66.96-.18.25 0 .68.34.54.91-.38 1.82-.75 2.76-1.07 1.04-.35 2.11-.65 3.17-.95.39-.11.28-.66-.07-.68.62-.4.95-.96.87-1.91-.3-3.34.72-7.47.86-8.52l2.14-11.43c1.75-10.74 3.13-17.51 3.23-20.86.02-.49.08-2.84.13-3.24.17-1.25.48-1-4.96-1.65l.03-.02Zm-46.19 5.67c-.04-.24-.09-.48-.15-.71l.85-.15c-.34.24-.56.53-.7.86Zm1.95 25.12c-.36-6.63-.7-13.26-1.32-19.87 0 .02 0 .04.01.06.29 1.65.44 2.47.56 2.89 1 8.46 1.5 16.14 1.46 22.8-.06.99-.1 2-.11 3.02-.01.29-.03.68-.05 1.12-.01-.26-.03-.53-.04-.78-.19-3.08-.35-6.16-.52-9.23l.01-.01Zm36.4 18.66c-.11-.11-.24-.29-.37-.49.35.21.74.26 1.17.16-.27.11-.53.22-.8.32v.01Zm-.89-33.72c.12-.43.23-.86.35-1.29.71-1.77 1.41-3.55 2.08-5.33-.15.68-.26 1.22-.31 1.55-.5 2.94-2.13 7.59-3.58 13.36-.15-.35-.29-.66-.43-1 .61-2.44 1.25-4.87 1.9-7.3l-.01.01Zm3.56-12.48c.14-.44.28-.89.42-1.34-.13.7-.27 1.41-.42 2.11-.43 1.19-.86 2.38-1.31 3.57.42-1.45.85-2.9 1.31-4.34Zm-5.22 16.05c-.11.44-.23.87-.35 1.31-.12.46-.23.92-.35 1.38-.1-.22-.19-.4-.28-.61.34-.69.66-1.38.97-2.08h.01Zm-11.64 2.62c.06-.1.12-.19.17-.28.05.13.09.26.14.39a.398.398 0 0 0-.31-.11Zm2.3 2.98c-.56-1.3-1.25-2.63-1.65-3.99 0 0 .01-.02.02-.02.06.08 1.52 2.93 1.63 3.08.73 1.13 3.38 7.04 5.67 12.26 1.2 2.73 2.08 5.17 2.83 7.18-.62-1.25-1.23-2.51-1.83-3.78-2.31-4.87-4.53-9.78-6.67-14.73ZM275.92 87.03c-1.06-2.18-1.13-3.45-2.44-2.93-1.52.57-2.94 1.3-4.5 2.1-1.4.72-2.68 1.44-3.92 2.12.01-.25-.24-.5-.51-.34-4.8 2.93-12.41 4.7-17.28 1.31-1.98-1.77-3.32-4.15-3.97-5.78-.29-.95-.49-1.94-.63-2.93-.14-3.34 1.58-6.53 3.9-9.12.8-.79 1.68-1.51 2.66-2.12 3.7-2.3 8.22-3.07 12.51-2.51 2.71.35 5.32 1.24 7.71 2.55.39.22.75-.39.35-.6-.18-.1-.37-.18-.55-.27.56.27 1.03.33 1.51.19l-.48.39c-.15.11-.23.3-.13.48.09.15.33.24.48.13 1.3-.97 2.46-2.09 3.45-3.37.37-.29.64-.6.65-.97v-.02c.08-.33-.03-.7-.21-1.08-.31-.87-.98-2.01-2.19-3.26-2.43-2.52-3.79-3.45-5.68-4.26-1.14-.49-3.12-1.06-4.42-1.23-3.28-.42-10.64-1.21-18.18 4.11-7.74 5.46-11.94 12.3-12.23 20.61-.08 2.06.04 3.98.34 5.71.74 4.18 2.57 8 5.44 11.34 4.26 4.99 9.76 7.52 16.34 7.52 4.85 0 9.69-1.77 14.89-4.62.23-.12.45-.23.68-.35 2.19-1.1 4.37-2.23 6.46-3.5.49-.3 1.03-.61 1.5-.98 1.47-.87 1.11-1.12.49-2.95-.39-1.14-.76-2.7-2.06-5.36l.02-.01Zm-17.38-21.76c3.05-.42 6.31.79 9.36 2.35.51.39.94.68 1.33.87-5.61-2.86-12.72-3.39-18.44-.79 2.05-1.33 4.24-1.95 7.74-2.44l.01.01ZM443.67 72.67c-.4-2.2-1.15-4.33-2.37-6.22-1.49-2.32-3.58-4.19-5.91-5.64-6.17-3.81-13.75-5.11-20.83-6.01-3.23-.41-6.47-.69-9.72-.92l-1.39-.12c-.85-.07-1.52-.1-2.05-.1-1.08-.06-2.17-.12-3.25-.17-.08 0-.14.02-.19.05-.1.05-.18.14-.16.3.27 2.55-.01 5.12-.92 7.52-.15.38.4.56.62.28 1.32.59 2.68 1.05 4.08 1.37 0 2.78-.14 7.58-.33 12.91 0 0 0 .02-.01.03-.61 3.66-.79 7.42-1 11.12-.23 4.01-.43 8.03-.44 12.05 0 .64 0 1.28.03 1.93.02.31 0 .68.15.96.06.11.14.16.24.17-.2.17-.21.54.11.59 3.83.67 7.78.71 11.68.25 2.3-.19 4.87-.65 7.65-1.56 1.85-.54 3.67-1.18 5.43-1.91 7.2-3.02 14.31-8.07 17.35-15.53.76-1.86 1.17-3.8 1.31-5.75.3-1.93.28-3.82-.09-5.58l.01-.02Zm-19.32-15.42c5.74 1.41 11.94 3.68 15.65 8.55.25.32.47.65.69.99-2.3-2.82-5.68-5.69-12.88-8.23-2.16-.76-4.35-1.43-6.64-2.02 1.06.21 2.13.45 3.18.71Zm-25.82-3.04c.13 0 .27.01.4.02-.14.1-.26.23-.37.38 0-.13-.02-.26-.03-.4Zm34.82 22.17c-.75 3.09-3.55 5.66-5.88 7.58-3.35 2.76-7.21 5.03-11.28 6.54-1.33.49-2.71.9-4.12 1.15.06-1.38.08-2.76.07-4.13-.02-3.78-.16-7.56-.41-11.33-.09-1.37-.18-2.74-.37-4.1 0-.06-.03-.11-.06-.15.09-3.25.12-6.16.03-8.12 6.86 1.05 10.56 2.17 14.06 3.62 5.52 2.28 8.59 5.44 7.97 8.96l-.01-.02Zm-22 16.15c-.12 0-.23-.02-.34-.03l.34-.03v.06Zm-.69-.7c0-3.13.26-8.84.47-14.51.06 1.2.11 2.41.15 3.6.15 3.6.25 7.23.09 10.83-.24.03-.48.05-.71.07v.01Zm-12.33-30.94c.37.63 2.01 1.01 3.23 1.25v.15c-1.31-.31-2.59-.73-3.83-1.29.12-.36.23-.72.33-1.09.08.48.18.84.27.98Zm13.7 31.65v-.18c3.41-.56 6.71-2.02 9.69-3.68 2.31-1.28 4.59-2.78 6.63-4.53-4.69 4.53-11.61 8.24-16.33 8.38l.01.01Zm24.07-.75c-2.05 1.93-4.37 3.56-6.83 4.95 2.7-1.78 5.52-4.03 8.42-6.87.82-.82 1.56-1.69 2.23-2.59-1.08 1.65-2.38 3.16-3.81 4.51h-.01ZM187.16 92.14c-.79-2.47-2.1-7.12-3.1-6.87-.19-.01-2.09.77-4.08 1.54-3.06 1.18-5.91 2.13-10.09 2.82-2.74.42-5.87 1.01-10.61 1.06.04-3.34.05-6.01.05-7.99 7.97-.65 12.33-2.11 16.37-3.55 1.11-.39 2.69-1.01 2.63-1.8-.08-.35-.55-1.39-1.17-2.61-.47-1.16-.98-2.31-1.61-3.38-.42-.71-1.04-1.69-1.86-2.06-.11-.08-.22-.13-.29-.12-.02 0-.04 0-.07.01-.19-.04-.39-.05-.6-.01-.17.03-.24.15-.25.28-.04.02-.09.04-.14.05-4.33 1.48-8.85 2.33-13.24 3.61a499.1 499.1 0 0 0-.31-8.19c4.51-.99 8.88-1.38 13.11-1.82 3.68-.38 6.28.12 7.47.34.59.11.9.16 1.16.18h.1c-.1.37.44.66.62.28.02-.04.03-.08.05-.13.15.2.53.22.62-.1.17-.58.19-1.21.21-1.81v-.36c.03-.15.05-.3.07-.45.52-2.47.33-5.09-.64-7.44-.11-.27-.44-.28-.6-.14-.08-.21-.15-.42-.24-.62-.19-.41-.79-.05-.6.35.03.07.05.15.09.22-.98-.42-2.15-.54-3.17-.63-2.17-.19-4.37-.14-6.54 0-5.7.35-11.4 1.3-16.91 2.79-2.08.56-4.13 1.22-6.14 2-4.54 1.05-3.79 1.51-2.17 6.07.18.51.46 1.68.54 1.94.82 2.47 1.08 2.13 3.1 2.13s0 .05 0 .08h.52c-.48 2.66-.51 5.45-.62 8.13-.15 3.48-.22 6.96-.28 10.45 0 .41-.01.82-.02 1.23-.16.29-.33.57-.51.85-.05.38-.09.77-.14 1.18-.42 3.52-.59 6.48-.52 8.8v.34c.02.47.05.76.06.87.16 1.57-.26 3.47 1.35 3.79 1.61.32 3.5.55 4.85.55.11 0 .22-.02.33-.02 1.79.24 3.67.05 5.45-.12 2.85-.28 5.69-.7 8.51-1.19 3.03-.53 6.05-1.14 9.04-1.86 2.4-.58 4.82-1.19 7.13-2.06.51-.19 1.73-.57 2.46-1.14 1.81-.68 2.18-1 1.57-2.67-.23-.62-.48-1.49-.91-2.78l-.03-.02Zm-11.12-38.71c.89.05 1.93.08 2.89.3-.33 0-.68-.02-1.06-.03-8.28-.26-14.88.75-23.97 2.51 2.41-.64 4.85-1.16 7.28-1.59 4.87-.86 9.91-1.45 14.86-1.19Zm-26.53 22.13c.03 1.71.04 3.43 0 5.14-.04 1.27-.11 2.55-.24 3.82 0-.73.02-1.46.04-2.19.05-2.26.12-4.51.22-6.77h-.02Zm6.73 27.85c.2-.1.4-.21.58-.33 1.82-.17 3.82-.24 5.94-.34-.86.11-1.72.24-2.58.33-1.27.14-2.61.31-3.93.34h-.01ZM534.48 85.44c-3.52-8.38-7.07-16.75-10.5-25.17-.63-1.54-1.25-3.09-1.86-4.65-.31-.8-.65-1.6-.87-2.43-.04-.17-.17-.24-.31-.25.1-.2 0-.51-.29-.53-1.59-.08-3.18-.22-4.78-.25-1.96-.03-3.91.13-5.84.42-.31.05-.31.38-.13.56-.03.06-.05.14-.04.22.23 1.54.63 3.06 1.16 4.53.13.35.27.7.41 1.06l-2.68 6.18c-.11.03-.2.09-.25.22-.67 1.9-1.52 3.73-2.34 5.56a536.85 536.85 0 0 1-3.9 8.45c-2.64 5.64-5.34 11.25-7.91 16.93-.44.97-.88 1.94-1.29 2.93-.2.48-.47 1-.55 1.52v.05c-.02.12.02.26.16.34 1.19.73 2.41 1.41 3.66 2.05 1.2.62 2.45 1.25 3.76 1.61.43.12.62-.55.19-.67-1.13-.31-2.2-.83-3.24-1.36 1.09.36 2.1.69 2.75.93 2.82 1.01 2.38 1.1 4.3-3.75 2.1-1.09 4.34-1.96 6.53-2.79 4.35-1.64 8.8-3.03 13.27-4.29.82 2.01 1.77 3.97 2.72 5.92.35.83.62 1.45.79 1.82.22.42.45.8.69 1.15.17.33.33.67.5 1 .42.8.84 1.63 1.4 2.35.23.29.6 0 .55-.31 1.53-.02 3.06-.07 4.58-.27.92-.12 1.82-.32 2.71-.54 1.39-.27 3.85-1.11 3.74-1.42-.67-1.96-1.55-3.87-2.34-5.78-1.57-3.78-3.16-7.56-4.75-11.33v-.01Zm-11.65-26.16c1.54 3.81 3.12 7.6 4.7 11.4 2.94 7.05 5.91 14.09 8.87 21.13l-1.06-2.17c-2.71-5.51-5.2-11.19-7.41-16.87l-6.65-17.15c-.65-1.45-.55-2.19-.93-2.53.09 0 .18.01.28.02a.29.29 0 0 0-.04.26c.52 2.02 1.47 3.98 2.25 5.91h-.01Zm-6.58 13.58c.05-.15.09-.31.14-.46 1.41 3.92 2.88 7.9 4.39 11.87-3.22.52-6.38 1.25-9.46 2.14.55-1.22 1.05-2.46 1.53-3.7 1.24-3.24 2.37-6.53 3.39-9.85h.01Zm-.23-20c.36 0 .73.03 1.09.05-2.15.1-5.18.33-5.87.74-.24.15-.41.3-.53.45-.06-.29-.13-.58-.18-.88 1.82-.26 3.65-.39 5.49-.35v-.01Zm-.09 18.72c-.49 1.67-1.05 3.33-1.6 4.97-1.07 3.19-2.19 6.38-3.57 9.46-.09.21-.19.43-.29.65-.25.07-.5.14-.74.22 2.53-6.16 4.61-11.29 6.2-15.3Zm-6.34 25.16c4.97-2.38 9.37-4.1 14.02-5.27l.26.64c-4.8 1.35-9.63 2.8-14.28 4.63Zm20.17 6.76c.33.23.68.42 1.04.56h-.33c-.12 0-.21.06-.26.13-.15-.23-.31-.45-.45-.7v.01ZM226.57 91.75c-3.55-4.74-6.68-9.11-9.31-12.99 9.2-15.25 10.05-17.81 10.35-18.38.17-.34 1.09-2.27.64-2.53-1.13-.65-1.03-.65-2.97-1.71-1.19-.65-3.04-1.61-4.53-2.12-1.71-.59-1.24-.36-3 2.77-.06.1-.11.2-.17.3-.75 1.02-1.48 2.05-2.2 3.09-1.88 2.71-3.73 5.45-5.69 8.1-3.68-4.91-6.88-8.76-9.51-11.43-.15-.15-.3-.29-.46-.42-1.27-1.28-7.24 3.53-7.93 5.58-.09.09-.19.16-.28.25-.27.26.03.64.33.58.19.65.5 1.29.94 1.91 3.85 5.06 7.19 9.76 9.94 14-1.23 2.61-3.06 5-4.67 7.38l-2.28 3.33c-.5.66-.93 1.23-1.29 1.69-.67.93-2.09 2.61-2.3 3.87-.51.85-1.16 1.84-1.29 2.83-.06.44.61.63.67.19.01-.08.04-.15.06-.22 1.36 1.08 2.76 2.11 4.19 3.11 1.3.91 2.62 1.85 4.04 2.56.21.1.4 0 .48-.17.24.07.48.14.72.2.44.1.62-.57.19-.67-2.02-.48-3.77-1.57-5.23-3.02-.47-.46-.9-.96-1.32-1.46 1.74 1.35 4.2 2.89 5.89 4.14 1.39 1.03 2.85-2.27 4.22-4.2 1.86-2.64 3.96-5.86 5.52-8.29l10.39 14.51c.67.81 1.14 1.21 1.57 1.36-.05.24.12.51.41.4 1.53-.58 3.05-1.19 4.54-1.87 1.52-.69 3.06-1.45 4.36-2.5a.28.28 0 0 0 .12-.23c1.66-1.1.81-1.74-1.41-4.91-1.13-1.58-1.71-2.36-3.7-5.01l-.03-.02Zm2.41 6.54c.56 1.15 1.19 2.52 1.11 3.81-.06.04-.12.07-.17.1-.03-.88-.55-2.66-.94-3.91Zm-16.51-32.73c1.86-2.65 3.65-5.35 5.57-7.95.4-.55.81-1.13 1.26-1.66.19-.18.38-.33.56-.45.18.03.36.08.55.13l-8.05 10.11.12-.18h-.01ZM192.7 95.48c.79-1.37 1.66-2.69 2.54-4 1.19-1.79 2.4-3.56 3.61-5.33-.04.09-.09.17-.13.26-.1.22.03.41.2.49-2.47 3.42-4.89 6.73-6.4 9.28.21.24.4.48.63.75-.24.07-.4.36-.17.56.4.33.72.77 1.05 1.17.09.11.18.21.27.32-.84-.61-1.66-1.24-2.47-1.88.24-.57.58-1.11.87-1.61v-.01Zm7.46-10.32c.47-.81.98-1.59 1.49-2.37.31-.48.64-.95.96-1.43.26-.29.52-.56.75-.79-.99 1.48-2.09 3.03-3.2 4.59Zm10.03-16.22s-.03-.05-.05-.07c.22-.29.43-.59.64-.89-.2.32-.4.65-.58.96h-.01ZM371.54 87.96c-.01-.08-.01-.16-.03-.23-.06-.38-.58-.29-.66.03-.3-.05-.6-.08-.81-.11-1.14-.15-2.29-.19-3.44-.2 1.04-.09 2.09-.18 3.14-.23.45-.02.45-.72 0-.7-6.57.35-13.14 1.23-19.65 2.11-1.53.21-3.05.42-4.57.68-.01 0-.02.01-.04.01-.04-3.33-.13-6.66-.24-9.99-.19-5.7-.4-11.41-.88-17.1-.13-1.51-.23-3.07-.49-4.58 0-.25 0-.48-.02-.68-.06-1.19-.04-2.61-.68-2.78-.16-.07-.72-.16-1.5-.24.22-.17.16-.62-.2-.63-1.19-.04-2.39.09-3.57.23-1.2.14-2.41.32-3.59.6-.16-.1-.41-.06-.5.12-.06.02-.13.03-.19.05-.35.1-.29.55-.03.66-.26.6-.19 2.27-.21 3-.02.66-.66 33.73-.9 40.3-.03.65.06 1.12.04 1.45-.16 3.05.87 4.96 6.34 3.93 1.09-.08 2.75-.77 5.36-1.43 4.13-1.04 5.78-1.52 6.2-1.65 6.43-1.69 6.78-1.97 11.72-2.43.55-.05 4.8-.38 6.03-.3.64.04 1.19.07 1.65.1.09 0 .16-.03.24-.05.1.27.56.33.66-.02.39-1.32.61-2.71.78-4.08.2-1.61.29-3.24.15-4.86.24.03.52-.23.38-.53-.09-.2-.27-.33-.49-.43v-.02Zm-.63.56c.07.57.11 1.14.11 1.71-.21-.99-.53-1.71-.95-1.87.22.03.44.06.65.11.06.01.12.04.19.05Zm-25.41 1.73c1.54-.36 3.1-.64 4.66-.89-1.61.37-3.18.77-4.66 1.2v-.31Zm-.86-7.37c-.07-1.37-.16-2.75-.25-4.12-.21-3.13-.45-6.27-.79-9.4.02-2.25.08-4.31.13-6.11.16 2.08.29 4.16.4 6.24.23 4.46.38 8.93.5 13.39h.01Zm-.94-4c.16 2.41.29 4.83.39 7.24.06 1.6.14 3.22.09 4.83-.15.05-.32.09-.47.14V78.88h-.01ZM483.72 92.83c-3.05-2.28-6.22-4.4-9.38-6.51 8.86-6.49 13.49-12.95 13.73-19.23.04-.76 0-1.5-.13-2.2-.67-3.82-3.5-6.68-8.39-8.48.13.04.27.08.4.13 3.92 1.39 7.74 4.23 8.5 8.56.34 1.95-.05 3.96-.98 5.69-.21.4.39.75.6.35 1.86-3.46 1.46-7.55-.97-10.63-3.53-4.47-9.76-5.88-15.16-6.16-2.32-.12-4.64-.04-6.95.19-6 .32-12.71 1.68-17.63 3.21-.37.11-.67.23-.92.35-.2-.17-.62.02-.57.37v.03c-.64.68-.18 1.64.48 3.21.38.91.67 1.89 1.15 2.58.32.76.68 1.51 1.13 2.19.14.21.38.19.53.07.19-.02.38-.05.57-.08v1.57c-.06.06-.1.13-.11.23-.27 4.18-.34 8.38-.48 12.57l-.3 9.03c-.24 3.91-.44 6.77-.46 7.26-.05.88-.11 1.95.07 2.81-.01.22-.02.43-.04.65 0 .11-.02.23-.03.35 0 .05-.03.27-.01.16-.05.4.5.59.64.28.05.04.12.08.2.08 1.75.13 3.5.28 5.25.3 1.69.02 3.38-.12 5.06-.32.08.23.36.39.55.15.06-.08.11-.17.16-.26.18-.09.24-.32.18-.48.05-.2.1-.4.13-.6.16-.86.25-1.74.33-2.62.11-1.17.17-2.34.23-3.51.15-.01.32-.03.52-.04.36-.03 1.73-.15 2.06-.15.39 0 .7-.02.95-.04 1.76 1.11 3.45 2.35 5.14 3.55 2.83 2.01 5.64 4.04 8.47 6.04 1.42 1 2.85 2 4.29 2.97.1.06.19.07.27.04.08 0 .17-.02.25-.1 1.61-1.56 3.15-3.18 4.6-4.88.75-.88 1.49-1.78 2.15-2.73.01.01.03.02.04.03.34.3.83-.2.49-.49-2.16-1.9-4.34-3.76-6.64-5.48l.03-.01Zm-6.38-3.65a55.72 55.72 0 0 0-4-2.13c.14-.1.26-.19.4-.29 1.2.81 2.4 1.61 3.6 2.42Zm-20.1 11.78c.67-.37 1.23-.91 1.67-1.6-.11.5-.24 1-.38 1.49-.43.04-.86.08-1.29.11Zm2.38-37.24c1.34-.31 2.56-.52 3.71-.69-1.03.19-2.04.41-3.04.65-.14-.07-.34-.02-.45.11-.07.02-.15.04-.22.05v-.13.01Zm.04.84c.07-.02.14-.03.2-.05.34 1.66.41 3.41.5 5.09.17 2.9.24 5.81.28 8.71l.03 3.17c-.17.07-.34.14-.51.2-.06-4.96-.21-10.58-.51-17.12h.01Zm16.04 5.62c-1.16 2.25-3.06 4.1-5.02 5.66-2.8 2.23-5.99 3.97-9.3 5.35-.01-3.56-.09-7.12-.27-10.67-.1-2.04-.16-4.16-.57-6.18 3.3-.78 6.72-1.36 10.1-1.1 1.85.14 4.23.59 5.32 2.29.92 1.43.46 3.24-.26 4.65Zm.85-.18c.6-1.37.9-2.92.28-4.32-.67-1.52-2.2-2.32-3.76-2.74.46.1.89.21 1.29.37 1.74.67 2.69 1.88 2.93 3.21.2 1.13-.05 2.25-.74 3.47V70Zm-27.47-4.14c-.12-.19-.23-.38-.34-.57.74.42.85.36.99.41v.08c-.22.03-.43.06-.65.08Zm11.21 30.46c-.08 1.08-.16 2.17-.33 3.24-.05.35-.11.69-.2 1.03 0 .04-.02.07-.03.11-.15.02-.3.04-.45.05.45-1.64.76-3.36.79-5.07.03-.29.08-.57.1-.89-.03-.31-.03-.47.24-.57-.04.69-.07 1.39-.12 2.08v.02Zm5.6-2.47c.48.11.92.52 2.49 1.72-.46-.32-.92-.65-1.38-.97-.37-.25-.73-.5-1.1-.75h-.01Zm21.23 7.24a70.76 70.76 0 0 1-4.37 4.63c-.14-.09-.27-.19-.4-.28.19-.09.37-.24.55-.47.87-1.14 5.43-5.51 5.49-7.45.31.26.62.53.92.79-.67.97-1.42 1.88-2.19 2.77v.01Z",fill:"currentColor",transform:"translate(-144.023 -51.76)"})]}),qpe=({style:e,size:t="small",withText:n})=>m.jsxs("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[m.jsx(Ype,{}),n&&m.jsx(Gpe,{})]}),Xv=({icon:e,shortcut:t,children:n})=>{let r=Zn();return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"welcome-screen-menu-item__icon",children:e}),m.jsx("div",{className:"welcome-screen-menu-item__text",children:n}),t&&!r.editor.isMobile&&m.jsx("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};Xv.displayName="WelcomeScreenMenuItemContent";var W1=({onSelect:e,children:t,icon:n,shortcut:r,className:i="",...a})=>m.jsx("button",{...a,type:"button",className:`welcome-screen-menu-item ${i}`,onClick:e,children:m.jsx(Xv,{icon:n,shortcut:r,children:t})});W1.displayName="WelcomeScreenMenuItem";var QP=({children:e,href:t,icon:n,shortcut:r,className:i="",...a})=>m.jsx("a",{...a,className:`welcome-screen-menu-item ${i}`,href:t,target:"_blank",rel:"noreferrer",children:m.jsx(Xv,{icon:n,shortcut:r,children:e})});QP.displayName="WelcomeScreenMenuItemLink";var Ro=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=ki();return m.jsx(t.In,{children:m.jsx("div",{className:"welcome-screen-center",children:e||m.jsxs(m.Fragment,{children:[m.jsx(Vv,{}),m.jsx(Yv,{children:D("welcomeScreen.defaults.center_heading")}),m.jsxs(Gv,{children:[m.jsx(Zv,{}),m.jsx(qv,{})]})]})})})};Ro.displayName="Center";var Vv=({children:e})=>m.jsx("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||m.jsx(qpe,{withText:!0})});Vv.displayName="Logo";var Yv=({children:e})=>m.jsx("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});Yv.displayName="Heading";var Gv=({children:e})=>m.jsx("div",{className:"welcome-screen-menu",children:e});Gv.displayName="Menu";var qv=()=>{let e=ui();return m.jsx(W1,{onSelect:()=>e.executeAction(Mv),shortcut:"?",icon:o7,children:D("helpDialog.title")})};qv.displayName="MenuItemHelp";var Zv=()=>{let e=Hr(),t=ui();return e.viewModeEnabled?null:m.jsx(W1,{onSelect:()=>t.executeAction(n8),shortcut:kr("loadScene"),icon:l7,children:D("buttons.load")})};Zv.displayName="MenuItemLoadScene";var JP=({onSelect:e})=>{let{t}=Ar();return m.jsx(W1,{shortcut:null,onSelect:e,icon:vI,children:t("labels.liveCollaboration")})};JP.displayName="MenuItemLiveCollaborationTrigger";Ro.Logo=Vv;Ro.Heading=Yv;Ro.Menu=Gv;Ro.MenuItem=W1;Ro.MenuItemLink=QP;Ro.MenuItemHelp=qv;Ro.MenuItemLoadScene=Zv;Ro.MenuItemLiveCollaborationTrigger=JP;var Zpe=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=ki();return m.jsx(t.In,{children:m.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[_Y,m.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||D("welcomeScreen.defaults.menuHint")})]})})};Zpe.displayName="MenuHint";var Kpe=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=ki();return m.jsx(t.In,{children:m.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[m.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||D("welcomeScreen.defaults.toolbarHint")}),TY]})})};Kpe.displayName="ToolbarHint";var Qpe=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=ki();return m.jsx(t.In,{children:m.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[m.jsx("div",{children:e||D("welcomeScreen.defaults.helpHint")}),kY]})})};Qpe.displayName="HelpHint";_1((e,t,n)=>{if(dt.DEV||dt.MODE===si.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES){let r=xo(e.map(i=>({...i})));E7(r,{shouldThrow:dt.DEV||dt.MODE===si.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:n}})}},1e3*60,{leading:!0,trailing:!1});Vpe();var Jpe=e=>{var Y,H,Z,V;let{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:i=!1,onPointerUpdate:a,renderTopRightUI:s,langCode:o=Ch.code,viewModeEnabled:c,zenModeEnabled:d,gridModeEnabled:l,libraryReturnUrl:h,theme:f,name:g,renderCustomStats:U,onPaste:y,detectScroll:v=!0,handleKeyboardGlobally:x=!1,onLibraryChange:w,autoFocus:C=!1,generateIdForFile:S,onLinkOpen:T,generateLinkForSelection:M,onPointerDown:_,onPointerUp:R,onScrollChange:P,onDuplicate:j,children:N,validateEmbeddable:F,renderEmbeddable:B,aiEnabled:G,showDeprecatedFonts:W}=e,X=(Y=e.UIOptions)==null?void 0:Y.canvasActions,$={...e.UIOptions,canvasActions:{...EE.canvasActions,...X},tools:{image:((Z=(H=e.UIOptions)==null?void 0:H.tools)==null?void 0:Z.image)??!0}};return X!=null&&X.export&&($.canvasActions.export.saveFileToDisk=((V=X.export)==null?void 0:V.saveFileToDisk)??EE.canvasActions.export.saveFileToDisk),$.canvasActions.toggleTheme===null&&typeof f>"u"&&($.canvasActions.toggleTheme=!0),I.useEffect(()=>{(async()=>await ge(()=>import("./roundRect-0PYZxl1G.js"),[],import.meta.url))();let te=ce=>{typeof ce.scale=="number"&&ce.scale!==1&&ce.preventDefault()};return document.addEventListener("touchmove",te,{passive:!1}),()=>{document.removeEventListener("touchmove",te)}},[]),m.jsx($le,{store:Sa,children:m.jsx(Xle,{langCode:o,theme:f,children:m.jsx(Wpe,{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:i,onPointerUpdate:a,renderTopRightUI:s,langCode:o,viewModeEnabled:c,zenModeEnabled:d,gridModeEnabled:l,libraryReturnUrl:h,theme:f,name:g,renderCustomStats:U,UIOptions:$,onPaste:y,detectScroll:v,handleKeyboardGlobally:x,onLibraryChange:w,autoFocus:C,generateIdForFile:S,onLinkOpen:T,generateLinkForSelection:M,onPointerDown:_,onPointerUp:R,onScrollChange:P,onDuplicate:j,validateEmbeddable:F,renderEmbeddable:B,aiEnabled:G!==!1,showDeprecatedFonts:W,children:N})})})},e1e=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:n,UIOptions:r={},...i}=e,{initialData:a,UIOptions:s={},...o}=t,c=Object.keys(r),d=Object.keys(s);return c.length!==d.length?!1:c.every(l=>l==="canvasActions"?Object.keys(r.canvasActions).every(h=>{var f,g,U,y;return h==="export"&&((f=r==null?void 0:r.canvasActions)!=null&&f.export)&&((g=s==null?void 0:s.canvasActions)!=null&&g.export)?r.canvasActions.export.saveFileToDisk===s.canvasActions.export.saveFileToDisk:((U=r==null?void 0:r.canvasActions)==null?void 0:U[h])===((y=s==null?void 0:s.canvasActions)==null?void 0:y[h])}):r[l]===s[l])&&pr(i,o)},eN=xe.memo(Jpe,e1e);eN.displayName="Excalidraw";const QU=20,t1e={rect:"rectangle",circle:"ellipse"},fk={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:`${QU*1.25}px`},maxEdges:500,maxTextSize:5e4};class JU{constructor({converter:t}){this.convert=(n,r)=>this.converter(n,{...r,fontSize:r.fontSize||QU}),this.converter=t}}var Ic;(function(e){e.ROUND="round",e.STADIUM="stadium",e.DOUBLECIRCLE="doublecircle",e.CIRCLE="circle",e.DIAMOND="diamond"})(Ic||(Ic={}));var p8;(function(e){e.COLOR="color"})(p8||(p8={}));var Su;(function(e){e.FILL="fill",e.STROKE="stroke",e.STROKE_WIDTH="stroke-width",e.STROKE_DASHARRAY="stroke-dasharray"})(Su||(Su={}));var Bf={},pk;function n1e(){if(pk)return Bf;pk=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.removeMarkdown=void 0;var e=function(t,n){n===void 0&&(n={listUnicodeChar:""}),n=n||{},n.listUnicodeChar=n.hasOwnProperty("listUnicodeChar")?n.listUnicodeChar:!1,n.stripListLeaders=n.hasOwnProperty("stripListLeaders")?n.stripListLeaders:!0,n.gfm=n.hasOwnProperty("gfm")?n.gfm:!0,n.useImgAltText=n.hasOwnProperty("useImgAltText")?n.useImgAltText:!0,n.preserveLinks=n.hasOwnProperty("preserveLinks")?n.preserveLinks:!1;var r=t||"";r=r.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{n.stripListLeaders&&(n.listUnicodeChar?r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,n.listUnicodeChar+" $1"):r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),n.gfm&&(r=r.replace(/\n={2,}/g,`
|
|
255
|
+
`).replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),n.preserveLinks&&(r=r.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),r=r.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,n.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,`
|
|
256
|
+
|
|
257
|
+
`).replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,`
|
|
258
|
+
|
|
259
|
+
`)}catch(i){return console.error(i),t}return r};return Bf.removeMarkdown=e,Bf}var r1e=n1e();const i1e={arrow_circle:{endArrowhead:"dot"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"dot",startArrowhead:"dot"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},a1e=e=>i1e[e],Nm=e=>{let t=e.text;return e.labelType==="markdown"&&(t=r1e.removeMarkdown(e.text)),s1e(t)},s1e=e=>{const t=/\s?(fa|fab):[a-zA-Z0-9-]+/g;return e.replace(t,"")},o1e=e=>{const t={};return Object.keys(e).forEach(n=>{var r;switch(n){case Su.FILL:{t.backgroundColor=e[n],t.fillStyle="solid";break}case Su.STROKE:{t.strokeColor=e[n];break}case Su.STROKE_WIDTH:{t.strokeWidth=Number((r=e[n])==null?void 0:r.split("px")[0]);break}case Su.STROKE_DASHARRAY:{t.strokeStyle="dashed";break}}}),t},l1e=e=>{const t={};return Object.keys(e).forEach(n=>{switch(n){case p8.COLOR:{t.strokeColor=e[n];break}}}),t},c1e=e=>{const t={};e.subGraphs.map(r=>{r.nodeIds.forEach(i=>{t[r.id]={id:r.id,parent:null,isLeaf:!1},t[i]={id:i,parent:r.id,isLeaf:e.vertices[i]!==void 0}})});const n={};return[...Object.keys(e.vertices),...e.subGraphs.map(r=>r.id)].forEach(r=>{if(!t[r])return;let i=t[r];const a=[];for(i.isLeaf||a.push(`subgraph_group_${i.id}`);i.parent;)a.push(`subgraph_group_${i.parent}`),i=t[i.parent];n[r]=a}),{getGroupIds:r=>n[r]||[],getParentId:r=>t[r]?t[r].parent:null}},d1e=new JU({converter:(e,t)=>{const n=[],r=t.fontSize,{getGroupIds:i,getParentId:a}=c1e(e);return e.subGraphs.reverse().forEach(s=>{const o=i(s.id),c={id:s.id,type:"rectangle",groupIds:o,x:s.x,y:s.y,width:s.width,height:s.height,label:{groupIds:o,text:Nm(s),fontSize:r,verticalAlign:"top"}};n.push(c)}),Object.values(e.vertices).forEach(s=>{if(!s)return;const o=i(s.id),c=o1e(s.containerStyle),d=l1e(s.labelStyle);let l={id:s.id,type:"rectangle",groupIds:o,x:s.x,y:s.y,width:s.width,height:s.height,strokeWidth:2,label:{groupIds:o,text:Nm(s),fontSize:r,...d},link:s.link||null,...c};switch(s.type){case Ic.STADIUM:{l={...l,roundness:{type:3}};break}case Ic.ROUND:{l={...l,roundness:{type:3}};break}case Ic.DOUBLECIRCLE:{o.push(`doublecircle_${s.id}}`);const f={type:"ellipse",groupIds:o,x:s.x+5,y:s.y+5,width:s.width-5*2,height:s.height-5*2,strokeWidth:2,roundness:{type:3},label:{groupIds:o,text:Nm(s),fontSize:r}};l={...l,groupIds:o,type:"ellipse"},n.push(f);break}case Ic.CIRCLE:{l.type="ellipse";break}case Ic.DIAMOND:{l.type="diamond";break}}n.push(l)}),e.edges.forEach(s=>{let o=[];const c=a(s.start),d=a(s.end);c&&c===d&&(o=i(c));const{startX:l,startY:h,reflectionPoints:f}=s,g=f.map(C=>[C.x-f[0].x,C.y-f[0].y]),U=a1e(s.type),v={id:`${s.start}_${s.end}`,type:"arrow",groupIds:o,x:l,y:h,strokeWidth:s.stroke==="thick"?4:2,strokeStyle:s.stroke==="dotted"?"dashed":void 0,points:g,...s.text?{label:{text:Nm(s),fontSize:r,groupIds:o}}:{},roundness:{type:2},...U},x=n.find(C=>C.id===s.start),w=n.find(C=>C.id===s.end);!x||!w||(v.start={id:x.id||""},v.end={id:w.id||""},n.push(v))}),{elements:n}}});let ho=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const u1e=new JU({converter:e=>{const t=ho(),{width:n,height:r}=e,i={type:"image",x:0,y:0,width:n,height:r,status:"saved",fileId:t};return{files:{[t]:{id:t,mimeType:e.mimeType,dataURL:e.dataURL}},elements:[i]}}}),Kv=e=>e.replace(/\\n/g,`
|
|
260
|
+
`),Mp=e=>{const t={type:"line",x:e.startX,y:e.startY,points:[[0,0],[e.endX-e.startX,e.endY-e.startY]],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e.strokeStyle||"solid",strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},M2=e=>{const t={type:"text",x:e.x,y:e.y,width:e.width,height:e.height,text:Kv(e.text)||"",fontSize:e.fontSize,verticalAlign:"middle"};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},op=e=>{var r,i,a,s;let t={};e.type==="rectangle"&&e.subtype==="activation"&&(t={backgroundColor:"#e9ecef",fillStyle:"solid"});const n={id:e.id,type:e.type,x:e.x,y:e.y,width:e.width,height:e.height,label:{text:Kv(((r=e==null?void 0:e.label)==null?void 0:r.text)||""),fontSize:(i=e==null?void 0:e.label)==null?void 0:i.fontSize,verticalAlign:((a=e.label)==null?void 0:a.verticalAlign)||"middle",strokeColor:((s=e.label)==null?void 0:s.color)||"#000",groupIds:e.groupId?[e.groupId]:[]},strokeStyle:e==null?void 0:e.strokeStyle,strokeWidth:e==null?void 0:e.strokeWidth,strokeColor:e==null?void 0:e.strokeColor,backgroundColor:e==null?void 0:e.bgColor,fillStyle:"solid",...t};return e.groupId&&Object.assign(n,{groupIds:[e.groupId]}),n},tN=e=>{var n;const t={type:"arrow",x:e.startX,y:e.startY,points:e.points||[[0,0],[e.endX-e.startX,e.endY-e.startY]],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:(e==null?void 0:e.strokeStyle)||"solid",endArrowhead:(e==null?void 0:e.endArrowhead)||null,startArrowhead:(e==null?void 0:e.startArrowhead)||null,label:{text:Kv(((n=e==null?void 0:e.label)==null?void 0:n.text)||""),fontSize:16},roundness:{type:2},start:e.start,end:e.end};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),t},h1e=new JU({converter:e=>{const t=[],n=[];if(Object.values(e.nodes).forEach(r=>{!r||!r.length||r.forEach(i=>{let a;switch(i.type){case"line":a=Mp(i);break;case"rectangle":case"ellipse":a=op(i);break;case"text":a=M2(i);break;default:throw`unknown type ${i.type}`}i.type==="rectangle"&&(i==null?void 0:i.subtype)==="activation"?n.push(a):t.push(a)})}),Object.values(e.lines).forEach(r=>{r&&t.push(Mp(r))}),Object.values(e.arrows).forEach(r=>{r&&(t.push(tN(r)),r.sequenceNumber&&t.push(op(r.sequenceNumber)))}),t.push(...n),e.loops){const{lines:r,texts:i,nodes:a}=e.loops;r.forEach(s=>{t.push(Mp(s))}),i.forEach(s=>{t.push(M2(s))}),a.forEach(s=>{t.push(op(s))})}return e.groups&&e.groups.forEach(r=>{const{actorKeys:i,name:a}=r;let s=1/0,o=1/0,c=0,d=0;if(!i.length)return;t.filter(T=>{if(T.id){const M=T.id.indexOf("-"),_=T.id.substring(0,M);return i.includes(_)}}).forEach(T=>{if(T.x===void 0||T.y===void 0||T.width===void 0||T.height===void 0)throw new Error(`Actor attributes missing ${T}`);s=Math.min(s,T.x),o=Math.min(o,T.y),c=Math.max(c,T.x+T.width),d=Math.max(d,T.y+T.height)});const h=10,f=s-h,g=o-h,U=c-s+h*2,y=d-o+h*2,v=ho(),x=op({type:"rectangle",x:f,y:g,width:U,height:y,bgColor:r.fill,id:v});t.unshift(x);const w=ho(),C=[v];t.forEach(T=>{if(T.type!=="frame"){if(T.x===void 0||T.y===void 0||T.width===void 0||T.height===void 0)throw new Error(`Element attributes missing ${T}`);if(T.x>=s&&T.x+T.width<=c&&T.y>=o&&T.y+T.height<=d){const M=T.id||ho();T.id||Object.assign(T,{id:M}),C.push(M)}}});const S={type:"frame",id:w,name:a,children:C};t.push(S)}),{elements:t}}}),f1e=new JU({converter:e=>{const t=[];return Object.values(e.nodes).forEach(n=>{!n||!n.length||n.forEach(r=>{let i;switch(r.type){case"line":i=Mp(r);break;case"rectangle":case"ellipse":i=op(r);break;case"text":i=M2(r);break;default:throw`unknown type ${r.type}`}t.push(i)})}),Object.values(e.lines).forEach(n=>{n&&t.push(Mp(n))}),Object.values(e.arrows).forEach(n=>{if(!n)return;const r=tN(n);t.push(r)}),Object.values(e.text).forEach(n=>{const r=M2(n);t.push(r)}),Object.values(e.namespaces).forEach(n=>{const r=Object.keys(n.classes),i=[...r],a=[...e.lines,...e.arrows,...e.text];r.forEach(o=>{const c=a.filter(d=>d.metadata&&d.metadata.classId===o).map(d=>d.id);c.length&&i.push(...c)});const s={type:"frame",id:ho(),name:n.id,children:i};t.push(s)}),{elements:t}}}),p1e=(e,t={})=>{switch(e.type){case"graphImage":return u1e.convert(e,t);case"flowchart":return d1e.convert(e,t);case"sequence":return h1e.convert(e,t);case"class":return f1e.convert(e,t);default:throw new Error(`graphToExcalidraw: unknown graph type "${e.type}, only flowcharts are supported!"`)}};function m1e(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.from(typeof e=="string"?[e]:e);r[r.length-1]=r[r.length-1].replace(/\r?\n([\t ]*)$/,"");var i=r.reduce(function(o,c){var d=c.match(/\n([\t ]+|(?!\s).)/g);return d?o.concat(d.map(function(l){var h,f;return(f=(h=l.match(/[\t ]/g))===null||h===void 0?void 0:h.length)!==null&&f!==void 0?f:0})):o},[]);if(i.length){var a=new RegExp(`
|
|
261
|
+
[ ]{`+Math.min.apply(Math,i)+"}","g");r=r.map(function(o){return o.replace(a,`
|
|
262
|
+
`)})}r[0]=r[0].replace(/^\r?\n/,"");var s=r[0];return t.forEach(function(o,c){var d=s.match(/(?:^|\n)( *)$/),l=d?d[1]:"",h=o;typeof o=="string"&&o.includes(`
|
|
263
|
+
`)&&(h=String(o).split(`
|
|
264
|
+
`).map(function(f,g){return g===0?f:""+l+f}).join(`
|
|
265
|
+
`)),s+=h+r[c+1]}),s}var Sg={exports:{}},g1e=Sg.exports,mk;function U1e(){return mk||(mk=1,function(e,t){(function(n,r){e.exports=r()})(g1e,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",s="second",o="minute",c="hour",d="day",l="week",h="month",f="quarter",g="year",U="date",y="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(G){var W=["th","st","nd","rd"],X=G%100;return"["+G+(W[(X-20)%10]||W[X]||W[0])+"]"}},C=function(G,W,X){var $=String(G);return!$||$.length>=W?G:""+Array(W+1-$.length).join(X)+G},S={s:C,z:function(G){var W=-G.utcOffset(),X=Math.abs(W),$=Math.floor(X/60),Y=X%60;return(W<=0?"+":"-")+C($,2,"0")+":"+C(Y,2,"0")},m:function G(W,X){if(W.date()<X.date())return-G(X,W);var $=12*(X.year()-W.year())+(X.month()-W.month()),Y=W.clone().add($,h),H=X-Y<0,Z=W.clone().add($+(H?-1:1),h);return+(-($+(X-Y)/(H?Y-Z:Z-Y))||0)},a:function(G){return G<0?Math.ceil(G)||0:Math.floor(G)},p:function(G){return{M:h,y:g,w:l,d,D:U,h:c,m:o,s,ms:a,Q:f}[G]||String(G||"").toLowerCase().replace(/s$/,"")},u:function(G){return G===void 0}},T="en",M={};M[T]=w;var _="$isDayjsObject",R=function(G){return G instanceof F||!(!G||!G[_])},P=function G(W,X,$){var Y;if(!W)return T;if(typeof W=="string"){var H=W.toLowerCase();M[H]&&(Y=H),X&&(M[H]=X,Y=H);var Z=W.split("-");if(!Y&&Z.length>1)return G(Z[0])}else{var V=W.name;M[V]=W,Y=V}return!$&&Y&&(T=Y),Y||!$&&T},j=function(G,W){if(R(G))return G.clone();var X=typeof W=="object"?W:{};return X.date=G,X.args=arguments,new F(X)},N=S;N.l=P,N.i=R,N.w=function(G,W){return j(G,{locale:W.$L,utc:W.$u,x:W.$x,$offset:W.$offset})};var F=function(){function G(X){this.$L=P(X.locale,null,!0),this.parse(X),this.$x=this.$x||X.x||{},this[_]=!0}var W=G.prototype;return W.parse=function(X){this.$d=function($){var Y=$.date,H=$.utc;if(Y===null)return new Date(NaN);if(N.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var Z=Y.match(v);if(Z){var V=Z[2]-1||0,te=(Z[7]||"0").substring(0,3);return H?new Date(Date.UTC(Z[1],V,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,te)):new Date(Z[1],V,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,te)}}return new Date(Y)}(X),this.init()},W.init=function(){var X=this.$d;this.$y=X.getFullYear(),this.$M=X.getMonth(),this.$D=X.getDate(),this.$W=X.getDay(),this.$H=X.getHours(),this.$m=X.getMinutes(),this.$s=X.getSeconds(),this.$ms=X.getMilliseconds()},W.$utils=function(){return N},W.isValid=function(){return this.$d.toString()!==y},W.isSame=function(X,$){var Y=j(X);return this.startOf($)<=Y&&Y<=this.endOf($)},W.isAfter=function(X,$){return j(X)<this.startOf($)},W.isBefore=function(X,$){return this.endOf($)<j(X)},W.$g=function(X,$,Y){return N.u(X)?this[$]:this.set(Y,X)},W.unix=function(){return Math.floor(this.valueOf()/1e3)},W.valueOf=function(){return this.$d.getTime()},W.startOf=function(X,$){var Y=this,H=!!N.u($)||$,Z=N.p(X),V=function(je,Le){var de=N.w(Y.$u?Date.UTC(Y.$y,Le,je):new Date(Y.$y,Le,je),Y);return H?de:de.endOf(d)},te=function(je,Le){return N.w(Y.toDate()[je].apply(Y.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(Le)),Y)},ce=this.$W,be=this.$M,fe=this.$D,Se="set"+(this.$u?"UTC":"");switch(Z){case g:return H?V(1,0):V(31,11);case h:return H?V(1,be):V(0,be+1);case l:var Ue=this.$locale().weekStart||0,ye=(ce<Ue?ce+7:ce)-Ue;return V(H?fe-ye:fe+(6-ye),be);case d:case U:return te(Se+"Hours",0);case c:return te(Se+"Minutes",1);case o:return te(Se+"Seconds",2);case s:return te(Se+"Milliseconds",3);default:return this.clone()}},W.endOf=function(X){return this.startOf(X,!1)},W.$set=function(X,$){var Y,H=N.p(X),Z="set"+(this.$u?"UTC":""),V=(Y={},Y[d]=Z+"Date",Y[U]=Z+"Date",Y[h]=Z+"Month",Y[g]=Z+"FullYear",Y[c]=Z+"Hours",Y[o]=Z+"Minutes",Y[s]=Z+"Seconds",Y[a]=Z+"Milliseconds",Y)[H],te=H===d?this.$D+($-this.$W):$;if(H===h||H===g){var ce=this.clone().set(U,1);ce.$d[V](te),ce.init(),this.$d=ce.set(U,Math.min(this.$D,ce.daysInMonth())).$d}else V&&this.$d[V](te);return this.init(),this},W.set=function(X,$){return this.clone().$set(X,$)},W.get=function(X){return this[N.p(X)]()},W.add=function(X,$){var Y,H=this;X=Number(X);var Z=N.p($),V=function(be){var fe=j(H);return N.w(fe.date(fe.date()+Math.round(be*X)),H)};if(Z===h)return this.set(h,this.$M+X);if(Z===g)return this.set(g,this.$y+X);if(Z===d)return V(1);if(Z===l)return V(7);var te=(Y={},Y[o]=r,Y[c]=i,Y[s]=n,Y)[Z]||1,ce=this.$d.getTime()+X*te;return N.w(ce,this)},W.subtract=function(X,$){return this.add(-1*X,$)},W.format=function(X){var $=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||y;var H=X||"YYYY-MM-DDTHH:mm:ssZ",Z=N.z(this),V=this.$H,te=this.$m,ce=this.$M,be=Y.weekdays,fe=Y.months,Se=Y.meridiem,Ue=function(Le,de,Te,qe){return Le&&(Le[de]||Le($,H))||Te[de].slice(0,qe)},ye=function(Le){return N.s(V%12||12,Le,"0")},je=Se||function(Le,de,Te){var qe=Le<12?"AM":"PM";return Te?qe.toLowerCase():qe};return H.replace(x,function(Le,de){return de||function(Te){switch(Te){case"YY":return String($.$y).slice(-2);case"YYYY":return N.s($.$y,4,"0");case"M":return ce+1;case"MM":return N.s(ce+1,2,"0");case"MMM":return Ue(Y.monthsShort,ce,fe,3);case"MMMM":return Ue(fe,ce);case"D":return $.$D;case"DD":return N.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Ue(Y.weekdaysMin,$.$W,be,2);case"ddd":return Ue(Y.weekdaysShort,$.$W,be,3);case"dddd":return be[$.$W];case"H":return String(V);case"HH":return N.s(V,2,"0");case"h":return ye(1);case"hh":return ye(2);case"a":return je(V,te,!0);case"A":return je(V,te,!1);case"m":return String(te);case"mm":return N.s(te,2,"0");case"s":return String($.$s);case"ss":return N.s($.$s,2,"0");case"SSS":return N.s($.$ms,3,"0");case"Z":return Z}return null}(Le)||Z.replace(":","")})},W.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},W.diff=function(X,$,Y){var H,Z=this,V=N.p($),te=j(X),ce=(te.utcOffset()-this.utcOffset())*r,be=this-te,fe=function(){return N.m(Z,te)};switch(V){case g:H=fe()/12;break;case h:H=fe();break;case f:H=fe()/3;break;case l:H=(be-ce)/6048e5;break;case d:H=(be-ce)/864e5;break;case c:H=be/i;break;case o:H=be/r;break;case s:H=be/n;break;default:H=be}return Y?H:N.a(H)},W.daysInMonth=function(){return this.endOf(h).$D},W.$locale=function(){return M[this.$L]},W.locale=function(X,$){if(!X)return this.$L;var Y=this.clone(),H=P(X,$,!0);return H&&(Y.$L=H),Y},W.clone=function(){return N.w(this.$d,this)},W.toDate=function(){return new Date(this.valueOf())},W.toJSON=function(){return this.isValid()?this.toISOString():null},W.toISOString=function(){return this.$d.toISOString()},W.toString=function(){return this.$d.toUTCString()},G}(),B=F.prototype;return j.prototype=B,[["$ms",a],["$s",s],["$m",o],["$H",c],["$W",d],["$M",h],["$y",g],["$D",U]].forEach(function(G){B[G[1]]=function(W){return this.$g(W,G[0],G[1])}}),j.extend=function(G,W){return G.$i||(G(W,F,j),G.$i=!0),j},j.locale=P,j.isDayjs=R,j.unix=function(G){return j(1e3*G)},j.en=M[T],j.Ls=M,j.p={},j})}(Sg)),Sg.exports}var b1e=U1e();const y1e=ta(b1e);var v1e={value:()=>{}};function nN(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new _g(n)}function _g(e){this._=e}function x1e(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_g.prototype=nN.prototype={constructor:_g,on:function(e,t){var n=this._,r=x1e(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=w1e(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=gk(n[i],e.name,t);else if(t==null)for(i in n)n[i]=gk(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _g(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function w1e(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function gk(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=v1e,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var m8="http://www.w3.org/1999/xhtml";const Uk={svg:"http://www.w3.org/2000/svg",xhtml:m8,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function e6(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Uk.hasOwnProperty(t)?{space:Uk[t],local:e}:e}function E1e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===m8&&t.documentElement.namespaceURI===m8?t.createElement(e):t.createElementNS(n,e)}}function C1e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rN(e){var t=e6(e);return(t.local?C1e:E1e)(t)}function S1e(){}function Qv(e){return e==null?S1e:function(){return this.querySelector(e)}}function _1e(e){typeof e!="function"&&(e=Qv(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=new Array(s),c,d,l=0;l<s;++l)(c=a[l])&&(d=e.call(c,c.__data__,l,a))&&("__data__"in c&&(d.__data__=c.__data__),o[l]=d);return new Si(r,this._parents)}function k1e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function T1e(){return[]}function iN(e){return e==null?T1e:function(){return this.querySelectorAll(e)}}function M1e(e){return function(){return k1e(e.apply(this,arguments))}}function I1e(e){typeof e=="function"?e=M1e(e):e=iN(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var s=t[a],o=s.length,c,d=0;d<o;++d)(c=s[d])&&(r.push(e.call(c,c.__data__,d,s)),i.push(c));return new Si(r,i)}function aN(e){return function(){return this.matches(e)}}function sN(e){return function(t){return t.matches(e)}}var A1e=Array.prototype.find;function L1e(e){return function(){return A1e.call(this.children,e)}}function R1e(){return this.firstElementChild}function D1e(e){return this.select(e==null?R1e:L1e(typeof e=="function"?e:sN(e)))}var j1e=Array.prototype.filter;function P1e(){return Array.from(this.children)}function N1e(e){return function(){return j1e.call(this.children,e)}}function O1e(e){return this.selectAll(e==null?P1e:N1e(typeof e=="function"?e:sN(e)))}function F1e(e){typeof e!="function"&&(e=aN(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],c,d=0;d<s;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&o.push(c);return new Si(r,this._parents)}function oN(e){return new Array(e.length)}function B1e(){return new Si(this._enter||this._groups.map(oN),this._parents)}function I2(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}I2.prototype={constructor:I2,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $1e(e){return function(){return e}}function z1e(e,t,n,r,i,a){for(var s=0,o,c=t.length,d=a.length;s<d;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new I2(e,a[s]);for(;s<c;++s)(o=t[s])&&(i[s]=o)}function H1e(e,t,n,r,i,a,s){var o,c,d=new Map,l=t.length,h=a.length,f=new Array(l),g;for(o=0;o<l;++o)(c=t[o])&&(f[o]=g=s.call(c,c.__data__,o,t)+"",d.has(g)?i[o]=c:d.set(g,c));for(o=0;o<h;++o)g=s.call(e,a[o],o,a)+"",(c=d.get(g))?(r[o]=c,c.__data__=a[o],d.delete(g)):n[o]=new I2(e,a[o]);for(o=0;o<l;++o)(c=t[o])&&d.get(f[o])===c&&(i[o]=c)}function W1e(e){return e.__data__}function X1e(e,t){if(!arguments.length)return Array.from(this,W1e);var n=t?H1e:z1e,r=this._parents,i=this._groups;typeof e!="function"&&(e=$1e(e));for(var a=i.length,s=new Array(a),o=new Array(a),c=new Array(a),d=0;d<a;++d){var l=r[d],h=i[d],f=h.length,g=V1e(e.call(l,l&&l.__data__,d,r)),U=g.length,y=o[d]=new Array(U),v=s[d]=new Array(U),x=c[d]=new Array(f);n(l,h,y,v,x,g,t);for(var w=0,C=0,S,T;w<U;++w)if(S=y[w]){for(w>=C&&(C=w+1);!(T=v[C])&&++C<U;);S._next=T||null}}return s=new Si(s,r),s._enter=o,s._exit=c,s}function V1e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Y1e(){return new Si(this._exit||this._groups.map(oN),this._parents)}function G1e(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function q1e(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),c=0;c<s;++c)for(var d=n[c],l=r[c],h=d.length,f=o[c]=new Array(h),g,U=0;U<h;++U)(g=d[U]||l[U])&&(f[U]=g);for(;c<i;++c)o[c]=n[c];return new Si(o,this._parents)}function Z1e(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function K1e(e){e||(e=Q1e);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var s=n[a],o=s.length,c=i[a]=new Array(o),d,l=0;l<o;++l)(d=s[l])&&(c[l]=d);c.sort(t)}return new Si(i,this._parents).order()}function Q1e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function J1e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function e0e(){return Array.from(this)}function t0e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function n0e(){let e=0;for(const t of this)++e;return e}function r0e(){return!this.node()}function i0e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function a0e(e){return function(){this.removeAttribute(e)}}function s0e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o0e(e,t){return function(){this.setAttribute(e,t)}}function l0e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function c0e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function d0e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function u0e(e,t){var n=e6(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?s0e:a0e:typeof t=="function"?n.local?d0e:c0e:n.local?l0e:o0e)(n,t))}function lN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function h0e(e){return function(){this.style.removeProperty(e)}}function f0e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function p0e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function m0e(e,t,n){return arguments.length>1?this.each((t==null?h0e:typeof t=="function"?p0e:f0e)(e,t,n??"")):sh(this.node(),e)}function sh(e,t){return e.style.getPropertyValue(t)||lN(e).getComputedStyle(e,null).getPropertyValue(t)}function g0e(e){return function(){delete this[e]}}function U0e(e,t){return function(){this[e]=t}}function b0e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function y0e(e,t){return arguments.length>1?this.each((t==null?g0e:typeof t=="function"?b0e:U0e)(e,t)):this.node()[e]}function cN(e){return e.trim().split(/^|\s+/)}function Jv(e){return e.classList||new dN(e)}function dN(e){this._node=e,this._names=cN(e.getAttribute("class")||"")}dN.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function uN(e,t){for(var n=Jv(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function hN(e,t){for(var n=Jv(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function v0e(e){return function(){uN(this,e)}}function x0e(e){return function(){hN(this,e)}}function w0e(e,t){return function(){(t.apply(this,arguments)?uN:hN)(this,e)}}function E0e(e,t){var n=cN(e+"");if(arguments.length<2){for(var r=Jv(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?w0e:t?v0e:x0e)(n,t))}function C0e(){this.textContent=""}function S0e(e){return function(){this.textContent=e}}function _0e(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function k0e(e){return arguments.length?this.each(e==null?C0e:(typeof e=="function"?_0e:S0e)(e)):this.node().textContent}function T0e(){this.innerHTML=""}function M0e(e){return function(){this.innerHTML=e}}function I0e(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function A0e(e){return arguments.length?this.each(e==null?T0e:(typeof e=="function"?I0e:M0e)(e)):this.node().innerHTML}function L0e(){this.nextSibling&&this.parentNode.appendChild(this)}function R0e(){return this.each(L0e)}function D0e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function j0e(){return this.each(D0e)}function P0e(e){var t=typeof e=="function"?e:rN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function N0e(){return null}function O0e(e,t){var n=typeof e=="function"?e:rN(e),r=t==null?N0e:typeof t=="function"?t:Qv(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function F0e(){var e=this.parentNode;e&&e.removeChild(this)}function B0e(){return this.each(F0e)}function $0e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z0e(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function H0e(e){return this.select(e?z0e:$0e)}function W0e(e){return arguments.length?this.property("__data__",e):this.node().__data__}function X0e(e){return function(t){e.call(this,t,this.__data__)}}function V0e(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Y0e(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function G0e(e,t,n){return function(){var r=this.__on,i,a=X0e(t);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function q0e(e,t,n){var r=V0e(e+""),i,a=r.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,d=o.length,l;c<d;++c)for(i=0,l=o[c];i<a;++i)if((s=r[i]).type===l.type&&s.name===l.name)return l.value}return}for(o=t?G0e:Y0e,i=0;i<a;++i)this.each(o(r[i],t,n));return this}function fN(e,t,n){var r=lN(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Z0e(e,t){return function(){return fN(this,e,t)}}function K0e(e,t){return function(){return fN(this,e,t.apply(this,arguments))}}function Q0e(e,t){return this.each((typeof t=="function"?K0e:Z0e)(e,t))}function*J0e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var pN=[null];function Si(e,t){this._groups=e,this._parents=t}function X1(){return new Si([[document.documentElement]],pN)}function eme(){return this}Si.prototype=X1.prototype={constructor:Si,select:_1e,selectAll:I1e,selectChild:D1e,selectChildren:O1e,filter:F1e,data:X1e,enter:B1e,exit:Y1e,join:G1e,merge:q1e,selection:eme,order:Z1e,sort:K1e,call:J1e,nodes:e0e,node:t0e,size:n0e,empty:r0e,each:i0e,attr:u0e,style:m0e,property:y0e,classed:E0e,text:k0e,html:A0e,raise:R0e,lower:j0e,append:P0e,insert:O0e,remove:B0e,clone:H0e,datum:W0e,on:q0e,dispatch:Q0e,[Symbol.iterator]:J0e};function $i(e){return typeof e=="string"?new Si([[document.querySelector(e)]],[document.documentElement]):new Si([[e]],pN)}function ex(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function V1(){}var p1=.7,A2=1/p1,Pu="\\s*([+-]?\\d+)\\s*",m1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ps="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tme=/^#([0-9a-f]{3,8})$/,nme=new RegExp(`^rgb\\(${Pu},${Pu},${Pu}\\)$`),rme=new RegExp(`^rgb\\(${ps},${ps},${ps}\\)$`),ime=new RegExp(`^rgba\\(${Pu},${Pu},${Pu},${m1}\\)$`),ame=new RegExp(`^rgba\\(${ps},${ps},${ps},${m1}\\)$`),sme=new RegExp(`^hsl\\(${m1},${ps},${ps}\\)$`),ome=new RegExp(`^hsla\\(${m1},${ps},${ps},${m1}\\)$`),bk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ex(V1,g1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yk,formatHex:yk,formatHex8:lme,formatHsl:cme,formatRgb:vk,toString:vk});function yk(){return this.rgb().formatHex()}function lme(){return this.rgb().formatHex8()}function cme(){return gN(this).formatHsl()}function vk(){return this.rgb().formatRgb()}function g1(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tme.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?xk(t):n===3?new oi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Om(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Om(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=nme.exec(e))?new oi(t[1],t[2],t[3],1):(t=rme.exec(e))?new oi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ime.exec(e))?Om(t[1],t[2],t[3],t[4]):(t=ame.exec(e))?Om(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sme.exec(e))?Ck(t[1],t[2]/100,t[3]/100,1):(t=ome.exec(e))?Ck(t[1],t[2]/100,t[3]/100,t[4]):bk.hasOwnProperty(e)?xk(bk[e]):e==="transparent"?new oi(NaN,NaN,NaN,0):null}function xk(e){return new oi(e>>16&255,e>>8&255,e&255,1)}function Om(e,t,n,r){return r<=0&&(e=t=n=NaN),new oi(e,t,n,r)}function dme(e){return e instanceof V1||(e=g1(e)),e?(e=e.rgb(),new oi(e.r,e.g,e.b,e.opacity)):new oi}function g8(e,t,n,r){return arguments.length===1?dme(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ex(oi,g8,mN(V1,{brighter(e){return e=e==null?A2:Math.pow(A2,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?p1:Math.pow(p1,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new oi(Yc(this.r),Yc(this.g),Yc(this.b),L2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wk,formatHex:wk,formatHex8:ume,formatRgb:Ek,toString:Ek}));function wk(){return`#${Oc(this.r)}${Oc(this.g)}${Oc(this.b)}`}function ume(){return`#${Oc(this.r)}${Oc(this.g)}${Oc(this.b)}${Oc((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ek(){const e=L2(this.opacity);return`${e===1?"rgb(":"rgba("}${Yc(this.r)}, ${Yc(this.g)}, ${Yc(this.b)}${e===1?")":`, ${e})`}`}function L2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oc(e){return e=Yc(e),(e<16?"0":"")+e.toString(16)}function Ck(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new va(e,t,n,r)}function gN(e){if(e instanceof va)return new va(e.h,e.s,e.l,e.opacity);if(e instanceof V1||(e=g1(e)),!e)return new va;if(e instanceof va)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,o=a-i,c=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=c<.5?a+i:2-a-i,s*=60):o=c>0&&c<1?0:s,new va(s,o,c,e.opacity)}function hme(e,t,n,r){return arguments.length===1?gN(e):new va(e,t,n,r??1)}function va(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ex(va,hme,mN(V1,{brighter(e){return e=e==null?A2:Math.pow(A2,e),new va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?p1:Math.pow(p1,e),new va(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new oi(My(e>=240?e-240:e+120,i,r),My(e,i,r),My(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new va(Sk(this.h),Fm(this.s),Fm(this.l),L2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=L2(this.opacity);return`${e===1?"hsl(":"hsla("}${Sk(this.h)}, ${Fm(this.s)*100}%, ${Fm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Sk(e){return e=(e||0)%360,e<0?e+360:e}function Fm(e){return Math.max(0,Math.min(1,e||0))}function My(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const tx=e=>()=>e;function UN(e,t){return function(n){return e+n*t}}function fme(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xxe(e,t){var n=t-e;return n?UN(e,n>180||n<-180?n-360*Math.round(n/360):n):tx(isNaN(e)?t:e)}function pme(e){return(e=+e)==1?bN:function(t,n){return n-t?fme(t,n,e):tx(isNaN(t)?n:t)}}function bN(e,t){var n=t-e;return n?UN(e,n):tx(isNaN(e)?t:e)}const _k=function e(t){var n=pme(t);function r(i,a){var s=n((i=g8(i)).r,(a=g8(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),d=bN(i.opacity,a.opacity);return function(l){return i.r=s(l),i.g=o(l),i.b=c(l),i.opacity=d(l),i+""}}return r.gamma=e,r}(1);function bl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var U8=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Iy=new RegExp(U8.source,"g");function mme(e){return function(){return e}}function gme(e){return function(t){return e(t)+""}}function Ume(e,t){var n=U8.lastIndex=Iy.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(e=e+"",t=t+"";(r=U8.exec(e))&&(i=Iy.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,c.push({i:s,x:bl(r,i)})),n=Iy.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?gme(c[0].x):mme(t):(t=c.length,function(d){for(var l=0,h;l<t;++l)o[(h=c[l]).i]=h.x(d);return o.join("")})}var kk=180/Math.PI,b8={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yN(e,t,n,r,i,a){var s,o,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,c/=o),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*kk,skewX:Math.atan(c)*kk,scaleX:s,scaleY:o}}var Bm;function bme(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?b8:yN(t.a,t.b,t.c,t.d,t.e,t.f)}function yme(e){return e==null||(Bm||(Bm=document.createElementNS("http://www.w3.org/2000/svg","g")),Bm.setAttribute("transform",e),!(e=Bm.transform.baseVal.consolidate()))?b8:(e=e.matrix,yN(e.a,e.b,e.c,e.d,e.e,e.f))}function vN(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function a(d,l,h,f,g,U){if(d!==h||l!==f){var y=g.push("translate(",null,t,null,n);U.push({i:y-4,x:bl(d,h)},{i:y-2,x:bl(l,f)})}else(h||f)&&g.push("translate("+h+t+f+n)}function s(d,l,h,f){d!==l?(d-l>180?l+=360:l-d>180&&(d+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:bl(d,l)})):l&&h.push(i(h)+"rotate("+l+r)}function o(d,l,h,f){d!==l?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:bl(d,l)}):l&&h.push(i(h)+"skewX("+l+r)}function c(d,l,h,f,g,U){if(d!==h||l!==f){var y=g.push(i(g)+"scale(",null,",",null,")");U.push({i:y-4,x:bl(d,h)},{i:y-2,x:bl(l,f)})}else(h!==1||f!==1)&&g.push(i(g)+"scale("+h+","+f+")")}return function(d,l){var h=[],f=[];return d=e(d),l=e(l),a(d.translateX,d.translateY,l.translateX,l.translateY,h,f),s(d.rotate,l.rotate,h,f),o(d.skewX,l.skewX,h,f),c(d.scaleX,d.scaleY,l.scaleX,l.scaleY,h,f),d=l=null,function(g){for(var U=-1,y=f.length,v;++U<y;)h[(v=f[U]).i]=v.x(g);return h.join("")}}}var vme=vN(bme,"px, ","px)","deg)"),xme=vN(yme,", ",")",")"),oh=0,lp=0,$f=0,xN=1e3,R2,cp,D2=0,ud=0,t6=0,U1=typeof performance=="object"&&performance.now?performance:Date,wN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function nx(){return ud||(wN(wme),ud=U1.now()+t6)}function wme(){ud=0}function j2(){this._call=this._time=this._next=null}j2.prototype=EN.prototype={constructor:j2,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?nx():+n)+(t==null?0:+t),!this._next&&cp!==this&&(cp?cp._next=this:R2=this,cp=this),this._call=e,this._time=n,y8()},stop:function(){this._call&&(this._call=null,this._time=1/0,y8())}};function EN(e,t,n){var r=new j2;return r.restart(e,t,n),r}function Eme(){nx(),++oh;for(var e=R2,t;e;)(t=ud-e._time)>=0&&e._call.call(void 0,t),e=e._next;--oh}function Tk(){ud=(D2=U1.now())+t6,oh=lp=0;try{Eme()}finally{oh=0,Sme(),ud=0}}function Cme(){var e=U1.now(),t=e-D2;t>xN&&(t6-=t,D2=e)}function Sme(){for(var e,t=R2,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:R2=n);cp=e,y8(r)}function y8(e){if(!oh){lp&&(lp=clearTimeout(lp));var t=e-ud;t>24?(e<1/0&&(lp=setTimeout(Tk,e-U1.now()-t6)),$f&&($f=clearInterval($f))):($f||(D2=U1.now(),$f=setInterval(Cme,xN)),oh=1,wN(Tk))}}function Mk(e,t,n){var r=new j2;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var _me=nN("start","end","cancel","interrupt"),kme=[],CN=0,Ik=1,v8=2,kg=3,Ak=4,x8=5,Tg=6;function n6(e,t,n,r,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Tme(e,n,{name:t,index:r,group:i,on:_me,tween:kme,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:CN})}function rx(e,t){var n=Fa(e,t);if(n.state>CN)throw new Error("too late; already scheduled");return n}function As(e,t){var n=Fa(e,t);if(n.state>kg)throw new Error("too late; already running");return n}function Fa(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Tme(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=EN(a,0,n.time);function a(d){n.state=Ik,n.timer.restart(s,n.delay,n.time),n.delay<=d&&s(d-n.delay)}function s(d){var l,h,f,g;if(n.state!==Ik)return c();for(l in r)if(g=r[l],g.name===n.name){if(g.state===kg)return Mk(s);g.state===Ak?(g.state=Tg,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[l]):+l<t&&(g.state=Tg,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[l])}if(Mk(function(){n.state===kg&&(n.state=Ak,n.timer.restart(o,n.delay,n.time),o(d))}),n.state=v8,n.on.call("start",e,e.__data__,n.index,n.group),n.state===v8){for(n.state=kg,i=new Array(f=n.tween.length),l=0,h=-1;l<f;++l)(g=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function o(d){for(var l=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=x8,1),h=-1,f=i.length;++h<f;)i[h].call(e,l);n.state===x8&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Tg,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Mme(e,t){var n=e.__transition,r,i,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}i=r.state>v8&&r.state<x8,r.state=Tg,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function Ime(e){return this.each(function(){Mme(this,e)})}function Ame(e,t){var n,r;return function(){var i=As(this,e),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Lme(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=As(this,e),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:t,value:n},c=0,d=i.length;c<d;++c)if(i[c].name===t){i[c]=o;break}c===d&&i.push(o)}a.tween=i}}function Rme(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Fa(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?Ame:Lme)(n,e,t))}function ix(e,t,n){var r=e._id;return e.each(function(){var i=As(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Fa(i,r).value[t]}}function SN(e,t){var n;return(typeof t=="number"?bl:t instanceof g1?_k:(n=g1(t))?(t=n,_k):Ume)(e,t)}function Dme(e){return function(){this.removeAttribute(e)}}function jme(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pme(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===r?a:a=t(r=s,n)}}function Nme(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?a:a=t(r=s,n)}}function Ome(e,t,n){var r,i,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=o+"",s===c?null:s===r&&c===i?a:(i=c,a=t(r=s,o)))}}function Fme(e,t,n){var r,i,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=o+"",s===c?null:s===r&&c===i?a:(i=c,a=t(r=s,o)))}}function Bme(e,t){var n=e6(e),r=n==="transform"?xme:SN;return this.attrTween(e,typeof t=="function"?(n.local?Fme:Ome)(n,r,ix(this,"attr."+e,t)):t==null?(n.local?jme:Dme)(n):(n.local?Nme:Pme)(n,r,t))}function $me(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function zme(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Hme(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&zme(e,a)),n}return i._value=t,i}function Wme(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&$me(e,a)),n}return i._value=t,i}function Xme(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=e6(e);return this.tween(n,(r.local?Hme:Wme)(r,t))}function Vme(e,t){return function(){rx(this,e).delay=+t.apply(this,arguments)}}function Yme(e,t){return t=+t,function(){rx(this,e).delay=t}}function Gme(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Vme:Yme)(t,e)):Fa(this.node(),t).delay}function qme(e,t){return function(){As(this,e).duration=+t.apply(this,arguments)}}function Zme(e,t){return t=+t,function(){As(this,e).duration=t}}function Kme(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qme:Zme)(t,e)):Fa(this.node(),t).duration}function Qme(e,t){if(typeof t!="function")throw new Error;return function(){As(this,e).ease=t}}function Jme(e){var t=this._id;return arguments.length?this.each(Qme(t,e)):Fa(this.node(),t).ease}function ege(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;As(this,e).ease=n}}function tge(e){if(typeof e!="function")throw new Error;return this.each(ege(this._id,e))}function nge(e){typeof e!="function"&&(e=aN(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],c,d=0;d<s;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&o.push(c);return new To(r,this._parents,this._name,this._id)}function rge(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var c=t[o],d=n[o],l=c.length,h=s[o]=new Array(l),f,g=0;g<l;++g)(f=c[g]||d[g])&&(h[g]=f);for(;o<r;++o)s[o]=t[o];return new To(s,this._parents,this._name,this._id)}function ige(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function age(e,t,n){var r,i,a=ige(t)?rx:As;return function(){var s=a(this,e),o=s.on;o!==r&&(i=(r=o).copy()).on(t,n),s.on=i}}function sge(e,t){var n=this._id;return arguments.length<2?Fa(this.node(),n).on.on(e):this.each(age(n,e,t))}function oge(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function lge(){return this.on("end.remove",oge(this._id))}function cge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qv(e));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],c=o.length,d=a[s]=new Array(c),l,h,f=0;f<c;++f)(l=o[f])&&(h=e.call(l,l.__data__,f,o))&&("__data__"in l&&(h.__data__=l.__data__),d[f]=h,n6(d[f],t,n,f,d,Fa(l,n)));return new To(a,this._parents,t,n)}function dge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=iN(e));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var c=r[o],d=c.length,l,h=0;h<d;++h)if(l=c[h]){for(var f=e.call(l,l.__data__,h,c),g,U=Fa(l,n),y=0,v=f.length;y<v;++y)(g=f[y])&&n6(g,t,n,y,f,U);a.push(f),s.push(l)}return new To(a,s,t,n)}var uge=X1.prototype.constructor;function hge(){return new uge(this._groups,this._parents)}function fge(e,t){var n,r,i;return function(){var a=sh(this,e),s=(this.style.removeProperty(e),sh(this,e));return a===s?null:a===n&&s===r?i:i=t(n=a,r=s)}}function _N(e){return function(){this.style.removeProperty(e)}}function pge(e,t,n){var r,i=n+"",a;return function(){var s=sh(this,e);return s===i?null:s===r?a:a=t(r=s,n)}}function mge(e,t,n){var r,i,a;return function(){var s=sh(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),sh(this,e))),s===c?null:s===r&&c===i?a:(i=c,a=t(r=s,o))}}function gge(e,t){var n,r,i,a="style."+t,s="end."+a,o;return function(){var c=As(this,e),d=c.on,l=c.value[a]==null?o||(o=_N(t)):void 0;(d!==n||i!==l)&&(r=(n=d).copy()).on(s,i=l),c.on=r}}function Uge(e,t,n){var r=(e+="")=="transform"?vme:SN;return t==null?this.styleTween(e,fge(e,r)).on("end.style."+e,_N(e)):typeof t=="function"?this.styleTween(e,mge(e,r,ix(this,"style."+e,t))).each(gge(this._id,e)):this.styleTween(e,pge(e,r,t),n).on("end.style."+e,null)}function bge(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function yge(e,t,n){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&bge(e,s,n)),r}return a._value=t,a}function vge(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,yge(e,t,n??""))}function xge(e){return function(){this.textContent=e}}function wge(e){return function(){var t=e(this);this.textContent=t??""}}function Ege(e){return this.tween("text",typeof e=="function"?wge(ix(this,"text",e)):xge(e==null?"":e+""))}function Cge(e){return function(t){this.textContent=e.call(this,t)}}function Sge(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cge(i)),t}return r._value=e,r}function _ge(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Sge(e))}function kge(){for(var e=this._name,t=this._id,n=kN(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,c,d=0;d<o;++d)if(c=s[d]){var l=Fa(c,t);n6(c,e,n,d,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new To(r,this._parents,e,n)}function Tge(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},c={value:function(){--i===0&&a()}};n.each(function(){var d=As(this,r),l=d.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),d.on=t}),i===0&&a()})}var Mge=0;function To(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function kN(){return++Mge}var qs=X1.prototype;To.prototype={constructor:To,select:cge,selectAll:dge,selectChild:qs.selectChild,selectChildren:qs.selectChildren,filter:nge,merge:rge,selection:hge,transition:kge,call:qs.call,nodes:qs.nodes,node:qs.node,size:qs.size,empty:qs.empty,each:qs.each,on:sge,attr:Bme,attrTween:Xme,style:Uge,styleTween:vge,text:Ege,textTween:_ge,remove:lge,tween:Rme,delay:Gme,duration:Kme,ease:Jme,easeVarying:tge,end:Tge,[Symbol.iterator]:qs[Symbol.iterator]};function Ige(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Age={time:null,delay:0,duration:250,ease:Ige};function Lge(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Rge(e){var t,n;e instanceof To?(t=e._id,e=e._name):(t=kN(),(n=Age).time=nx(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,c,d=0;d<o;++d)(c=s[d])&&n6(c,e,t,d,s,n||Lge(c,t));return new To(r,this._parents,e,t)}X1.prototype.interrupt=Ime;X1.prototype.transition=Rge;const wxe=Math.abs,Exe=Math.atan2,Cxe=Math.cos,Sxe=Math.max,_xe=Math.min,kxe=Math.sin,Txe=Math.sqrt,Lk=1e-12,ax=Math.PI,Rk=ax/2,Mxe=2*ax;function Ixe(e){return e>1?0:e<-1?ax:Math.acos(e)}function Axe(e){return e>=1?Rk:e<=-1?-Rk:Math.asin(e)}function TN(e){this._context=e}TN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Dge(e){return new TN(e)}class MN{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function jge(e){return new MN(e,!0)}function Pge(e){return new MN(e,!1)}function zl(){}function P2(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function r6(e){this._context=e}r6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:P2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:P2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nge(e){return new r6(e)}function IN(e){this._context=e}IN.prototype={areaStart:zl,areaEnd:zl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:P2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oge(e){return new IN(e)}function AN(e){this._context=e}AN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:P2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fge(e){return new AN(e)}function LN(e,t){this._basis=new r6(e),this._beta=t}LN.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,s=t[n]-i,o=-1,c;++o<=n;)c=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+c*a),this._beta*t[o]+(1-this._beta)*(i+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Bge=function e(t){function n(r){return t===1?new r6(r):new LN(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function N2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function sx(e,t){this._context=e,this._k=(1-t)/6}sx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:N2(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:N2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $ge=function e(t){function n(r){return new sx(r,t)}return n.tension=function(r){return e(+r)},n}(0);function ox(e,t){this._context=e,this._k=(1-t)/6}ox.prototype={areaStart:zl,areaEnd:zl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:N2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zge=function e(t){function n(r){return new ox(r,t)}return n.tension=function(r){return e(+r)},n}(0);function lx(e,t){this._context=e,this._k=(1-t)/6}lx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:N2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Hge=function e(t){function n(r){return new lx(r,t)}return n.tension=function(r){return e(+r)},n}(0);function cx(e,t,n){var r=e._x1,i=e._y1,a=e._x2,s=e._y2;if(e._l01_a>Lk){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>Lk){var d=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*d+e._x1*e._l23_2a-t*e._l12_2a)/l,s=(s*d+e._y1*e._l23_2a-n*e._l12_2a)/l}e._context.bezierCurveTo(r,i,a,s,e._x2,e._y2)}function RN(e,t){this._context=e,this._alpha=t}RN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:cx(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Wge=function e(t){function n(r){return t?new RN(r,t):new sx(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function DN(e,t){this._context=e,this._alpha=t}DN.prototype={areaStart:zl,areaEnd:zl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:cx(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Xge=function e(t){function n(r){return t?new DN(r,t):new ox(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function jN(e,t){this._context=e,this._alpha=t}jN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cx(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Vge=function e(t){function n(r){return t?new jN(r,t):new lx(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function PN(e){this._context=e}PN.prototype={areaStart:zl,areaEnd:zl,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Yge(e){return new PN(e)}function Dk(e){return e<0?-1:1}function jk(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(Dk(a)+Dk(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Pk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ay(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function O2(e){this._context=e}O2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ay(this,this._t0,Pk(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ay(this,Pk(this,n=jk(this,e,t)),n);break;default:Ay(this,this._t0,n=jk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function NN(e){this._context=new ON(e)}(NN.prototype=Object.create(O2.prototype)).point=function(e,t){O2.prototype.point.call(this,t,e)};function ON(e){this._context=e}ON.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Gge(e){return new O2(e)}function qge(e){return new NN(e)}function FN(e){this._context=e}FN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Nk(e),i=Nk(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Nk(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Zge(e){return new FN(e)}function i6(e,t){this._context=e,this._t=t}i6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Kge(e){return new i6(e,.5)}function Qge(e){return new i6(e,0)}function Jge(e){return new i6(e,1)}function dp(e,t,n){this.k=e,this.x=t,this.y=n}dp.prototype={constructor:dp,scale:function(e){return e===1?this:new dp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new dp(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};dp.prototype;/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:BN,setPrototypeOf:Ok,isFrozen:e2e,getPrototypeOf:t2e,getOwnPropertyDescriptor:n2e}=Object;let{freeze:zr,seal:Ji,create:$N}=Object,{apply:w8,construct:E8}=typeof Reflect<"u"&&Reflect;zr||(zr=function(t){return t});Ji||(Ji=function(t){return t});w8||(w8=function(t,n,r){return t.apply(n,r)});E8||(E8=function(t,n){return new t(...n)});const $m=_i(Array.prototype.forEach),Fk=_i(Array.prototype.pop),zf=_i(Array.prototype.push),Mg=_i(String.prototype.toLowerCase),Ly=_i(String.prototype.toString),Bk=_i(String.prototype.match),Hf=_i(String.prototype.replace),r2e=_i(String.prototype.indexOf),i2e=_i(String.prototype.trim),ga=_i(Object.prototype.hasOwnProperty),Dr=_i(RegExp.prototype.test),Wf=a2e(TypeError);function _i(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return w8(e,t,r)}}function a2e(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return E8(e,n)}}function Ct(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Mg;Ok&&Ok(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(e2e(t)||(t[r]=a),i=a)}e[i]=!0}return e}function s2e(e){for(let t=0;t<e.length;t++)ga(e,t)||(e[t]=null);return e}function Cc(e){const t=$N(null);for(const[n,r]of BN(e))ga(e,n)&&(Array.isArray(r)?t[n]=s2e(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Cc(r):t[n]=r);return t}function Xf(e,t){for(;e!==null;){const r=n2e(e,t);if(r){if(r.get)return _i(r.get);if(typeof r.value=="function")return _i(r.value)}e=t2e(e)}function n(){return null}return n}const $k=zr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ry=zr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Dy=zr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),o2e=zr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),jy=zr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),l2e=zr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zk=zr(["#text"]),Hk=zr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Py=zr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wk=zr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zm=zr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),c2e=Ji(/\{\{[\w\W]*|[\w\W]*\}\}/gm),d2e=Ji(/<%[\w\W]*|[\w\W]*%>/gm),u2e=Ji(/\${[\w\W]*}/gm),h2e=Ji(/^data-[\-\w.\u00B7-\uFFFF]/),f2e=Ji(/^aria-[\-\w]+$/),zN=Ji(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),p2e=Ji(/^(?:\w+script|data):/i),m2e=Ji(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),HN=Ji(/^html$/i),g2e=Ji(/^[a-z][.\w]*(-[.\w]+)+$/i);var Xk=Object.freeze({__proto__:null,MUSTACHE_EXPR:c2e,ERB_EXPR:d2e,TMPLIT_EXPR:u2e,DATA_ATTR:h2e,ARIA_ATTR:f2e,IS_ALLOWED_URI:zN,IS_SCRIPT_OR_DATA:p2e,ATTR_WHITESPACE:m2e,DOCTYPE_NAME:HN,CUSTOM_ELEMENT:g2e});const Vf={element:1,text:3,progressingInstruction:7,comment:8,document:9},U2e=function(){return typeof window>"u"?null:window},b2e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function WN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U2e();const t=Ve=>WN(Ve);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Vf.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:c,NodeFilter:d,NamedNodeMap:l=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:g}=e,U=c.prototype,y=Xf(U,"cloneNode"),v=Xf(U,"remove"),x=Xf(U,"nextSibling"),w=Xf(U,"childNodes"),C=Xf(U,"parentNode");if(typeof s=="function"){const Ve=n.createElement("template");Ve.content&&Ve.content.ownerDocument&&(n=Ve.content.ownerDocument)}let S,T="";const{implementation:M,createNodeIterator:_,createDocumentFragment:R,getElementsByTagName:P}=n,{importNode:j}=r;let N={};t.isSupported=typeof BN=="function"&&typeof C=="function"&&M&&M.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:B,TMPLIT_EXPR:G,DATA_ATTR:W,ARIA_ATTR:X,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:H}=Xk;let{IS_ALLOWED_URI:Z}=Xk,V=null;const te=Ct({},[...$k,...Ry,...Dy,...jy,...zk]);let ce=null;const be=Ct({},[...Hk,...Py,...Wk,...zm]);let fe=Object.seal($N(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Ue=null,ye=!0,je=!0,Le=!1,de=!0,Te=!1,qe=!0,Ut=!1,Pe=!1,bt=!1,Tt=!1,zn=!1,Et=!1,nn=!0,Wr=!1;const Ah="user-content-";let xd=!0,jo=!1,Rs={},Ds=null;const wd=Ct({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Zl=null;const Lh=Ct({},["audio","video","img","source","image","track"]);let js=null;const Po=Ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ed="http://www.w3.org/1998/Math/MathML",Kl="http://www.w3.org/2000/svg",Ti="http://www.w3.org/1999/xhtml";let No=Ti,Ql=!1,Jl=null;const Rh=Ct({},[Ed,Kl,Ti],Ly);let Ps=null;const Dh=["application/xhtml+xml","text/html"],Oo="text/html";let rn=null,Ns=null;const K1=n.createElement("form"),jh=function(ee){return ee instanceof RegExp||ee instanceof Function},Cd=function(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ns&&Ns===ee)){if((!ee||typeof ee!="object")&&(ee={}),ee=Cc(ee),Ps=Dh.indexOf(ee.PARSER_MEDIA_TYPE)===-1?Oo:ee.PARSER_MEDIA_TYPE,rn=Ps==="application/xhtml+xml"?Ly:Mg,V=ga(ee,"ALLOWED_TAGS")?Ct({},ee.ALLOWED_TAGS,rn):te,ce=ga(ee,"ALLOWED_ATTR")?Ct({},ee.ALLOWED_ATTR,rn):be,Jl=ga(ee,"ALLOWED_NAMESPACES")?Ct({},ee.ALLOWED_NAMESPACES,Ly):Rh,js=ga(ee,"ADD_URI_SAFE_ATTR")?Ct(Cc(Po),ee.ADD_URI_SAFE_ATTR,rn):Po,Zl=ga(ee,"ADD_DATA_URI_TAGS")?Ct(Cc(Lh),ee.ADD_DATA_URI_TAGS,rn):Lh,Ds=ga(ee,"FORBID_CONTENTS")?Ct({},ee.FORBID_CONTENTS,rn):wd,Se=ga(ee,"FORBID_TAGS")?Ct({},ee.FORBID_TAGS,rn):{},Ue=ga(ee,"FORBID_ATTR")?Ct({},ee.FORBID_ATTR,rn):{},Rs=ga(ee,"USE_PROFILES")?ee.USE_PROFILES:!1,ye=ee.ALLOW_ARIA_ATTR!==!1,je=ee.ALLOW_DATA_ATTR!==!1,Le=ee.ALLOW_UNKNOWN_PROTOCOLS||!1,de=ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=ee.SAFE_FOR_TEMPLATES||!1,qe=ee.SAFE_FOR_XML!==!1,Ut=ee.WHOLE_DOCUMENT||!1,Tt=ee.RETURN_DOM||!1,zn=ee.RETURN_DOM_FRAGMENT||!1,Et=ee.RETURN_TRUSTED_TYPE||!1,bt=ee.FORCE_BODY||!1,nn=ee.SANITIZE_DOM!==!1,Wr=ee.SANITIZE_NAMED_PROPS||!1,xd=ee.KEEP_CONTENT!==!1,jo=ee.IN_PLACE||!1,Z=ee.ALLOWED_URI_REGEXP||zN,No=ee.NAMESPACE||Ti,fe=ee.CUSTOM_ELEMENT_HANDLING||{},ee.CUSTOM_ELEMENT_HANDLING&&jh(ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ee.CUSTOM_ELEMENT_HANDLING&&jh(ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ee.CUSTOM_ELEMENT_HANDLING&&typeof ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Te&&(je=!1),zn&&(Tt=!0),Rs&&(V=Ct({},zk),ce=[],Rs.html===!0&&(Ct(V,$k),Ct(ce,Hk)),Rs.svg===!0&&(Ct(V,Ry),Ct(ce,Py),Ct(ce,zm)),Rs.svgFilters===!0&&(Ct(V,Dy),Ct(ce,Py),Ct(ce,zm)),Rs.mathMl===!0&&(Ct(V,jy),Ct(ce,Wk),Ct(ce,zm))),ee.ADD_TAGS&&(V===te&&(V=Cc(V)),Ct(V,ee.ADD_TAGS,rn)),ee.ADD_ATTR&&(ce===be&&(ce=Cc(ce)),Ct(ce,ee.ADD_ATTR,rn)),ee.ADD_URI_SAFE_ATTR&&Ct(js,ee.ADD_URI_SAFE_ATTR,rn),ee.FORBID_CONTENTS&&(Ds===wd&&(Ds=Cc(Ds)),Ct(Ds,ee.FORBID_CONTENTS,rn)),xd&&(V["#text"]=!0),Ut&&Ct(V,["html","head","body"]),V.table&&(Ct(V,["tbody"]),delete Se.tbody),ee.TRUSTED_TYPES_POLICY){if(typeof ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=ee.TRUSTED_TYPES_POLICY,T=S.createHTML("")}else S===void 0&&(S=b2e(g,i)),S!==null&&typeof T=="string"&&(T=S.createHTML(""));zr&&zr(ee),Ns=ee}},Ph=Ct({},["mi","mo","mn","ms","mtext"]),Sd=Ct({},["foreignobject","annotation-xml"]),Q1=Ct({},["title","style","font","a","script"]),Fo=Ct({},[...Ry,...Dy,...o2e]),_d=Ct({},[...jy,...l2e]),ec=function(ee){let Ee=C(ee);(!Ee||!Ee.tagName)&&(Ee={namespaceURI:No,tagName:"template"});const ze=Mg(ee.tagName),Wt=Mg(Ee.tagName);return Jl[ee.namespaceURI]?ee.namespaceURI===Kl?Ee.namespaceURI===Ti?ze==="svg":Ee.namespaceURI===Ed?ze==="svg"&&(Wt==="annotation-xml"||Ph[Wt]):!!Fo[ze]:ee.namespaceURI===Ed?Ee.namespaceURI===Ti?ze==="math":Ee.namespaceURI===Kl?ze==="math"&&Sd[Wt]:!!_d[ze]:ee.namespaceURI===Ti?Ee.namespaceURI===Kl&&!Sd[Wt]||Ee.namespaceURI===Ed&&!Ph[Wt]?!1:!_d[ze]&&(Q1[ze]||!Fo[ze]):!!(Ps==="application/xhtml+xml"&&Jl[ee.namespaceURI]):!1},Mi=function(ee){zf(t.removed,{element:ee});try{C(ee).removeChild(ee)}catch{v(ee)}},Ba=function(ee,Ee){try{zf(t.removed,{attribute:Ee.getAttributeNode(ee),from:Ee})}catch{zf(t.removed,{attribute:null,from:Ee})}if(Ee.removeAttribute(ee),ee==="is"&&!ce[ee])if(Tt||zn)try{Mi(Ee)}catch{}else try{Ee.setAttribute(ee,"")}catch{}},tc=function(ee){let Ee=null,ze=null;if(bt)ee="<remove></remove>"+ee;else{const vt=Bk(ee,/^[\r\n\t ]+/);ze=vt&&vt[0]}Ps==="application/xhtml+xml"&&No===Ti&&(ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ee+"</body></html>");const Wt=S?S.createHTML(ee):ee;if(No===Ti)try{Ee=new f().parseFromString(Wt,Ps)}catch{}if(!Ee||!Ee.documentElement){Ee=M.createDocument(No,"template",null);try{Ee.documentElement.innerHTML=Ql?T:Wt}catch{}}const Qn=Ee.body||Ee.documentElement;return ee&&ze&&Qn.insertBefore(n.createTextNode(ze),Qn.childNodes[0]||null),No===Ti?P.call(Ee,Ut?"html":"body")[0]:Ut?Ee.documentElement:Qn},nc=function(ee){return _.call(ee.ownerDocument||ee,ee,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},kd=function(ee){return ee instanceof h&&(typeof ee.nodeName!="string"||typeof ee.textContent!="string"||typeof ee.removeChild!="function"||!(ee.attributes instanceof l)||typeof ee.removeAttribute!="function"||typeof ee.setAttribute!="function"||typeof ee.namespaceURI!="string"||typeof ee.insertBefore!="function"||typeof ee.hasChildNodes!="function")},J1=function(ee){return typeof o=="function"&&ee instanceof o},ra=function(ee,Ee,ze){N[ee]&&$m(N[ee],Wt=>{Wt.call(t,Ee,ze,Ns)})},e0=function(ee){let Ee=null;if(ra("beforeSanitizeElements",ee,null),kd(ee))return Mi(ee),!0;const ze=rn(ee.nodeName);if(ra("uponSanitizeElement",ee,{tagName:ze,allowedTags:V}),ee.hasChildNodes()&&!J1(ee.firstElementChild)&&Dr(/<[/\w]/g,ee.innerHTML)&&Dr(/<[/\w]/g,ee.textContent)||ee.nodeType===Vf.progressingInstruction||qe&&ee.nodeType===Vf.comment&&Dr(/<[/\w]/g,ee.data))return Mi(ee),!0;if(!V[ze]||Se[ze]){if(!Se[ze]&&Nh(ze)&&(fe.tagNameCheck instanceof RegExp&&Dr(fe.tagNameCheck,ze)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ze)))return!1;if(xd&&!Ds[ze]){const Wt=C(ee)||ee.parentNode,Qn=w(ee)||ee.childNodes;if(Qn&&Wt){const vt=Qn.length;for(let mr=vt-1;mr>=0;--mr){const Xr=y(Qn[mr],!0);Xr.__removalCount=(ee.__removalCount||0)+1,Wt.insertBefore(Xr,x(ee))}}}return Mi(ee),!0}return ee instanceof c&&!ec(ee)||(ze==="noscript"||ze==="noembed"||ze==="noframes")&&Dr(/<\/no(script|embed|frames)/i,ee.innerHTML)?(Mi(ee),!0):(Te&&ee.nodeType===Vf.text&&(Ee=ee.textContent,$m([F,B,G],Wt=>{Ee=Hf(Ee,Wt," ")}),ee.textContent!==Ee&&(zf(t.removed,{element:ee.cloneNode()}),ee.textContent=Ee)),ra("afterSanitizeElements",ee,null),!1)},$a=function(ee,Ee,ze){if(nn&&(Ee==="id"||Ee==="name")&&(ze in n||ze in K1))return!1;if(!(je&&!Ue[Ee]&&Dr(W,Ee))){if(!(ye&&Dr(X,Ee))){if(!ce[Ee]||Ue[Ee]){if(!(Nh(ee)&&(fe.tagNameCheck instanceof RegExp&&Dr(fe.tagNameCheck,ee)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ee))&&(fe.attributeNameCheck instanceof RegExp&&Dr(fe.attributeNameCheck,Ee)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(Ee))||Ee==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&Dr(fe.tagNameCheck,ze)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ze))))return!1}else if(!js[Ee]){if(!Dr(Z,Hf(ze,Y,""))){if(!((Ee==="src"||Ee==="xlink:href"||Ee==="href")&&ee!=="script"&&r2e(ze,"data:")===0&&Zl[ee])){if(!(Le&&!Dr($,Hf(ze,Y,"")))){if(ze)return!1}}}}}}return!0},Nh=function(ee){return ee!=="annotation-xml"&&Bk(ee,H)},Oh=function(ee){ra("beforeSanitizeAttributes",ee,null);const{attributes:Ee}=ee;if(!Ee)return;const ze={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ce};let Wt=Ee.length;for(;Wt--;){const Qn=Ee[Wt],{name:vt,namespaceURI:mr,value:Xr}=Qn,Bo=rn(vt);let Rn=vt==="value"?Xr:i2e(Xr);if(ze.attrName=Bo,ze.attrValue=Rn,ze.keepAttr=!0,ze.forceKeepAttr=void 0,ra("uponSanitizeAttribute",ee,ze),Rn=ze.attrValue,qe&&Dr(/((--!?|])>)|<\/(style|title)/i,Rn)){Ba(vt,ee);continue}if(ze.forceKeepAttr||(Ba(vt,ee),!ze.keepAttr))continue;if(!de&&Dr(/\/>/i,Rn)){Ba(vt,ee);continue}Te&&$m([F,B,G],Fh=>{Rn=Hf(Rn,Fh," ")});const t0=rn(ee.nodeName);if($a(t0,Bo,Rn)){if(Wr&&(Bo==="id"||Bo==="name")&&(Ba(vt,ee),Rn=Ah+Rn),S&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!mr)switch(g.getAttributeType(t0,Bo)){case"TrustedHTML":{Rn=S.createHTML(Rn);break}case"TrustedScriptURL":{Rn=S.createScriptURL(Rn);break}}try{mr?ee.setAttributeNS(mr,vt,Rn):ee.setAttribute(vt,Rn),kd(ee)?Mi(ee):Fk(t.removed)}catch{}}}ra("afterSanitizeAttributes",ee,null)},b6=function Ve(ee){let Ee=null;const ze=nc(ee);for(ra("beforeSanitizeShadowDOM",ee,null);Ee=ze.nextNode();)ra("uponSanitizeShadowNode",Ee,null),!e0(Ee)&&(Ee.content instanceof a&&Ve(Ee.content),Oh(Ee));ra("afterSanitizeShadowDOM",ee,null)};return t.sanitize=function(Ve){let ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ee=null,ze=null,Wt=null,Qn=null;if(Ql=!Ve,Ql&&(Ve="<!-->"),typeof Ve!="string"&&!J1(Ve))if(typeof Ve.toString=="function"){if(Ve=Ve.toString(),typeof Ve!="string")throw Wf("dirty is not a string, aborting")}else throw Wf("toString is not a function");if(!t.isSupported)return Ve;if(Pe||Cd(ee),t.removed=[],typeof Ve=="string"&&(jo=!1),jo){if(Ve.nodeName){const Xr=rn(Ve.nodeName);if(!V[Xr]||Se[Xr])throw Wf("root node is forbidden and cannot be sanitized in-place")}}else if(Ve instanceof o)Ee=tc("<!---->"),ze=Ee.ownerDocument.importNode(Ve,!0),ze.nodeType===Vf.element&&ze.nodeName==="BODY"||ze.nodeName==="HTML"?Ee=ze:Ee.appendChild(ze);else{if(!Tt&&!Te&&!Ut&&Ve.indexOf("<")===-1)return S&&Et?S.createHTML(Ve):Ve;if(Ee=tc(Ve),!Ee)return Tt?null:Et?T:""}Ee&&bt&&Mi(Ee.firstChild);const vt=nc(jo?Ve:Ee);for(;Wt=vt.nextNode();)e0(Wt)||(Wt.content instanceof a&&b6(Wt.content),Oh(Wt));if(jo)return Ve;if(Tt){if(zn)for(Qn=R.call(Ee.ownerDocument);Ee.firstChild;)Qn.appendChild(Ee.firstChild);else Qn=Ee;return(ce.shadowroot||ce.shadowrootmode)&&(Qn=j.call(r,Qn,!0)),Qn}let mr=Ut?Ee.outerHTML:Ee.innerHTML;return Ut&&V["!doctype"]&&Ee.ownerDocument&&Ee.ownerDocument.doctype&&Ee.ownerDocument.doctype.name&&Dr(HN,Ee.ownerDocument.doctype.name)&&(mr="<!DOCTYPE "+Ee.ownerDocument.doctype.name+`>
|
|
266
|
+
`+mr),Te&&$m([F,B,G],Xr=>{mr=Hf(mr,Xr," ")}),S&&Et?S.createHTML(mr):mr},t.setConfig=function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cd(Ve),Pe=!0},t.clearConfig=function(){Ns=null,Pe=!1},t.isValidAttribute=function(Ve,ee,Ee){Ns||Cd({});const ze=rn(Ve),Wt=rn(ee);return $a(ze,Wt,Ee)},t.addHook=function(Ve,ee){typeof ee=="function"&&(N[Ve]=N[Ve]||[],zf(N[Ve],ee))},t.removeHook=function(Ve){if(N[Ve])return Fk(N[Ve])},t.removeHooks=function(Ve){N[Ve]&&(N[Ve]=[])},t.removeAllHooks=function(){N={}},t}var lh=WN();const Ig={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return n*2.55;e/=360,t/=100,n/=100;const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;switch(r){case"r":return Ig.hue2rgb(a,i,e+1/3)*255;case"g":return Ig.hue2rgb(a,i,e)*255;case"b":return Ig.hue2rgb(a,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;const i=Math.max(e,t,n),a=Math.min(e,t,n),s=(i+a)/2;if(r==="l")return s*100;if(i===a)return 0;const o=i-a,c=s>.5?o/(2-i-a):o/(i+a);if(r==="s")return c*100;switch(i){case e:return((t-n)/o+(t<n?6:0))*60;case t:return((n-e)/o+2)*60;case n:return((e-t)/o+4)*60;default:return-1}}},y2e={clamp:(e,t,n)=>t>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},v2e={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ot={channel:Ig,lang:y2e,unit:v2e},gl={};for(let e=0;e<=255;e++)gl[e]=ot.unit.dec2hex(e);const xr={ALL:0,RGB:1,HSL:2};class x2e{constructor(){this.type=xr.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=xr.ALL}is(t){return this.type===t}}class w2e{constructor(t,n){this.color=n,this.changed=!1,this.data=t,this.type=new x2e}set(t,n){return this.color=n,this.changed=!1,this.data=t,this.type.type=xr.ALL,this}_ensureHSL(){const t=this.data,{h:n,s:r,l:i}=t;n===void 0&&(t.h=ot.channel.rgb2hsl(t,"h")),r===void 0&&(t.s=ot.channel.rgb2hsl(t,"s")),i===void 0&&(t.l=ot.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:n,g:r,b:i}=t;n===void 0&&(t.r=ot.channel.hsl2rgb(t,"r")),r===void 0&&(t.g=ot.channel.hsl2rgb(t,"g")),i===void 0&&(t.b=ot.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,n=t.r;return!this.type.is(xr.HSL)&&n!==void 0?n:(this._ensureHSL(),ot.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,n=t.g;return!this.type.is(xr.HSL)&&n!==void 0?n:(this._ensureHSL(),ot.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,n=t.b;return!this.type.is(xr.HSL)&&n!==void 0?n:(this._ensureHSL(),ot.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,n=t.h;return!this.type.is(xr.RGB)&&n!==void 0?n:(this._ensureRGB(),ot.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,n=t.s;return!this.type.is(xr.RGB)&&n!==void 0?n:(this._ensureRGB(),ot.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,n=t.l;return!this.type.is(xr.RGB)&&n!==void 0?n:(this._ensureRGB(),ot.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(xr.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(xr.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(xr.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(xr.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(xr.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(xr.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const a6=new w2e({r:0,g:0,b:0,a:0},"transparent"),Nu={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Nu.re);if(!t)return;const n=t[1],r=parseInt(n,16),i=n.length,a=i%4===0,s=i>4,o=s?1:17,c=s?8:4,d=a?0:-1,l=s?255:15;return a6.set({r:(r>>c*(d+3)&l)*o,g:(r>>c*(d+2)&l)*o,b:(r>>c*(d+1)&l)*o,a:a?(r&l)*o/255:1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`#${gl[Math.round(t)]}${gl[Math.round(n)]}${gl[Math.round(r)]}${gl[Math.round(i*255)]}`:`#${gl[Math.round(t)]}${gl[Math.round(n)]}${gl[Math.round(r)]}`}},Fc={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Fc.hueRe);if(t){const[,n,r]=t;switch(r){case"grad":return ot.channel.clamp.h(parseFloat(n)*.9);case"rad":return ot.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return ot.channel.clamp.h(parseFloat(n)*360)}}return ot.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const n=e.match(Fc.re);if(!n)return;const[,r,i,a,s,o]=n;return a6.set({h:Fc._hue2deg(r),s:ot.channel.clamp.s(parseFloat(i)),l:ot.channel.clamp.l(parseFloat(a)),a:s?ot.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${ot.lang.round(t)}, ${ot.lang.round(n)}%, ${ot.lang.round(r)}%, ${i})`:`hsl(${ot.lang.round(t)}, ${ot.lang.round(n)}%, ${ot.lang.round(r)}%)`}},Ip={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Ip.colors[e];if(t)return Nu.parse(t)},stringify:e=>{const t=Nu.stringify(e);for(const n in Ip.colors)if(Ip.colors[n]===t)return n}},up={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const n=e.match(up.re);if(!n)return;const[,r,i,a,s,o,c,d,l]=n;return a6.set({r:ot.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:ot.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:ot.channel.clamp.b(c?parseFloat(o)*2.55:parseFloat(o)),a:d?ot.channel.clamp.a(l?parseFloat(d)/100:parseFloat(d)):1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${ot.lang.round(t)}, ${ot.lang.round(n)}, ${ot.lang.round(r)}, ${ot.lang.round(i)})`:`rgb(${ot.lang.round(t)}, ${ot.lang.round(n)}, ${ot.lang.round(r)})`}},Cs={format:{keyword:Ip,hex:Nu,rgb:up,rgba:up,hsl:Fc,hsla:Fc},parse:e=>{if(typeof e!="string")return e;const t=Nu.parse(e)||up.parse(e)||Fc.parse(e)||Ip.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(xr.HSL)||e.data.r===void 0?Fc.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?up.stringify(e):Nu.stringify(e)},XN=(e,t)=>{const n=Cs.parse(e);for(const r in t)n[r]=ot.channel.clamp[r](t[r]);return Cs.stringify(n)},Ap=(e,t,n=0,r=1)=>{if(typeof e!="number")return XN(e,{a:t});const i=a6.set({r:ot.channel.clamp.r(e),g:ot.channel.clamp.g(t),b:ot.channel.clamp.b(n),a:ot.channel.clamp.a(r)});return Cs.stringify(i)},E2e=e=>{const{r:t,g:n,b:r}=Cs.parse(e),i=.2126*ot.channel.toLinear(t)+.7152*ot.channel.toLinear(n)+.0722*ot.channel.toLinear(r);return ot.lang.round(i)},C2e=e=>E2e(e)>=.5,Y1=e=>!C2e(e),VN=(e,t,n)=>{const r=Cs.parse(e),i=r[t],a=ot.channel.clamp[t](i+n);return i!==a&&(r[t]=a),Cs.stringify(r)},Ye=(e,t)=>VN(e,"l",t),tt=(e,t)=>VN(e,"l",-t),re=(e,t)=>{const n=Cs.parse(e),r={};for(const i in t)t[i]&&(r[i]=n[i]+t[i]);return XN(e,r)},S2e=(e,t,n=50)=>{const{r,g:i,b:a,a:s}=Cs.parse(e),{r:o,g:c,b:d,a:l}=Cs.parse(t),h=n/100,f=h*2-1,g=s-l,y=((f*g===-1?f:(f+g)/(1+f*g))+1)/2,v=1-y,x=r*y+o*v,w=i*y+c*v,C=a*y+d*v,S=s*h+l*(1-h);return Ap(x,w,C,S)},Ae=(e,t=100)=>{const n=Cs.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,S2e(n,e,t)};var YN=typeof global=="object"&&global&&global.Object===Object&&global,_2e=typeof self=="object"&&self&&self.Object===Object&&self,Ls=YN||_2e||Function("return this")(),F2=Ls.Symbol,GN=Object.prototype,k2e=GN.hasOwnProperty,T2e=GN.toString,Yf=F2?F2.toStringTag:void 0;function M2e(e){var t=k2e.call(e,Yf),n=e[Yf];try{e[Yf]=void 0;var r=!0}catch{}var i=T2e.call(e);return r&&(t?e[Yf]=n:delete e[Yf]),i}var I2e=Object.prototype,A2e=I2e.toString;function L2e(e){return A2e.call(e)}var R2e="[object Null]",D2e="[object Undefined]",Vk=F2?F2.toStringTag:void 0;function kh(e){return e==null?e===void 0?D2e:R2e:Vk&&Vk in Object(e)?M2e(e):L2e(e)}function bd(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var j2e="[object AsyncFunction]",P2e="[object Function]",N2e="[object GeneratorFunction]",O2e="[object Proxy]";function dx(e){if(!bd(e))return!1;var t=kh(e);return t==P2e||t==N2e||t==j2e||t==O2e}var Ny=Ls["__core-js_shared__"],Yk=function(){var e=/[^.]+$/.exec(Ny&&Ny.keys&&Ny.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function F2e(e){return!!Yk&&Yk in e}var B2e=Function.prototype,$2e=B2e.toString;function yd(e){if(e!=null){try{return $2e.call(e)}catch{}try{return e+""}catch{}}return""}var z2e=/[\\^$.*+?()[\]{}|]/g,H2e=/^\[object .+?Constructor\]$/,W2e=Function.prototype,X2e=Object.prototype,V2e=W2e.toString,Y2e=X2e.hasOwnProperty,G2e=RegExp("^"+V2e.call(Y2e).replace(z2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q2e(e){if(!bd(e)||F2e(e))return!1;var t=dx(e)?G2e:H2e;return t.test(yd(e))}function Z2e(e,t){return e==null?void 0:e[t]}function vd(e,t){var n=Z2e(e,t);return q2e(n)?n:void 0}var b1=vd(Object,"create");function K2e(){this.__data__=b1?b1(null):{},this.size=0}function Q2e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var J2e="__lodash_hash_undefined__",eUe=Object.prototype,tUe=eUe.hasOwnProperty;function nUe(e){var t=this.__data__;if(b1){var n=t[e];return n===J2e?void 0:n}return tUe.call(t,e)?t[e]:void 0}var rUe=Object.prototype,iUe=rUe.hasOwnProperty;function aUe(e){var t=this.__data__;return b1?t[e]!==void 0:iUe.call(t,e)}var sUe="__lodash_hash_undefined__";function oUe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=b1&&t===void 0?sUe:t,this}function hd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hd.prototype.clear=K2e;hd.prototype.delete=Q2e;hd.prototype.get=nUe;hd.prototype.has=aUe;hd.prototype.set=oUe;function lUe(){this.__data__=[],this.size=0}function s6(e,t){return e===t||e!==e&&t!==t}function o6(e,t){for(var n=e.length;n--;)if(s6(e[n][0],t))return n;return-1}var cUe=Array.prototype,dUe=cUe.splice;function uUe(e){var t=this.__data__,n=o6(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():dUe.call(t,n,1),--this.size,!0}function hUe(e){var t=this.__data__,n=o6(t,e);return n<0?void 0:t[n][1]}function fUe(e){return o6(this.__data__,e)>-1}function pUe(e,t){var n=this.__data__,r=o6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Do(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Do.prototype.clear=lUe;Do.prototype.delete=uUe;Do.prototype.get=hUe;Do.prototype.has=fUe;Do.prototype.set=pUe;var y1=vd(Ls,"Map");function mUe(){this.size=0,this.__data__={hash:new hd,map:new(y1||Do),string:new hd}}function gUe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function l6(e,t){var n=e.__data__;return gUe(t)?n[typeof t=="string"?"string":"hash"]:n.map}function UUe(e){var t=l6(this,e).delete(e);return this.size-=t?1:0,t}function bUe(e){return l6(this,e).get(e)}function yUe(e){return l6(this,e).has(e)}function vUe(e,t){var n=l6(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ql(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ql.prototype.clear=mUe;ql.prototype.delete=UUe;ql.prototype.get=bUe;ql.prototype.has=yUe;ql.prototype.set=vUe;var xUe="Expected a function";function G1(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(xUe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(G1.Cache||ql),n}G1.Cache=ql;function wUe(){this.__data__=new Do,this.size=0}function EUe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function CUe(e){return this.__data__.get(e)}function SUe(e){return this.__data__.has(e)}var _Ue=200;function kUe(e,t){var n=this.__data__;if(n instanceof Do){var r=n.__data__;if(!y1||r.length<_Ue-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ql(r)}return n.set(e,t),this.size=n.size,this}function Th(e){var t=this.__data__=new Do(e);this.size=t.size}Th.prototype.clear=wUe;Th.prototype.delete=EUe;Th.prototype.get=CUe;Th.prototype.has=SUe;Th.prototype.set=kUe;var B2=function(){try{var e=vd(Object,"defineProperty");return e({},"",{}),e}catch{}}();function ux(e,t,n){t=="__proto__"&&B2?B2(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function C8(e,t,n){(n!==void 0&&!s6(e[t],n)||n===void 0&&!(t in e))&&ux(e,t,n)}function TUe(e){return function(t,n,r){for(var i=-1,a=Object(t),s=r(t),o=s.length;o--;){var c=s[++i];if(n(a[c],c,a)===!1)break}return t}}var MUe=TUe(),qN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gk=qN&&typeof module=="object"&&module&&!module.nodeType&&module,IUe=Gk&&Gk.exports===qN,qk=IUe?Ls.Buffer:void 0,Zk=qk?qk.allocUnsafe:void 0;function AUe(e,t){if(t)return e.slice();var n=e.length,r=Zk?Zk(n):new e.constructor(n);return e.copy(r),r}var Kk=Ls.Uint8Array;function LUe(e){var t=new e.constructor(e.byteLength);return new Kk(t).set(new Kk(e)),t}function RUe(e,t){var n=t?LUe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function DUe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Qk=Object.create,jUe=function(){function e(){}return function(t){if(!bd(t))return{};if(Qk)return Qk(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ZN(e,t){return function(n){return e(t(n))}}var KN=ZN(Object.getPrototypeOf,Object),PUe=Object.prototype;function c6(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||PUe;return e===n}function NUe(e){return typeof e.constructor=="function"&&!c6(e)?jUe(KN(e)):{}}function q1(e){return e!=null&&typeof e=="object"}var OUe="[object Arguments]";function Jk(e){return q1(e)&&kh(e)==OUe}var QN=Object.prototype,FUe=QN.hasOwnProperty,BUe=QN.propertyIsEnumerable,$2=Jk(function(){return arguments}())?Jk:function(e){return q1(e)&&FUe.call(e,"callee")&&!BUe.call(e,"callee")},z2=Array.isArray,$Ue=9007199254740991;function JN(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$Ue}function d6(e){return e!=null&&JN(e.length)&&!dx(e)}function zUe(e){return q1(e)&&d6(e)}function HUe(){return!1}var eO=typeof exports=="object"&&exports&&!exports.nodeType&&exports,eT=eO&&typeof module=="object"&&module&&!module.nodeType&&module,WUe=eT&&eT.exports===eO,tT=WUe?Ls.Buffer:void 0,XUe=tT?tT.isBuffer:void 0,hx=XUe||HUe,VUe="[object Object]",YUe=Function.prototype,GUe=Object.prototype,tO=YUe.toString,qUe=GUe.hasOwnProperty,ZUe=tO.call(Object);function KUe(e){if(!q1(e)||kh(e)!=VUe)return!1;var t=KN(e);if(t===null)return!0;var n=qUe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&tO.call(n)==ZUe}var QUe="[object Arguments]",JUe="[object Array]",e6e="[object Boolean]",t6e="[object Date]",n6e="[object Error]",r6e="[object Function]",i6e="[object Map]",a6e="[object Number]",s6e="[object Object]",o6e="[object RegExp]",l6e="[object Set]",c6e="[object String]",d6e="[object WeakMap]",u6e="[object ArrayBuffer]",h6e="[object DataView]",f6e="[object Float32Array]",p6e="[object Float64Array]",m6e="[object Int8Array]",g6e="[object Int16Array]",U6e="[object Int32Array]",b6e="[object Uint8Array]",y6e="[object Uint8ClampedArray]",v6e="[object Uint16Array]",x6e="[object Uint32Array]",on={};on[f6e]=on[p6e]=on[m6e]=on[g6e]=on[U6e]=on[b6e]=on[y6e]=on[v6e]=on[x6e]=!0;on[QUe]=on[JUe]=on[u6e]=on[e6e]=on[h6e]=on[t6e]=on[n6e]=on[r6e]=on[i6e]=on[a6e]=on[s6e]=on[o6e]=on[l6e]=on[c6e]=on[d6e]=!1;function w6e(e){return q1(e)&&JN(e.length)&&!!on[kh(e)]}function E6e(e){return function(t){return e(t)}}var nO=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Lp=nO&&typeof module=="object"&&module&&!module.nodeType&&module,C6e=Lp&&Lp.exports===nO,Oy=C6e&&YN.process,nT=function(){try{var e=Lp&&Lp.require&&Lp.require("util").types;return e||Oy&&Oy.binding&&Oy.binding("util")}catch{}}(),rT=nT&&nT.isTypedArray,fx=rT?E6e(rT):w6e;function S8(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var S6e=Object.prototype,_6e=S6e.hasOwnProperty;function k6e(e,t,n){var r=e[t];(!(_6e.call(e,t)&&s6(r,n))||n===void 0&&!(t in e))&&ux(e,t,n)}function T6e(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var o=t[a],c=void 0;c===void 0&&(c=e[o]),i?ux(n,o,c):k6e(n,o,c)}return n}function M6e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var I6e=9007199254740991,A6e=/^(?:0|[1-9]\d*)$/;function rO(e,t){var n=typeof e;return t=t??I6e,!!t&&(n=="number"||n!="symbol"&&A6e.test(e))&&e>-1&&e%1==0&&e<t}var L6e=Object.prototype,R6e=L6e.hasOwnProperty;function D6e(e,t){var n=z2(e),r=!n&&$2(e),i=!n&&!r&&hx(e),a=!n&&!r&&!i&&fx(e),s=n||r||i||a,o=s?M6e(e.length,String):[],c=o.length;for(var d in e)(t||R6e.call(e,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||rO(d,c)))&&o.push(d);return o}function j6e(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var P6e=Object.prototype,N6e=P6e.hasOwnProperty;function O6e(e){if(!bd(e))return j6e(e);var t=c6(e),n=[];for(var r in e)r=="constructor"&&(t||!N6e.call(e,r))||n.push(r);return n}function iO(e){return d6(e)?D6e(e,!0):O6e(e)}function F6e(e){return T6e(e,iO(e))}function B6e(e,t,n,r,i,a,s){var o=S8(e,n),c=S8(t,n),d=s.get(c);if(d){C8(e,n,d);return}var l=a?a(o,c,n+"",e,t,s):void 0,h=l===void 0;if(h){var f=z2(c),g=!f&&hx(c),U=!f&&!g&&fx(c);l=c,f||g||U?z2(o)?l=o:zUe(o)?l=DUe(o):g?(h=!1,l=AUe(c,!0)):U?(h=!1,l=RUe(c,!0)):l=[]:KUe(c)||$2(c)?(l=o,$2(o)?l=F6e(o):(!bd(o)||dx(o))&&(l=NUe(c))):h=!1}h&&(s.set(c,l),i(l,c,r,a,s),s.delete(c)),C8(e,n,l)}function aO(e,t,n,r,i){e!==t&&MUe(t,function(a,s){if(i||(i=new Th),bd(a))B6e(e,t,s,n,aO,r,i);else{var o=r?r(S8(e,s),a,s+"",e,t,i):void 0;o===void 0&&(o=a),C8(e,s,o)}},iO)}function sO(e){return e}function $6e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var iT=Math.max;function z6e(e,t,n){return t=iT(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=iT(r.length-t,0),s=Array(a);++i<a;)s[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(s),$6e(e,this,o)}}function H6e(e){return function(){return e}}var W6e=B2?function(e,t){return B2(e,"toString",{configurable:!0,enumerable:!1,value:H6e(t),writable:!0})}:sO,X6e=800,V6e=16,Y6e=Date.now;function G6e(e){var t=0,n=0;return function(){var r=Y6e(),i=V6e-(r-n);if(n=r,i>0){if(++t>=X6e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var q6e=G6e(W6e);function Z6e(e,t){return q6e(z6e(e,t,sO),e+"")}function K6e(e,t,n){if(!bd(n))return!1;var r=typeof t;return(r=="number"?d6(n)&&rO(t,n.length):r=="string"&&t in n)?s6(n[t],e):!1}function Q6e(e){return Z6e(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,s&&K6e(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,a)}return t})}var J6e=Q6e(function(e,t,n){aO(e,t,n)}),oO="comm",lO="rule",cO="decl",e5e="@import",t5e="@namespace",n5e="@keyframes",r5e="@layer",dO=Math.abs,px=String.fromCharCode;function uO(e){return e.trim()}function Ag(e,t,n){return e.replace(t,n)}function i5e(e,t,n){return e.indexOf(t,n)}function Ou(e,t){return e.charCodeAt(t)|0}function ch(e,t,n){return e.slice(t,n)}function is(e){return e.length}function a5e(e){return e.length}function Hm(e,t){return t.push(e),e}var u6=1,dh=1,hO=0,ea=0,Nn=0,Mh="";function mx(e,t,n,r,i,a,s,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:u6,column:dh,length:s,return:"",siblings:o}}function s5e(){return Nn}function o5e(){return Nn=ea>0?Ou(Mh,--ea):0,dh--,Nn===10&&(dh=1,u6--),Nn}function Aa(){return Nn=ea<hO?Ou(Mh,ea++):0,dh++,Nn===10&&(dh=1,u6++),Nn}function kl(){return Ou(Mh,ea)}function Lg(){return ea}function h6(e,t){return ch(Mh,e,t)}function v1(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function l5e(e){return u6=dh=1,hO=is(Mh=e),ea=0,[]}function c5e(e){return Mh="",e}function Fy(e){return uO(h6(ea-1,_8(e===91?e+2:e===40?e+1:e)))}function d5e(e){for(;(Nn=kl())&&Nn<33;)Aa();return v1(e)>2||v1(Nn)>3?"":" "}function u5e(e,t){for(;--t&&Aa()&&!(Nn<48||Nn>102||Nn>57&&Nn<65||Nn>70&&Nn<97););return h6(e,Lg()+(t<6&&kl()==32&&Aa()==32))}function _8(e){for(;Aa();)switch(Nn){case e:return ea;case 34:case 39:e!==34&&e!==39&&_8(Nn);break;case 40:e===41&&_8(e);break;case 92:Aa();break}return ea}function h5e(e,t){for(;Aa()&&e+Nn!==57;)if(e+Nn===84&&kl()===47)break;return"/*"+h6(t,ea-1)+"*"+px(e===47?e:Aa())}function f5e(e){for(;!v1(kl());)Aa();return h6(e,ea)}function p5e(e){return c5e(Rg("",null,null,null,[""],e=l5e(e),0,[0],e))}function Rg(e,t,n,r,i,a,s,o,c){for(var d=0,l=0,h=s,f=0,g=0,U=0,y=1,v=1,x=1,w=0,C="",S=i,T=a,M=r,_=C;v;)switch(U=w,w=Aa()){case 40:if(U!=108&&Ou(_,h-1)==58){i5e(_+=Ag(Fy(w),"&","&\f"),"&\f",dO(d?o[d-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:_+=Fy(w);break;case 9:case 10:case 13:case 32:_+=d5e(U);break;case 92:_+=u5e(Lg()-1,7);continue;case 47:switch(kl()){case 42:case 47:Hm(m5e(h5e(Aa(),Lg()),t,n,c),c),(v1(U||1)==5||v1(kl()||1)==5)&&is(_)&&ch(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*y:o[d++]=is(_)*x;case 125*y:case 59:case 0:switch(w){case 0:case 125:v=0;case 59+l:x==-1&&(_=Ag(_,/\f/g,"")),g>0&&(is(_)-h||y===0&&U===47)&&Hm(g>32?sT(_+";",r,n,h-1,c):sT(Ag(_," ","")+";",r,n,h-2,c),c);break;case 59:_+=";";default:if(Hm(M=aT(_,t,n,d,l,i,o,C,S=[],T=[],h,a),a),w===123)if(l===0)Rg(_,t,M,M,S,a,h,o,T);else{switch(f){case 99:if(Ou(_,3)===110)break;case 108:if(Ou(_,2)===97)break;default:l=0;case 100:case 109:case 115:}l?Rg(e,M,M,r&&Hm(aT(e,M,M,0,0,i,o,C,i,S=[],h,T),T),i,T,h,o,r?S:T):Rg(_,M,M,M,[""],T,0,o,T)}}d=l=g=0,y=x=1,C=_="",h=s;break;case 58:h=1+is(_),g=U;default:if(y<1){if(w==123)--y;else if(w==125&&y++==0&&o5e()==125)continue}switch(_+=px(w),w*y){case 38:x=l>0?1:(_+="\f",-1);break;case 44:o[d++]=(is(_)-1)*x,x=1;break;case 64:kl()===45&&(_+=Fy(Aa())),f=kl(),l=h=is(C=_+=f5e(Lg())),w++;break;case 45:U===45&&is(_)==2&&(y=0)}}return a}function aT(e,t,n,r,i,a,s,o,c,d,l,h){for(var f=i-1,g=i===0?a:[""],U=a5e(g),y=0,v=0,x=0;y<r;++y)for(var w=0,C=ch(e,f+1,f=dO(v=s[y])),S=e;w<U;++w)(S=uO(v>0?g[w]+" "+C:Ag(C,/&\f/g,g[w])))&&(c[x++]=S);return mx(e,t,n,i===0?lO:o,c,d,l,h)}function m5e(e,t,n,r){return mx(e,t,n,oO,px(s5e()),ch(e,2,-2),0,r)}function sT(e,t,n,r,i){return mx(e,t,n,cO,ch(e,0,r),ch(e,r+1,-1),r,i)}function k8(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function g5e(e,t,n,r){switch(e.type){case r5e:if(e.children.length)break;case e5e:case t5e:case cO:return e.return=e.return||e.value;case oO:return"";case n5e:return e.return=e.value+"{"+k8(e.children,r)+"}";case lO:if(!is(e.value=e.props.join(",")))return""}return is(n=k8(e.children,r))?e.return=e.value+"{"+n+"}":""}var U5e=ZN(Object.keys,Object),b5e=Object.prototype,y5e=b5e.hasOwnProperty;function v5e(e){if(!c6(e))return U5e(e);var t=[];for(var n in Object(e))y5e.call(e,n)&&n!="constructor"&&t.push(n);return t}var T8=vd(Ls,"DataView"),M8=vd(Ls,"Promise"),I8=vd(Ls,"Set"),A8=vd(Ls,"WeakMap"),oT="[object Map]",x5e="[object Object]",lT="[object Promise]",cT="[object Set]",dT="[object WeakMap]",uT="[object DataView]",w5e=yd(T8),E5e=yd(y1),C5e=yd(M8),S5e=yd(I8),_5e=yd(A8),Sc=kh;(T8&&Sc(new T8(new ArrayBuffer(1)))!=uT||y1&&Sc(new y1)!=oT||M8&&Sc(M8.resolve())!=lT||I8&&Sc(new I8)!=cT||A8&&Sc(new A8)!=dT)&&(Sc=function(e){var t=kh(e),n=t==x5e?e.constructor:void 0,r=n?yd(n):"";if(r)switch(r){case w5e:return uT;case E5e:return oT;case C5e:return lT;case S5e:return cT;case _5e:return dT}return t});var k5e="[object Map]",T5e="[object Set]",M5e=Object.prototype,I5e=M5e.hasOwnProperty;function By(e){if(e==null)return!0;if(d6(e)&&(z2(e)||typeof e=="string"||typeof e.splice=="function"||hx(e)||fx(e)||$2(e)))return!e.length;var t=Sc(e);if(t==k5e||t==T5e)return!e.size;if(c6(e))return!v5e(e).length;for(var n in e)if(I5e.call(e,n))return!1;return!0}const Zs={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Ze={trace:(...e)=>{},debug:(...e)=>{},info:(...e)=>{},warn:(...e)=>{},error:(...e)=>{},fatal:(...e)=>{}},gx=function(e="fatal"){let t=Zs.fatal;typeof e=="string"?(e=e.toLowerCase(),e in Zs&&(t=Zs[e])):typeof e=="number"&&(t=e),Ze.trace=()=>{},Ze.debug=()=>{},Ze.info=()=>{},Ze.warn=()=>{},Ze.error=()=>{},Ze.fatal=()=>{},t<=Zs.fatal&&(Ze.fatal=console.error?console.error.bind(console,Pi("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Pi("FATAL"))),t<=Zs.error&&(Ze.error=console.error?console.error.bind(console,Pi("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Pi("ERROR"))),t<=Zs.warn&&(Ze.warn=console.warn?console.warn.bind(console,Pi("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Pi("WARN"))),t<=Zs.info&&(Ze.info=console.info?console.info.bind(console,Pi("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Pi("INFO"))),t<=Zs.debug&&(Ze.debug=console.debug?console.debug.bind(console,Pi("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Pi("DEBUG"))),t<=Zs.trace&&(Ze.trace=console.debug?console.debug.bind(console,Pi("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Pi("TRACE")))},Pi=e=>`%c${y1e().format("ss.SSS")} : ${e} : `,Z1=/<br\s*\/?>/gi,A5e=e=>e?pO(e).replace(/\\n/g,"#br#").split("#br#"):[""],L5e=(()=>{let e=!1;return()=>{e||(R5e(),e=!0)}})();function R5e(){const e="data-temp-href-target";lh.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")||"")}),lh.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)||""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}const fO=e=>(L5e(),lh.sanitize(e)),hT=(e,t)=>{var n;if(((n=t.flowchart)==null?void 0:n.htmlLabels)!==!1){const r=t.securityLevel;r==="antiscript"||r==="strict"?e=fO(e):r!=="loose"&&(e=pO(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=N5e(e))}return e},uh=(e,t)=>e&&(t.dompurifyConfig?e=lh.sanitize(hT(e,t),t.dompurifyConfig).toString():e=lh.sanitize(hT(e,t),{FORBID_TAGS:["style"]}).toString(),e),D5e=(e,t)=>typeof e=="string"?uh(e,t):e.flat().map(n=>uh(n,t)),j5e=e=>Z1.test(e),P5e=e=>e.split(Z1),N5e=e=>e.replace(/#br#/g,"<br/>"),pO=e=>e.replace(Z1,"#br#"),O5e=e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=t.replaceAll(/\(/g,"\\("),t=t.replaceAll(/\)/g,"\\)")),t},mO=e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),F5e=function(...e){const t=e.filter(n=>!isNaN(n));return Math.max(...t)},B5e=function(...e){const t=e.filter(n=>!isNaN(n));return Math.min(...t)},Lxe=function(e){const t=e.split(/(,)/),n=[];for(let r=0;r<t.length;r++){let i=t[r];if(i===","&&r>0&&r+1<t.length){const a=t[r-1],s=t[r+1];$5e(a,s)&&(i=a+","+s,r++,n.pop())}n.push(z5e(i))}return n.join("")},L8=(e,t)=>Math.max(0,e.split(t).length-1),$5e=(e,t)=>{const n=L8(e,"~"),r=L8(t,"~");return n===1&&r===1},z5e=e=>{const t=L8(e,"~");let n=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),n=!0);const r=[...e];let i=r.indexOf("~"),a=r.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)r[i]="<",r[a]=">",i=r.indexOf("~"),a=r.lastIndexOf("~");return n&&r.unshift("~"),r.join("")},fT=()=>window.MathMLElement!==void 0,R8=/\$\$(.*)\$\$/g,pT=e=>{var t;return(((t=e.match(R8))==null?void 0:t.length)??0)>0},Rxe=async(e,t)=>{const n=document.createElement("div");n.innerHTML=await W5e(e,t),n.id="katex-temp",n.style.visibility="hidden",n.style.position="absolute",n.style.top="0";const r=document.querySelector("body");r==null||r.insertAdjacentElement("beforeend",n);const i={width:n.clientWidth,height:n.clientHeight};return n.remove(),i},H5e=async(e,t)=>{if(!pT(e))return e;if(!fT()&&!t.legacyMathML)return e.replace(R8,"MathML is unsupported in this environment.");const{default:n}=await ge(async()=>{const{default:r}=await import("./katex-ChWnQ-fc.js");return{default:r}},[],import.meta.url);return e.split(Z1).map(r=>pT(r)?`
|
|
267
|
+
<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">
|
|
268
|
+
${r}
|
|
269
|
+
</div>
|
|
270
|
+
`:`<div>${r}</div>`).join("").replace(R8,(r,i)=>n.renderToString(i,{throwOnError:!0,displayMode:!0,output:fT()?"mathml":"htmlAndMathml"}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))},W5e=async(e,t)=>uh(await H5e(e,t),t),Ux={getRows:A5e,sanitizeText:uh,sanitizeTextOrArray:D5e,hasBreaks:j5e,splitBreaks:P5e,lineBreakRegex:Z1,removeScript:fO,getUrl:O5e,evaluate:mO,getMax:F5e,getMin:B5e},Or=(e,t)=>t?re(e,{s:-40,l:10}):re(e,{s:-40,l:-10}),f6="#ffffff",p6="#f2f2f2";let X5e=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||re(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||re(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Or(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Or(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Or(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Or(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ae(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ae(this.tertiaryColor),this.lineColor=this.lineColor||Ae(this.background),this.arrowheadColor=this.arrowheadColor||Ae(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?tt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||"grey",this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||tt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ae(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Ye(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||re(this.primaryColor,{h:30}),this.cScale4=this.cScale4||re(this.primaryColor,{h:60}),this.cScale5=this.cScale5||re(this.primaryColor,{h:90}),this.cScale6=this.cScale6||re(this.primaryColor,{h:120}),this.cScale7=this.cScale7||re(this.primaryColor,{h:150}),this.cScale8=this.cScale8||re(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||re(this.primaryColor,{h:270}),this.cScale10=this.cScale10||re(this.primaryColor,{h:300}),this.cScale11=this.cScale11||re(this.primaryColor,{h:330}),this.darkMode)for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScale"+g]=tt(this["cScale"+g],75);else for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScale"+g]=tt(this["cScale"+g],25);for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScaleInv"+g]=this["cScaleInv"+g]||Ae(this["cScale"+g]);for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this.darkMode?this["cScalePeer"+g]=this["cScalePeer"+g]||Ye(this["cScale"+g],10):this["cScalePeer"+g]=this["cScalePeer"+g]||tt(this["cScale"+g],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScaleLabel"+g]=this["cScaleLabel"+g]||this.scaleLabelColor;const f=this.darkMode?-4:-1;for(let g=0;g<5;g++)this["surface"+g]=this["surface"+g]||re(this.mainBkg,{h:180,s:-15,l:f*(5+g*3)}),this["surfacePeer"+g]=this["surfacePeer"+g]||re(this.mainBkg,{h:180,s:-15,l:f*(8+g*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||re(this.primaryColor,{h:64}),this.fillType3=this.fillType3||re(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||re(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||re(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||re(this.primaryColor,{h:128}),this.fillType7=this.fillType7||re(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||re(this.primaryColor,{l:-10}),this.pie5=this.pie5||re(this.secondaryColor,{l:-10}),this.pie6=this.pie6||re(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||re(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||re(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||re(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||re(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||re(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||re(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||re(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||re(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||re(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||re(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||re(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||re(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Y1(this.quadrant1Fill)?Ye(this.quadrant1Fill):tt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?tt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||re(this.primaryColor,{h:-30}),this.git4=this.git4||re(this.primaryColor,{h:-60}),this.git5=this.git5||re(this.primaryColor,{h:-90}),this.git6=this.git6||re(this.primaryColor,{h:60}),this.git7=this.git7||re(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ye(this.git0,25),this.git1=Ye(this.git1,25),this.git2=Ye(this.git2,25),this.git3=Ye(this.git3,25),this.git4=Ye(this.git4,25),this.git5=Ye(this.git5,25),this.git6=Ye(this.git6,25),this.git7=Ye(this.git7,25)):(this.git0=tt(this.git0,25),this.git1=tt(this.git1,25),this.git2=tt(this.git2,25),this.git3=tt(this.git3,25),this.git4=tt(this.git4,25),this.git5=tt(this.git5,25),this.git6=tt(this.git6,25),this.git7=tt(this.git7,25)),this.gitInv0=this.gitInv0||Ae(this.git0),this.gitInv1=this.gitInv1||Ae(this.git1),this.gitInv2=this.gitInv2||Ae(this.git2),this.gitInv3=this.gitInv3||Ae(this.git3),this.gitInv4=this.gitInv4||Ae(this.git4),this.gitInv5=this.gitInv5||Ae(this.git5),this.gitInv6=this.gitInv6||Ae(this.git6),this.gitInv7=this.gitInv7||Ae(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||f6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||p6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const V5e=e=>{const t=new X5e;return t.calculate(e),t};let Y5e=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Ye(this.primaryColor,16),this.tertiaryColor=re(this.primaryColor,{h:-160}),this.primaryBorderColor=Ae(this.background),this.secondaryBorderColor=Or(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Or(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ae(this.primaryColor),this.secondaryTextColor=Ae(this.secondaryColor),this.tertiaryTextColor=Ae(this.tertiaryColor),this.lineColor=Ae(this.background),this.textColor=Ae(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Ye(Ae("#323D47"),10),this.lineColor="calculated",this.border1="#81B1DB",this.border2=Ap(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=tt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=tt(this.sectionBkgColor,10),this.taskBorderColor=Ap(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ap(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.secondBkg=Ye(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Ye(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.mainContrastColor,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Ye(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=re(this.primaryColor,{h:64}),this.fillType3=re(this.secondaryColor,{h:64}),this.fillType4=re(this.primaryColor,{h:-64}),this.fillType5=re(this.secondaryColor,{h:-64}),this.fillType6=re(this.primaryColor,{h:128}),this.fillType7=re(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||re(this.primaryColor,{h:30}),this.cScale4=this.cScale4||re(this.primaryColor,{h:60}),this.cScale5=this.cScale5||re(this.primaryColor,{h:90}),this.cScale6=this.cScale6||re(this.primaryColor,{h:120}),this.cScale7=this.cScale7||re(this.primaryColor,{h:150}),this.cScale8=this.cScale8||re(this.primaryColor,{h:210}),this.cScale9=this.cScale9||re(this.primaryColor,{h:270}),this.cScale10=this.cScale10||re(this.primaryColor,{h:300}),this.cScale11=this.cScale11||re(this.primaryColor,{h:330});for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||Ae(this["cScale"+f]);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScalePeer"+f]=this["cScalePeer"+f]||Ye(this["cScale"+f],10);for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||re(this.mainBkg,{h:30,s:-30,l:-(-10+f*4)}),this["surfacePeer"+f]=this["surfacePeer"+f]||re(this.mainBkg,{h:30,s:-30,l:-(-7+f*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.scaleLabelColor;for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["pie"+f]=this["cScale"+f];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||re(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||re(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||re(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||re(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||re(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||re(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Y1(this.quadrant1Fill)?Ye(this.quadrant1Fill):tt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?tt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Ye(this.secondaryColor,20),this.git1=Ye(this.pie2||this.secondaryColor,20),this.git2=Ye(this.pie3||this.tertiaryColor,20),this.git3=Ye(this.pie4||re(this.primaryColor,{h:-30}),20),this.git4=Ye(this.pie5||re(this.primaryColor,{h:-60}),20),this.git5=Ye(this.pie6||re(this.primaryColor,{h:-90}),10),this.git6=Ye(this.pie7||re(this.primaryColor,{h:60}),10),this.git7=Ye(this.pie8||re(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Ae(this.git0),this.gitInv1=this.gitInv1||Ae(this.git1),this.gitInv2=this.gitInv2||Ae(this.git2),this.gitInv3=this.gitInv3||Ae(this.git3),this.gitInv4=this.gitInv4||Ae(this.git4),this.gitInv5=this.gitInv5||Ae(this.git5),this.gitInv6=this.gitInv6||Ae(this.git6),this.gitInv7=this.gitInv7||Ae(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ae(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ae(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ye(this.background,2)}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const G5e=e=>{const t=new Y5e;return t.calculate(e),t};let q5e=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=re(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=re(this.primaryColor,{h:-160}),this.primaryBorderColor=Or(this.primaryColor,this.darkMode),this.secondaryBorderColor=Or(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Or(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ae(this.primaryColor),this.secondaryTextColor=Ae(this.secondaryColor),this.tertiaryTextColor=Ae(this.tertiaryColor),this.lineColor=Ae(this.background),this.textColor=Ae(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#e8e8e8",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=Ap(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||re(this.primaryColor,{h:30}),this.cScale4=this.cScale4||re(this.primaryColor,{h:60}),this.cScale5=this.cScale5||re(this.primaryColor,{h:90}),this.cScale6=this.cScale6||re(this.primaryColor,{h:120}),this.cScale7=this.cScale7||re(this.primaryColor,{h:150}),this.cScale8=this.cScale8||re(this.primaryColor,{h:210}),this.cScale9=this.cScale9||re(this.primaryColor,{h:270}),this.cScale10=this.cScale10||re(this.primaryColor,{h:300}),this.cScale11=this.cScale11||re(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||tt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||tt(this.tertiaryColor,40);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScale"+f]=tt(this["cScale"+f],10),this["cScalePeer"+f]=this["cScalePeer"+f]||tt(this["cScale"+f],25);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||re(this["cScale"+f],{h:180});for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||re(this.mainBkg,{h:30,l:-(5+f*5)}),this["surfacePeer"+f]=this["surfacePeer"+f]||re(this.mainBkg,{h:30,l:-(7+f*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||Ae(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Ae(this.labelTextColor);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=Ye(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=re(this.primaryColor,{h:64}),this.fillType3=re(this.secondaryColor,{h:64}),this.fillType4=re(this.primaryColor,{h:-64}),this.fillType5=re(this.secondaryColor,{h:-64}),this.fillType6=re(this.primaryColor,{h:128}),this.fillType7=re(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||re(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||re(this.primaryColor,{l:-10}),this.pie5=this.pie5||re(this.secondaryColor,{l:-30}),this.pie6=this.pie6||re(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||re(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||re(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||re(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||re(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||re(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||re(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||re(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||re(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||re(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||re(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||re(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||re(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Y1(this.quadrant1Fill)?Ye(this.quadrant1Fill):tt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||re(this.primaryColor,{h:-30}),this.git4=this.git4||re(this.primaryColor,{h:-60}),this.git5=this.git5||re(this.primaryColor,{h:-90}),this.git6=this.git6||re(this.primaryColor,{h:60}),this.git7=this.git7||re(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ye(this.git0,25),this.git1=Ye(this.git1,25),this.git2=Ye(this.git2,25),this.git3=Ye(this.git3,25),this.git4=Ye(this.git4,25),this.git5=Ye(this.git5,25),this.git6=Ye(this.git6,25),this.git7=Ye(this.git7,25)):(this.git0=tt(this.git0,25),this.git1=tt(this.git1,25),this.git2=tt(this.git2,25),this.git3=tt(this.git3,25),this.git4=tt(this.git4,25),this.git5=tt(this.git5,25),this.git6=tt(this.git6,25),this.git7=tt(this.git7,25)),this.gitInv0=this.gitInv0||tt(Ae(this.git0),25),this.gitInv1=this.gitInv1||Ae(this.git1),this.gitInv2=this.gitInv2||Ae(this.git2),this.gitInv3=this.gitInv3||Ae(this.git3),this.gitInv4=this.gitInv4||Ae(this.git4),this.gitInv5=this.gitInv5||Ae(this.git5),this.gitInv6=this.gitInv6||Ae(this.git6),this.gitInv7=this.gitInv7||Ae(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ae(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ae(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||f6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||p6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const Z5e=e=>{const t=new q5e;return t.calculate(e),t};let K5e=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Ye("#cde498",10),this.primaryBorderColor=Or(this.primaryColor,this.darkMode),this.secondaryBorderColor=Or(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Or(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ae(this.primaryColor),this.secondaryTextColor=Ae(this.secondaryColor),this.tertiaryTextColor=Ae(this.primaryColor),this.lineColor=Ae(this.background),this.textColor=Ae(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.actorBorder=tt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||re(this.primaryColor,{h:30}),this.cScale4=this.cScale4||re(this.primaryColor,{h:60}),this.cScale5=this.cScale5||re(this.primaryColor,{h:90}),this.cScale6=this.cScale6||re(this.primaryColor,{h:120}),this.cScale7=this.cScale7||re(this.primaryColor,{h:150}),this.cScale8=this.cScale8||re(this.primaryColor,{h:210}),this.cScale9=this.cScale9||re(this.primaryColor,{h:270}),this.cScale10=this.cScale10||re(this.primaryColor,{h:300}),this.cScale11=this.cScale11||re(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||tt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||tt(this.tertiaryColor,40);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScale"+f]=tt(this["cScale"+f],10),this["cScalePeer"+f]=this["cScalePeer"+f]||tt(this["cScale"+f],25);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||re(this["cScale"+f],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.scaleLabelColor;for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||re(this.mainBkg,{h:30,s:-30,l:-(5+f*5)}),this["surfacePeer"+f]=this["surfacePeer"+f]||re(this.mainBkg,{h:30,s:-30,l:-(8+f*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=re(this.primaryColor,{h:64}),this.fillType3=re(this.secondaryColor,{h:64}),this.fillType4=re(this.primaryColor,{h:-64}),this.fillType5=re(this.secondaryColor,{h:-64}),this.fillType6=re(this.primaryColor,{h:128}),this.fillType7=re(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||re(this.primaryColor,{l:-30}),this.pie5=this.pie5||re(this.secondaryColor,{l:-30}),this.pie6=this.pie6||re(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||re(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||re(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||re(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||re(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||re(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||re(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||re(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||re(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||re(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||re(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||re(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||re(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Y1(this.quadrant1Fill)?Ye(this.quadrant1Fill):tt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||re(this.primaryColor,{h:-30}),this.git4=this.git4||re(this.primaryColor,{h:-60}),this.git5=this.git5||re(this.primaryColor,{h:-90}),this.git6=this.git6||re(this.primaryColor,{h:60}),this.git7=this.git7||re(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ye(this.git0,25),this.git1=Ye(this.git1,25),this.git2=Ye(this.git2,25),this.git3=Ye(this.git3,25),this.git4=Ye(this.git4,25),this.git5=Ye(this.git5,25),this.git6=Ye(this.git6,25),this.git7=Ye(this.git7,25)):(this.git0=tt(this.git0,25),this.git1=tt(this.git1,25),this.git2=tt(this.git2,25),this.git3=tt(this.git3,25),this.git4=tt(this.git4,25),this.git5=tt(this.git5,25),this.git6=tt(this.git6,25),this.git7=tt(this.git7,25)),this.gitInv0=this.gitInv0||Ae(this.git0),this.gitInv1=this.gitInv1||Ae(this.git1),this.gitInv2=this.gitInv2||Ae(this.git2),this.gitInv3=this.gitInv3||Ae(this.git3),this.gitInv4=this.gitInv4||Ae(this.git4),this.gitInv5=this.gitInv5||Ae(this.git5),this.gitInv6=this.gitInv6||Ae(this.git6),this.gitInv7=this.gitInv7||Ae(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ae(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ae(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||f6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||p6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const Q5e=e=>{const t=new K5e;return t.calculate(e),t};class J5e{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Ye(this.contrast,55),this.background="#ffffff",this.tertiaryColor=re(this.primaryColor,{h:-160}),this.primaryBorderColor=Or(this.primaryColor,this.darkMode),this.secondaryBorderColor=Or(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Or(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ae(this.primaryColor),this.secondaryTextColor=Ae(this.secondaryColor),this.tertiaryTextColor=Ae(this.tertiaryColor),this.lineColor=Ae(this.background),this.textColor=Ae(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.secondBkg=Ye(this.contrast,55),this.border2=this.contrast,this.actorBorder=Ye(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.lineColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||Ae(this["cScale"+f]);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this.darkMode?this["cScalePeer"+f]=this["cScalePeer"+f]||Ye(this["cScale"+f],10):this["cScalePeer"+f]=this["cScalePeer"+f]||tt(this["cScale"+f],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.scaleLabelColor;for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||re(this.mainBkg,{l:-(5+f*5)}),this["surfacePeer"+f]=this["surfacePeer"+f]||re(this.mainBkg,{l:-(8+f*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Ye(this.contrast,30),this.sectionBkgColor2=Ye(this.contrast,30),this.taskBorderColor=tt(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Ye(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=tt(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=re(this.primaryColor,{h:64}),this.fillType3=re(this.secondaryColor,{h:64}),this.fillType4=re(this.primaryColor,{h:-64}),this.fillType5=re(this.secondaryColor,{h:-64}),this.fillType6=re(this.primaryColor,{h:128}),this.fillType7=re(this.secondaryColor,{h:128});for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["pie"+f]=this["cScale"+f];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||re(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||re(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||re(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||re(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||re(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||re(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Y1(this.quadrant1Fill)?Ye(this.quadrant1Fill):tt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=tt(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||re(this.primaryColor,{h:-30}),this.git4=this.pie5||re(this.primaryColor,{h:-60}),this.git5=this.pie6||re(this.primaryColor,{h:-90}),this.git6=this.pie7||re(this.primaryColor,{h:60}),this.git7=this.pie8||re(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||Ae(this.git0),this.gitInv1=this.gitInv1||Ae(this.git1),this.gitInv2=this.gitInv2||Ae(this.git2),this.gitInv3=this.gitInv3||Ae(this.git3),this.gitInv4=this.gitInv4||Ae(this.git4),this.gitInv5=this.gitInv5||Ae(this.git5),this.gitInv6=this.gitInv6||Ae(this.git6),this.gitInv7=this.gitInv7||Ae(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||f6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||p6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}}const ebe=e=>{const t=new J5e;return t.calculate(e),t},fo={base:{getThemeVariables:V5e},dark:{getThemeVariables:G5e},default:{getThemeVariables:Z5e},forest:{getThemeVariables:Q5e},neutral:{getThemeVariables:ebe}},Ks={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},theme:"default",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","maxEdges"],legacyMathML:!1,deterministicIds:!1,fontSize:16},gO={...Ks,deterministicIDSeed:void 0,themeCSS:void 0,themeVariables:fo.default.getThemeVariables(),sequence:{...Ks.sequence,messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},noteFont:function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},actorFont:function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}},gantt:{...Ks.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ks.c4,useWidth:void 0,personFont:function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},external_personFont:function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},systemFont:function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},external_systemFont:function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},system_dbFont:function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},external_system_dbFont:function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},system_queueFont:function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},external_system_queueFont:function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},containerFont:function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},external_containerFont:function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},container_dbFont:function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},external_container_dbFont:function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},container_queueFont:function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},external_container_queueFont:function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},componentFont:function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},external_componentFont:function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},component_dbFont:function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},external_component_dbFont:function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},component_queueFont:function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},external_component_queueFont:function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},boundaryFont:function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}},pie:{...Ks.pie,useWidth:984},xyChart:{...Ks.xyChart,useWidth:void 0},requirement:{...Ks.requirement,useWidth:void 0},gitGraph:{...Ks.gitGraph,useMaxWidth:!1},sankey:{...Ks.sankey,useMaxWidth:!1}},UO=(e,t="")=>Object.keys(e).reduce((n,r)=>Array.isArray(e[r])?n:typeof e[r]=="object"&&e[r]!==null?[...n,t+r,...UO(e[r],"")]:[...n,t+r],[]),tbe=new Set(UO(gO,"")),nbe=gO,H2=e=>{if(Ze.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>H2(t));return}for(const t of Object.keys(e)){if(Ze.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!tbe.has(t)||e[t]==null){Ze.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){Ze.debug("sanitizing object",t),H2(e[t]);continue}const n=["themeCSS","fontFamily","altFontFamily"];for(const r of n)t.includes(r)&&(Ze.debug("sanitizing css option",t),e[t]=rbe(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const n=e.themeVariables[t];n!=null&&n.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}Ze.debug("After sanitization",e)}},rbe=e=>{let t=0,n=0;for(const r of e){if(t<n)return"{ /* ERROR: Unbalanced CSS */ }";r==="{"?t++:r==="}"&&n++}return t!==n?"{ /* ERROR: Unbalanced CSS */ }":e},bO=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Rp=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ibe=/\s*%%.*\n/gm;class yO extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}}const hh={},m6=function(e,t){e=e.replace(bO,"").replace(Rp,"").replace(ibe,`
|
|
271
|
+
`);for(const[n,{detector:r}]of Object.entries(hh))if(r(e,t))return n;throw new yO(`No diagram type detected matching given configuration for text: ${e}`)},vO=(...e)=>{for(const{id:t,detector:n,loader:r}of e)xO(t,n,r)},xO=(e,t,n)=>{hh[e]?Ze.error(`Detector with key ${e} already exists`):hh[e]={detector:t,loader:n},Ze.debug(`Detector with key ${e} added${n?" with loader":""}`)},abe=e=>hh[e].loader,D8=(e,t,{depth:n=2,clobber:r=!1}={})=>{const i={depth:n,clobber:r};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(a=>D8(e,a,i)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(a=>{e.includes(a)||e.push(a)}),e):e===void 0||n<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(a=>{typeof t[a]=="object"&&(e[a]===void 0||typeof e[a]=="object")?(e[a]===void 0&&(e[a]=Array.isArray(t[a])?[]:{}),e[a]=D8(e[a],t[a],{depth:n-1,clobber:r})):(r||typeof e[a]!="object"&&typeof t[a]!="object")&&(e[a]=t[a])}),e)},Sr=D8,sbe="",obe={curveBasis:Nge,curveBasisClosed:Oge,curveBasisOpen:Fge,curveBumpX:jge,curveBumpY:Pge,curveBundle:Bge,curveCardinalClosed:zge,curveCardinalOpen:Hge,curveCardinal:$ge,curveCatmullRomClosed:Xge,curveCatmullRomOpen:Vge,curveCatmullRom:Wge,curveLinear:Dge,curveLinearClosed:Yge,curveMonotoneX:Gge,curveMonotoneY:qge,curveNatural:Zge,curveStep:Kge,curveStepAfter:Jge,curveStepBefore:Qge},lbe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,cbe=function(e,t){const n=wO(e,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(n)){const s=n.map(o=>o.args);H2(s),r=Sr(r,[...s])}else r=n.args;if(!r)return;let i=m6(e,t);const a="config";return r[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),r[i]=r[a],delete r[a]),r},wO=function(e,t=null){try{const n=new RegExp(`[%]{2}(?![{]${lbe.source})(?=[}][%]{2}).*
|
|
272
|
+
`,"ig");e=e.trim().replace(n,"").replace(/'/gm,'"'),Ze.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let r;const i=[];for(;(r=Rp.exec(e))!==null;)if(r.index===Rp.lastIndex&&Rp.lastIndex++,r&&!t||t&&r[1]&&r[1].match(t)||t&&r[2]&&r[2].match(t)){const a=r[1]?r[1]:r[2],s=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:a,args:s})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(n){return Ze.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},dbe=function(e){return e.replace(Rp,"")},ube=function(e,t){for(const[n,r]of t.entries())if(r.match(e))return n;return-1};function hbe(e,t){if(!e)return t;const n=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return obe[n]??t}function fbe(e,t){const n=e.trim();if(n)return t.securityLevel!=="loose"?LM.sanitizeUrl(n):n}const pbe=(e,...t)=>{const n=e.split("."),r=n.length-1,i=n[r];let a=window;for(let s=0;s<r;s++)if(a=a[n[s]],!a){Ze.error(`Function name: ${e} not found in window`);return}a[i](...t)};function EO(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function mbe(e){let t,n=0;e.forEach(i=>{n+=EO(i,t),t=i});const r=n/2;return bx(e,r)}function gbe(e){return e.length===1?e[0]:mbe(e)}const mT=(e,t=2)=>{const n=Math.pow(10,t);return Math.round(e*n)/n},bx=(e,t)=>{let n,r=t;for(const i of e){if(n){const a=EO(i,n);if(a<r)r-=a;else{const s=r/a;if(s<=0)return n;if(s>=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:mT((1-s)*n.x+s*i.x,5),y:mT((1-s)*n.y+s*i.y,5)}}}n=i}throw new Error("Could not find a suitable point for the given distance")},Ube=(e,t,n)=>{Ze.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());const i=bx(t,25),a=e?10:5,s=Math.atan2(t[0].y-i.y,t[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(t[0].x+i.x)/2,o.y=-Math.cos(s)*a+(t[0].y+i.y)/2,o};function bbe(e,t,n){const r=structuredClone(n);Ze.info("our points",r),t!=="start_left"&&t!=="start_right"&&r.reverse();const i=25+e,a=bx(r,i),s=10+e*.5,o=Math.atan2(r[0].y-a.y,r[0].x-a.x),c={x:0,y:0};return t==="start_left"?(c.x=Math.sin(o+Math.PI)*s+(r[0].x+a.x)/2,c.y=-Math.cos(o+Math.PI)*s+(r[0].y+a.y)/2):t==="end_right"?(c.x=Math.sin(o-Math.PI)*s+(r[0].x+a.x)/2-5,c.y=-Math.cos(o-Math.PI)*s+(r[0].y+a.y)/2-5):t==="end_left"?(c.x=Math.sin(o)*s+(r[0].x+a.x)/2-5,c.y=-Math.cos(o)*s+(r[0].y+a.y)/2-5):(c.x=Math.sin(o)*s+(r[0].x+a.x)/2,c.y=-Math.cos(o)*s+(r[0].y+a.y)/2),c}function ybe(e){let t="",n="";for(const r of e)r!==void 0&&(r.startsWith("color:")||r.startsWith("text-align:")?n=n+r+";":t=t+r+";");return{style:t,labelStyle:n}}let gT=0;const vbe=()=>(gT++,"id-"+Math.random().toString(36).substr(2,12)+"-"+gT);function xbe(e){let t="";const n="0123456789abcdef",r=n.length;for(let i=0;i<e;i++)t+=n.charAt(Math.floor(Math.random()*r));return t}const wbe=e=>xbe(e.length),Ebe=function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},Cbe=function(e,t){const n=t.text.replace(Ux.lineBreakRegex," "),[,r]=vx(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",r),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),t.class!==void 0&&i.attr("class",t.class);const a=i.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(n),i},Sbe=G1((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},n),Ux.lineBreakRegex.test(e)))return e;const r=e.split(" "),i=[];let a="";return r.forEach((s,o)=>{const c=W2(`${s} `,n),d=W2(a,n);if(c>t){const{hyphenatedStrings:f,remainingWord:g}=_be(s,t,"-",n);i.push(a,...f),a=g}else d+c>=t?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===r.length&&i.push(a)}),i.filter(s=>s!=="").join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),_be=G1((e,t,n="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const i=[...e],a=[];let s="";return i.forEach((o,c)=>{const d=`${s}${o}`;if(W2(d,r)>=t){const h=c+1,f=i.length===h,g=`${d}${n}`;a.push(f?d:g),s=""}else s=d}),{hyphenatedStrings:a,remainingWord:s}},(e,t,n="-",r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function kbe(e,t){return yx(e,t).height}function W2(e,t){return yx(e,t).width}const yx=G1((e,t)=>{const{fontSize:n=12,fontFamily:r="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};const[,a]=vx(n),s=["sans-serif",r],o=e.split(Ux.lineBreakRegex),c=[],d=$i("body");if(!d.remove)return{width:0,height:0,lineHeight:0};const l=d.append("svg");for(const f of s){let g=0;const U={width:0,height:0,lineHeight:0};for(const y of o){const v=Ebe();v.text=y||sbe;const x=Cbe(l,v).style("font-size",a).style("font-weight",i).style("font-family",f),w=(x._groups||x)[0][0].getBBox();if(w.width===0&&w.height===0)throw new Error("svg element not in render tree");U.width=Math.round(Math.max(U.width,w.width)),g=Math.round(w.height),U.height+=g,U.lineHeight=Math.round(Math.max(U.lineHeight,g))}c.push(U)}l.remove();const h=isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1;return c[h]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`);class Tbe{constructor(t=!1,n){this.count=0,this.count=n?n.length:0,this.next=t?()=>this.count++:()=>Date.now()}}let Wm;const Mbe=function(e){return Wm=Wm||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Wm.innerHTML=e,unescape(Wm.textContent)};function CO(e){return"str"in e}const Ibe=(e,t,n,r)=>{var i;if(!r)return;const a=(i=e.node())==null?void 0:i.getBBox();a&&e.append("text").text(r).attr("x",a.x+a.width/2).attr("y",-n).attr("class",t)},vx=e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]};function SO(e,t){return J6e({},e,t)}const Dp={assignWithDepth:Sr,wrapLabel:Sbe,calculateTextHeight:kbe,calculateTextWidth:W2,calculateTextDimensions:yx,cleanAndMerge:SO,detectInit:cbe,detectDirective:wO,isSubstringInArray:ube,interpolateToCurve:hbe,calcLabelPosition:gbe,calcCardinalityPosition:Ube,calcTerminalLabelPosition:bbe,formatUrl:fbe,getStylesFromArray:ybe,generateId:vbe,random:wbe,runFunc:pbe,entityDecode:Mbe,insertTitle:Ibe,parseFontSize:vx,InitIDGenerator:Tbe},Abe=function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(n){return n.substring(0,n.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(n){return n.substring(0,n.length-1)}),t=t.replace(/#\w+;/g,function(n){const r=n.substring(1,n.length-1);return/^\+?\d+$/.test(r)?"fl°°"+r+"¶ß":"fl°"+r+"¶ß"}),t},Lbe=function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},UT="10.9.4",fh=Object.freeze(nbe);let ni=Sr({},fh),_O,ph=[],jp=Sr({},fh);const g6=(e,t)=>{let n=Sr({},e),r={};for(const i of t)MO(i),r=Sr(r,i);if(n=Sr(n,r),r.theme&&r.theme in fo){const i=Sr({},_O),a=Sr(i.themeVariables||{},r.themeVariables);n.theme&&n.theme in fo&&(n.themeVariables=fo[n.theme].getThemeVariables(a))}return jp=n,IO(jp),jp},Rbe=e=>(ni=Sr({},fh),ni=Sr(ni,e),e.theme&&fo[e.theme]&&(ni.themeVariables=fo[e.theme].getThemeVariables(e.themeVariables)),g6(ni,ph),ni),Dbe=e=>{_O=Sr({},e)},jbe=e=>(ni=Sr(ni,e),g6(ni,ph),ni),kO=()=>Sr({},ni),TO=e=>(IO(e),Sr(jp,e),Ss()),Ss=()=>Sr({},jp),MO=e=>{e&&(["secure",...ni.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(Ze.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&MO(e[t])}))},Pbe=e=>{H2(e),e.fontFamily&&(!e.themeVariables||!e.themeVariables.fontFamily)&&(e.themeVariables={fontFamily:e.fontFamily}),ph.push(e),g6(ni,ph)},X2=(e=ni)=>{ph=[],g6(e,ph)},Nbe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},bT={},Obe=e=>{bT[e]||(Ze.warn(Nbe[e]),bT[e]=!0)},IO=e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Obe("LAZY_LOAD_DEPRECATED")},AO="c4",Fbe=e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),Bbe=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./c4Diagram-15b5d702-Dm7F1Pn_.js");return{diagram:t}},__vite__mapDeps([4,5]),import.meta.url);return{id:AO,diagram:e}},$be={id:AO,detector:Fbe,loader:Bbe},zbe=$be,LO="flowchart",Hbe=(e,t)=>{var n,r;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},Wbe=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./flowDiagram-cbd28bf7-Bw4Z2nBD.js");return{diagram:t}},__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url);return{id:LO,diagram:e}},Xbe={id:LO,detector:Hbe,loader:Wbe},Vbe=Xbe,RO="flowchart-v2",Ybe=(e,t)=>{var n,r,i;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)&&((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)},Gbe=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./flowDiagram-v2-ffc7f31a-CoQufPp2.js");return{diagram:t}},__vite__mapDeps([24,7,12,8,9,13,10,11,14,15,16,17,18,19,20,21,22]),import.meta.url);return{id:RO,diagram:e}},qbe={id:RO,detector:Ybe,loader:Gbe},Zbe=qbe,DO="er",Kbe=e=>/^\s*erDiagram/.test(e),Qbe=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./erDiagram-880f2ed8-BjBeR38f.js");return{diagram:t}},__vite__mapDeps([25,8,9,10,11,18,19,20]),import.meta.url);return{id:DO,diagram:e}},Jbe={id:DO,detector:Kbe,loader:Qbe},eye=Jbe,jO="gitGraph",tye=e=>/^\s*gitGraph/.test(e),nye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./gitGraphDiagram-21fc4d3e-uW6XA6Y6.js");return{diagram:t}},[],import.meta.url);return{id:jO,diagram:e}},rye={id:jO,detector:tye,loader:nye},iye=rye,PO="gantt",aye=e=>/^\s*gantt/.test(e),sye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./ganttDiagram-04f9e578-CtUSsXCz.js");return{diagram:t}},__vite__mapDeps([26,27,28,29]),import.meta.url);return{id:PO,diagram:e}},oye={id:PO,detector:aye,loader:sye},lye=oye,NO="info",cye=e=>/^\s*info/.test(e),dye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./infoDiagram-4a4f5b27-ZxmAcaW1.js");return{diagram:t}},[],import.meta.url);return{id:NO,diagram:e}},uye={id:NO,detector:cye,loader:dye},OO="pie",hye=e=>/^\s*pie/.test(e),fye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./pieDiagram-421022e6-Bgy-duyf.js");return{diagram:t}},__vite__mapDeps([30,31,20,32,29,33,19]),import.meta.url);return{id:OO,diagram:e}},pye={id:OO,detector:hye,loader:fye},FO="quadrantChart",mye=e=>/^\s*quadrantChart/.test(e),gye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./quadrantDiagram-0957ecba-DcwYI1oi.js");return{diagram:t}},__vite__mapDeps([34,28,29]),import.meta.url);return{id:FO,diagram:e}},Uye={id:FO,detector:mye,loader:gye},bye=Uye,BO="xychart",yye=e=>/^\s*xychart-beta/.test(e),vye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./xychartDiagram-b6496bcd-BMKDop6v.js");return{diagram:t}},__vite__mapDeps([35,16,17,36,29,32,28,18,19,20]),import.meta.url);return{id:BO,diagram:e}},xye={id:BO,detector:yye,loader:vye},wye=xye,$O="requirement",Eye=e=>/^\s*requirement(Diagram)?/.test(e),Cye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./requirementDiagram-23d650b8-tdagN8HP.js");return{diagram:t}},__vite__mapDeps([37,8,9,10,11,18,19,20]),import.meta.url);return{id:$O,diagram:e}},Sye={id:$O,detector:Eye,loader:Cye},_ye=Sye,zO="sequence",kye=e=>/^\s*sequenceDiagram/.test(e),Tye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./sequenceDiagram-17ac3bff-ChyKKRZA.js");return{diagram:t}},__vite__mapDeps([38,5]),import.meta.url);return{id:zO,diagram:e}},Mye={id:zO,detector:kye,loader:Tye},Iye=Mye,HO="class",Aye=(e,t)=>{var n;return((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},Lye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./classDiagram-d40c83e7-DNbA-n-a.js");return{diagram:t}},__vite__mapDeps([39,40,8,9,10,11,18,19,20]),import.meta.url);return{id:HO,diagram:e}},Rye={id:HO,detector:Aye,loader:Lye},Dye=Rye,WO="classDiagram",jye=(e,t)=>{var n;return/^\s*classDiagram/.test(e)&&((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},Pye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./classDiagram-v2-d5a6b087-l-GglywH.js");return{diagram:t}},__vite__mapDeps([41,40,8,9,13,10,11,14,15,16,17,18,19,20]),import.meta.url);return{id:WO,diagram:e}},Nye={id:WO,detector:jye,loader:Pye},Oye=Nye,XO="state",Fye=(e,t)=>{var n;return((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},Bye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./stateDiagram-9c5f0230-BzU36S5C.js");return{diagram:t}},__vite__mapDeps([42,43,8,9,10,11,18,19,20]),import.meta.url);return{id:XO,diagram:e}},$ye={id:XO,detector:Fye,loader:Bye},zye=$ye,VO="stateDiagram",Hye=(e,t)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},Wye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./stateDiagram-v2-51a3dcff-CfX1qo7U.js");return{diagram:t}},__vite__mapDeps([44,43,8,9,13,10,11,14,15,16,17,18,19,20]),import.meta.url);return{id:VO,diagram:e}},Xye={id:VO,detector:Hye,loader:Wye},Vye=Xye,YO="journey",Yye=e=>/^\s*journey/.test(e),Gye=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./journeyDiagram-29694f62-ggDKs06f.js");return{diagram:t}},__vite__mapDeps([45,5,31,20]),import.meta.url);return{id:YO,diagram:e}},qye={id:YO,detector:Yye,loader:Gye},Zye=qye,Kye=function(e,t){for(let n of t)e.attr(n[0],n[1])},Qye=function(e,t,n){let r=new Map;return n?(r.set("width","100%"),r.set("style",`max-width: ${t}px;`)):(r.set("height",e),r.set("width",t)),r},GO=function(e,t,n,r){const i=Qye(t,n,r);Kye(e,i)},Jye=function(e,t,n,r){const i=t.node().getBBox(),a=i.width,s=i.height;Ze.info(`SVG bounds: ${a}x${s}`,i);let o=0,c=0;Ze.info(`Graph bounds: ${o}x${c}`,e),o=a+n*2,c=s+n*2,Ze.info(`Calculated bounds: ${o}x${c}`),GO(t,c,o,r);const d=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;t.attr("viewBox",d)},Dg={},e3e=(e,t,n)=>{let r="";return e in Dg&&Dg[e]?r=Dg[e](n):Ze.warn(`No theme found for ${e}`),` & {
|
|
273
|
+
font-family: ${n.fontFamily};
|
|
274
|
+
font-size: ${n.fontSize};
|
|
275
|
+
fill: ${n.textColor}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* Classes common for multiple diagrams */
|
|
279
|
+
|
|
280
|
+
& .error-icon {
|
|
281
|
+
fill: ${n.errorBkgColor};
|
|
282
|
+
}
|
|
283
|
+
& .error-text {
|
|
284
|
+
fill: ${n.errorTextColor};
|
|
285
|
+
stroke: ${n.errorTextColor};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
& .edge-thickness-normal {
|
|
289
|
+
stroke-width: 2px;
|
|
290
|
+
}
|
|
291
|
+
& .edge-thickness-thick {
|
|
292
|
+
stroke-width: 3.5px
|
|
293
|
+
}
|
|
294
|
+
& .edge-pattern-solid {
|
|
295
|
+
stroke-dasharray: 0;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
& .edge-pattern-dashed{
|
|
299
|
+
stroke-dasharray: 3;
|
|
300
|
+
}
|
|
301
|
+
.edge-pattern-dotted {
|
|
302
|
+
stroke-dasharray: 2;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
& .marker {
|
|
306
|
+
fill: ${n.lineColor};
|
|
307
|
+
stroke: ${n.lineColor};
|
|
308
|
+
}
|
|
309
|
+
& .marker.cross {
|
|
310
|
+
stroke: ${n.lineColor};
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
& svg {
|
|
314
|
+
font-family: ${n.fontFamily};
|
|
315
|
+
font-size: ${n.fontSize};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
${r}
|
|
319
|
+
|
|
320
|
+
${t}
|
|
321
|
+
`},t3e=(e,t)=>{t!==void 0&&(Dg[e]=t)},n3e=e3e;let xx="",wx="",Ex="";const Cx=e=>uh(e,Ss()),r3e=()=>{xx="",Ex="",wx=""},i3e=e=>{xx=Cx(e).replace(/^\s+/g,"")},a3e=()=>xx,s3e=e=>{Ex=Cx(e).replace(/\n\s+/g,`
|
|
322
|
+
`)},o3e=()=>Ex,l3e=e=>{wx=Cx(e)},c3e=()=>wx,d3e=Object.freeze(Object.defineProperty({__proto__:null,clear:r3e,getAccDescription:o3e,getAccTitle:a3e,getDiagramTitle:c3e,setAccDescription:s3e,setAccTitle:i3e,setDiagramTitle:l3e},Symbol.toStringTag,{value:"Module"})),u3e=Ze,h3e=gx,Sx=Ss,Oxe=TO,Fxe=fh,f3e=e=>uh(e,Sx()),p3e=Jye,m3e=()=>d3e,V2={},Y2=(e,t,n)=>{var r;if(V2[e])throw new Error(`Diagram ${e} already registered.`);V2[e]=t,n&&xO(e,n),t3e(e,t.styles),(r=t.injectUtils)==null||r.call(t,u3e,h3e,Sx,f3e,p3e,m3e(),()=>{})},_x=e=>{if(e in V2)return V2[e];throw new g3e(e)};class g3e extends Error{constructor(t){super(`Diagram ${t} not found.`)}}const U3e=e=>{var t;const{securityLevel:n}=Sx();let r=$i("body");if(n==="sandbox"){const s=((t=$i(`#i${e}`).node())==null?void 0:t.contentDocument)??document;r=$i(s.body)}return r.select(`#${e}`)},b3e=(e,t,n)=>{Ze.debug(`rendering svg for syntax error
|
|
323
|
+
`);const r=U3e(t),i=r.append("g");r.attr("viewBox","0 0 2412 512"),GO(r,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},qO={draw:b3e},y3e=qO,v3e={db:{},renderer:qO,parser:{parser:{yy:{}},parse:()=>{}}},x3e=v3e,ZO="flowchart-elk",w3e=(e,t)=>{var n;return!!(/^\s*flowchart-elk/.test(e)||/^\s*flowchart|graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk")},E3e=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./flowchart-elk-definition-36e2d292-1kZNdf3X.js");return{diagram:t}},__vite__mapDeps([46,7,15,16,17,18,19,20,47,3]),import.meta.url);return{id:ZO,diagram:e}},C3e={id:ZO,detector:w3e,loader:E3e},S3e=C3e,KO="timeline",_3e=e=>/^\s*timeline/.test(e),k3e=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./timeline-definition-7e6b55e7-BIcL44O_.js");return{diagram:t}},__vite__mapDeps([48,31,20]),import.meta.url);return{id:KO,diagram:e}},T3e={id:KO,detector:_3e,loader:k3e},M3e=T3e,QO="mindmap",I3e=e=>/^\s*mindmap/.test(e),A3e=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./mindmap-definition-ac74a2e8-DsRo8f2w.js");return{diagram:t}},__vite__mapDeps([49,50,16,17]),import.meta.url);return{id:QO,diagram:e}},L3e={id:QO,detector:I3e,loader:A3e},R3e=L3e,JO="sankey",D3e=e=>/^\s*sankey-beta/.test(e),j3e=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./sankeyDiagram-23345273-ncj1Ol7S.js");return{diagram:t}},__vite__mapDeps([51,52,32,29,53]),import.meta.url);return{id:JO,diagram:e}},P3e={id:JO,detector:D3e,loader:j3e},N3e=P3e,eF="block",O3e=e=>/^\s*block-beta/.test(e),F3e=async()=>{const{diagram:e}=await ge(async()=>{const{diagram:t}=await import("./blockDiagram-68f4deed-Ynbqr7bQ.js");return{diagram:t}},__vite__mapDeps([54,14,9,15,16,17,18,19,20,8,21,32,29,53]),import.meta.url);return{id:eF,diagram:e}},B3e={id:eF,detector:O3e,loader:F3e},$3e=B3e;let yT=!1;const kx=()=>{yT||(yT=!0,Y2("error",x3e,e=>e.toLowerCase().trim()==="error"),Y2("---",{db:{clear:()=>{}},styles:{},renderer:{draw:()=>{}},parser:{parser:{yy:{}},parse:()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")}},init:()=>null},e=>e.toLowerCase().trimStart().startsWith("---")),vO(zbe,Oye,Dye,eye,lye,uye,pye,_ye,Iye,S3e,Zbe,Vbe,R3e,M3e,iye,Vye,zye,Zye,bye,N3e,wye,$3e))};class tF{constructor(t,n={}){this.text=t,this.metadata=n,this.type="graph",this.text=Abe(t),this.text+=`
|
|
324
|
+
`;const r=Ss();try{this.type=m6(t,r)}catch(a){this.type="error",this.detectError=a}const i=_x(this.type);Ze.debug("Type "+this.type),this.db=i.db,this.renderer=i.renderer,this.parser=i.parser,this.parser.parser.yy=this.db,this.init=i.init,this.parse()}parse(){var t,n,r,i,a;if(this.detectError)throw this.detectError;(n=(t=this.db).clear)==null||n.call(t);const s=Ss();(r=this.init)==null||r.call(this,s),this.metadata.title&&((a=(i=this.db).setDiagramTitle)==null||a.call(i,this.metadata.title)),this.parser.parse(this.text)}async render(t,n){await this.renderer.draw(this.text,t,n,this)}getParser(){return this.parser}getType(){return this.type}}const z3e=async(e,t={})=>{const n=m6(e,Ss());try{_x(n)}catch{const i=abe(n);if(!i)throw new yO(`Diagram ${n} not found.`);const{id:a,diagram:s}=await i();Y2(a,s)}return new tF(e,t)};let vT=[];const H3e=()=>{vT.forEach(e=>{e()}),vT=[]},W3e="graphics-document document";function X3e(e,t){e.attr("role",W3e),t!==""&&e.attr("aria-roledescription",t)}function V3e(e,t,n,r){if(e.insert!==void 0){if(n){const i=`chart-desc-${r}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(n)}if(t){const i=`chart-title-${r}`;e.attr("aria-labelledby",i),e.insert("title",":first-child").attr("id",i).text(t)}}}const Y3e=e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart();/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function nF(e){return typeof e>"u"||e===null}function G3e(e){return typeof e=="object"&&e!==null}function q3e(e){return Array.isArray(e)?e:nF(e)?[]:[e]}function Z3e(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function K3e(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Q3e(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var J3e=nF,e8e=G3e,t8e=q3e,n8e=K3e,r8e=Q3e,i8e=Z3e,Nr={isNothing:J3e,isObject:e8e,toArray:t8e,repeat:n8e,isNegativeZero:r8e,extend:i8e};function rF(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
|
325
|
+
|
|
326
|
+
`+e.mark.snippet),r+" "+n):r}function x1(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=rF(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}x1.prototype=Object.create(Error.prototype);x1.prototype.constructor=x1;x1.prototype.toString=function(t){return this.name+": "+rF(this,t)};var ao=x1;function $y(e,t,n,r,i){var a="",s="",o=Math.floor(i/2)-1;return r-t>o&&(a=" ... ",t=r-o+a.length),n-r>o&&(s=" ...",n=r+o-s.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+s,pos:r-t+a.length}}function zy(e,t){return Nr.repeat(" ",t-e.length)+e}function a8e(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,s=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);var o="",c,d,l=Math.min(e.line+t.linesAfter,i.length).toString().length,h=t.maxLength-(t.indent+l+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)d=$y(e.buffer,r[s-c],i[s-c],e.position-(r[s]-r[s-c]),h),o=Nr.repeat(" ",t.indent)+zy((e.line-c+1).toString(),l)+" | "+d.str+`
|
|
327
|
+
`+o;for(d=$y(e.buffer,r[s],i[s],e.position,h),o+=Nr.repeat(" ",t.indent)+zy((e.line+1).toString(),l)+" | "+d.str+`
|
|
328
|
+
`,o+=Nr.repeat("-",t.indent+l+3+d.pos)+`^
|
|
329
|
+
`,c=1;c<=t.linesAfter&&!(s+c>=i.length);c++)d=$y(e.buffer,r[s+c],i[s+c],e.position-(r[s]-r[s+c]),h),o+=Nr.repeat(" ",t.indent)+zy((e.line+c+1).toString(),l)+" | "+d.str+`
|
|
330
|
+
`;return o.replace(/\n$/,"")}var s8e=a8e,o8e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],l8e=["scalar","sequence","mapping"];function c8e(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function d8e(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(o8e.indexOf(n)===-1)throw new ao('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=c8e(t.styleAliases||null),l8e.indexOf(this.kind)===-1)throw new ao('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ir=d8e;function xT(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(a,s){a.tag===r.tag&&a.kind===r.kind&&a.multi===r.multi&&(i=s)}),n[i]=r}),n}function u8e(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function j8(e){return this.extend(e)}j8.prototype.extend=function(t){var n=[],r=[];if(t instanceof Ir)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new ao("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(a){if(!(a instanceof Ir))throw new ao("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new ao("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new ao("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(a){if(!(a instanceof Ir))throw new ao("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(j8.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=xT(i,"implicit"),i.compiledExplicit=xT(i,"explicit"),i.compiledTypeMap=u8e(i.compiledImplicit,i.compiledExplicit),i};var h8e=j8,f8e=new Ir("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),p8e=new Ir("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),m8e=new Ir("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),g8e=new h8e({explicit:[f8e,p8e,m8e]});function U8e(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function b8e(){return null}function y8e(e){return e===null}var v8e=new Ir("tag:yaml.org,2002:null",{kind:"scalar",resolve:U8e,construct:b8e,predicate:y8e,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function x8e(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function w8e(e){return e==="true"||e==="True"||e==="TRUE"}function E8e(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var C8e=new Ir("tag:yaml.org,2002:bool",{kind:"scalar",resolve:x8e,construct:w8e,predicate:E8e,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function S8e(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function _8e(e){return 48<=e&&e<=55}function k8e(e){return 48<=e&&e<=57}function T8e(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!S8e(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!_8e(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!k8e(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function M8e(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function I8e(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Nr.isNegativeZero(e)}var A8e=new Ir("tag:yaml.org,2002:int",{kind:"scalar",resolve:T8e,construct:M8e,predicate:I8e,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),L8e=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function R8e(e){return!(e===null||!L8e.test(e)||e[e.length-1]==="_")}function D8e(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var j8e=/^[-+]?[0-9]+e/;function P8e(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Nr.isNegativeZero(e))return"-0.0";return n=e.toString(10),j8e.test(n)?n.replace("e",".e"):n}function N8e(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Nr.isNegativeZero(e))}var O8e=new Ir("tag:yaml.org,2002:float",{kind:"scalar",resolve:R8e,construct:D8e,predicate:N8e,represent:P8e,defaultStyle:"lowercase"}),iF=g8e.extend({implicit:[v8e,C8e,A8e,O8e]}),F8e=iF,aF=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),sF=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function B8e(e){return e===null?!1:aF.exec(e)!==null||sF.exec(e)!==null}function $8e(e){var t,n,r,i,a,s,o,c=0,d=null,l,h,f;if(t=aF.exec(e),t===null&&(t=sF.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],s=+t[5],o=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(l=+t[10],h=+(t[11]||0),d=(l*60+h)*6e4,t[9]==="-"&&(d=-d)),f=new Date(Date.UTC(n,r,i,a,s,o,c)),d&&f.setTime(f.getTime()-d),f}function z8e(e){return e.toISOString()}var H8e=new Ir("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:B8e,construct:$8e,instanceOf:Date,represent:z8e});function W8e(e){return e==="<<"||e===null}var X8e=new Ir("tag:yaml.org,2002:merge",{kind:"scalar",resolve:W8e}),Tx=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
331
|
+
\r`;function V8e(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=Tx;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function Y8e(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=Tx,s=0,o=[];for(t=0;t<i;t++)t%4===0&&t&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):n===18?(o.push(s>>10&255),o.push(s>>2&255)):n===12&&o.push(s>>4&255),new Uint8Array(o)}function G8e(e){var t="",n=0,r,i,a=e.length,s=Tx;for(r=0;r<a;r++)r%3===0&&r&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):i===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):i===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function q8e(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Z8e=new Ir("tag:yaml.org,2002:binary",{kind:"scalar",resolve:V8e,construct:Y8e,predicate:q8e,represent:G8e}),K8e=Object.prototype.hasOwnProperty,Q8e=Object.prototype.toString;function J8e(e){if(e===null)return!0;var t=[],n,r,i,a,s,o=e;for(n=0,r=o.length;n<r;n+=1){if(i=o[n],s=!1,Q8e.call(i)!=="[object Object]")return!1;for(a in i)if(K8e.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function e7e(e){return e!==null?e:[]}var t7e=new Ir("tag:yaml.org,2002:omap",{kind:"sequence",resolve:J8e,construct:e7e}),n7e=Object.prototype.toString;function r7e(e){if(e===null)return!0;var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],n7e.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function i7e(e){if(e===null)return[];var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var a7e=new Ir("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r7e,construct:i7e}),s7e=Object.prototype.hasOwnProperty;function o7e(e){if(e===null)return!0;var t,n=e;for(t in n)if(s7e.call(n,t)&&n[t]!==null)return!1;return!0}function l7e(e){return e!==null?e:{}}var c7e=new Ir("tag:yaml.org,2002:set",{kind:"mapping",resolve:o7e,construct:l7e}),d7e=F8e.extend({implicit:[H8e,X8e],explicit:[Z8e,t7e,a7e,c7e]}),Hl=Object.prototype.hasOwnProperty,G2=1,oF=2,lF=3,q2=4,Hy=1,u7e=2,wT=3,h7e=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f7e=/[\x85\u2028\u2029]/,p7e=/[,\[\]\{\}]/,cF=/^(?:!|!!|![a-z\-]+!)$/i,dF=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ET(e){return Object.prototype.toString.call(e)}function ms(e){return e===10||e===13}function Gc(e){return e===9||e===32}function li(e){return e===9||e===32||e===10||e===13}function _u(e){return e===44||e===91||e===93||e===123||e===125}function m7e(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function g7e(e){return e===120?2:e===117?4:e===85?8:0}function U7e(e){return 48<=e&&e<=57?e-48:-1}function CT(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
332
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function b7e(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var uF=new Array(256),hF=new Array(256);for(var cu=0;cu<256;cu++)uF[cu]=CT(cu)?1:0,hF[cu]=CT(cu);function y7e(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||d7e,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function fF(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=s8e(n),new ao(t,n)}function Ge(e,t){throw fF(e,t)}function Z2(e,t){e.onWarning&&e.onWarning.call(null,fF(e,t))}var ST={YAML:function(t,n,r){var i,a,s;t.version!==null&&Ge(t,"duplication of %YAML directive"),r.length!==1&&Ge(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Ge(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Ge(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Z2(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,a;r.length!==2&&Ge(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],cF.test(i)||Ge(t,"ill-formed tag handle (first argument) of the TAG directive"),Hl.call(t.tagMap,i)&&Ge(t,'there is a previously declared suffix for "'+i+'" tag handle'),dF.test(a)||Ge(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Ge(t,"tag prefix is malformed: "+a)}t.tagMap[i]=a}};function Dl(e,t,n,r){var i,a,s,o;if(t<n){if(o=e.input.slice(t,n),r)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||Ge(e,"expected valid JSON character");else h7e.test(o)&&Ge(e,"the stream contains non-printable characters");e.result+=o}}function _T(e,t,n,r){var i,a,s,o;for(Nr.isObject(n)||Ge(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),s=0,o=i.length;s<o;s+=1)a=i[s],Hl.call(t,a)||(t[a]=n[a],r[a]=!0)}function ku(e,t,n,r,i,a,s,o,c){var d,l;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),d=0,l=i.length;d<l;d+=1)Array.isArray(i[d])&&Ge(e,"nested arrays are not supported inside keys"),typeof i=="object"&&ET(i[d])==="[object Object]"&&(i[d]="[object Object]");if(typeof i=="object"&&ET(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(d=0,l=a.length;d<l;d+=1)_T(e,t,a[d],n);else _T(e,t,a,n);else!e.json&&!Hl.call(n,i)&&Hl.call(t,i)&&(e.line=s||e.line,e.lineStart=o||e.lineStart,e.position=c||e.position,Ge(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):t[i]=a,delete n[i];return t}function Mx(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Ge(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function On(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Gc(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(ms(i))for(Mx(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Z2(e,"deficient indentation"),r}function U6(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||li(n)))}function Ix(e,t){t===1?e.result+=" ":t>1&&(e.result+=Nr.repeat(`
|
|
333
|
+
`,t-1))}function v7e(e,t,n){var r,i,a,s,o,c,d,l,h=e.kind,f=e.result,g;if(g=e.input.charCodeAt(e.position),li(g)||_u(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96||(g===63||g===45)&&(i=e.input.charCodeAt(e.position+1),li(i)||n&&_u(i)))return!1;for(e.kind="scalar",e.result="",a=s=e.position,o=!1;g!==0;){if(g===58){if(i=e.input.charCodeAt(e.position+1),li(i)||n&&_u(i))break}else if(g===35){if(r=e.input.charCodeAt(e.position-1),li(r))break}else{if(e.position===e.lineStart&&U6(e)||n&&_u(g))break;if(ms(g))if(c=e.line,d=e.lineStart,l=e.lineIndent,On(e,!1,-1),e.lineIndent>=t){o=!0,g=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=d,e.lineIndent=l;break}}o&&(Dl(e,a,s,!1),Ix(e,e.line-c),a=s=e.position,o=!1),Gc(g)||(s=e.position+1),g=e.input.charCodeAt(++e.position)}return Dl(e,a,s,!1),e.result?!0:(e.kind=h,e.result=f,!1)}function x7e(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Dl(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else ms(n)?(Dl(e,r,i,!0),Ix(e,On(e,!1,t)),r=i=e.position):e.position===e.lineStart&&U6(e)?Ge(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Ge(e,"unexpected end of the stream within a single quoted scalar")}function w7e(e,t){var n,r,i,a,s,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Dl(e,n,e.position,!0),e.position++,!0;if(o===92){if(Dl(e,n,e.position,!0),o=e.input.charCodeAt(++e.position),ms(o))On(e,!1,t);else if(o<256&&uF[o])e.result+=hF[o],e.position++;else if((s=g7e(o))>0){for(i=s,a=0;i>0;i--)o=e.input.charCodeAt(++e.position),(s=m7e(o))>=0?a=(a<<4)+s:Ge(e,"expected hexadecimal character");e.result+=b7e(a),e.position++}else Ge(e,"unknown escape sequence");n=r=e.position}else ms(o)?(Dl(e,n,r,!0),Ix(e,On(e,!1,t)),n=r=e.position):e.position===e.lineStart&&U6(e)?Ge(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}Ge(e,"unexpected end of the stream within a double quoted scalar")}function E7e(e,t){var n=!0,r,i,a,s=e.tag,o,c=e.anchor,d,l,h,f,g,U=Object.create(null),y,v,x,w;if(w=e.input.charCodeAt(e.position),w===91)l=93,g=!1,o=[];else if(w===123)l=125,g=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),w=e.input.charCodeAt(++e.position);w!==0;){if(On(e,!0,t),w=e.input.charCodeAt(e.position),w===l)return e.position++,e.tag=s,e.anchor=c,e.kind=g?"mapping":"sequence",e.result=o,!0;n?w===44&&Ge(e,"expected the node content, but found ','"):Ge(e,"missed comma between flow collection entries"),v=y=x=null,h=f=!1,w===63&&(d=e.input.charCodeAt(e.position+1),li(d)&&(h=f=!0,e.position++,On(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,mh(e,t,G2,!1,!0),v=e.tag,y=e.result,On(e,!0,t),w=e.input.charCodeAt(e.position),(f||e.line===r)&&w===58&&(h=!0,w=e.input.charCodeAt(++e.position),On(e,!0,t),mh(e,t,G2,!1,!0),x=e.result),g?ku(e,o,U,v,y,x,r,i,a):h?o.push(ku(e,null,U,v,y,x,r,i,a)):o.push(y),On(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(n=!0,w=e.input.charCodeAt(++e.position)):n=!1}Ge(e,"unexpected end of the stream within a flow collection")}function C7e(e,t){var n,r,i=Hy,a=!1,s=!1,o=t,c=0,d=!1,l,h;if(h=e.input.charCodeAt(e.position),h===124)r=!1;else if(h===62)r=!0;else return!1;for(e.kind="scalar",e.result="";h!==0;)if(h=e.input.charCodeAt(++e.position),h===43||h===45)Hy===i?i=h===43?wT:u7e:Ge(e,"repeat of a chomping mode identifier");else if((l=U7e(h))>=0)l===0?Ge(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Ge(e,"repeat of an indentation width identifier"):(o=t+l-1,s=!0);else break;if(Gc(h)){do h=e.input.charCodeAt(++e.position);while(Gc(h));if(h===35)do h=e.input.charCodeAt(++e.position);while(!ms(h)&&h!==0)}for(;h!==0;){for(Mx(e),e.lineIndent=0,h=e.input.charCodeAt(e.position);(!s||e.lineIndent<o)&&h===32;)e.lineIndent++,h=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>o&&(o=e.lineIndent),ms(h)){c++;continue}if(e.lineIndent<o){i===wT?e.result+=Nr.repeat(`
|
|
334
|
+
`,a?1+c:c):i===Hy&&a&&(e.result+=`
|
|
335
|
+
`);break}for(r?Gc(h)?(d=!0,e.result+=Nr.repeat(`
|
|
336
|
+
`,a?1+c:c)):d?(d=!1,e.result+=Nr.repeat(`
|
|
337
|
+
`,c+1)):c===0?a&&(e.result+=" "):e.result+=Nr.repeat(`
|
|
338
|
+
`,c):e.result+=Nr.repeat(`
|
|
339
|
+
`,a?1+c:c),a=!0,s=!0,c=0,n=e.position;!ms(h)&&h!==0;)h=e.input.charCodeAt(++e.position);Dl(e,n,e.position,!1)}return!0}function kT(e,t){var n,r=e.tag,i=e.anchor,a=[],s,o=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Ge(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!li(s))));){if(o=!0,e.position++,On(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,mh(e,t,lF,!1,!0),a.push(e.result),On(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)Ge(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function S7e(e,t,n){var r,i,a,s,o,c,d=e.tag,l=e.anchor,h={},f=Object.create(null),g=null,U=null,y=null,v=!1,x=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),w=e.input.charCodeAt(e.position);w!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Ge(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),a=e.line,(w===63||w===58)&&li(r))w===63?(v&&(ku(e,h,f,g,U,null,s,o,c),g=U=y=null),x=!0,v=!0,i=!0):v?(v=!1,i=!0):Ge(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=r;else{if(s=e.line,o=e.lineStart,c=e.position,!mh(e,n,oF,!1,!0))break;if(e.line===a){for(w=e.input.charCodeAt(e.position);Gc(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),li(w)||Ge(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(ku(e,h,f,g,U,null,s,o,c),g=U=y=null),x=!0,v=!1,i=!1,g=e.tag,U=e.result;else if(x)Ge(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=l,!0}else if(x)Ge(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=l,!0}if((e.line===a||e.lineIndent>t)&&(v&&(s=e.line,o=e.lineStart,c=e.position),mh(e,t,q2,!0,i)&&(v?U=e.result:y=e.result),v||(ku(e,h,f,g,U,y,s,o,c),g=U=y=null),On(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&w!==0)Ge(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&ku(e,h,f,g,U,null,s,o,c),x&&(e.tag=d,e.anchor=l,e.kind="mapping",e.result=h),x}function _7e(e){var t,n=!1,r=!1,i,a,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&Ge(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(r=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(a=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):Ge(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!li(s);)s===33&&(r?Ge(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),cF.test(i)||Ge(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),p7e.test(a)&&Ge(e,"tag suffix cannot contain flow indicator characters")}a&&!dF.test(a)&&Ge(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{Ge(e,"tag name is malformed: "+a)}return n?e.tag=a:Hl.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:Ge(e,'undeclared tag handle "'+i+'"'),!0}function k7e(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&Ge(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!li(n)&&!_u(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ge(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function T7e(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!li(r)&&!_u(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Ge(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Hl.call(e.anchorMap,n)||Ge(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],On(e,!0,-1),!0}function mh(e,t,n,r,i){var a,s,o,c=1,d=!1,l=!1,h,f,g,U,y,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=o=q2===n||lF===n,r&&On(e,!0,-1)&&(d=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;_7e(e)||k7e(e);)On(e,!0,-1)?(d=!0,o=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):o=!1;if(o&&(o=d||i),(c===1||q2===n)&&(G2===n||oF===n?y=t:y=t+1,v=e.position-e.lineStart,c===1?o&&(kT(e,v)||S7e(e,v,y))||E7e(e,y)?l=!0:(s&&C7e(e,y)||x7e(e,y)||w7e(e,y)?l=!0:T7e(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&Ge(e,"alias node should not have any properties")):v7e(e,y,G2===n)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=o&&kT(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Ge(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),h=0,f=e.implicitTypes.length;h<f;h+=1)if(U=e.implicitTypes[h],U.resolve(e.result)){e.result=U.construct(e.result),e.tag=U.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Hl.call(e.typeMap[e.kind||"fallback"],e.tag))U=e.typeMap[e.kind||"fallback"][e.tag];else for(U=null,g=e.typeMap.multi[e.kind||"fallback"],h=0,f=g.length;h<f;h+=1)if(e.tag.slice(0,g[h].tag.length)===g[h].tag){U=g[h];break}U||Ge(e,"unknown tag !<"+e.tag+">"),e.result!==null&&U.kind!==e.kind&&Ge(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+U.kind+'", not "'+e.kind+'"'),U.resolve(e.result,e.tag)?(e.result=U.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Ge(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||l}function M7e(e){var t=e.position,n,r,i,a=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(On(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(a=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!li(s);)s=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&Ge(e,"directive name must not be less than one character in length");s!==0;){for(;Gc(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!ms(s));break}if(ms(s))break;for(n=e.position;s!==0&&!li(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}s!==0&&Mx(e),Hl.call(ST,r)?ST[r](e,r,i):Z2(e,'unknown document directive "'+r+'"')}if(On(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,On(e,!0,-1)):a&&Ge(e,"directives end mark is expected"),mh(e,e.lineIndent-1,q2,!1,!0),On(e,!0,-1),e.checkLineBreaks&&f7e.test(e.input.slice(t,e.position))&&Z2(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&U6(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,On(e,!0,-1));return}if(e.position<e.length-1)Ge(e,"end of the stream or a document separator is expected");else return}function I7e(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
340
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new y7e(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,Ge(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)M7e(n);return n.documents}function A7e(e,t){var n=I7e(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new ao("expected a single document in the stream, but found more")}}var L7e=A7e,R7e={load:L7e},D7e=iF,j7e=R7e.load;function P7e(e){const t=e.match(bO);if(!t)return{text:e,metadata:{}};let n=j7e(t[1],{schema:D7e})??{};n=typeof n=="object"&&!Array.isArray(n)?n:{};const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}const N7e=e=>e.replace(/\r\n?/g,`
|
|
341
|
+
`).replace(/<(\w+)([^>]*)>/g,(t,n,r)=>"<"+n+r.replace(/="([^"]*)"/g,"='$1'")+">"),O7e=e=>{const{text:t,metadata:n}=P7e(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||(a.gantt={}),a.gantt.displayMode=r),{title:i,config:a,text:t}},F7e=e=>{const t=Dp.detectInit(e)??{},n=Dp.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:r})=>{}):(n==null?void 0:n.type)==="wrap"&&(t.wrap=!0),{text:dbe(e),directive:t}};function pF(e){const t=N7e(e),n=O7e(t),r=F7e(n.text),i=SO(n.config,r.directive);return e=Y3e(r.text),{code:e,title:n.title,config:i}}const B7e=5e4,$7e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",z7e="sandbox",H7e="loose",W7e="http://www.w3.org/2000/svg",X7e="http://www.w3.org/1999/xlink",V7e="http://www.w3.org/1999/xhtml",Y7e="100%",G7e="100%",q7e="border:0;margin:0;",Z7e="margin:0",K7e="allow-top-navigation-by-user-activation allow-popups",Q7e='The "iframe" tag is not supported by your browser.',J7e=["foreignobject"],eve=["dominant-baseline"];function mF(e){const t=pF(e);return X2(),Pbe(t.config??{}),t}async function tve(e,t){kx(),e=mF(e).code;try{await Ax(e)}catch(n){if(t!=null&&t.suppressErrors)return!1;throw n}return!0}const TT=(e,t,n=[])=>`
|
|
342
|
+
.${e} ${t} { ${n.join(" !important; ")} !important; }`,nve=(e,t={})=>{var n;let r="";if(e.themeCSS!==void 0&&(r+=`
|
|
343
|
+
${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
|
|
344
|
+
:root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
|
|
345
|
+
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),!By(t)){const o=e.htmlLabels||((n=e.flowchart)==null?void 0:n.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];for(const c in t){const d=t[c];By(d.styles)||o.forEach(l=>{r+=TT(d.id,l,d.styles)}),By(d.textStyles)||(r+=TT(d.id,"tspan",d.textStyles))}}return r},rve=(e,t,n,r)=>{const i=nve(e,n),a=n3e(t,i,e.themeVariables);return k8(p5e(`${r}{${a}}`),g5e)},ive=(e="",t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),r=Lbe(r),r=r.replace(/<br>/g,"<br/>"),r},ave=(e="",t)=>{var n,r;const i=(r=(n=t==null?void 0:t.viewBox)==null?void 0:n.baseVal)!=null&&r.height?t.viewBox.baseVal.height+"px":G7e,a=btoa('<body style="'+Z7e+'">'+e+"</body>");return`<iframe style="width:${Y7e};height:${i};${q7e}" src="data:text/html;base64,${a}" sandbox="${K7e}">
|
|
346
|
+
${Q7e}
|
|
347
|
+
</iframe>`},MT=(e,t,n,r,i)=>{const a=e.append("div");a.attr("id",n),r&&a.attr("style",r);const s=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",W7e);return i&&s.attr("xmlns:xlink",i),s.append("g"),e};function IT(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}const sve=(e,t,n,r)=>{var i,a,s;(i=e.getElementById(t))==null||i.remove(),(a=e.getElementById(n))==null||a.remove(),(s=e.getElementById(r))==null||s.remove()},ove=async function(e,t,n){var r,i,a,s,o,c;kx();const d=mF(t);t=d.code;const l=Ss();Ze.debug(l),t.length>((l==null?void 0:l.maxTextSize)??B7e)&&(t=$7e);const h="#"+e,f="i"+e,g="#"+f,U="d"+e,y="#"+U;let v=$i("body");const x=l.securityLevel===z7e,w=l.securityLevel===H7e,C=l.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=""),x){const H=IT($i(n),f);v=$i(H.nodes()[0].contentDocument.body),v.node().style.margin=0}else v=$i(n);MT(v,e,U,`font-family: ${C}`,X7e)}else{if(sve(document,e,U,f),x){const H=IT($i("body"),f);v=$i(H.nodes()[0].contentDocument.body),v.node().style.margin=0}else v=$i("body");MT(v,e,U)}let S,T;try{S=await Ax(t,{title:d.title})}catch(H){S=new tF("error"),T=H}const M=v.select(y).node(),_=S.type,R=M.firstChild,P=R.firstChild,j=(i=(r=S.renderer).getClasses)==null?void 0:i.call(r,t,S),N=rve(l,_,j,h),F=document.createElement("style");F.innerHTML=N,R.insertBefore(F,P);try{await S.renderer.draw(t,e,UT,S)}catch(H){throw y3e.draw(t,e,UT),H}const B=v.select(`${y} svg`),G=(s=(a=S.db).getAccTitle)==null?void 0:s.call(a),W=(c=(o=S.db).getAccDescription)==null?void 0:c.call(o);cve(_,B,G,W),v.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",V7e);let X=v.select(y).node().innerHTML;if(Ze.debug("config.arrowMarkerAbsolute",l.arrowMarkerAbsolute),X=ive(X,x,mO(l.arrowMarkerAbsolute)),x){const H=v.select(y+" svg").node();X=ave(X,H)}else w||(X=lh.sanitize(X,{ADD_TAGS:J7e,ADD_ATTR:eve}));if(H3e(),T)throw T;const Y=$i(x?g:y).node();return Y&&"remove"in Y&&Y.remove(),{svg:X,bindFunctions:S.db.bindFunctions}};function lve(e={}){var t;e!=null&&e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Dbe(e),e!=null&&e.theme&&e.theme in fo?e.themeVariables=fo[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=fo.default.getThemeVariables(e.themeVariables));const n=typeof e=="object"?Rbe(e):kO();gx(n.logLevel),kx()}const Ax=(e,t={})=>{const{code:n}=pF(e);return z3e(n,t)};function cve(e,t,n,r){X3e(t,e),V3e(t,n,r,t.attr("id"))}const fd=Object.freeze({render:ove,parse:tve,getDiagramFromText:Ax,initialize:lve,getConfig:Ss,setConfig:TO,getSiteConfig:kO,updateSiteConfig:jbe,reset:()=>{X2()},globalReset:()=>{X2(fh)},defaultConfig:fh});gx(Ss().logLevel);X2(Ss());const dve=async()=>{Ze.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(hh).map(async([n,{detector:r,loader:i}])=>{if(i)try{_x(n)}catch{try{const{diagram:s,id:o}=await i();Y2(o,s,r)}catch(s){throw Ze.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete hh[n],s}}}))).filter(n=>n.status==="rejected");if(t.length>0){Ze.error(`Failed to load ${t.length} external diagrams`);for(const n of t)Ze.error(n);throw new Error(`Failed to load ${t.length} external diagrams`)}},uve=(e,t,n)=>{Ze.warn(e),CO(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},gF=async function(e={querySelector:".mermaid"}){try{await hve(e)}catch(t){if(CO(t)&&Ze.error(t.str),wi.parseError&&wi.parseError(t),!e.suppressErrors)throw Ze.error("Use the suppressErrors option to suppress these errors"),t}},hve=async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:".mermaid"}){const r=fd.getConfig();Ze.debug(`${e?"":"No "}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Ze.debug(`Found ${i.length} diagrams`),(r==null?void 0:r.startOnLoad)!==void 0&&(Ze.debug("Start On Load: "+(r==null?void 0:r.startOnLoad)),fd.updateSiteConfig({startOnLoad:r==null?void 0:r.startOnLoad}));const a=new Dp.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let s;const o=[];for(const c of Array.from(i)){Ze.info("Rendering diagram: "+c.id);/*! Check if previously processed */if(c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const d=`mermaid-${a.next()}`;s=c.innerHTML,s=m1e(Dp.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const l=Dp.detectInit(s);l&&Ze.debug("Detected early reinit: ",l);try{const{svg:h,bindFunctions:f}=await vF(d,s,c);c.innerHTML=h,e&&await e(d),f&&f(c)}catch(h){uve(h,o,wi.parseError)}}if(o.length>0)throw o[0]},UF=function(e){fd.initialize(e)},fve=async function(e,t,n){Ze.warn("mermaid.init is deprecated. Please use run instead."),e&&UF(e);const r={postRenderCallback:n,querySelector:".mermaid"};typeof t=="string"?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await gF(r)},pve=async(e,{lazyLoad:t=!0}={})=>{vO(...e),t===!1&&await dve()},bF=function(){if(wi.startOnLoad){const{startOnLoad:e}=fd.getConfig();e&&wi.run().catch(t=>Ze.error("Mermaid failed to initialize",t))}};if(typeof document<"u"){/*!
|
|
348
|
+
* Wait for document loaded before starting the execution
|
|
349
|
+
*/window.addEventListener("load",bF,!1)}const mve=function(e){wi.parseError=e},K2=[];let Wy=!1;const yF=async()=>{if(!Wy){for(Wy=!0;K2.length>0;){const e=K2.shift();if(e)try{await e()}catch(t){Ze.error("Error executing queue",t)}}Wy=!1}},gve=async(e,t)=>new Promise((n,r)=>{const i=()=>new Promise((a,s)=>{fd.parse(e,t).then(o=>{a(o),n(o)},o=>{var c;Ze.error("Error parsing",o),(c=wi.parseError)==null||c.call(wi,o),s(o),r(o)})});K2.push(i),yF().catch(r)}),vF=(e,t,n)=>new Promise((r,i)=>{const a=()=>new Promise((s,o)=>{fd.render(e,t,n).then(c=>{s(c),r(c)},c=>{var d;Ze.error("Error parsing",c),(d=wi.parseError)==null||d.call(wi,c),o(c),i(c)})});K2.push(a),yF().catch(i)}),wi={startOnLoad:!0,mermaidAPI:fd,parse:gve,render:vF,init:fve,run:gF,registerExternalDiagrams:pve,initialize:UF,parseError:void 0,contentLoaded:bF,setParseErrorHandler:mve,detectType:m6},Ih=e=>{e=bve(e);const t=e.replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),n=document.createElement("textarea");return n.innerHTML=t,n.value},Fu=e=>{const t=e.getAttribute("transform"),n=t==null?void 0:t.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/);let r=0,i=0;return n&&(r=Number(n[1]),i=Number(n[2])),{transformX:r,transformY:i}},Uve=e=>{let t=e;return t=t.replace(/style.*:\S*#.*;/g,n=>n.substring(0,n.length-1)),t=t.replace(/classDef.*:\S*#.*;/g,n=>n.substring(0,n.length-1)),t=t.replace(/#\w+;/g,n=>{const r=n.substring(1,n.length-1);return/^\+?\d+$/.test(r)?`fl°°${r}¶ß`:`fl°${r}¶ß`}),t},bve=function(e){return e.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},xF=(e,t={x:0,y:0})=>{if(e.tagName.toLowerCase()!=="path")throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${e.tagName}`);const n=e.getAttribute("d");if(!n)throw new Error('Path element does not contain a "d" attribute');const r=n.split(/(?=[LM])/),i=r[0].substring(1).split(",").map(o=>parseFloat(o)),a=r[r.length-1].substring(1).split(",").map(o=>parseFloat(o)),s=r.map(o=>{const c=o.substring(1).split(",").map(d=>parseFloat(d));return{x:c[0],y:c[1]}}).filter((o,c,d)=>{if(c===0||c===d.length-1)return!0;if(o.x===d[c-1].x&&o.y===d[c-1].y)return!1;if(c===d.length-2&&(d[c-1].x===o.x||d[c-1].y===o.y)){const l=d[d.length-1];return Math.hypot(l.x-o.x,l.y-o.y)>20}return o.x!==d[c-1].x||o.y!==d[c-1].y}).map(o=>({x:o.x+t.x,y:o.y+t.y}));return{startX:i[0]+t.x,startY:i[1]+t.y,endX:a[0]+t.x,endY:a[1]+t.y,reflectionPoints:s}},yve=(e,t)=>{const n=e.nodes.map(o=>o.startsWith("flowchart-")?o.split("-")[1]:o),r=t.querySelector(`[id='${e.id}']`);if(!r)throw new Error("SubGraph element not found");const i=Lx(r,t),a=r.getBBox(),s={width:a.width,height:a.height};return e.classes=void 0,e.dir=void 0,{...e,nodeIds:n,...i,...s,text:Ih(e.title)}},vve=(e,t,n)=>{var f,g,U,y,v;const r=t.querySelector(`[id*="flowchart-${e.id}-"]`);if(!r)return;let i;((f=r.parentElement)==null?void 0:f.tagName.toLowerCase())==="a"&&(i=r.parentElement.getAttribute("xlink:href"));const a=Lx(i?r.parentElement:r,t),s=r.getBBox(),o={width:s.width,height:s.height},c=(g=r.querySelector(".label-container"))==null?void 0:g.getAttribute("style"),d=(U=r.querySelector(".label"))==null?void 0:U.getAttribute("style"),l={};c==null||c.split(";").forEach(x=>{if(!x)return;const w=x.split(":")[0].trim(),C=x.split(":")[1].trim();l[w]=C});const h={};if(d==null||d.split(";").forEach(x=>{if(!x)return;const w=x.split(":")[0].trim(),C=x.split(":")[1].trim();h[w]=C}),e.classes){const x=n[e.classes];x&&((y=x.styles)==null||y.forEach(w=>{const[C,S]=w.split(":");l[C.trim()]=S.trim()}),(v=x.textStyles)==null||v.forEach(w=>{const[C,S]=w.split(":");h[C.trim()]=S.trim()}))}return{id:e.id,labelType:e.labelType,text:Ih(e.text),type:e.type,link:i||void 0,...a,...o,containerStyle:l,labelStyle:h}},xve=(e,t,n)=>{const r=n.querySelector(`[id*="L-${e.start}-${e.end}-${t}"]`);if(!r)throw new Error("Edge element not found");const i=Lx(r,n),a=xF(r,i);return e.length=void 0,{...e,...a,text:Ih(e.text)}},Lx=(e,t)=>{var c;if(!e)throw new Error("Element not found");let n=(c=e.parentElement)==null?void 0:c.parentElement;const r=e.childNodes[0];let i={x:0,y:0};if(r){const{transformX:d,transformY:l}=Fu(r),h=r.getBBox();i={x:Number(r.getAttribute("x"))||d+h.x||0,y:Number(r.getAttribute("y"))||l+h.y||0}}const{transformX:a,transformY:s}=Fu(e),o={x:a+i.x,y:s+i.y};for(;n&&n.id!==t.id;){if(n.classList.value==="root"&&n.hasAttribute("transform")){const{transformX:d,transformY:l}=Fu(n);o.x+=d,o.y+=l}n=n.parentElement}return o},wve=(e,t)=>{e.parse();const n=e.parser.yy,r=n.getVertices(),i=n.getClasses();Object.keys(r).forEach(c=>{r[c]=vve(r[c],t,i)});const a=new Map,s=n.getEdges().filter(c=>t.querySelector(`[id*="L-${c.start}-${c.end}"]`)).map(c=>{const d=`${c.start}-${c.end}`,l=a.get(d)||0;return a.set(d,l+1),xve(c,l,t)});return{type:"flowchart",subGraphs:n.getSubGraphs().map(c=>yve(c,t)),vertices:r,edges:s}},Eve=(e,t)=>{const n={};t!=null&&t.label&&(n.label={text:Ih(t.label),fontSize:16});const r=e.tagName;if(r==="line")n.startX=Number(e.getAttribute("x1")),n.startY=Number(e.getAttribute("y1")),n.endX=Number(e.getAttribute("x2")),n.endY=Number(e.getAttribute("y2"));else if(r==="path"){const i=e.getAttribute("d");if(!i)throw new Error('Path element does not contain a "d" attribute');const a=i.split(/(?=[LC])/),s=a[0].substring(1).split(",").map(d=>parseFloat(d)),o=[];a.forEach(d=>{const l=d.substring(1).trim().split(" ").map(h=>{const[f,g]=h.split(",");return[parseFloat(f)-s[0],parseFloat(g)-s[1]]});o.push(...l)});const c=o[o.length-1];n.startX=s[0],n.startY=s[1],n.endX=c[0],n.endY=c[1],n.points=o}return t!=null&&t.label&&(n.startY=n.startY-10,n.endY=n.endY-10),n.strokeColor=e.getAttribute("stroke"),n.strokeWidth=Number(e.getAttribute("stroke-width")),n.type="arrow",n.strokeStyle=(t==null?void 0:t.strokeStyle)||"solid",n.startArrowhead=(t==null?void 0:t.startArrowhead)||null,n.endArrowhead=(t==null?void 0:t.endArrowhead)||null,n},wF=(e,t,n,r,i)=>{const a={};return a.type="arrow",a.startX=e,a.startY=t,a.endX=n,a.endY=r,Object.assign(a,{...i}),a},P8=(e,t,n,r)=>({type:"text",x:e,y:t,text:n,width:(r==null?void 0:r.width)||20,height:(r==null?void 0:r.height)||20,fontSize:(r==null?void 0:r.fontSize)||QU,id:r==null?void 0:r.id,groupId:r==null?void 0:r.groupId,metadata:r==null?void 0:r.metadata}),EF=(e,t,n)=>{const r={},i=Number(e.getAttribute("x")),a=Number(e.getAttribute("y"));r.type="text",r.text=Ih(t),n!=null&&n.id&&(r.id=n.id),n!=null&&n.groupId&&(r.groupId=n.groupId);const s=e.getBBox();r.width=s.width,r.height=s.height,r.x=i-s.width/2,r.y=a;const o=parseInt(getComputedStyle(e).fontSize);return r.fontSize=o,r},_s=(e,t,n={})=>{const r={};r.type=t;const{label:i,subtype:a,id:s,groupId:o}=n;r.id=s,o&&(r.groupId=o),i&&(r.label={text:Ih(i.text),fontSize:16,verticalAlign:i==null?void 0:i.verticalAlign});const c=e.getBBox();switch(r.x=c.x,r.y=c.y,r.width=c.width,r.height=c.height,r.subtype=a,a){case"highlight":const d=e.getAttribute("fill");d&&(r.bgColor=d);break;case"note":r.strokeStyle="dashed";break}return r},w1=(e,t,n,r,i,a)=>{const s={};return s.startX=t,s.startY=n,s.endX=r,a!=null&&a.groupId&&(s.groupId=a.groupId),a!=null&&a.id&&(s.id=a.id),s.endY=i,s.strokeColor=e.getAttribute("stroke"),s.strokeWidth=Number(e.getAttribute("stroke-width")),s.type="line",s},AT={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},es={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,SOLID_POINT:24,DOTTED_POINT:25,CRITICAL_START:27},Cve=e=>{let t;switch(e){case es.SOLID:case es.SOLID_CROSS:case es.SOLID_OPEN:case es.SOLID_POINT:t="solid";break;case es.DOTTED:case es.DOTTED_CROSS:case es.DOTTED_OPEN:case es.DOTTED_POINT:t="dotted";break;default:t="solid";break}return t},Sve=(e,t)=>{var r,i;if(!!((r=e.nextElementSibling)!=null&&r.classList.contains("sequenceNumber"))){const a=(i=e.nextElementSibling)==null?void 0:i.textContent;if(!a)throw new Error("sequence number not present");const s=30,o=s/2,d={type:"rectangle",x:t.startX-10,y:t.startY-o,label:{text:a,fontSize:14},bgColor:"#e9ecef",height:s,subtype:"sequence"};Object.assign(t,{sequenceNumber:d})}},LT=(e,t,n)=>{if(!e)throw"root node not found";const r=ho(),i=Array.from(e.children),a=[];return i.forEach((s,o)=>{const c=`${n==null?void 0:n.id}-${o}`;let d;switch(s.tagName){case"line":const l=Number(s.getAttribute("x1")),h=Number(s.getAttribute("y1")),f=Number(s.getAttribute("x2")),g=Number(s.getAttribute("y2"));d=w1(s,l,h,f,g,{groupId:r,id:c});break;case"text":d=EF(s,t,{groupId:r,id:c});break;case"circle":d=_s(s,"ellipse",{label:s.textContent?{text:s.textContent}:void 0,groupId:r,id:c});default:d=_s(s,t1e[s.tagName],{label:s.textContent?{text:s.textContent}:void 0,groupId:r,id:c})}a.push(d)}),a},_ve=(e,t)=>{const n=Array.from(t.querySelectorAll(".actor-top")),r=Array.from(t.querySelectorAll(".actor-bottom")),i=[],a=[];return Object.values(e).forEach((s,o)=>{var h;const c=n.find(f=>f.getAttribute("name")===s.name),d=r.find(f=>f.getAttribute("name")===s.name);if(!c||!d)throw"root not found";const l=s.description;if(s.type==="participant"){const f=_s(c,"rectangle",{id:`${s.name}-top`,label:{text:l},subtype:"actor"});if(!f)throw"Top Node element not found!";i.push([f]);const g=_s(d,"rectangle",{id:`${s.name}-bottom`,label:{text:l},subtype:"actor"});i.push([g]);const U=(h=c==null?void 0:c.parentElement)==null?void 0:h.previousElementSibling;if((U==null?void 0:U.tagName)!=="line")throw"Line not found";const y=Number(U.getAttribute("x1"));if(!f.height)throw"Top node element height is null";const v=f.y+f.height,x=g.y,w=Number(U.getAttribute("x2")),C=w1(U,y,v,w,x);a.push(C)}else if(s.type==="actor"){const f=LT(c,l,{id:`${s.name}-top`});i.push(f);const g=LT(d,l,{id:`${s.name}-bottom`});i.push(g);const U=c.previousElementSibling;if((U==null?void 0:U.tagName)!=="line")throw"Line not found";const y=Number(U.getAttribute("x1")),v=Number(U.getAttribute("y1")),x=Number(U.getAttribute("x2")),w=g.find(C=>C.type==="ellipse");if(w){const C=w.y,S=w1(U,y,v,x,C);a.push(S)}}}),{nodes:i,lines:a}},kve=(e,t)=>{const n=[],r=Array.from(t.querySelectorAll('[class*="messageLine"]')),i=Object.keys(AT),a=e.filter(s=>i.includes(s.type.toString()));return r.forEach((s,o)=>{const c=a[o],d=AT[c.type],l=Eve(s,{label:c==null?void 0:c.message,strokeStyle:Cve(c.type),endArrowhead:d==="SOLID_OPEN"||d==="DOTTED_OPEN"?null:"arrow"});Sve(s,l),n.push(l)}),n},Tve=(e,t)=>{const n=Array.from(t.querySelectorAll(".note")).map(a=>a.parentElement),r=e.filter(a=>a.type===es.NOTE),i=[];return n.forEach((a,s)=>{if(!a)return;const o=a.firstChild,c=r[s].message,d=_s(o,"rectangle",{label:{text:c},subtype:"note"});i.push(d)}),i},Mve=e=>{const t=Array.from(e.querySelectorAll("[class*=activation]")),n=[];return t.forEach(r=>{const i=_s(r,"rectangle",{label:{text:""},subtype:"activation"});n.push(i)}),n},Ive=(e,t)=>{const n=Array.from(t.querySelectorAll(".loopLine")),r=[],i=[],a=[];n.forEach(l=>{const h=Number(l.getAttribute("x1")),f=Number(l.getAttribute("y1")),g=Number(l.getAttribute("x2")),U=Number(l.getAttribute("y2")),y=w1(l,h,f,g,U);y.strokeStyle="dotted",y.strokeColor="#adb5bd",y.strokeWidth=2,r.push(y)});const s=Array.from(t.querySelectorAll(".loopText")),o=e.filter(l=>l.type===es.CRITICAL_START).map(l=>l.message);s.forEach(l=>{var y;const h=l.textContent||"",f=EF(l,h),g=((y=h.match(/\[(.*?)\]/))==null?void 0:y[1])||"";o.includes(g)&&(f.x+=16),i.push(f)});const c=Array.from(t==null?void 0:t.querySelectorAll(".labelBox")),d=Array.from(t==null?void 0:t.querySelectorAll(".labelText"));return c.forEach((l,h)=>{var U;const f=((U=d[h])==null?void 0:U.textContent)||"",g=_s(l,"rectangle",{label:{text:f}});g.strokeColor="#adb5bd",g.bgColor="#e9ecef",g.width=void 0,a.push(g)}),{lines:r,texts:i,nodes:a}},Ave=e=>{const t=Array.from(e.querySelectorAll(".rect")).filter(r=>{var i;return((i=r.parentElement)==null?void 0:i.tagName)!=="g"}),n=[];return t.forEach(r=>{const i=_s(r,"rectangle",{label:{text:""},subtype:"highlight"});n.push(i)}),n},Lve=(e,t)=>{e.parse();const n=e.parser.yy,r=[],i=n.getBoxes(),a=Ave(t),s=n.getActors(),{nodes:o,lines:c}=_ve(s,t),d=n.getMessages(),l=kve(d,t),h=Tve(d,t),f=Mve(t),g=Ive(d,t);return r.push(a),r.push(...o),r.push(h),r.push(f),{type:"sequence",lines:c,arrows:l,nodes:r,loops:g,groups:i}},Xm={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},RT={LINE:0,DOTTED_LINE:1},dl=16,Rve=e=>{let t;switch(e){case RT.LINE:t="solid";break;case RT.DOTTED_LINE:t="dotted";break;default:t="solid"}return t},DT=e=>{let t;switch(e){case Xm.AGGREGATION:t="diamond_outline";break;case Xm.COMPOSITION:t="diamond";break;case Xm.EXTENSION:t="triangle_outline";break;case"none":t=null;break;case Xm.DEPENDENCY:default:t="arrow";break}return t},Dve=(e,t)=>{const n=[],r=[],i=[];return Object.values(e).forEach(a=>{var y;const{domId:s,id:o}=a,c=ho(),d=t.querySelector(`[data-id=${o}]`);if(!d)throw Error(`DOM Node with id ${s} not found`);const{transformX:l,transformY:h}=Fu(d),f=_s(d.firstChild,"rectangle",{id:o,groupId:c});f.x+=l,f.y+=h,f.metadata={classId:o},n.push(f),Array.from(d.querySelectorAll(".divider")).forEach(v=>{const x=Number(v.getAttribute("x1")),w=Number(v.getAttribute("y1")),C=Number(v.getAttribute("x2")),S=Number(v.getAttribute("y2")),T=w1(v,x,w,C,S,{groupId:c,id:ho()});T.startX+=l,T.startY+=h,T.endX+=l,T.endY+=h,T.metadata={classId:o},r.push(T)});const U=(y=d.querySelector(".label"))==null?void 0:y.children;if(!U)throw"label nodes not found";Array.from(U).forEach(v=>{const x=v.textContent;if(!x)return;const w=ho(),{transformX:C,transformY:S}=Fu(v),T=v.getBBox(),_=P8(l+C,h+S+10,x,{width:T.width,height:T.height,id:w,groupId:c,metadata:{classId:o}});i.push(_)})}),{nodes:n,lines:r,text:i}},jve=(e,t)=>{const n=["triangle_outline","diamond","diamond_outline"],r=t.startArrowhead&&n.includes(t.startArrowhead),i=t.endArrowhead&&n.includes(t.endArrowhead);return!i&&!r||(r&&(e==="LR"?t.startX-=dl:e==="RL"?t.startX+=dl:e==="TB"?t.startY-=dl:e==="BT"&&(t.startY+=dl)),i&&(e==="LR"?t.endX+=dl:e==="RL"?t.endX-=dl:e==="TB"?t.endY+=dl:e==="BT"&&(t.endY-=dl))),t},Pve=(e,t,n,r)=>{var o;const i=(o=n.querySelector(".edgePaths"))==null?void 0:o.children;if(!i)throw new Error("No Edges found!");const a=[],s=[];return e.forEach((c,d)=>{const{id1:l,id2:h,relation:f}=c,g=t.find(F=>F.id===l),U=t.find(F=>F.id===h),y=Rve(f.lineType),v=DT(f.type1),x=DT(f.type2),w=xF(i[d]),C=wF(w.startX,w.startY,w.endX,w.endY,{strokeStyle:y,startArrowhead:v,endArrowhead:x,label:c.title?{text:c.title}:void 0,start:{type:"rectangle",id:g.id},end:{type:"rectangle",id:U.id}}),S=jve(r,C);a.push(S);const{relationTitle1:T,relationTitle2:M}=c,_=20,R=15,P=15;let j,N;if(T&&T!=="none"){switch(r){case"TB":j=S.startX-_,S.endX<S.startX&&(j-=P),N=S.startY+R;break;case"BT":j=S.startX+_,S.endX>S.startX&&(j+=P),N=S.startY-R;break;case"LR":j=S.startX+_,N=S.startY+R,S.endY>S.startY&&(N+=P);break;case"RL":j=S.startX-_,N=S.startY-R,S.startY>S.endY&&(N-=P);break;default:j=S.startX-_,N=S.startY+R}const F=P8(j,N,T,{fontSize:16});s.push(F)}if(M&&M!=="none"){switch(r){case"TB":j=S.endX+_,S.endX<S.startX&&(j+=P),N=S.endY-R;break;case"BT":j=S.endX-_,S.endX>S.startX&&(j-=P),N=S.endY+R;break;case"LR":j=S.endX-_,N=S.endY-R,S.endY>S.startY&&(N-=P);break;case"RL":j=S.endX+_,N=S.endY+R,S.startY>S.endY&&(N+=P);break;default:j=S.endX+_,N=S.endY-R}const F=P8(j,N,M,{fontSize:16});s.push(F)}}),{arrows:a,text:s}},Nve=(e,t,n)=>{const r=[],i=[];return e.forEach(a=>{const{id:s,text:o,class:c}=a,d=t.querySelector(`#${s}`);if(!d)throw new Error(`Node with id ${s} not found!`);const{transformX:l,transformY:h}=Fu(d),f=d.firstChild,g=_s(f,"rectangle",{id:s,subtype:"note",label:{text:o}});if(Object.assign(g,{x:g.x+l,y:g.y+h}),r.push(g),c){const U=n.find(S=>S.id===c);if(!U)throw new Error(`class node with id ${c} not found!`);const y=g.x+(g.width||0)/2,v=g.y+(g.height||0),x=y,w=U.y,C=wF(y,v,x,w,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:g.id,type:"rectangle"},end:{id:U.id,type:"rectangle"}});i.push(C)}}),{notes:r,connectors:i}},Ove=(e,t)=>{e.parse();const n=e.parser.yy,r=n.getDirection(),i=[],a=[],s=[],o=[],c=n.getNamespaces(),d=n.getClasses();if(Object.keys(d).length){const y=Dve(d,t);i.push(y.nodes),a.push(...y.lines),s.push(...y.text),o.push(...y.nodes)}const l=n.getRelations(),{arrows:h,text:f}=Pve(l,o,t,r),{notes:g,connectors:U}=Nve(n.getNotes(),t,o);return i.push(g),h.push(...U),s.push(...f),{type:"class",nodes:i,lines:a,arrows:h,text:s,namespaces:c}},Fve=e=>{const t=e.querySelector("svg");if(!t)throw new Error("SVG element not found");const n=t.getBoundingClientRect(),r=n.width,i=n.height;t.setAttribute("width",`${r}`),t.setAttribute("height",`${i}`);const a="image/svg+xml",s=unescape(encodeURIComponent(t.outerHTML)),c=`data:image/svg+xml;base64,${btoa(s)}`;return{type:"graphImage",mimeType:a,dataURL:c,width:r,height:i}},Bve=async(e,t=fk)=>{wi.initialize({...fk,...t});const n=await wi.mermaidAPI.getDiagramFromText(Uve(e)),{svg:r}=await wi.render("mermaid-to-excalidraw",e),i=document.createElement("div");i.setAttribute("style","opacity: 0; position: relative; z-index: -1;"),i.innerHTML=r,i.id="mermaid-diagram",document.body.appendChild(i);let a;switch(n.type){case"flowchart-v2":{a=wve(n,i);break}case"sequence":{a=Lve(n,i);break}case"classDiagram":{a=Ove(n,i);break}default:a=Fve(i)}return i.remove(),a},$ve=async(e,t)=>{var s;const n=t||{},r=parseInt(((s=n.themeVariables)==null?void 0:s.fontSize)??"")||QU,i=await Bve(e,{...n,themeVariables:{...n.themeVariables,fontSize:`${r*1.25}px`}});return p1e(i,{fontSize:r})},zve=async(e,t)=>{try{const n=await $ve(e,t);return{elements:n.elements,files:n.files}}catch(n){return console.error("Error converting Mermaid to Excalidraw:",n),{elements:[],error:n instanceof Error?n.message:String(n)}}},Hve={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:"20px"},maxEdges:500,maxTextSize:5e4},po={};function Wve(){const e=po==null?void 0:po.VITE_REPO_SLUG;if(e!=null&&e.includes("/")){const[r,i]=e.split("/");return{owner:r,repo:i,branch:"gh-pages"}}const t=window.location.hostname,n=window.location.pathname.split("/").filter(Boolean);return t.endsWith(".github.io")&&n.length>0?{owner:t.slice(0,-10),repo:n[0],branch:"gh-pages"}:null}const Q2="excalidrop_gh_token";function Xve(){if(window.location.hash.startsWith("#token=")){const e=decodeURIComponent(window.location.hash.slice(7));if(e)return localStorage.setItem(Q2,e),history.replaceState(null,"",window.location.pathname+window.location.search),e}return localStorage.getItem(Q2)}function Vve(e){e?localStorage.setItem(Q2,e):localStorage.removeItem(Q2)}async function Ac(e,t,n){const r=await fetch(`https://api.github.com${e}`,{...n,headers:{Authorization:`Bearer ${t}`,Accept:"application/vnd.github+json","Content-Type":"application/json",...(n==null?void 0:n.headers)||{}}});if(!r.ok)throw new Error(`GitHub ${r.status}: ${(await r.text()).slice(0,200)}`);return r.json()}async function Yve(e,t,n){const r="canvas.excalidraw";let i;try{i=(await Ac(`/repos/${e.owner}/${e.repo}/contents/${r}?ref=${e.branch}`,t)).sha}catch{}const a={message:`excalidrop: autosync ${n.elements.length} elements`,content:btoa(unescape(encodeURIComponent(JSON.stringify({type:"excalidraw",version:2,source:"excalidrop",elements:n.elements},null,2)))),branch:e.branch};return i&&(a.sha=i),(await Ac(`/repos/${e.owner}/${e.repo}/contents/${r}`,t,{method:"PUT",body:JSON.stringify(a)})).content.sha}async function Gve(){const e=await fetch("./canvas.excalidraw",{cache:"no-cache"});if(!e.ok)throw new Error(`scene fetch ${e.status}`);const t=await e.json();return{elements:t.elements||[],files:t.files||{}}}async function qve(e){const t=await fetch("https://github.com/login/device/code",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({client_id:e})});if(!t.ok)throw new Error("device flow start failed");const n=await t.json();return{user_code:n.user_code,verification_uri:n.verification_uri}}async function Zve(e,t){const r=(await Ac("/user",t)).login||"",i=`${e.owner}/${e.repo}`.toLowerCase(),a=await Ac("/user/installations?per_page=100",t).catch(()=>null);if(a!=null&&a.installations){if(a.installations.length===0)return{access:"denied",login:r,detail:"app-not-installed"};for(const o of a.installations||[]){const c=await Ac(`/user/installations/${o.id}/repositories?per_page=100`,t).catch(()=>null);if(((c==null?void 0:c.repositories)||[]).find(l=>l.full_name.toLowerCase()===i)){const l=await Ac(`/repos/${e.owner}/${e.repo}/collaborators/${r}/permission`,t).catch(()=>null),h=(l==null?void 0:l.permission)||"";return h==="read"||h==="triage"?{access:"viewer",login:r,detail:null}:{access:"editor",login:r,detail:null}}}return{access:"denied",login:r,detail:"repo-not-covered"}}const s=await Ac(`/repos/${e.owner}/${e.repo}`,t).catch(()=>null);return s!=null&&s.permissions?s.permissions.push||s.permissions.admin||s.permissions.maintain?{access:"editor",login:r,detail:null}:{access:"viewer",login:r,detail:null}:{access:"denied",login:r,detail:"no-token-permissions"}}const CF=(po==null?void 0:po.VITE_GITHUB_CLIENT_ID)||"Iv23liuS2fx3QOEIoDmx",SF=(po==null?void 0:po.VITE_GITHUB_APP_SLUG)||"excalidrop",N8=`https://github.com/apps/${SF}/installations/new`,Kve=!CF.includes("EXCALIDROP_APP"),du=Object.freeze(Object.defineProperty({__proto__:null,APP_INSTALL_URL:N8,APP_SLUG:SF,CLIENT_ID:CF,HAS_CLIENT_ID:Kve,checkAccess:Zve,detectRepo:Wve,getToken:Xve,loadStaticScene:Gve,pushScene:Yve,setToken:Vve,startDeviceFlow:qve},Symbol.toStringTag,{value:"Module"}));function Qve(){try{const e=document,t=navigator,n=e.modelContext??t.modelContext;if(n&&typeof n.registerTool=="function")return n}catch{}return null}function Jve(){try{if(typeof crypto<"u"&&"randomUUID"in crypto)return crypto.randomUUID().slice(0,12)}catch{}return`el_${Math.random().toString(36).slice(2,10)}`}function exe(e){var r;const t={id:e.id,type:e.type,x:Math.round(Number(e.x??0)),y:Math.round(Number(e.y??0))};e.width!==void 0&&(t.width=e.width),e.height!==void 0&&(t.height=e.height);const n=typeof e.text=="string"&&e.text||((r=e.label)==null?void 0:r.text);return n&&(t.text=String(n).slice(0,120)),e.locked&&(t.locked=!0),t}const txe={type:"object",properties:{id:{type:"string",description:"Custom element ID (auto-generated if omitted)"},type:{type:"string",description:"Excalidraw element type: rectangle, ellipse, diamond, text, arrow, line, freedraw, image"},x:{type:"number"},y:{type:"number"},width:{type:"number"},height:{type:"number"},text:{type:"string",description:"Label text for shapes / content for text elements"},backgroundColor:{type:"string"},strokeColor:{type:"string"},strokeWidth:{type:"number"},fontSize:{type:"number"},startElementId:{type:"string",description:"For arrows: bind start to this element ID"},endElementId:{type:"string",description:"For arrows: bind end to this element ID"}},required:["type","x","y"],additionalProperties:!0};function nxe(e){const t=()=>{},n=Qve();if(!n)return{available:!1,count:0,cleanup:t};const r=new AbortController,i=r.signal;let a=0;const s=()=>{const c=e();if(!c)throw new Error("Canvas not ready yet");return c},o=c=>{try{const d=n.registerTool(c,{signal:i});d&&typeof d.catch=="function"&&d.catch(()=>{}),a+=1}catch{}};return o({name:"describe_scene",title:"Describe canvas scene",description:"Read-only summary of the live Excalidraw canvas: element counts by type plus id/type/position/label per element (capped at 200). Call before editing.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0},execute:()=>{const d=s().getSceneElements().filter(h=>!h.isDeleted),l={};for(const h of d){const f=String(h.type??"unknown");l[f]=(l[f]??0)+1}return{count:d.length,byType:l,elements:d.slice(0,200).map(exe)}}}),o({name:"create_elements",title:"Create canvas elements",description:"Add new elements to the live canvas in one batch. Assign custom ids to shapes so arrows can reference them via startElementId/endElementId.",inputSchema:{type:"object",properties:{elements:{type:"array",items:txe,minItems:1}},required:["elements"],additionalProperties:!1},annotations:{destructiveHint:!1},execute:c=>{const d=s(),l=Array.isArray(c==null?void 0:c.elements)?c.elements:[];if(l.length===0)throw new Error("elements must be a non-empty array");if(l.length>200)throw new Error("max 200 elements per call");const h=l.map(g=>{if(!g||typeof g!="object")throw new Error("each element must be an object");if(typeof g.type!="string")throw new Error("each element needs a type");if(typeof g.x!="number"||typeof g.y!="number")throw new Error("each element needs numeric x and y");const{startElementId:U,endElementId:y,...v}=g,x={id:Jve(),...v};return typeof U=="string"&&(x.start={id:U}),typeof y=="string"&&(x.end={id:y}),(x.type==="arrow"||x.type==="line")&&!Array.isArray(x.points)&&(x.points=[[0,0],[100,0]]),x}),f=d.getSceneElements();return d.updateScene({elements:[...f,...h]}),{ok:!0,count:h.length,ids:h.map(g=>g.id)}}}),o({name:"update_element",title:"Update canvas element",description:"Patch position, size, colors, or text of one element by id on the live canvas.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Element ID from describe_scene"},patch:{type:"object",description:"Fields to merge (x, y, width, height, backgroundColor, strokeColor, text, ...)"}},required:["id","patch"],additionalProperties:!1},annotations:{destructiveHint:!1},execute:c=>{const d=s();if(!(c!=null&&c.id))throw new Error("id is required");if(!(c!=null&&c.patch)||typeof c.patch!="object")throw new Error("patch must be an object");const l=d.getSceneElements(),h=l.findIndex(g=>g.id===c.id);if(h===-1)throw new Error(`Element ${c.id} not found`);const f=l.slice();return f[h]={...l[h],...c.patch,id:c.id},d.updateScene({elements:f}),{ok:!0,id:c.id}}}),o({name:"delete_element",title:"Delete canvas element",description:"Remove one element by id from the live canvas.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},annotations:{destructiveHint:!0},execute:c=>{const d=s();if(!(c!=null&&c.id))throw new Error("id is required");const l=d.getSceneElements();if(!l.some(h=>h.id===c.id))throw new Error(`Element ${c.id} not found`);return d.updateScene({elements:l.filter(h=>h.id!==c.id)}),{ok:!0,deleted:c.id}}}),o({name:"clear_canvas",title:"Clear canvas",description:"Remove ALL elements from the live canvas. Ask the user to confirm first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{destructiveHint:!0,consequentialHint:!0},execute:()=>{const c=s(),d=c.getSceneElements().length;return c.resetScene(),{ok:!0,cleared:d}}}),{available:!0,count:a,cleanup:()=>{try{r.abort()}catch{}}}}const Xy=()=>{const e=localStorage.getItem("excalidrop_token");return e?{Authorization:`Bearer ${e}`}:{}},rxe=1200,uu=e=>{const{createdAt:t,updatedAt:n,version:r,syncedAt:i,source:a,syncTimestamp:s,...o}=e;return o},ixe=e=>{const t=new Map(e.map(n=>[n.id,n]));return e.map(n=>{const r={...n};return r.boundElements&&(Array.isArray(r.boundElements)?(r.boundElements=r.boundElements.filter(i=>!(!i||typeof i!="object"||!i.id||!i.type||!t.get(i.id)||!["text","arrow"].includes(i.type))),r.boundElements.length===0&&(r.boundElements=null)):r.boundElements=null),r.containerId&&(t.get(r.containerId)||(r.containerId=null)),r})},jT=e=>e.type==="image",axe=e=>e==="rectangle"||e==="ellipse"||e==="diamond",sxe=e=>{const t=new Map(e.map(n=>[n.id,n]));return e.map(n=>{if(n.type!=="text"||!n.containerId)return n;const r=n,i=t.get(r.containerId);return!i||!axe(i.type)||r.autoResize===!1||typeof i.x!="number"||typeof i.y!="number"||typeof i.width!="number"||typeof i.height!="number"||typeof r.width!="number"||typeof r.height!="number"?n:{...n,x:i.x+(i.width-r.width)/2,y:i.y+(i.height-r.height)/2}})},oxe=e=>{const t=e;return{...t,angle:t.angle||0,strokeColor:t.strokeColor||"transparent",backgroundColor:t.backgroundColor||"transparent",fillStyle:t.fillStyle||"solid",strokeWidth:t.strokeWidth||1,strokeStyle:t.strokeStyle||"solid",roughness:t.roughness??0,opacity:t.opacity??100,groupIds:t.groupIds||[],roundness:null,seed:t.seed||Math.floor(Math.random()*1e6),version:t.version||1,versionNonce:t.versionNonce||Math.floor(Math.random()*1e6),isDeleted:t.isDeleted??!1,boundElements:t.boundElements||null,link:t.link||null,locked:t.locked||!1,status:t.status||"saved",fileId:t.fileId,scale:t.scale||[1,1]}},lxe=(e,t)=>{const n=new Map;for(const r of t)r.id&&n.set(r.id,r);return e.map(r=>{const i=n.get(r.id);if(!i)return r;const a={...r};return i.startBinding&&!r.startBinding&&(a.startBinding=i.startBinding),i.endBinding&&!r.endBinding&&(a.endBinding=i.endBinding),i.boundElements&&(!r.boundElements||r.boundElements.length===0)&&(a.boundElements=i.boundElements),i.elbowed!==void 0&&r.elbowed===void 0&&(a.elbowed=i.elbowed),a})},Vm=e=>{if(e.length===0)return[];const t=ixe(e),n=t.filter(jT).map(oxe),r=t.filter(s=>!jT(s)),i=f1(r,{regenerateIds:!1}),a=lxe(i,r);return sxe([...a,...n])};function cxe(){const[e,t]=I.useState(null),n=I.useRef(null);I.useEffect(()=>{n.current=e},[e]),I.useEffect(()=>{if(!e)return;const de=nxe(()=>n.current);return()=>de.cleanup()},[e]);const[r,i]=I.useState(!1),a=I.useRef(null),[s,o]=I.useState("idle"),[c,d]=I.useState(null),l=I.useRef(null),h=I.useRef(!1),f=I.useRef(0),g=I.useRef(!1),U=de=>{f.current+=1,api.updateScene(de),setTimeout(()=>{f.current=Math.max(0,f.current-1)},0)};I.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const[y,v]=I.useState(!1),[x,w]=I.useState(null),[C,S]=I.useState("unknown"),[T,M]=I.useState(""),[_,R]=I.useState(null),[P,j]=I.useState(null),[N,F]=I.useState(!1),B=I.useRef(null),G=I.useRef(!1);I.useEffect(()=>(fetch("/api/health",{headers:Xy()}).then(de=>{de.ok?(v(!0),Y()):W()}).catch(()=>W()),()=>{a.current&&a.current.close()}),[]);const W=async()=>{const de=await ge(()=>Promise.resolve().then(()=>du),void 0,import.meta.url);R(de.detectRepo()),w(de.getToken())};I.useEffect(()=>{if(!(y||!_)){if(!x){S("denied"),M(""),j(null);return}S("unknown"),(async()=>{try{const de=await ge(()=>Promise.resolve().then(()=>du),void 0,import.meta.url),{access:Te,login:qe,detail:Ut}=await de.checkAccess(_,x);S(Te),M(qe),j(Ut)}catch{S("denied"),M(""),j(null)}})()}},[y,x,_]),I.useEffect(()=>{if(y)return;const de=setInterval(()=>{X(!1)},1e4),Te=()=>{X(!0)},qe=Ut=>{(N||G.current)&&Ut.preventDefault()};return document.addEventListener("visibilitychange",()=>{document.hidden&&Te()}),window.addEventListener("pagehide",Te),window.addEventListener("beforeunload",qe),()=>{clearInterval(de),document.removeEventListener("visibilitychange",()=>{}),window.removeEventListener("pagehide",Te),window.removeEventListener("beforeunload",qe)}},[y,x,_,N,e]);const X=async de=>{if(!(y||!e||!x||!_)&&C==="editor"&&!(!N&&!de||G.current)){G.current=!0,de||o("syncing");try{const Te=await ge(()=>Promise.resolve().then(()=>du),void 0,import.meta.url),qe=e.getSceneElements().filter(Pe=>!Pe.isDeleted),Ut=e.getFiles();if(de){const Pe=await fetch(`https://api.github.com/repos/${_.owner}/${_.repo}/contents/canvas.excalidraw?ref=${_.branch}`,{headers:{Authorization:`Bearer ${x}`,Accept:"application/vnd.github+json"}}).then(bt=>bt.json()).catch(()=>null);await fetch(`https://api.github.com/repos/${_.owner}/${_.repo}/contents/canvas.excalidraw`,{method:"PUT",keepalive:!0,headers:{Authorization:`Bearer ${x}`,Accept:"application/vnd.github+json","Content-Type":"application/json"},body:JSON.stringify({message:`excalidrop: force-save on close (${qe.length} elements)`,content:btoa(unescape(encodeURIComponent(JSON.stringify({type:"excalidraw",version:2,source:"excalidrop",elements:qe},null,2)))),branch:_.branch,...Pe!=null&&Pe.sha?{sha:Pe.sha}:{}})}).catch(()=>{})}else B.current=await Te.pushScene(_,x,{elements:qe,files:Ut}),d(new Date),o("success"),setTimeout(()=>o("idle"),2e3);F(!1)}catch(Te){if(console.error("GitHub push failed:",Te),String(Te.message).includes("403")&&_&&x)try{const qe=await ge(()=>Promise.resolve().then(()=>du),void 0,import.meta.url),{access:Ut,detail:Pe}=await qe.checkAccess(_,x);S(Ut),j(Pe)}catch{S("viewer")}de||o("error")}finally{G.current=!1}}};I.useEffect(()=>{e&&($(),r||Y())},[e,r]);const $=async()=>{try{const de=await fetch("/api/elements",{headers:Xy()}).catch(()=>null);if(de!=null&&de.ok){const Ut=await de.json();if(Ut.success&&Ut.elements&&Ut.elements.length>0){const bt=Ut.elements.map(uu),Tt=Vm(bt);e&&U(e,{elements:Tt,captureUpdate:se.NEVER})}const Pe=await fetch("/api/files",{headers:Xy()});if(Pe.ok){const bt=await Pe.json();bt.files&&(e==null||e.addFiles(Object.values(bt.files)))}return}const qe=await(await ge(()=>Promise.resolve().then(()=>du),void 0,import.meta.url)).loadStaticScene();if(qe.elements.length>0&&e){const Ut=Vm(qe.elements.map(uu));U(e,{elements:Ut,captureUpdate:se.NEVER})}qe.files&&(e==null||e.addFiles(Object.values(qe.files)))}catch(de){console.error("Error loading existing elements:",de)}},Y=()=>{if(a.current&&a.current.readyState===WebSocket.OPEN)return;const Te=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;a.current=new WebSocket(Te),a.current.onopen=()=>{i(!0),e&&setTimeout($,100)},a.current.onmessage=qe=>{try{const Ut=JSON.parse(qe.data);H(Ut)}catch(Ut){console.error("Error parsing WebSocket message:",Ut,qe.data)}},a.current.onclose=qe=>{i(!1),qe.code!==1e3&&setTimeout(Y,3e3)},a.current.onerror=qe=>{console.error("WebSocket error:",qe),i(!1)}},H=async de=>{const Te=n.current;if(Te)try{const qe=Te.getSceneElements(),Ut=Pe=>{if(Pe.length===0)return;const bt=new Map;Pe.forEach(Et=>{Et.id&&bt.set(Et.id,Et)});const Tt=qe.map(Et=>{const nn=bt.get(Et.id);return nn?(bt.delete(Et.id),{...Et,...nn}):Et});Tt.push(...bt.values());const zn=Vm(Tt);U(Te,{elements:zn,captureUpdate:se.NEVER})};switch(de.type){case"initial_elements":if(de.elements&&de.elements.length>0){const Pe=de.elements.map(uu),bt=Vm(Pe);U(Te,{elements:bt,captureUpdate:se.NEVER})}de.files&&Te.addFiles(Object.values(de.files));break;case"files_added":Array.isArray(de.files)&&Te.addFiles(de.files);break;case"element_created":if(de.element){const Pe=uu(de.element);Ut([Pe])}break;case"element_updated":if(de.element){const Pe=uu(de.element);Ut([Pe])}break;case"element_deleted":if(de.elementId){const Pe=qe.filter(bt=>bt.id!==de.elementId);U(Te,{elements:Pe,captureUpdate:se.NEVER})}break;case"elements_batch_created":if(de.elements){const Pe=de.elements.map(uu);Ut(Pe)}break;case"elements_synced":console.log(`Sync confirmed by server: ${de.count} elements`);break;case"sync_status":console.log(`Server sync status: ${de.count} elements`);break;case"canvas_cleared":console.log("Canvas cleared by server"),U(Te,{elements:[],captureUpdate:se.NEVER});break;case"export_image_request":if(de.requestId)try{const Pe=Te.getSceneElements(),bt=Te.getAppState(),Tt=Te.getFiles();if(de.format==="svg"){const zn=await $7({elements:Pe,appState:{...bt,exportBackground:de.background!==!1},files:Tt}),Et=new XMLSerializer().serializeToString(zn);await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:de.requestId,format:"svg",data:Et})})}else{const zn=await ore({elements:Pe,appState:{...bt,exportBackground:de.background!==!1},files:Tt,mimeType:"image/png"}),Et=new FileReader;Et.onload=async()=>{try{const nn=Et.result,Wr=nn==null?void 0:nn.split(",")[1];if(!Wr)throw new Error("Could not extract base64 data from result");await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:de.requestId,format:"png",data:Wr})})}catch(nn){console.error("Image export (FileReader) failed:",nn),await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:de.requestId,error:nn.message})}).catch(()=>{})}},Et.onerror=async()=>{var nn;console.error("FileReader error:",Et.error),await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:de.requestId,error:((nn=Et.error)==null?void 0:nn.message)||"FileReader failed"})}).catch(()=>{})},Et.readAsDataURL(zn)}}catch(Pe){console.error("Image export failed:",Pe),await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:de.requestId,error:Pe.message})})}break;case"set_viewport":if(console.log("Received viewport control request",de),de.requestId)try{if(de.scrollToContent){const Pe=Te.getSceneElements();Pe.length>0&&Te.scrollToContent(Pe,{fitToViewport:!0,animate:!0})}else if(de.scrollToElementId){const bt=Te.getSceneElements().find(Tt=>Tt.id===de.scrollToElementId);if(bt)Te.scrollToContent([bt],{fitToViewport:!1,animate:!0});else throw new Error(`Element ${de.scrollToElementId} not found`)}else{const Pe={};de.zoom!==void 0&&(Pe.zoom={value:de.zoom}),de.offsetX!==void 0&&(Pe.scrollX=de.offsetX),de.offsetY!==void 0&&(Pe.scrollY=de.offsetY),Object.keys(Pe).length>0&&U(Te,{appState:Pe})}await fetch("/api/viewport/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:de.requestId,success:!0,message:"Viewport updated"})})}catch(Pe){console.error("Viewport control failed:",Pe),await fetch("/api/viewport/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:de.requestId,error:Pe.message})}).catch(()=>{})}break;case"mermaid_convert":if(console.log("Received Mermaid conversion request from MCP"),de.mermaidDiagram)try{const Pe=await zve(de.mermaidDiagram,de.config||Hve);if(Pe.error){console.error("Mermaid conversion error:",Pe.error);return}if(Pe.elements&&Pe.elements.length>0){const bt=f1(Pe.elements,{regenerateIds:!1});U(Te,{elements:bt,captureUpdate:se.IMMEDIATELY}),Pe.files&&Te.addFiles(Object.values(Pe.files)),console.log("Mermaid diagram converted successfully:",Pe.elements.length,"elements"),await te()}}catch(Pe){console.error("Error converting Mermaid diagram from WebSocket:",Pe)}break;default:console.log("Unknown WebSocket message type:",de.type)}}catch(qe){console.error("Error processing WebSocket message:",qe,de)}},Z=de=>({...de}),V=de=>de?de.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"",te=async(de={})=>{const{silent:Te=!1}=de;if(!e){console.warn("Excalidraw API not available");return}if(!h.current){l.current&&(clearTimeout(l.current),l.current=null),h.current=!0,Te||o("syncing");try{const qe=e.getSceneElements();console.log(`Syncing ${qe.length} elements to backend`);const Ut=qe.filter(Et=>!Et.isDeleted),Pe=e.getFiles(),bt=Object.values(Pe),Tt=Ut.map(Z),zn=await fetch("/api/elements/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({elements:Tt,timestamp:new Date().toISOString()})});if(zn.ok){const Et=await zn.json();if(console.log(`Sync successful: ${Et.count} elements synced`),bt.length>0){console.log(`Syncing ${bt.length} files to backend`);const nn=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(bt)});if(nn.ok){const Wr=await nn.json();console.log(`Files sync successful: ${Wr.count} files synced`)}else console.error("Files sync failed:",await nn.text())}d(new Date),Te||(o("success"),setTimeout(()=>o("idle"),2e3))}else{const Et=await zn.json();console.error("Sync failed:",Et.error),Te||o("error")}}catch(qe){console.error("Sync error:",qe),Te||o("error")}finally{h.current=!1}}},ce=()=>{!r||!e||g.current&&(f.current>0||(l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,!(f.current>0||h.current)&&te({silent:!0})},rxe)))},[be,fe]=I.useState(!1),[Se,Ue]=I.useState(""),[ye,je]=I.useState(null),Le=async()=>{const de=await ge(()=>Promise.resolve().then(()=>du),void 0,import.meta.url);if(Se.trim()){de.setToken(Se.trim()),w(Se.trim()),Ue(""),fe(!1);return}try{const Te=await de.startDeviceFlow(de.CLIENT_ID);je({user_code:Te.user_code,verification_uri:Te.verification_uri}),window.open(Te.verification_uri,"_blank")}catch(Te){console.warn("Device flow blocked by CORS, showing agent handoff:",Te),je({user_code:"ASK-YOUR-AGENT",verification_uri:"ask the agent to run the github_login tool"})}};return m.jsxs("div",{className:"app",children:[m.jsxs("div",{className:"pill",children:[m.jsx("div",{className:`status-dot ${(y?r:C==="editor")?"status-connected":"status-disconnected"}`}),m.jsx("span",{children:y?r?"Live":"Offline":C==="unknown"?"Checking access…":C==="editor"?s==="syncing"?"Saving…":N?"Unsaved changes":c?`Saved ${V(c)}${T?` · ${T}`:""}`:`Can edit${T?` · ${T}`:""}`:C==="viewer"?`Read-only${T?` · ${T}`:""} — your changes won't save`:"No access — login with a collaborator account"}),!y&&(C==="editor"?m.jsx("button",{className:"pill-btn",onClick:()=>{X(!1)},children:"Save now"}):m.jsx("button",{className:"pill-btn",onClick:()=>fe(!0),children:"Login with GitHub"}))]}),be&&!y&&m.jsxs("div",{className:"login-modal",children:[m.jsx("h3",{children:"Login with GitHub"}),P==="repo-not-covered"&&T&&m.jsxs("p",{children:[m.jsxs("b",{children:["Almost there, ",T,":"]})," the app is installed on your account but ",m.jsx("b",{children:"this repo isn't included"}),". Open your ",m.jsx("a",{href:"https://github.com/settings/installations",target:"_blank",rel:"noreferrer",children:"app installations"}),", pick Excalidrop → Configure → add ",m.jsxs("code",{children:[_==null?void 0:_.owner,"/",_==null?void 0:_.repo]})," (or switch to All repositories), then close and reopen this login."]}),P==="app-not-installed"&&m.jsxs("p",{children:["First time on this repo? ",m.jsx("a",{href:N8,target:"_blank",rel:"noreferrer",children:"Install the Excalidrop app"})," on it — repo access is canvas access."]}),P!=="repo-not-covered"&&P!=="app-not-installed"&&m.jsxs("p",{children:["First time on this repo? ",m.jsx("a",{href:N8,target:"_blank",rel:"noreferrer",children:"Install the Excalidrop app"})," on it — repo access is canvas access."]}),m.jsxs("p",{children:[m.jsx("b",{children:"Easiest:"})," ask your agent to run ",m.jsx("code",{children:"github_login"})," for this site — it shows a code, you approve it (2FA via GitHub), and this page unlocks. No copy-paste."]}),m.jsxs("details",{children:[m.jsx("summary",{children:"Or paste a token manually"}),m.jsx("input",{placeholder:"Paste token (gh auth token)…",value:Se,onChange:de=>Ue(de.target.value)}),m.jsx("div",{className:"login-row",children:m.jsx("button",{className:"btn-primary",onClick:()=>{Le()},children:"Save token"})})]}),m.jsx("div",{className:"login-row",children:m.jsx("button",{className:"btn-secondary",onClick:()=>{fe(!1),je(null)},children:"Close"})}),ye&&ye.user_code!=="ASK-YOUR-AGENT"&&m.jsxs("div",{style:{background:"#f0f0f0",padding:"12px",borderRadius:"8px",marginTop:"8px"},children:[m.jsx("p",{style:{margin:"0 0 8px 0"},children:m.jsx("b",{children:"Device Flow Started:"})}),m.jsxs("p",{style:{margin:"0 0 8px 0"},children:["Open ",m.jsx("a",{href:ye.verification_uri,target:"_blank",rel:"noreferrer",children:ye.verification_uri})," and enter code:"]}),m.jsx("p",{style:{margin:"0",fontSize:"20px",fontWeight:"bold",fontFamily:"monospace",letterSpacing:"2px"},children:ye.user_code})]}),ye&&ye.user_code==="ASK-YOUR-AGENT"&&m.jsxs("p",{children:["Ask your agent to run ",m.jsx("code",{children:"github_login"})," for this site."]})]}),m.jsx("div",{className:"canvas-container",children:m.jsx("div",{onPointerDownCapture:()=>{g.current=!0},onKeyDownCapture:()=>{g.current=!0},style:{width:"100%",height:"100%"},children:m.jsx(eN,{viewModeEnabled:!y&&C!=="editor",excalidrawAPI:de=>t(de),onChange:()=>{y?ce():f.current||F(!0)},initialData:{elements:[],appState:{theme:"light",viewBackgroundColor:"#ffffff"}},children:m.jsxs(Jt,{children:[m.jsx(Jt.DefaultItems.LoadScene,{}),m.jsx(Jt.DefaultItems.SaveToActiveFile,{}),m.jsx(Jt.DefaultItems.Export,{}),m.jsx(Jt.DefaultItems.SaveAsImage,{}),m.jsx(Jt.Separator,{}),m.jsx(Jt.DefaultItems.ClearCanvas,{}),m.jsx(Jt.DefaultItems.ChangeCanvasBackground,{}),m.jsx(Jt.DefaultItems.ToggleTheme,{}),m.jsx(Jt.Separator,{}),m.jsx(Jt.DefaultItems.SearchMenu,{}),m.jsx(Jt.DefaultItems.CommandPalette,{})]})})})})]})}const _F=document.getElementById("root");if(!_F)throw new Error("Root element not found");w$.createRoot(_F).render(m.jsx(xe.StrictMode,{children:m.jsx(cxe,{})}));const kF=Object.freeze(Object.defineProperty({__proto__:null,decodePngMetadata:Qre,encodePngMetadata:NL,getTEXtChunk:PL},Symbol.toStringTag,{value:"Module"})),dxe=Object.freeze(Object.defineProperty({__proto__:null,alerts:HL,buttons:zL,canvasError:qL,clearCanvasDialog:nR,colorPicker:hR,colors:dR,commandPalette:bR,confirmDialog:aR,default:nv,element:VL,elementLink:FL,encrypted:oR,errorDialog:JL,errorSplash:ZL,errors:WL,exportDialog:eR,fontList:gR,headings:YL,helpDialog:tR,hints:GL,imageExportDialog:sR,labels:OL,library:BL,mermaid:pR,overwriteConfirm:fR,publishDialog:rR,publishSuccessDialog:iR,quickSearch:mR,roomDialog:QL,search:$L,shareDialog:KL,stats:lR,toast:cR,toolBar:XL,userList:UR,welcomeScreen:uR},Symbol.toStringTag,{value:"Module"})),uxe=Object.freeze(Object.defineProperty({__proto__:null,default:xR,en:yR,kaa:vR},Symbol.toStringTag,{value:"Module"}));export{Sxe as $,Nge as A,mO as B,Cs as C,Lbe as D,Ss as E,m1e as F,Oxe as G,p3e as H,wbe as I,y1e as J,U3e as K,SO as L,vx as M,nbe as N,ax as O,Cxe as P,kxe as Q,Rk as R,Si as S,Lk as T,ot as U,Mxe as V,Txe as W,_xe as X,wxe as Y,Exe as Z,Axe as _,o3e as a,Z6e as a$,Ixe as a0,Z5e as a1,pT as a2,Rxe as a3,sbe as a4,W5e as a5,Lxe as a6,Jye as a7,ybe as a8,hbe as a9,Pge as aA,jge as aB,Fge as aC,Oge as aD,J6e as aE,k8 as aF,p5e as aG,re as aH,Ae as aI,ge as aJ,g5e as aK,z2 as aL,oi as aM,dme as aN,ex as aO,mN as aP,V1 as aQ,bN as aR,xxe as aS,tx as aT,bl as aU,_k as aV,Ume as aW,g1 as aX,bd as aY,q6e as aZ,z6e as a_,Dge as aa,vbe as ab,Y1 as ac,Ye as ad,tt as ae,d3e as af,Ap as ag,ta as ah,KUe as ai,xl as aj,r1e as ak,G1 as al,Qge as am,Jge as an,Kge as ao,Zge as ap,qge as aq,Gge as ar,Yge as as,Wge as at,Vge as au,Xge as av,$ge as aw,Hge as ax,zge as ay,Bge as az,a3e as b,K6e as b0,iO as b1,s6 as b2,d6 as b3,MUe as b4,ux as b5,sO as b6,rO as b7,k6e as b8,E6e as b9,q1 as ba,kh as bb,F2 as bc,D6e as bd,v5e as be,$2 as bf,T6e as bg,KN as bh,LUe as bi,RUe as bj,Sc as bk,nT as bl,DUe as bm,hx as bn,AUe as bo,NUe as bp,Th as bq,ql as br,Kk as bs,fx as bt,JN as bu,I8 as bv,zUe as bw,hxe as bx,i3e as c,$i as d,GO as e,Sr as f,Sx as g,W2 as h,uh as i,LM as j,Ux as k,Ze as l,kbe as m,Z1 as n,c3e as o,l3e as p,Fxe as q,r3e as r,s3e as s,H6e as t,Dp as u,dx as v,Sbe as w,By as x,pN as y,k1e as z};
|