collabmd 0.1.21 → 0.1.25
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/README.md +102 -12
- package/bin/collabmd.js +3 -2
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BHWNpLuY.js +1 -0
- package/dist/client/assets/_basePickBy-CJWegqog.js +1 -0
- package/dist/client/assets/_baseUniq-CFKN1k1n.js +1 -0
- package/dist/client/assets/apl-khHl8vBy.js +1 -0
- package/dist/client/assets/ar-SA-NXDWD63E-DND5MLpM.js +8 -0
- package/dist/client/assets/arc-D1SV2GW0.js +1 -0
- package/dist/client/assets/architecture-PBZL5I3N-0dui3p7-.js +1 -0
- package/dist/client/assets/architectureDiagram-2XIMDMQ5-DXpDe6lq.js +36 -0
- package/dist/client/assets/array-BTHl6o_K.js +1 -0
- package/dist/client/assets/asciiarmor-7xnRhA8w.js +1 -0
- package/dist/client/assets/asn1-_x-T1mFB.js +1 -0
- package/dist/client/assets/asterisk-Ct2NwVUw.js +1 -0
- package/dist/client/assets/az-AZ-MXSORGZV-ILYw2sYr.js +1 -0
- package/dist/client/assets/bg-BG-O6MV2KSF-DmfoZHM8.js +5 -0
- package/dist/client/assets/blockDiagram-WCTKOSBZ-DlJn0Rs1.js +132 -0
- package/dist/client/assets/bn-BD-T2VJNT7N-uYQx1Wph.js +3 -0
- package/dist/client/assets/bn-IN-MMW2ORAC-CmlBLY7g.js +3 -0
- package/dist/client/assets/brainfuck-CAmdgqDN.js +1 -0
- package/dist/client/assets/c4Diagram-IC4MRINW-C6S9MOEW.js +10 -0
- package/dist/client/assets/ca-ES-MKBCGNOG-DWiYvMvF.js +8 -0
- package/dist/client/assets/channel-CVwYcdlk.js +1 -0
- package/dist/client/assets/chunk-27N2SPOM-RxZ2_zJJ.js +34 -0
- package/dist/client/assets/chunk-3PELD44J-BvOh9EJp.js +1 -0
- package/dist/client/assets/chunk-4BX2VUAB-LBTVcC6-.js +1 -0
- package/dist/client/assets/chunk-55IACEB6-T5nuDI6U.js +1 -0
- package/dist/client/assets/chunk-7E7YKBS2-CBNUsbS7.js +1 -0
- package/dist/client/assets/chunk-7R4GIKGN-Dh9p1sbP.js +80 -0
- package/{public/assets/js/chunks/chunk-IR2DOYV4.js → dist/client/assets/chunk-A66AFZZU-D0IDIehU.js} +2 -2
- package/dist/client/assets/chunk-C72U2L5F-DLNOvzEI.js +1 -0
- package/dist/client/assets/chunk-Cq_f4orQ.js +1 -0
- package/dist/client/assets/chunk-EGIJ26TM-BkBsHEWn.js +1 -0
- package/dist/client/assets/chunk-ETSVUAFD-BnK5BhxL.js +12 -0
- package/{public/assets/js/chunks/chunk-U6APNHAF.js → dist/client/assets/chunk-FMBD7UC4-BoiIqhkb.js} +2 -2
- package/dist/client/assets/chunk-GEFDOKGD-CIg-LRSp.js +2 -0
- package/dist/client/assets/chunk-GLR3WWYH-CqGMuOti.js +2 -0
- package/dist/client/assets/chunk-HHEYEP7N-Czb3OX2v.js +1 -0
- package/dist/client/assets/chunk-JSJVCQXG-C6-G93S3.js +1 -0
- package/dist/client/assets/chunk-KX2RTZJC-CJlt0Rne.js +1 -0
- package/dist/client/assets/chunk-KYZI473N-C-ObF5L3.js +53 -0
- package/dist/client/assets/chunk-L3YUKLVL-BzkNNFii.js +1 -0
- package/dist/client/assets/chunk-MX3YWQON-bjcMtEei.js +1 -0
- package/dist/client/assets/chunk-NQ4KR5QH-DY9oh8PD.js +220 -0
- package/dist/client/assets/chunk-O4XLMI2P-CVfnFXq8.js +7 -0
- package/dist/client/assets/chunk-OZEHJAEY-DyD-ywvu.js +1 -0
- package/dist/client/assets/chunk-PQ6SQG4A-BOJs3QbF.js +1 -0
- package/dist/client/assets/chunk-PU5JKC2W-1nkyDxBh.js +70 -0
- package/dist/client/assets/chunk-QZHKN3VN-DU7fMcaP.js +1 -0
- package/dist/client/assets/chunk-R5LLSJPH-D9t4mFiL.js +1 -0
- package/dist/client/assets/chunk-SRAX5OIU-B-Zdxy2r.js +1 -0
- package/dist/client/assets/chunk-WL4C6EOR-Bs95uEnp.js +189 -0
- package/dist/client/assets/chunk-XIRO2GV7-CtwY16Jh.js +1 -0
- package/dist/client/assets/chunk-XPW4576I-CvxG514V.js +32 -0
- package/dist/client/assets/chunk-XZSTWKYB-BNB3Mgw3.js +94 -0
- package/dist/client/assets/chunk-YBOYWFTD-MIDp82ug.js +1 -0
- package/dist/client/assets/chunk-Z5NKEFVG-CIMf1Se5.js +22 -0
- package/dist/client/assets/classDiagram-VBA2DB6C-CBSmkOe7.js +1 -0
- package/dist/client/assets/classDiagram-v2-RAHNMMFH-CJarRy94.js +1 -0
- package/dist/client/assets/clike-BJcwKCE7.js +1 -0
- package/dist/client/assets/clojure-uSRILJfc.js +1 -0
- package/dist/client/assets/clone-CMmi3x0H.js +1 -0
- package/dist/client/assets/cmake-j5-7WxMz.js +1 -0
- package/dist/client/assets/cobol-cnURuZ43.js +1 -0
- package/dist/client/assets/coffeescript-iQD116iO.js +1 -0
- package/dist/client/assets/commonlisp-DGzExN9H.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-BKEY00wk.js +1 -0
- package/dist/client/assets/crystal-CnjkM1-q.js +1 -0
- package/dist/client/assets/cs-CZ-V77HGUP7-sLBAF2Iw.js +7 -0
- package/dist/client/assets/css-C-Nv0c9S.js +1 -0
- package/dist/client/assets/cypher-hxitpny2.js +1 -0
- package/dist/client/assets/cytoscape.esm-0xzpJ66h.js +321 -0
- package/dist/client/assets/d-BtdAWoTB.js +1 -0
- package/dist/client/assets/da-DK-I5RFNTM4-B__PLwca.js +2 -0
- package/dist/client/assets/dagre-Cm2w_QpZ.js +1 -0
- package/dist/client/assets/dagre-KLK3FWXG-BddfhbwG.js +4 -0
- package/dist/client/assets/de-CH-WLRDEVBV-D61DKw_9.js +7 -0
- package/dist/client/assets/de-DE-DTI4WUSC-Ba3fBYEU.js +7 -0
- package/dist/client/assets/defaultLocale-PG3Gbk8q.js +1 -0
- package/dist/client/assets/diagram-E7M64L7V-BoyJ8kpo.js +24 -0
- package/dist/client/assets/diagram-IFDJBPK2-DLWembLL.js +43 -0
- package/dist/client/assets/diagram-P4PSJMXO-CPmPa0OC.js +24 -0
- package/dist/client/assets/diff-f_ZkWiYS.js +1 -0
- package/dist/client/assets/dist-BATDm5JF.js +1 -0
- package/dist/client/assets/dist-BDDCA7hC.js +1 -0
- package/dist/client/assets/dist-BEs40fGb.js +1 -0
- package/dist/client/assets/dist-BPyPcaZr.js +1 -0
- package/dist/client/assets/dist-BiNL3fhN.js +1 -0
- package/dist/client/assets/dist-BpEcA20b.js +2 -0
- package/dist/client/assets/dist-BtROnx4-.js +1 -0
- package/dist/client/assets/dist-CCxn5Mk-.js +13 -0
- package/dist/client/assets/dist-CKdaLumK.js +1 -0
- package/dist/client/assets/dist-CNcGnl0T.js +1 -0
- package/dist/client/assets/dist-CPzoLjNz.js +1 -0
- package/dist/client/assets/dist-CQzPpOiH.js +1 -0
- package/dist/client/assets/dist-Cje3pdZH.js +9 -0
- package/dist/client/assets/dist-CnKD4Y92.js +1 -0
- package/dist/client/assets/dist-CxPc5kI6.js +1 -0
- package/dist/client/assets/dist-Czv7DXcw.js +23 -0
- package/dist/client/assets/dist-D4ebIlQB.js +6 -0
- package/dist/client/assets/dist-D7S1mzwR.js +1 -0
- package/dist/client/assets/dist-DFIisyRk.js +1 -0
- package/dist/client/assets/dist-DGbPPlZ8.js +1 -0
- package/dist/client/assets/dist-DL-EaOiC.js +1 -0
- package/dist/client/assets/dist-DhkKj77m.js +1 -0
- package/dist/client/assets/dist-DnpxzfoU.js +1 -0
- package/dist/client/assets/dist-Dy9oGocr.js +11 -0
- package/dist/client/assets/dist-Le-AVwIk.js +1 -0
- package/dist/client/assets/dist-StJm6K24.js +1 -0
- package/dist/client/assets/dist-gCWIHDgw.js +1 -0
- package/dist/client/assets/dist-mDBaykBY.js +1 -0
- package/dist/client/assets/dist-tyxqXzyB.js +1 -0
- package/dist/client/assets/dist-vL71uaef.js +1 -0
- package/dist/client/assets/dockerfile-BmylqEVx.js +1 -0
- package/dist/client/assets/dtd-B6xdyNDx.js +1 -0
- package/dist/client/assets/dylan-BzUoKQTn.js +1 -0
- package/dist/client/assets/ebnf-BlTaNq16.js +1 -0
- package/dist/client/assets/ecl-CffPaRqR.js +1 -0
- package/dist/client/assets/editor-session-DsM3VgQv.js +16 -0
- package/dist/client/assets/eiffel-B66P6crR.js +1 -0
- package/dist/client/assets/el-GR-ZXDJ2OS4-CpEbk42T.js +7 -0
- package/dist/client/assets/elm-DIwllOLv.js +1 -0
- package/dist/client/assets/en-CTDJDZ6K-C36Iqh9O.js +1 -0
- package/dist/client/assets/erDiagram-INFDFZHY-Dwg_AhU2.js +70 -0
- package/dist/client/assets/erlang-DwYA67QU.js +1 -0
- package/dist/client/assets/es-ES-DYQHAD43-Ba-6t0Wr.js +7 -0
- package/dist/client/assets/eu-ES-QDSYU5Y3-CYzUKQ2_.js +7 -0
- package/dist/client/assets/excalidraw-editor-Cs5p0lBn.js +182 -0
- package/dist/client/assets/excalidraw-editor-D8O7A69r.css +1 -0
- package/dist/client/assets/excalidraw-mermaid-stub-BtCKxPxK.js +1 -0
- package/dist/client/assets/excalidraw-mermaid-stub-C1ZaaI05.js +1 -0
- package/dist/client/assets/excalidrawEditor-wgJb2hmP.js +2 -0
- package/dist/client/assets/fa-IR-26LZG4PM-CxLc7ohL.js +9 -0
- package/dist/client/assets/factor-Cc9mS1OI.js +1 -0
- package/dist/client/assets/fcl-DD6dBrvI.js +1 -0
- package/dist/client/assets/fi-FI-6YS4KDE4-DtYLOEJY.js +6 -0
- package/dist/client/assets/flowDiagram-PKNHOUZH-BIJd4wAz.js +162 -0
- package/dist/client/assets/forth-DFLLMv-i.js +1 -0
- package/dist/client/assets/fortran-CNZVMQdQ.js +1 -0
- package/dist/client/assets/fr-FR-BRLLPTZC-9O_U5gdi.js +12 -0
- package/dist/client/assets/ganttDiagram-A5KZAMGK-BiMwicnp.js +292 -0
- package/dist/client/assets/gas-DyiCLKEJ.js +1 -0
- package/dist/client/assets/gherkin-CHgE7bAJ.js +1 -0
- package/dist/client/assets/gitGraph-HDMCJU4V-iPo6Lz4k.js +1 -0
- package/dist/client/assets/gitGraphDiagram-K3NZZRJ6-lk_paRel.js +65 -0
- package/dist/client/assets/github-dark.min-Z5exjX_n.css +1 -0
- package/dist/client/assets/github.min-D2BCvnWf.css +1 -0
- package/dist/client/assets/gl-ES-OKUZTLYG-Bb7TO64O.js +6 -0
- package/dist/client/assets/graphlib-B2nPo9Z4.js +1 -0
- package/dist/client/assets/groovy-BZc3It91.js +1 -0
- package/dist/client/assets/haskell-DJ4hTi3A.js +1 -0
- package/dist/client/assets/haxe-sJjg_lHN.js +1 -0
- package/dist/client/assets/he-IL-26MGYIU7-CQW1igm9.js +8 -0
- package/dist/client/assets/hi-IN-Q4ZOGTP2-BM91ENLs.js +3 -0
- package/dist/client/assets/http-DwAi3Ho1.js +1 -0
- package/dist/client/assets/hu-HU-P2OXPSN5-HiGbsUwM.js +3 -0
- package/dist/client/assets/id-ID-2EIKXYN6-DEG8vRZ2.js +8 -0
- package/dist/client/assets/idl-CCIDRFwr.js +1 -0
- package/dist/client/assets/image-32MOCVDX-viHDtJGM.js +1 -0
- package/dist/client/assets/image-blob-reduce.esm-D4wBfumB.js +2 -0
- package/dist/client/assets/index-B6m_KATZ.css +1 -0
- package/dist/client/assets/index-D20GlrKF.js +2 -0
- package/dist/client/assets/info-3K5VOQVL-DePZHLA4.js +1 -0
- package/dist/client/assets/infoDiagram-LFFYTUFH-CiAT_kJZ.js +2 -0
- package/dist/client/assets/init-Bb7Vx0CW.js +1 -0
- package/dist/client/assets/isArrayLikeObject-DxEG9mY7.js +1 -0
- package/dist/client/assets/isEmpty-DGNCKhlT.js +1 -0
- package/dist/client/assets/ishikawaDiagram-PHBUUO56-CE3HierS.js +70 -0
- package/dist/client/assets/it-IT-4CFKVXI2-DSrGqCKD.js +12 -0
- package/dist/client/assets/ja-JP-MAND2Z4V-OFpEymIv.js +7 -0
- package/dist/client/assets/javascript-BlUxwA0O.js +1 -0
- package/dist/client/assets/javascript-DcX_cm1u.js +1 -0
- package/dist/client/assets/journeyDiagram-4ABVD52K-CzoczPjW.js +139 -0
- package/dist/client/assets/jsx-runtime-DRYOYO9I.js +1 -0
- package/dist/client/assets/julia-BU0qBb1w.js +1 -0
- package/dist/client/assets/kaa-HQRTCXTJ-CpOJ_vn4.js +1 -0
- package/dist/client/assets/kab-KAB-JKIKKTGH-CNPzzJH6.js +4 -0
- package/dist/client/assets/kanban-definition-K7BYSVSG-Cr6iNYl4.js +89 -0
- package/dist/client/assets/katex-DoaSnJ5T.js +261 -0
- package/dist/client/assets/kk-KZ-HXQ63ZFC-CgtjU5JI.js +1 -0
- package/dist/client/assets/km-KH-PKL3LSGX-BAJh8UnF.js +7 -0
- package/dist/client/assets/ko-KR-KXLREZX3-BshOksBX.js +5 -0
- package/dist/client/assets/ku-TR-MJ4IER3X-Bi3YtiD-.js +6 -0
- package/dist/client/assets/line-D2NTyhqv.js +1 -0
- package/dist/client/assets/linear-DntNI0Uj.js +1 -0
- package/dist/client/assets/livescript-uk34VDGK.js +1 -0
- package/dist/client/assets/lt-LT-H6WFQ6FJ-DQ2W0g7h.js +3 -0
- package/dist/client/assets/lua-ClQGOv84.js +1 -0
- package/dist/client/assets/lv-LV-GOCK6SJW-DeqTo8T7.js +4 -0
- package/dist/client/assets/main-DONXLDrC.js +599 -0
- package/dist/client/assets/math-DQo53qzt.js +1 -0
- package/dist/client/assets/mathematica-BDmKpvRN.js +1 -0
- package/dist/client/assets/mbox-T5kA6jAQ.js +1 -0
- package/dist/client/assets/mermaid-parser.core-Bh2Ta9ou.js +4 -0
- package/dist/client/assets/mermaid-runtime-CLtta79D.js +11 -0
- package/dist/client/assets/mindmap-definition-YRQLILUH-DufPyQO8.js +68 -0
- package/dist/client/assets/mirc-DRRKKkcJ.js +1 -0
- package/dist/client/assets/mllike-iZXopbca.js +1 -0
- package/dist/client/assets/modelica-DP8T2DKM.js +1 -0
- package/dist/client/assets/mr-IN-IXVLDMEQ-CnH5Wjc7.js +9 -0
- package/dist/client/assets/mscgen-DXIRw2qg.js +1 -0
- package/dist/client/assets/mumps-BKUS05-y.js +1 -0
- package/dist/client/assets/my-MM-YG6MYTTD-BefEpouO.js +1 -0
- package/dist/client/assets/nb-NO-XGWJISD2-CNRrlrPY.js +8 -0
- package/dist/client/assets/nginx-CzYOtr2G.js +1 -0
- package/dist/client/assets/nl-NL-XVDVCPNC-CuLTw3kL.js +13 -0
- package/dist/client/assets/nn-NO-EMX5MJX5-NHFRnQkl.js +4 -0
- package/dist/client/assets/nsis-YyYYKQIB.js +1 -0
- package/dist/client/assets/ntriples-ZgZuaYbW.js +1 -0
- package/dist/client/assets/oc-FR-ROEINTVO-8kCbAtcr.js +4 -0
- package/dist/client/assets/octave-CnOndUN3.js +1 -0
- package/dist/client/assets/ordinal-BuNU9EgZ.js +1 -0
- package/dist/client/assets/oz-DjW322Rn.js +1 -0
- package/dist/client/assets/pa-IN-ZYN6SUDY-Dh8USSIe.js +4 -0
- package/dist/client/assets/packet-RMMSAZCW-BVw0pEk-.js +1 -0
- package/dist/client/assets/pascal-BdeW5uRX.js +1 -0
- package/dist/client/assets/path-BxyPWlyM.js +1 -0
- package/dist/client/assets/percentages-5DKR754L-RQFE76Sg.js +1 -0
- package/dist/client/assets/perl-_CDvIe1D.js +1 -0
- package/dist/client/assets/pica-BG8AR4mo.js +2 -0
- package/dist/client/assets/pie-UPGHQEXC-ChUWa5qF.js +1 -0
- package/dist/client/assets/pieDiagram-SKSYHLDU--YidSJxi.js +30 -0
- package/dist/client/assets/pig-inWo_B4W.js +1 -0
- package/dist/client/assets/pl-PL-6VTG7PHC-BMbgP62B.js +12 -0
- package/dist/client/assets/powershell-CO5KWJsy.js +1 -0
- package/dist/client/assets/preload-helper-Chd9yIcd.js +1 -0
- package/dist/client/assets/preview-render-compiler-CWBdv5tw.js +1 -0
- package/dist/client/assets/preview-render-profile-BjrQVCWD.js +23 -0
- package/dist/client/assets/preview-render-worker-DbMTa0Y6.js +23 -0
- package/dist/client/assets/properties-CjVp4a6M.js +1 -0
- package/dist/client/assets/protobuf-DybFT2KT.js +1 -0
- package/dist/client/assets/pt-BR-5YFKRR5G-CyrwFw_N.js +6 -0
- package/dist/client/assets/pt-PT-GEIXXZ67-SpK5vaGR.js +8 -0
- package/dist/client/assets/pug-CM36H1hd.js +1 -0
- package/dist/client/assets/puppet-Dw_NDgko.js +1 -0
- package/dist/client/assets/python-2pwcWoy7.js +1 -0
- package/dist/client/assets/q-C47l8kdS.js +1 -0
- package/dist/client/assets/quadrantDiagram-337W2JSQ-n7EIFT_f.js +7 -0
- package/dist/client/assets/quick-switcher-controller-CKrGBgcl.js +5 -0
- package/dist/client/assets/r-BmcXGVZ5.js +1 -0
- package/dist/client/assets/radar-KQ55EAFF-B4gMcoDX.js +1 -0
- package/dist/client/assets/requirementDiagram-Z7DCOOCP-BrquJATD.js +73 -0
- package/dist/client/assets/ro-RO-E2P6TFZI-90dn2iUp.js +12 -0
- package/dist/client/assets/room-zaSnuMv5.js +4 -0
- package/dist/client/assets/rough.esm-C7Rbwqik.js +1 -0
- package/dist/client/assets/roundRect-CDlbNkEg.js +1 -0
- package/dist/client/assets/rpm-Cm0x5xT_.js +1 -0
- package/dist/client/assets/ru-RU-YBIIY43T-Cl52NZnQ.js +10 -0
- package/dist/client/assets/ruby-Dl-I4pxG.js +1 -0
- package/dist/client/assets/runtime-config-loader--hxFvh23.js +1 -0
- package/dist/client/assets/sankeyDiagram-WA2Y5GQK-IpD6lgfO.js +10 -0
- package/dist/client/assets/sas-Bxkg4GVX.js +1 -0
- package/dist/client/assets/scheme-CO3zogua.js +1 -0
- package/dist/client/assets/sequenceDiagram-2WXFIKYE-DxZ6glIZ.js +145 -0
- package/dist/client/assets/shell-gYrTvBTP.js +1 -0
- package/dist/client/assets/si-LK-673C2CI2-DMSUxT-y.js +1 -0
- package/dist/client/assets/sieve-COX4Kn1X.js +1 -0
- package/dist/client/assets/simple-mode-BY9UFVy7.js +1 -0
- package/dist/client/assets/sk-SK-CKZHQ4AP-DUDai5Oe.js +7 -0
- package/dist/client/assets/sl-SI-557H2GWM-BbLeATfl.js +6 -0
- package/dist/client/assets/smalltalk-Dma1z5eE.js +1 -0
- package/dist/client/assets/solr-BvhcdkNH.js +1 -0
- package/dist/client/assets/sparql-gX7W9xeh.js +1 -0
- package/dist/client/assets/spreadsheet-BnlQRxWz.js +1 -0
- package/dist/client/assets/sql-CwA10oIk.js +1 -0
- package/dist/client/assets/src-H0-aBY9y.js +1 -0
- package/dist/client/assets/stateDiagram-RAJIS63D-A-rbDcdL.js +1 -0
- package/dist/client/assets/stateDiagram-v2-FVOUBMTO-CKhOHHLe.js +1 -0
- package/dist/client/assets/stex-DhLUylSV.js +1 -0
- package/dist/client/assets/stylus-9ZGSp3KB.js +1 -0
- package/dist/client/assets/subset-shared.chunk-93a-Md8B.js +1 -0
- package/dist/client/assets/subset-worker.chunk-B7pmUG1o.js +1 -0
- package/dist/client/assets/sv-SE-XOPKKDWS-BBa-AcMf.js +8 -0
- package/dist/client/assets/swift-CurfpLXH.js +1 -0
- package/dist/client/assets/ta-IN-XBH7DQI3-9uR7ADzx.js +6 -0
- package/dist/client/assets/tcl-BPvzXR-t.js +1 -0
- package/dist/client/assets/textile-BUq3vgBH.js +1 -0
- package/dist/client/assets/th-TH-TOCWH3R4-Box9U3ny.js +1 -0
- package/dist/client/assets/tiddlywiki-DRR6E4hS.js +1 -0
- package/dist/client/assets/tiki-C1XMixgx.js +1 -0
- package/dist/client/assets/timeline-definition-YZTLITO2-DuTppHot.js +61 -0
- package/dist/client/assets/toml-BQjoWSzq.js +1 -0
- package/dist/client/assets/tr-TR-GXW6CYY5-BA8pS3C5.js +4 -0
- package/dist/client/assets/treemap-KZPCXAKY-on28XbV_.js +1 -0
- package/dist/client/assets/troff-DbgTp3Cj.js +1 -0
- package/dist/client/assets/ttcn-1OxchGWH.js +1 -0
- package/dist/client/assets/ttcn-cfg-CC8OhyHu.js +1 -0
- package/dist/client/assets/turtle-D1WjVU4-.js +1 -0
- package/dist/client/assets/uk-UA-IJKTNUDG-B6hoHqzM.js +6 -0
- package/dist/client/assets/uz-UZ-TBZZEA4V-CPuftH33.js +1 -0
- package/dist/client/assets/vault-api-client-D7C_m9eq.js +188 -0
- package/dist/client/assets/vault-utils-Js2T-e-h.js +1 -0
- package/dist/client/assets/vb-Bf-XXYNJ.js +1 -0
- package/dist/client/assets/vbscript-HeSyWuOi.js +1 -0
- package/dist/client/assets/velocity-CUkiDsJQ.js +1 -0
- package/dist/client/assets/vennDiagram-LZ73GAT5-J0SBkXj8.js +34 -0
- package/dist/client/assets/verilog-BFxB5RAN.js +1 -0
- package/dist/client/assets/vhdl-BJUXQE-6.js +1 -0
- package/dist/client/assets/vi-VN-MULSGNVB-yRFd9OXl.js +7 -0
- package/dist/client/assets/webidl-advQMGTP.js +1 -0
- package/dist/client/assets/xquery-CNzoFgd7.js +1 -0
- package/dist/client/assets/xychartDiagram-JWTSCODW-Dn9dSYxn.js +7 -0
- package/dist/client/assets/yacas-BsmlDKac.js +1 -0
- package/dist/client/assets/yjs-provider-reset-guard-BcnBGrS9.js +4 -0
- package/dist/client/assets/z80-Bnez4vZ_.js +1 -0
- package/dist/client/assets/zh-CN-MVX3E32U-VzUIXB4K.js +11 -0
- package/dist/client/assets/zh-HK-JNU5RLIE-i0G2jHO_.js +1 -0
- package/dist/client/assets/zh-TW-LENVCA6T-BkHZg3jv.js +9 -0
- package/dist/client/excalidraw-editor.html +31 -0
- package/{public → dist/client}/index.html +135 -222
- package/docker-compose.yml +13 -1
- package/package.json +14 -7
- package/src/client/app/excalidraw-editor-entry.js +4 -0
- package/{public → src/client/app}/excalidraw-editor.html +1 -3
- package/src/client/app/index.html +469 -0
- package/src/client/app/main-entry.js +24 -0
- package/src/client/application/app-shell/git-feature.js +268 -32
- package/src/client/application/app-shell/ui-feature-identity.js +170 -0
- package/src/client/application/app-shell/ui-feature-shell.js +419 -0
- package/src/client/application/app-shell/ui-feature-sidebar.js +98 -0
- package/src/client/application/app-shell/ui-feature-tab-activity.js +128 -0
- package/src/client/application/app-shell/ui-feature-toolbar.js +520 -0
- package/src/client/application/app-shell/ui-feature.js +10 -648
- package/src/client/application/app-shell/workspace-feature.js +46 -0
- package/src/client/application/app-shell-elements.js +4 -0
- package/src/client/application/mermaid-preview-hydrator.js +1 -1
- package/src/client/application/plantuml-preview-hydrator.js +1 -1
- package/src/client/application/workspace-coordinator.js +147 -18
- package/src/client/application/workspace-preview-controller.js +34 -0
- package/src/client/application/workspace-route-controller.js +104 -0
- package/src/client/bootstrap/collabmd-app-shell.js +104 -0
- package/src/client/domain/markdown-formatting.js +197 -52
- package/src/client/domain/markdown-toolbar-actions.js +191 -0
- package/src/client/domain/runtime-paths.js +15 -0
- package/src/client/domain/workspace-request-id.js +7 -0
- package/src/client/excalidraw-editor.js +48 -2
- package/src/client/infrastructure/app-version-monitor.js +114 -0
- package/src/client/infrastructure/auth-client.js +219 -52
- package/src/client/infrastructure/browser-navigation-port.js +20 -0
- package/src/client/infrastructure/editor-collaboration-client.js +4 -0
- package/src/client/infrastructure/editor-session.js +47 -7
- package/src/client/infrastructure/editor-view-adapter.js +122 -58
- package/src/client/infrastructure/runtime-config-loader.js +56 -0
- package/src/client/infrastructure/runtime-config.js +66 -0
- package/src/client/infrastructure/vault-api-client.js +41 -7
- package/src/client/presentation/backlinks-panel.js +42 -9
- package/src/client/presentation/comment-ui/comment-ui-card.js +632 -0
- package/src/client/presentation/comment-ui/comment-ui-layout.js +452 -0
- package/src/client/presentation/comment-ui/comment-ui-render.js +149 -0
- package/src/client/presentation/comment-ui/comment-ui-shared.js +297 -0
- package/src/client/presentation/comment-ui/comment-ui-state.js +268 -0
- package/src/client/presentation/comment-ui-controller.js +13 -1529
- package/src/client/presentation/comments-panel.js +2 -2
- package/src/client/presentation/excalidraw-embed-controller.js +60 -2
- package/src/client/presentation/file-action-controller.js +195 -32
- package/src/client/presentation/file-explorer-controller.js +16 -2
- package/src/client/presentation/file-explorer-view.js +248 -7
- package/src/client/presentation/file-history-view-controller.js +806 -0
- package/src/client/presentation/file-tree-state.js +100 -5
- package/src/client/presentation/git-diff-view-controller.js +718 -121
- package/src/client/presentation/git-panel-controller.js +458 -66
- package/src/client/presentation/layout-controller.js +1 -1
- package/src/client/presentation/toast-controller.js +49 -6
- package/src/client/styles/components/actions.css +89 -0
- package/src/client/styles/components/feedback.css +71 -0
- package/src/client/styles/components/navigation.css +68 -0
- package/src/client/styles/components/scrollbars.css +104 -0
- package/src/client/styles/components/states.css +289 -0
- package/src/client/styles/components/surfaces.css +155 -0
- package/src/client/styles/features/backlinks.css +218 -0
- package/src/client/styles/features/collaboration-chat.css +228 -0
- package/src/client/styles/features/collaboration-dialogs.css +154 -0
- package/src/client/styles/features/collaboration-presence.css +103 -0
- package/src/client/styles/features/collaboration-ui.css +3 -0
- package/src/client/styles/features/comment-card.css +236 -0
- package/src/client/styles/features/comment-markdown.css +127 -0
- package/src/client/styles/features/comment-overlays.css +60 -0
- package/src/client/styles/features/comments-drawer.css +120 -0
- package/src/client/styles/features/comments.css +4 -0
- package/src/client/styles/features/diagram-preview.css +227 -0
- package/src/client/styles/features/diff-commit.css +268 -0
- package/src/client/styles/features/diff-lines.css +160 -0
- package/src/client/styles/features/diff-toolbar.css +98 -0
- package/src/client/styles/features/diff.css +3 -0
- package/src/client/styles/features/embedded-preview.css +218 -0
- package/src/client/styles/features/git-branch.css +155 -0
- package/src/client/styles/features/git-files.css +105 -0
- package/src/client/styles/features/git-history.css +339 -0
- package/src/client/styles/features/git.css +3 -0
- package/src/client/styles/features/media-lightbox.css +157 -0
- package/src/client/styles/features/outline.css +115 -0
- package/src/client/styles/features/preview-content.css +3 -0
- package/src/client/styles/features/preview-markdown.css +201 -0
- package/src/client/styles/features/preview-sidebars.css +2 -0
- package/src/client/styles/features/quick-switcher.css +167 -0
- package/src/client/styles/foundation/themes.css +347 -0
- package/src/client/styles/foundation/tokens.css +66 -0
- package/src/client/styles/foundation/utilities.css +36 -0
- package/src/client/styles/layout/editor-page.css +303 -0
- package/src/client/styles/layout/overlays.css +132 -0
- package/src/client/styles/layout/responsive.css +331 -0
- package/src/client/styles/layout/shell.css +314 -0
- package/src/client/styles/layout/sidebar.css +209 -0
- package/src/client/styles/layout/view-modes.css +92 -0
- package/src/client/styles/overrides/codemirror.css +53 -0
- package/src/client/styles/overrides/highlightjs.css +7 -0
- package/src/client/styles/overrides/vendor.css +2 -0
- package/src/client/styles/primitives/controls.css +277 -0
- package/src/client/styles/style.css +25 -4945
- package/src/server/auth/create-auth-service.js +373 -15
- package/src/server/auth/session-cookie.js +30 -4
- package/src/server/config/build-info.js +76 -0
- package/src/server/config/env.js +130 -6
- package/src/server/create-app-server.js +8 -0
- package/src/server/domain/collaboration/collaboration-room.js +90 -47
- package/src/server/index.js +3 -1
- package/src/server/infrastructure/git/command-runner.js +2 -1
- package/src/server/infrastructure/git/git-service.js +48 -2
- package/src/server/infrastructure/git/history-service.js +683 -0
- package/src/server/infrastructure/git/parsers.js +30 -0
- package/src/server/infrastructure/git/responses.js +73 -0
- package/src/server/infrastructure/http/create-auth-api-handler.js +30 -2
- package/src/server/infrastructure/http/create-git-api-command-handler.js +2 -0
- package/src/server/infrastructure/http/create-git-api-handler.js +2 -0
- package/src/server/infrastructure/http/create-git-api-query-handler.js +61 -0
- package/src/server/infrastructure/http/create-request-handler.js +15 -0
- package/src/server/infrastructure/http/create-static-handler.js +11 -2
- package/src/server/infrastructure/http/create-vault-api-command-handler.js +67 -0
- package/src/server/infrastructure/persistence/path-utils.js +11 -0
- package/src/server/infrastructure/persistence/vault-file-store.js +158 -3
- package/src/server/infrastructure/workspace/workspace-mutation-coordinator.js +84 -3
- package/public/assets/css/base.css +0 -1
- package/public/assets/css/style.css +0 -1
- package/public/assets/js/chunks/CodeMirrorEditor-UCMRAMCV-MAKZFDBE.js +0 -12
- package/public/assets/js/chunks/apl-C5P5JBDI.js +0 -1
- package/public/assets/js/chunks/ar-SA-NXDWD63E-MF6HMEA4.js +0 -8
- package/public/assets/js/chunks/architecture-PBZL5I3N-55LDZ5WS.js +0 -1
- package/public/assets/js/chunks/architectureDiagram-2XIMDMQ5-2VP562X7.js +0 -36
- package/public/assets/js/chunks/asciiarmor-3NCLLELT.js +0 -1
- package/public/assets/js/chunks/asn1-KF4WXU3M.js +0 -1
- package/public/assets/js/chunks/asterisk-EA3VIN65.js +0 -1
- package/public/assets/js/chunks/az-AZ-MXSORGZV-AIGO4TNU.js +0 -1
- package/public/assets/js/chunks/bg-BG-O6MV2KSF-X6AVO2AF.js +0 -5
- package/public/assets/js/chunks/blockDiagram-WCTKOSBZ-KM56WWDE.js +0 -132
- package/public/assets/js/chunks/bn-BD-T2VJNT7N-7OMHRIGC.js +0 -3
- package/public/assets/js/chunks/bn-IN-MMW2ORAC-EPKMNKG7.js +0 -3
- package/public/assets/js/chunks/brainfuck-A3CTQVFD.js +0 -1
- package/public/assets/js/chunks/c4Diagram-IC4MRINW-KX6UEGQZ.js +0 -10
- package/public/assets/js/chunks/ca-ES-MKBCGNOG-U44SUUTN.js +0 -8
- package/public/assets/js/chunks/chunk-2NTQWLZD.js +0 -25
- package/public/assets/js/chunks/chunk-2YRP2AWD.js +0 -1
- package/public/assets/js/chunks/chunk-3BUCGSSJ.js +0 -1
- package/public/assets/js/chunks/chunk-47L7JGE3.js +0 -1
- package/public/assets/js/chunks/chunk-4BCHPULB.js +0 -1
- package/public/assets/js/chunks/chunk-4NKM6YFO.js +0 -161
- package/public/assets/js/chunks/chunk-4WGMPBK5.js +0 -1
- package/public/assets/js/chunks/chunk-55WF6Y2Q.js +0 -1
- package/public/assets/js/chunks/chunk-5QRWYPYT.js +0 -25
- package/public/assets/js/chunks/chunk-775E65SU.js +0 -1
- package/public/assets/js/chunks/chunk-AJRGTECU.js +0 -70
- package/public/assets/js/chunks/chunk-B2J3PHGY.js +0 -1
- package/public/assets/js/chunks/chunk-B4JKB3BC.js +0 -1
- package/public/assets/js/chunks/chunk-CGVY4PKT.js +0 -13
- package/public/assets/js/chunks/chunk-CVTRX3TE.js +0 -220
- package/public/assets/js/chunks/chunk-DW6KK6VF.js +0 -1
- package/public/assets/js/chunks/chunk-E2HMNOQL.js +0 -189
- package/public/assets/js/chunks/chunk-EPTJZP5H.js +0 -7
- package/public/assets/js/chunks/chunk-G7NUGGE7.js +0 -13
- package/public/assets/js/chunks/chunk-GFDM7YCF.js +0 -1
- package/public/assets/js/chunks/chunk-GI7LBIBP.js +0 -1
- package/public/assets/js/chunks/chunk-GXRL27M7.js +0 -1
- package/public/assets/js/chunks/chunk-H6EYDHRW.js +0 -1
- package/public/assets/js/chunks/chunk-HEWVH67U.js +0 -9
- package/public/assets/js/chunks/chunk-HOCBCDA5.js +0 -1
- package/public/assets/js/chunks/chunk-HS2CUOC6.js +0 -1
- package/public/assets/js/chunks/chunk-HUAS4BYI.js +0 -12
- package/public/assets/js/chunks/chunk-HVNNEPP5.js +0 -2
- package/public/assets/js/chunks/chunk-I2GVZI7W.js +0 -38
- package/public/assets/js/chunks/chunk-I6PVWGBN.js +0 -14
- package/public/assets/js/chunks/chunk-IZ3V3F2A.js +0 -1
- package/public/assets/js/chunks/chunk-KPAQHIOI.js +0 -1
- package/public/assets/js/chunks/chunk-M3EW4V74.js +0 -1
- package/public/assets/js/chunks/chunk-MK3AFU3C.js +0 -90
- package/public/assets/js/chunks/chunk-NM6J3ND7.js +0 -1
- package/public/assets/js/chunks/chunk-NO7UPWTU.js +0 -1
- package/public/assets/js/chunks/chunk-OHGDMMWM.js +0 -1
- package/public/assets/js/chunks/chunk-OOT2HALX.js +0 -1
- package/public/assets/js/chunks/chunk-OQLLZFFN.js +0 -1
- package/public/assets/js/chunks/chunk-PF6TP4EI.js +0 -1
- package/public/assets/js/chunks/chunk-PMOZMECZ.js +0 -85
- package/public/assets/js/chunks/chunk-QBGS6DJR.js +0 -1
- package/public/assets/js/chunks/chunk-QF3ZQ6UQ.js +0 -1
- package/public/assets/js/chunks/chunk-QFXMAUW4.js +0 -1
- package/public/assets/js/chunks/chunk-QYKIT2IH.js +0 -41
- package/public/assets/js/chunks/chunk-S75BI2UQ.js +0 -1
- package/public/assets/js/chunks/chunk-SKEZZ3H6.js +0 -1
- package/public/assets/js/chunks/chunk-SO6QBCB6.js +0 -1
- package/public/assets/js/chunks/chunk-TFP6LRYJ.js +0 -53
- package/public/assets/js/chunks/chunk-VOODXHXA.js +0 -1
- package/public/assets/js/chunks/chunk-W7WJUTSA.js +0 -3
- package/public/assets/js/chunks/chunk-WNXFO2F2.js +0 -1
- package/public/assets/js/chunks/chunk-X6EEYWV4.js +0 -6
- package/public/assets/js/chunks/chunk-YVW3ZETS.js +0 -1
- package/public/assets/js/chunks/chunk-ZR2QRTBG.js +0 -339
- package/public/assets/js/chunks/chunk-ZZJX4LQ2.js +0 -1
- package/public/assets/js/chunks/classDiagram-VBA2DB6C-IYW4O2RM.js +0 -1
- package/public/assets/js/chunks/classDiagram-v2-RAHNMMFH-DNKVN2WD.js +0 -1
- package/public/assets/js/chunks/clike-RTBH33GE.js +0 -1
- package/public/assets/js/chunks/clojure-BR2VJ2JI.js +0 -1
- package/public/assets/js/chunks/cmake-2HEWVFEE.js +0 -1
- package/public/assets/js/chunks/cobol-V6EIK6DN.js +0 -1
- package/public/assets/js/chunks/coffeescript-JW3ZOGMD.js +0 -1
- package/public/assets/js/chunks/commonlisp-UCWSIHYK.js +0 -1
- package/public/assets/js/chunks/cose-bilkent-S5V4N54A-QVYRFFNC.js +0 -1
- package/public/assets/js/chunks/crystal-GR4VLC3M.js +0 -1
- package/public/assets/js/chunks/cs-CZ-V77HGUP7-OLBAKFG5.js +0 -7
- package/public/assets/js/chunks/css-C5DVWGB4.js +0 -1
- package/public/assets/js/chunks/cypher-K7FZM5GC.js +0 -1
- package/public/assets/js/chunks/d-CF3QNNH5.js +0 -1
- package/public/assets/js/chunks/da-DK-I5RFNTM4-QJIG2SEZ.js +0 -2
- package/public/assets/js/chunks/dagre-KLK3FWXG-KVNBUDOY.js +0 -4
- package/public/assets/js/chunks/de-CH-WLRDEVBV-4MMJDMVD.js +0 -7
- package/public/assets/js/chunks/de-DE-DTI4WUSC-ML7C46TT.js +0 -7
- package/public/assets/js/chunks/diagram-E7M64L7V-ZP33VRUC.js +0 -24
- package/public/assets/js/chunks/diagram-IFDJBPK2-ZG35YWOD.js +0 -43
- package/public/assets/js/chunks/diagram-P4PSJMXO-ZGIGM7D2.js +0 -24
- package/public/assets/js/chunks/diff-KOMSZU7O.js +0 -1
- package/public/assets/js/chunks/dist-7RQKSOUX.js +0 -7
- package/public/assets/js/chunks/dist-ARWGZ6MN.js +0 -1
- package/public/assets/js/chunks/dist-DPBSGC3Y.js +0 -2
- package/public/assets/js/chunks/dist-E36PJE5M.js +0 -1
- package/public/assets/js/chunks/dist-E5NM7OBW.js +0 -1
- package/public/assets/js/chunks/dist-ERADYPEK.js +0 -1
- package/public/assets/js/chunks/dist-F43RIHBZ.js +0 -1
- package/public/assets/js/chunks/dist-HAB5NIXI.js +0 -1
- package/public/assets/js/chunks/dist-HG23OLRA.js +0 -1
- package/public/assets/js/chunks/dist-IEJXBSDJ.js +0 -1
- package/public/assets/js/chunks/dist-IQA4KVJK.js +0 -1
- package/public/assets/js/chunks/dist-OIQTNVT2.js +0 -3
- package/public/assets/js/chunks/dist-PMZJ734S.js +0 -1
- package/public/assets/js/chunks/dist-RCQFQRLD.js +0 -1
- package/public/assets/js/chunks/dist-RQLC4GVI.js +0 -1
- package/public/assets/js/chunks/dist-RSJGLSKC.js +0 -1
- package/public/assets/js/chunks/dist-SGNQZVVX.js +0 -1
- package/public/assets/js/chunks/dist-VCFTF7Z6.js +0 -1
- package/public/assets/js/chunks/dist-VTO23SHH.js +0 -1
- package/public/assets/js/chunks/dist-XOODBV4L.js +0 -1
- package/public/assets/js/chunks/dist-ZFZNCRZY.js +0 -1
- package/public/assets/js/chunks/dockerfile-XCIKYOSI.js +0 -1
- package/public/assets/js/chunks/dtd-3XFH7W6Z.js +0 -1
- package/public/assets/js/chunks/dylan-3UWPKVOR.js +0 -1
- package/public/assets/js/chunks/ebnf-OLHTL3VN.js +0 -1
- package/public/assets/js/chunks/ecl-43LZ3ZRM.js +0 -1
- package/public/assets/js/chunks/editor-session-EAUBJCHH.js +0 -22
- package/public/assets/js/chunks/eiffel-ISPO2UJF.js +0 -1
- package/public/assets/js/chunks/el-GR-ZXDJ2OS4-WSCEIO6J.js +0 -7
- package/public/assets/js/chunks/elm-CLK576PK.js +0 -1
- package/public/assets/js/chunks/en-CTDJDZ6K-IC3QAUOI.js +0 -1
- package/public/assets/js/chunks/erDiagram-INFDFZHY-ZMS6H2TH.js +0 -70
- package/public/assets/js/chunks/erlang-AVQXQFOT.js +0 -1
- package/public/assets/js/chunks/es-ES-DYQHAD43-XGB5X5IM.js +0 -7
- package/public/assets/js/chunks/eu-ES-QDSYU5Y3-LA3JTIJ2.js +0 -7
- package/public/assets/js/chunks/excalidraw-mermaid-stub-NYXTOJ4H.js +0 -1
- package/public/assets/js/chunks/fa-IR-26LZG4PM-PFALMEDX.js +0 -9
- package/public/assets/js/chunks/factor-CRTVBD6Q.js +0 -1
- package/public/assets/js/chunks/fcl-FX24LKTH.js +0 -1
- package/public/assets/js/chunks/fi-FI-6YS4KDE4-ES5MV6P4.js +0 -6
- package/public/assets/js/chunks/flowDiagram-PKNHOUZH-QD4L5IE5.js +0 -162
- package/public/assets/js/chunks/forth-YKDKCTVS.js +0 -1
- package/public/assets/js/chunks/fortran-UJWC6SLU.js +0 -1
- package/public/assets/js/chunks/fr-FR-BRLLPTZC-VMFE22YV.js +0 -12
- package/public/assets/js/chunks/ganttDiagram-A5KZAMGK-VTMTQESP.js +0 -292
- package/public/assets/js/chunks/gas-MYEMWGRE.js +0 -1
- package/public/assets/js/chunks/gherkin-JWHAU2YG.js +0 -1
- package/public/assets/js/chunks/gitGraph-HDMCJU4V-YPHS74XX.js +0 -1
- package/public/assets/js/chunks/gitGraphDiagram-K3NZZRJ6-Z3EZ634T.js +0 -65
- package/public/assets/js/chunks/gl-ES-OKUZTLYG-GPT42ZHV.js +0 -6
- package/public/assets/js/chunks/groovy-QZIZQIAK.js +0 -1
- package/public/assets/js/chunks/haskell-JR3G7YNW.js +0 -1
- package/public/assets/js/chunks/haxe-TVLAIYEN.js +0 -1
- package/public/assets/js/chunks/he-IL-26MGYIU7-VQ5XQYYY.js +0 -8
- package/public/assets/js/chunks/hi-IN-Q4ZOGTP2-2Z766MXA.js +0 -3
- package/public/assets/js/chunks/http-YXQRE77G.js +0 -1
- package/public/assets/js/chunks/hu-HU-P2OXPSN5-6XDVPGTE.js +0 -3
- package/public/assets/js/chunks/id-ID-2EIKXYN6-J5GWSY2S.js +0 -8
- package/public/assets/js/chunks/idl-RAQGJ6LJ.js +0 -1
- package/public/assets/js/chunks/image-32MOCVDX-JN2EUMQG.js +0 -1
- package/public/assets/js/chunks/image-blob-reduce.esm-K5OWL55S.js +0 -13
- package/public/assets/js/chunks/info-3K5VOQVL-CXJSPNNP.js +0 -1
- package/public/assets/js/chunks/infoDiagram-LFFYTUFH-WQ34MUJA.js +0 -2
- package/public/assets/js/chunks/ishikawaDiagram-PHBUUO56-4IARWKJK.js +0 -70
- package/public/assets/js/chunks/it-IT-4CFKVXI2-NMBWUWFF.js +0 -12
- package/public/assets/js/chunks/ja-JP-MAND2Z4V-GQZYXXOC.js +0 -7
- package/public/assets/js/chunks/javascript-NM7KDJUE.js +0 -1
- package/public/assets/js/chunks/journeyDiagram-4ABVD52K-FJ4LF4SX.js +0 -139
- package/public/assets/js/chunks/julia-LG3BH25B.js +0 -1
- package/public/assets/js/chunks/kaa-HQRTCXTJ-7D6PAKDJ.js +0 -1
- package/public/assets/js/chunks/kab-KAB-JKIKKTGH-TNKFXNAX.js +0 -4
- package/public/assets/js/chunks/kanban-definition-K7BYSVSG-TY4EVYI3.js +0 -89
- package/public/assets/js/chunks/katex-5YJCUCFD.js +0 -261
- package/public/assets/js/chunks/kk-KZ-HXQ63ZFC-T4HCMWED.js +0 -1
- package/public/assets/js/chunks/km-KH-PKL3LSGX-HTLHEJV6.js +0 -7
- package/public/assets/js/chunks/ko-KR-KXLREZX3-QMR52QVI.js +0 -5
- package/public/assets/js/chunks/ku-TR-MJ4IER3X-K5CNY4UO.js +0 -6
- package/public/assets/js/chunks/livescript-4CVWVI4M.js +0 -1
- package/public/assets/js/chunks/lt-LT-H6WFQ6FJ-IW25FAGX.js +0 -3
- package/public/assets/js/chunks/lua-VWGE7DQ7.js +0 -1
- package/public/assets/js/chunks/lv-LV-GOCK6SJW-KTDFW5OH.js +0 -4
- package/public/assets/js/chunks/mathematica-D7APQSEU.js +0 -1
- package/public/assets/js/chunks/mbox-BN3XQBYX.js +0 -1
- package/public/assets/js/chunks/mermaid-runtime-BIFNJ2CT.js +0 -18
- package/public/assets/js/chunks/mindmap-definition-YRQLILUH-5B565RNP.js +0 -68
- package/public/assets/js/chunks/mirc-565WBI76.js +0 -1
- package/public/assets/js/chunks/mllike-VV3KS46B.js +0 -1
- package/public/assets/js/chunks/modelica-EGX44FZV.js +0 -1
- package/public/assets/js/chunks/mr-IN-IXVLDMEQ-PHM5DT7Q.js +0 -9
- package/public/assets/js/chunks/mscgen-GFGTHENT.js +0 -1
- package/public/assets/js/chunks/mumps-POZYWSMI.js +0 -1
- package/public/assets/js/chunks/my-MM-YG6MYTTD-ZHLCMEVA.js +0 -1
- package/public/assets/js/chunks/nb-NO-XGWJISD2-KSDFG6YU.js +0 -8
- package/public/assets/js/chunks/nginx-JUBX55EU.js +0 -1
- package/public/assets/js/chunks/nl-NL-XVDVCPNC-KVF3ZO2R.js +0 -13
- package/public/assets/js/chunks/nn-NO-EMX5MJX5-34QKSHNR.js +0 -4
- package/public/assets/js/chunks/nsis-RC4CREGM.js +0 -1
- package/public/assets/js/chunks/ntriples-4WK6CNVE.js +0 -1
- package/public/assets/js/chunks/oc-FR-ROEINTVO-5GP4AOYO.js +0 -4
- package/public/assets/js/chunks/octave-GOKFN2V7.js +0 -1
- package/public/assets/js/chunks/oz-OQUMNC63.js +0 -1
- package/public/assets/js/chunks/pa-IN-ZYN6SUDY-MVL7O44W.js +0 -4
- package/public/assets/js/chunks/packet-RMMSAZCW-D7XTR5TT.js +0 -1
- package/public/assets/js/chunks/pascal-BBWQWWWD.js +0 -1
- package/public/assets/js/chunks/percentages-5DKR754L-DG7W23CV.js +0 -1
- package/public/assets/js/chunks/perl-KTPJTTAM.js +0 -1
- package/public/assets/js/chunks/pica-6G3NROWT.js +0 -17
- package/public/assets/js/chunks/pie-UPGHQEXC-KGC3O6LN.js +0 -1
- package/public/assets/js/chunks/pieDiagram-SKSYHLDU-KWKRDEZS.js +0 -30
- package/public/assets/js/chunks/pig-IJMBS4FZ.js +0 -1
- package/public/assets/js/chunks/pl-PL-6VTG7PHC-VADRWSX4.js +0 -12
- package/public/assets/js/chunks/powershell-6YGCBHDP.js +0 -1
- package/public/assets/js/chunks/preview-render-compiler-6Y7TKXFJ.js +0 -1
- package/public/assets/js/chunks/properties-5QTD3364.js +0 -1
- package/public/assets/js/chunks/protobuf-LTRWBIK3.js +0 -1
- package/public/assets/js/chunks/pt-BR-5YFKRR5G-HHF4UPO4.js +0 -6
- package/public/assets/js/chunks/pt-PT-GEIXXZ67-TUTAUZJK.js +0 -8
- package/public/assets/js/chunks/pug-U4PV3WLG.js +0 -1
- package/public/assets/js/chunks/puppet-WGYJPR3Y.js +0 -1
- package/public/assets/js/chunks/python-6YGH4S47.js +0 -1
- package/public/assets/js/chunks/q-VIG4IJLI.js +0 -1
- package/public/assets/js/chunks/quadrantDiagram-337W2JSQ-GWQRUFHQ.js +0 -7
- package/public/assets/js/chunks/quick-switcher-controller-A6SKH5HI.js +0 -5
- package/public/assets/js/chunks/r-NVPCXGTR.js +0 -1
- package/public/assets/js/chunks/radar-KQ55EAFF-OPO64DRI.js +0 -1
- package/public/assets/js/chunks/requirementDiagram-Z7DCOOCP-ASW7IPJL.js +0 -73
- package/public/assets/js/chunks/ro-RO-E2P6TFZI-RJFCULYF.js +0 -12
- package/public/assets/js/chunks/roundRect-Z3DX3W5S.js +0 -1
- package/public/assets/js/chunks/rpm-UEA257HD.js +0 -1
- package/public/assets/js/chunks/ru-RU-YBIIY43T-BF27TNVK.js +0 -10
- package/public/assets/js/chunks/ruby-KPQRAJGE.js +0 -1
- package/public/assets/js/chunks/sankeyDiagram-WA2Y5GQK-W6BBWCLW.js +0 -10
- package/public/assets/js/chunks/sas-L7VATVH5.js +0 -1
- package/public/assets/js/chunks/scheme-T2NOWR3P.js +0 -1
- package/public/assets/js/chunks/sequenceDiagram-2WXFIKYE-H4G3ISLN.js +0 -145
- package/public/assets/js/chunks/shell-DLVDUNFA.js +0 -1
- package/public/assets/js/chunks/si-LK-673C2CI2-IOFGU4U2.js +0 -1
- package/public/assets/js/chunks/sieve-BKBZYDBU.js +0 -1
- package/public/assets/js/chunks/sk-SK-CKZHQ4AP-6O5JGN26.js +0 -7
- package/public/assets/js/chunks/sl-SI-557H2GWM-2NEHLV7W.js +0 -6
- package/public/assets/js/chunks/smalltalk-WRJQKJSD.js +0 -1
- package/public/assets/js/chunks/solr-66B3BIDL.js +0 -1
- package/public/assets/js/chunks/sparql-S25Z47JG.js +0 -1
- package/public/assets/js/chunks/spreadsheet-B272EF7Y.js +0 -1
- package/public/assets/js/chunks/sql-BPLIIUYC.js +0 -1
- package/public/assets/js/chunks/stateDiagram-RAJIS63D-OF5XXRUS.js +0 -1
- package/public/assets/js/chunks/stateDiagram-v2-FVOUBMTO-IV2CSQSQ.js +0 -1
- package/public/assets/js/chunks/stex-4IJY64QX.js +0 -1
- package/public/assets/js/chunks/stylus-PJUHLGPT.js +0 -1
- package/public/assets/js/chunks/subset-shared.chunk-4NMWHS4D.js +0 -1
- package/public/assets/js/chunks/subset-worker.chunk-NTLP7Y66.js +0 -1
- package/public/assets/js/chunks/sv-SE-XOPKKDWS-Q2L6KGFV.js +0 -8
- package/public/assets/js/chunks/swift-UYHTO4SX.js +0 -1
- package/public/assets/js/chunks/ta-IN-XBH7DQI3-ISSUGZAK.js +0 -6
- package/public/assets/js/chunks/tcl-OQ5J3VO2.js +0 -1
- package/public/assets/js/chunks/textile-NOGVBEYF.js +0 -1
- package/public/assets/js/chunks/th-TH-TOCWH3R4-TABEAMJA.js +0 -1
- package/public/assets/js/chunks/tiddlywiki-SYTK4QUE.js +0 -1
- package/public/assets/js/chunks/tiki-P7K4ZLOM.js +0 -1
- package/public/assets/js/chunks/timeline-definition-YZTLITO2-HBCANIUC.js +0 -61
- package/public/assets/js/chunks/toml-AUZYRP36.js +0 -1
- package/public/assets/js/chunks/tr-TR-GXW6CYY5-5NQRN52Y.js +0 -4
- package/public/assets/js/chunks/treemap-KZPCXAKY-WYMCT5F7.js +0 -1
- package/public/assets/js/chunks/troff-XFYJNQOJ.js +0 -1
- package/public/assets/js/chunks/ttcn-AK2IXWU6.js +0 -1
- package/public/assets/js/chunks/ttcn-cfg-3IDPIYPU.js +0 -1
- package/public/assets/js/chunks/turtle-OIDMF46P.js +0 -1
- package/public/assets/js/chunks/uk-UA-IJKTNUDG-2IIL3TO5.js +0 -6
- package/public/assets/js/chunks/uz-UZ-TBZZEA4V-X22KVKBP.js +0 -1
- package/public/assets/js/chunks/vb-J6K4XVA2.js +0 -1
- package/public/assets/js/chunks/vbscript-FM7DDZZE.js +0 -1
- package/public/assets/js/chunks/velocity-6KZFEOFD.js +0 -1
- package/public/assets/js/chunks/vennDiagram-LZ73GAT5-EBRF3MZR.js +0 -34
- package/public/assets/js/chunks/verilog-EWWQPMNN.js +0 -1
- package/public/assets/js/chunks/vhdl-CJ3M4IHI.js +0 -1
- package/public/assets/js/chunks/vi-VN-MULSGNVB-TENM65C7.js +0 -7
- package/public/assets/js/chunks/webidl-XVBHXCRV.js +0 -1
- package/public/assets/js/chunks/xquery-7WZOZ4UK.js +0 -1
- package/public/assets/js/chunks/xychartDiagram-JWTSCODW-WIFVRQPR.js +0 -7
- package/public/assets/js/chunks/yacas-MZ2ZZPF3.js +0 -1
- package/public/assets/js/chunks/z80-I447CBF7.js +0 -1
- package/public/assets/js/chunks/zh-CN-MVX3E32U-S5VA2BA5.js +0 -11
- package/public/assets/js/chunks/zh-HK-JNU5RLIE-A4VUKZFV.js +0 -1
- package/public/assets/js/chunks/zh-TW-LENVCA6T-KFB6KHMM.js +0 -9
- package/public/assets/js/excalidraw-editor-7ORML5YA.css +0 -1
- package/public/assets/js/excalidraw-editor-TCIH6GJL.js +0 -347
- package/public/assets/js/excalidraw-editor.css +0 -1
- package/public/assets/js/excalidraw-editor.js +0 -1
- package/public/assets/js/main.js +0 -381
- package/public/assets/js/preview-render-worker.js +0 -30
- /package/{public/assets/js/assets/Assistant-Bold-ZDZZ6JHA.woff2 → dist/client/assets/Assistant-Bold-gm-uSS1B.woff2} +0 -0
- /package/{public/assets/js/assets/Assistant-Medium-DZ25RZU3.woff2 → dist/client/assets/Assistant-Medium-DrcxCXg3.woff2} +0 -0
- /package/{public/assets/js/assets/Assistant-Regular-PLF2XOGW.woff2 → dist/client/assets/Assistant-Regular-DVxZuzxb.woff2} +0 -0
- /package/{public/assets/js/assets/Assistant-SemiBold-CZ5MX6FK.woff2 → dist/client/assets/Assistant-SemiBold-SCI4bEL9.woff2} +0 -0
- /package/{public → src/client}/assets/vendor/highlight/github-dark.min.css +0 -0
- /package/{public → src/client}/assets/vendor/highlight/github.min.css +0 -0
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
import{a as G,b as B}from"./chunks/chunk-2NTQWLZD.js";import{c as m7}from"./chunks/chunk-QFXMAUW4.js";import{N as V3}from"./chunks/chunk-HUAS4BYI.js";import{$ as Xi,$a as Ds,$b as J0,$c as ze,$d as pb,$e as W8,$f as b3,$g as T3,$h as l7,A as hM,Aa as DM,Ab as q0,Ac as ab,Ad as E8,Ae as Ji,Af as kb,Ag as yA,Ah as lh,B as Wc,Ba as IM,Bb as Zc,Bc as ci,Bd as kt,Be as ad,Bf as nA,Bg as xA,Bh as $A,C as mM,Ca as Hu,Cb as XE,Cc as QE,Cd as Yu,Ce as z8,Cf as Qn,Cg as wA,Ch as Ub,D as pM,Da as FE,Db as ju,Dc as wl,Dd as S8,De as Zu,Df as Tb,Dg as EA,Dh as pf,E as fM,Ea as HE,Eb as Gp,Ec as ca,Ed as C8,Ee as wt,Ef as Fs,Eg as SA,Eh as O3,F as _r,Fa as LM,Fb as hr,Fc as Qi,Fd as qp,Fe as P8,Ff as Qe,Fg as CA,Fh as z3,G as P0,Ga as jE,Gb as ZE,Gc as ib,Gd as _8,Ge as U8,Gf as Mb,Gg as _A,Gh as ff,H as U0,Ha as G0,Hb as $e,Hc as JE,Hd as k8,He as B8,Hf as Tl,Hg as kA,Hh as XA,I as B0,Ia as Ms,Ib as KM,Ic as di,Id as T8,Ie as u3,If as g3,Ig as TA,Ih as ZA,J as gM,Ja as RM,Jb as qE,Jc as s8,Jd as Cl,Je as xb,Jf as Qu,Jg as MA,Jh as qA,K as bM,Ka as VE,Kb as $M,Kc as c8,Kd as on,Ke as Bs,Kf as od,Kg as AA,Kh as P3,L as vM,La as GE,Lb as sa,Lc as e3,Ld as M8,Le as wb,Lf as No,Lg as DA,Lh as gf,M as yM,Ma as NM,Mb as qc,Mc as d8,Md as zs,Me as F8,Mf as df,Mg as IA,Mh as QA,N as Hr,Na as Y0,Nb as Mt,Nc as El,Nd as Qp,Ne as H8,Nf as Ju,Ng as S3,Nh as cd,O as Up,Oa as YE,Ob as XM,Oc as u8,Od as Le,Oe as h3,Of as rA,Og as C3,Oh as sh,P as Kc,Pa as si,Pb as Qc,Pc as Ns,Pd as ui,Pe as vn,Pf as aA,Pg as LA,Ph as U3,Q as xM,Qa as WE,Qb as Yp,Qc as ft,Qd as hb,Qe as Re,Qf as Hs,Qg as RA,Qh as JA,R as F0,Ra as W0,Rb as Zi,Rc as Tr,Rd as A8,Re as nf,Rf as eo,Rg as NA,Rh as e7,S as NE,Sa as OM,Sb as ZM,Sc as ed,Sd as a3,Se as nt,Sf as U,Sg as OA,Sh as B3,T as Uu,Ta as zt,Tb as qM,Tc as ob,Td as i3,Te as Eb,Tf as iA,Tg as rh,Th as t7,U as wM,Ua as As,Ub as Jc,Uc as oe,Ud as D8,Ue as j8,Uf as oA,Ug as zA,Uh as F3,V as Bu,Va as K0,Vb as Wp,Vc as lb,Vd as Wu,Ve as m3,Vf as uf,Vg as Nb,Vh as n7,W as EM,Wa as jp,Wb as tt,Wc as he,Wd as Jp,We as V8,Wf as lA,Wg as PA,Wh as r7,X as OE,Xa as bl,Xb as dt,Xc as td,Xd as mb,Xe as pi,Xf as sA,Xg as UA,Xh as a7,Y as SM,Ya as kr,Yb as zn,Yc as Te,Yd as ef,Ye as G8,Yf as Ab,Yg as Ob,Yh as i7,Z as zE,Za as $0,Zb as Kp,Zc as Pt,Zd as I8,Ze as Y8,Zf as Oo,Zg as _3,Zh as bf,_ as Ve,_a as rn,_b as Q0,_c as Oe,_d as Ps,_e as da,_f as eh,_g as k3,_h as o7,a as nn,aa as $c,ab as zM,ac as eb,ad as sb,ae as L8,af as id,ag as cA,ah as BA,ai as s7,b as oi,ba as Q,bb as Vp,bc as QM,bd as h8,be as R8,bf as K8,bg as dA,bh as ah,bi as c7,c as lM,ca as Bp,cb as oa,cc as JM,cd as Mr,ce as hi,cf as qu,cg as uA,ch as hf,ci as H3,d as TE,da as vt,db as an,dc as e8,dd as m8,de as Ku,df as Sb,dg as v3,dh as M3,di as j3,e as Ao,ea as li,eb as PM,ec as t8,ed as nd,ee as fb,ef as $8,eg as Db,eh as A3,ei as d7,f as zu,fa as Ot,fb as X0,fc as me,fd as Sl,fe as gb,ff as Io,fg as Ib,fh as Pe,fi as u7,g as ME,ga as se,gb as UM,gc as n8,gd as t3,ge as Ar,gf as Lo,gg as Lb,gh as D3,gi as h7,h as Pu,ha as yt,hb as Is,hc as xl,hd as cb,he as pe,hf as X8,hg as ld,hh as FA,hi as Bb,i as AE,ia as ks,ib as vl,ic as qn,id as gn,ie as _l,if as p3,ig as hA,ih as HA,j as DE,ja as Fu,jb as jr,jc as r8,jd as jt,je as N8,jf as Z8,jg as ua,jh as zb,k as IE,ka as H0,kb as BM,kc as tb,kd as p8,ke as $u,kf as f3,kg as y3,kh as ih,l as N,la as PE,lb as FM,lc as Vu,ld as Os,le as Xu,lf as q8,lg as mA,lh as to,m as sM,ma as j0,mb as HM,mc as a8,md as f8,me as bb,mf as Cb,mg as Rb,mh as oh,n as cM,na as UE,nb as la,nc as Ls,nd as g8,ne as tf,nf as _b,ng as x3,nh as Pb,o as Ie,oa as Fp,ob as Z0,oc as $p,od as rd,oe as o3,of as Q8,og as mr,oh as jA,p as Cr,pa as CM,pb as yl,pc as Qt,pd as n3,pe as l3,pf as J8,pg as pA,ph as I3,q as LE,qa as _M,qb as jM,qc as Rs,qd as b8,qe as mi,qf as eA,qg as fA,qh as VA,r as Op,ra as BE,rb as VM,rc as nb,rd as r3,re as Us,rf as tA,rg as Vr,rh as mf,s as RE,sa as Hp,sb as GM,sc as ut,sd as v8,se as s3,sf as kl,sg as th,sh as Ml,t as dM,ta as _e,tb as KE,tc as i8,td as db,te as c3,tf as rf,tg as gA,th as GA,u as uM,ua as kM,ub as Xc,uc as rb,ud as Xp,ue as vb,uf as af,ug as w3,uh as L3,v as z0,va as V0,vb as $E,vc as qi,vd as y8,ve as d3,vf as of,vg as sd,vh as R3,w as ia,wa as Ts,wb as YM,wc as Gu,wd as ub,we as ae,wf as lf,wg as bA,wh as YA,x as zp,xa as TM,xb as WM,xc as xt,xd as x8,xe as O8,xf as sf,xg as nh,xh as N3,y as Pp,ya as MM,yb as Ee,yc as o8,yd as Zp,ye as bn,yf as cf,yg as E3,yh as WA,z as Do,za as AM,zb as D,zc as l8,zd as w8,ze as yb,zf as Ro,zg as vA,zh as KA}from"./chunks/chunk-I2GVZI7W.js";import{a as _s}from"./chunks/chunk-IR2DOYV4.js";import{b as p7}from"./chunks/chunk-47L7JGE3.js";import{b as oM,c as kE,d as L}from"./chunks/chunk-HS2CUOC6.js";import{b as Fa,c as _E,d as M}from"./chunks/chunk-NM6J3ND7.js";var C7=Fa(Vt=>{"use strict";function K3(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<Fb(a,t))e[r]=t,e[n]=a,n=r;else break e}}function zo(e){return e.length===0?null:e[0]}function jb(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,i=a>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,s=e[c];if(0>Fb(l,n))c<a&&0>Fb(s,l)?(e[r]=s,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else if(c<a&&0>Fb(s,n))e[r]=s,e[c]=n,r=c;else break e}}return t}function Fb(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}Vt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(f7=performance,Vt.unstable_now=function(){return f7.now()}):(G3=Date,g7=G3.now(),Vt.unstable_now=function(){return G3.now()-g7});var f7,G3,g7,Al=[],js=[],OW=1,fi=null,Dr=3,$3=!1,vf=!1,yf=!1,X3=!1,y7=typeof setTimeout=="function"?setTimeout:null,x7=typeof clearTimeout=="function"?clearTimeout:null,b7=typeof setImmediate<"u"?setImmediate:null;function Hb(e){for(var t=zo(js);t!==null;){if(t.callback===null)jb(js);else if(t.startTime<=e)jb(js),t.sortIndex=t.expirationTime,K3(Al,t);else break;t=zo(js)}}function Z3(e){if(yf=!1,Hb(e),!vf)if(zo(Al)!==null)vf=!0,dh||(dh=!0,ch());else{var t=zo(js);t!==null&&q3(Z3,t.startTime-e)}}var dh=!1,xf=-1,w7=5,E7=-1;function S7(){return X3?!0:!(Vt.unstable_now()-E7<w7)}function Y3(){if(X3=!1,dh){var e=Vt.unstable_now();E7=e;var t=!0;try{e:{vf=!1,yf&&(yf=!1,x7(xf),xf=-1),$3=!0;var n=Dr;try{t:{for(Hb(e),fi=zo(Al);fi!==null&&!(fi.expirationTime>e&&S7());){var r=fi.callback;if(typeof r=="function"){fi.callback=null,Dr=fi.priorityLevel;var a=r(fi.expirationTime<=e);if(e=Vt.unstable_now(),typeof a=="function"){fi.callback=a,Hb(e),t=!0;break t}fi===zo(Al)&&jb(Al),Hb(e)}else jb(Al);fi=zo(Al)}if(fi!==null)t=!0;else{var i=zo(js);i!==null&&q3(Z3,i.startTime-e),t=!1}}break e}finally{fi=null,Dr=n,$3=!1}t=void 0}}finally{t?ch():dh=!1}}}var ch;typeof b7=="function"?ch=function(){b7(Y3)}:typeof MessageChannel<"u"?(W3=new MessageChannel,v7=W3.port2,W3.port1.onmessage=Y3,ch=function(){v7.postMessage(null)}):ch=function(){y7(Y3,0)};var W3,v7;function q3(e,t){xf=y7(function(){e(Vt.unstable_now())},t)}Vt.unstable_IdlePriority=5;Vt.unstable_ImmediatePriority=1;Vt.unstable_LowPriority=4;Vt.unstable_NormalPriority=3;Vt.unstable_Profiling=null;Vt.unstable_UserBlockingPriority=2;Vt.unstable_cancelCallback=function(e){e.callback=null};Vt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w7=0<e?Math.floor(1e3/e):5};Vt.unstable_getCurrentPriorityLevel=function(){return Dr};Vt.unstable_next=function(e){switch(Dr){case 1:case 2:case 3:var t=3;break;default:t=Dr}var n=Dr;Dr=t;try{return e()}finally{Dr=n}};Vt.unstable_requestPaint=function(){X3=!0};Vt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Dr;Dr=e;try{return t()}finally{Dr=n}};Vt.unstable_scheduleCallback=function(e,t,n){var r=Vt.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return a=n+a,e={id:OW++,callback:t,priorityLevel:e,startTime:n,expirationTime:a,sortIndex:-1},n>r?(e.sortIndex=n,K3(js,e),zo(Al)===null&&e===zo(js)&&(yf?(x7(xf),xf=-1):yf=!0,q3(Z3,n-r))):(e.sortIndex=a,K3(Al,e),vf||$3||(vf=!0,dh||(dh=!0,ch()))),e};Vt.unstable_shouldYield=S7;Vt.unstable_wrapCallback=function(e){var t=Dr;return function(){var n=Dr;Dr=t;try{return e.apply(this,arguments)}finally{Dr=n}}}});var k7=Fa((Epe,_7)=>{"use strict";_7.exports=C7()});var M7=Fa(Yr=>{"use strict";var zW=G();function T7(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Vs(){}var Gr={d:{f:Vs,r:function(){throw Error(T7(522))},D:Vs,C:Vs,L:Vs,m:Vs,X:Vs,S:Vs,M:Vs},p:0,findDOMNode:null},PW=Symbol.for("react.portal");function UW(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:PW,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var wf=zW.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Vb(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Yr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Gr;Yr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(T7(299));return UW(e,t,null,n)};Yr.flushSync=function(e){var t=wf.T,n=Gr.p;try{if(wf.T=null,Gr.p=2,e)return e()}finally{wf.T=t,Gr.p=n,Gr.d.f()}};Yr.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Gr.d.C(e,t))};Yr.prefetchDNS=function(e){typeof e=="string"&&Gr.d.D(e)};Yr.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=Vb(n,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Gr.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:i}):n==="script"&&Gr.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Yr.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Vb(t.as,t.crossOrigin);Gr.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Gr.d.M(e)};Yr.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=Vb(n,t.crossOrigin);Gr.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Yr.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Vb(t.as,t.crossOrigin);Gr.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Gr.d.m(e)};Yr.requestFormReset=function(e){Gr.d.r(e)};Yr.unstable_batchedUpdates=function(e,t){return e(t)};Yr.useFormState=function(e,t,n){return wf.H.useFormState(e,t,n)};Yr.useFormStatus=function(){return wf.H.useHostTransitionStatus()};Yr.version="19.2.0"});var gi=Fa((Cpe,D7)=>{"use strict";function A7(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A7)}catch(e){console.error(e)}}A7(),D7.exports=M7()});var j9=Fa(py=>{"use strict";var Un=k7(),nI=G(),BW=gi();function $(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function rI(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function lg(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function aI(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function iI(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function I7(e){if(lg(e)!==e)throw Error($(188))}function FW(e){var t=e.alternate;if(!t){if(t=lg(e),t===null)throw Error($(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return I7(a),e;if(i===r)return I7(a),t;i=i.sibling}throw Error($(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error($(189))}}if(n.alternate!==r)throw Error($(190))}if(n.tag!==3)throw Error($(188));return n.stateNode.current===n?e:t}function oI(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=oI(e),t!==null)return t;e=e.sibling}return null}var Ft=Object.assign,HW=Symbol.for("react.element"),Gb=Symbol.for("react.transitional.element"),Af=Symbol.for("react.portal"),gh=Symbol.for("react.fragment"),lI=Symbol.for("react.strict_mode"),IS=Symbol.for("react.profiler"),sI=Symbol.for("react.consumer"),Pl=Symbol.for("react.context"),k5=Symbol.for("react.forward_ref"),LS=Symbol.for("react.suspense"),RS=Symbol.for("react.suspense_list"),T5=Symbol.for("react.memo"),Gs=Symbol.for("react.lazy"),NS=Symbol.for("react.activity"),jW=Symbol.for("react.memo_cache_sentinel"),L7=Symbol.iterator;function Ef(e){return e===null||typeof e!="object"?null:(e=L7&&e[L7]||e["@@iterator"],typeof e=="function"?e:null)}var VW=Symbol.for("react.client.reference");function OS(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===VW?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case gh:return"Fragment";case IS:return"Profiler";case lI:return"StrictMode";case LS:return"Suspense";case RS:return"SuspenseList";case NS:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Af:return"Portal";case Pl:return e.displayName||"Context";case sI:return(e._context.displayName||"Context")+".Consumer";case k5:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T5:return t=e.displayName||null,t!==null?t:OS(e.type)||"Memo";case Gs:t=e._payload,e=e._init;try{return OS(e(t))}catch{}}return null}var Df=Array.isArray,ye=nI.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt=BW.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fd={pending:!1,data:null,method:null,action:null},zS=[],bh=-1;function Ho(e){return{current:e}}function tr(e){0>bh||(e.current=zS[bh],zS[bh]=null,bh--)}function At(e,t){bh++,zS[bh]=e.current,e.current=t}var Fo=Ho(null),Kf=Ho(null),tc=Ho(null),Sv=Ho(null);function Cv(e,t){switch(At(tc,t),At(Kf,e),At(Fo,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?BD(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=BD(t),e=M9(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}tr(Fo),At(Fo,e)}function Oh(){tr(Fo),tr(Kf),tr(tc)}function PS(e){e.memoizedState!==null&&At(Sv,e);var t=Fo.current,n=M9(t,e.type);t!==n&&(At(Kf,e),At(Fo,n))}function _v(e){Kf.current===e&&(tr(Fo),tr(Kf)),Sv.current===e&&(tr(Sv),ag._currentValue=fd)}var Q3,R7;function ud(e){if(Q3===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Q3=t&&t[1]||"",R7=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Q3+e+R7}var J3=!1;function eS(e,t){if(!e||J3)return"";J3=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(m){var h=m}Reflect.construct(e,[],u)}else{try{u.call()}catch(m){h=m}e.call(u.prototype)}}else{try{throw Error()}catch(m){h=m}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(m){if(m&&h&&typeof m.stack=="string")return[m.stack,h.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
|
|
4
|
-
`),s=l.split(`
|
|
5
|
-
`);for(a=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;a<s.length&&!s[a].includes("DetermineComponentFrameRoot");)a++;if(r===c.length||a===s.length)for(r=c.length-1,a=s.length-1;1<=r&&0<=a&&c[r]!==s[a];)a--;for(;1<=r&&0<=a;r--,a--)if(c[r]!==s[a]){if(r!==1||a!==1)do if(r--,a--,0>a||c[r]!==s[a]){var d=`
|
|
6
|
-
`+c[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=r&&0<=a);break}}}finally{J3=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ud(n):""}function GW(e,t){switch(e.tag){case 26:case 27:case 5:return ud(e.type);case 16:return ud("Lazy");case 13:return e.child!==t&&t!==null?ud("Suspense Fallback"):ud("Suspense");case 19:return ud("SuspenseList");case 0:case 15:return eS(e.type,!1);case 11:return eS(e.type.render,!1);case 1:return eS(e.type,!0);case 31:return ud("Activity");default:return""}}function N7(e){try{var t="",n=null;do t+=GW(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
-
Error generating stack: `+r.message+`
|
|
8
|
-
`+r.stack}}var US=Object.prototype.hasOwnProperty,M5=Un.unstable_scheduleCallback,tS=Un.unstable_cancelCallback,YW=Un.unstable_shouldYield,WW=Un.unstable_requestPaint,Ya=Un.unstable_now,KW=Un.unstable_getCurrentPriorityLevel,cI=Un.unstable_ImmediatePriority,dI=Un.unstable_UserBlockingPriority,kv=Un.unstable_NormalPriority,$W=Un.unstable_LowPriority,uI=Un.unstable_IdlePriority,XW=Un.log,ZW=Un.unstable_setDisableYieldValue,sg=null,Wa=null;function Zs(e){if(typeof XW=="function"&&ZW(e),Wa&&typeof Wa.setStrictMode=="function")try{Wa.setStrictMode(sg,e)}catch{}}var Ka=Math.clz32?Math.clz32:JW,qW=Math.log,QW=Math.LN2;function JW(e){return e>>>=0,e===0?32:31-(qW(e)/QW|0)|0}var Yb=256,Wb=262144,Kb=4194304;function hd(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qv(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~i,r!==0?a=hd(r):(o&=l,o!==0?a=hd(o):n||(n=l&~e,n!==0&&(a=hd(n))))):(l=r&~i,l!==0?a=hd(l):o!==0?a=hd(o):n||(n=r&~e,n!==0&&(a=hd(n)))),a===0?0:t!==0&&t!==a&&(t&i)===0&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function cg(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function eK(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hI(){var e=Kb;return Kb<<=1,(Kb&62914560)===0&&(Kb=4194304),e}function nS(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dg(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tK(e,t,n,r,a,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,s=e.hiddenUpdates;for(n=o&~n;0<n;){var d=31-Ka(n),u=1<<d;l[d]=0,c[d]=-1;var h=s[d];if(h!==null)for(s[d]=null,d=0;d<h.length;d++){var m=h[d];m!==null&&(m.lane&=-536870913)}n&=~u}r!==0&&mI(e,r,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function mI(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ka(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function pI(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ka(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function fI(e,t){var n=t&-t;return n=(n&42)!==0?1:A5(n),(n&(e.suspendedLanes|t))!==0?0:n}function A5(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function D5(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gI(){var e=lt.p;return e!==0?e:(e=window.event,e===void 0?32:B9(e.type))}function O7(e,t){var n=lt.p;try{return lt.p=e,t()}finally{lt.p=n}}var pc=Math.random().toString(36).slice(2),fr="__reactFiber$"+pc,ba="__reactProps$"+pc,Wh="__reactContainer$"+pc,BS="__reactEvents$"+pc,nK="__reactListeners$"+pc,rK="__reactHandles$"+pc,z7="__reactResources$"+pc,ug="__reactMarker$"+pc;function I5(e){delete e[fr],delete e[ba],delete e[BS],delete e[nK],delete e[rK]}function vh(e){var t=e[fr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wh]||n[fr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=GD(e);e!==null;){if(n=e[fr])return n;e=GD(e)}return t}e=n,n=e.parentNode}return null}function Kh(e){if(e=e[fr]||e[Wh]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function If(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error($(33))}function Mh(e){var t=e[z7];return t||(t=e[z7]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function er(e){e[ug]=!0}var bI=new Set,vI={};function _d(e,t){zh(e,t),zh(e+"Capture",t)}function zh(e,t){for(vI[e]=t,e=0;e<t.length;e++)bI.add(t[e])}var aK=RegExp("^[: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]*$"),P7={},U7={};function iK(e){return US.call(U7,e)?!0:US.call(P7,e)?!1:aK.test(e)?U7[e]=!0:(P7[e]=!0,!1)}function sv(e,t,n){if(iK(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function $b(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Dl(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function vi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oK(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function FS(e){if(!e._valueTracker){var t=yI(e)?"checked":"value";e._valueTracker=oK(e,t,""+e[t])}}function xI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=yI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Tv(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var lK=/[\n"\\]/g;function wi(e){return e.replace(lK,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function HS(e,t,n,r,a,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+vi(t)):e.value!==""+vi(t)&&(e.value=""+vi(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?jS(e,o,vi(t)):n!=null?jS(e,o,vi(n)):r!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+vi(l):e.removeAttribute("name")}function wI(e,t,n,r,a,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){FS(e);return}n=n!=null?""+vi(n):"",t=t!=null?""+vi(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??a,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),FS(e)}function jS(e,t,n){t==="number"&&Tv(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ah(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+vi(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function EI(e,t,n){if(t!=null&&(t=""+vi(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+vi(n):""}function SI(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error($(92));if(Df(r)){if(1<r.length)throw Error($(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=vi(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),FS(e)}function Ph(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sK=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function B7(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||sK.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function CI(e,t,n){if(t!=null&&typeof t!="object")throw Error($(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&B7(e,a,r)}else for(var i in t)t.hasOwnProperty(i)&&B7(e,i,t[i])}function L5(e){if(e.indexOf("-")===-1)return!1;switch(e){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 cK=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dK=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function cv(e){return dK.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ul(){}var VS=null;function R5(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yh=null,Dh=null;function F7(e){var t=Kh(e);if(t&&(e=t.stateNode)){var n=e[ba]||null;e:switch(e=t.stateNode,t.type){case"input":if(HS(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+wi(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ba]||null;if(!a)throw Error($(90));HS(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&xI(r)}break e;case"textarea":EI(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ah(e,!!n.multiple,t,!1)}}}var rS=!1;function _I(e,t,n){if(rS)return e(t,n);rS=!0;try{var r=e(t);return r}finally{if(rS=!1,(yh!==null||Dh!==null)&&(dy(),yh&&(t=yh,e=Dh,Dh=yh=null,F7(t),e)))for(t=0;t<e.length;t++)F7(e[t])}}function $f(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ba]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error($(231,t,typeof n));return n}var Vl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),GS=!1;if(Vl)try{uh={},Object.defineProperty(uh,"passive",{get:function(){GS=!0}}),window.addEventListener("test",uh,uh),window.removeEventListener("test",uh,uh)}catch{GS=!1}var uh,qs=null,N5=null,dv=null;function kI(){if(dv)return dv;var e,t=N5,n=t.length,r,a="value"in qs?qs.value:qs.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return dv=a.slice(e,1<r?1-r:void 0)}function uv(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Xb(){return!0}function H7(){return!1}function va(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xb:H7,this.isPropagationStopped=H7,this}return Ft(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xb)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xb)},persist:function(){},isPersistent:Xb}),t}var kd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jv=va(kd),hg=Ft({},kd,{view:0,detail:0}),uK=va(hg),aS,iS,Sf,ey=Ft({},hg,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:O5,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Sf&&(Sf&&e.type==="mousemove"?(aS=e.screenX-Sf.screenX,iS=e.screenY-Sf.screenY):iS=aS=0,Sf=e),aS)},movementY:function(e){return"movementY"in e?e.movementY:iS}}),j7=va(ey),hK=Ft({},ey,{dataTransfer:0}),mK=va(hK),pK=Ft({},hg,{relatedTarget:0}),oS=va(pK),fK=Ft({},kd,{animationName:0,elapsedTime:0,pseudoElement:0}),gK=va(fK),bK=Ft({},kd,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vK=va(bK),yK=Ft({},kd,{data:0}),V7=va(yK),xK={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wK={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"},EK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SK(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=EK[e])?!!t[e]:!1}function O5(){return SK}var CK=Ft({},hg,{key:function(e){if(e.key){var t=xK[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=uv(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wK[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:O5,charCode:function(e){return e.type==="keypress"?uv(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?uv(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_K=va(CK),kK=Ft({},ey,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),G7=va(kK),TK=Ft({},hg,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:O5}),MK=va(TK),AK=Ft({},kd,{propertyName:0,elapsedTime:0,pseudoElement:0}),DK=va(AK),IK=Ft({},ey,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),LK=va(IK),RK=Ft({},kd,{newState:0,oldState:0}),NK=va(RK),OK=[9,13,27,32],z5=Vl&&"CompositionEvent"in window,Nf=null;Vl&&"documentMode"in document&&(Nf=document.documentMode);var zK=Vl&&"TextEvent"in window&&!Nf,TI=Vl&&(!z5||Nf&&8<Nf&&11>=Nf),Y7=" ",W7=!1;function MI(e,t){switch(e){case"keyup":return OK.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function AI(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xh=!1;function PK(e,t){switch(e){case"compositionend":return AI(t);case"keypress":return t.which!==32?null:(W7=!0,Y7);case"textInput":return e=t.data,e===Y7&&W7?null:e;default:return null}}function UK(e,t){if(xh)return e==="compositionend"||!z5&&MI(e,t)?(e=kI(),dv=N5=qs=null,xh=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return TI&&t.locale!=="ko"?null:t.data;default:return null}}var BK={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 K7(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BK[e.type]:t==="textarea"}function DI(e,t,n,r){yh?Dh?Dh.push(r):Dh=[r]:yh=r,t=Yv(t,"onChange"),0<t.length&&(n=new Jv("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Of=null,Xf=null;function FK(e){_9(e,0)}function ty(e){var t=If(e);if(xI(t))return e}function $7(e,t){if(e==="change")return t}var II=!1;Vl&&(Vl?(qb="oninput"in document,qb||(lS=document.createElement("div"),lS.setAttribute("oninput","return;"),qb=typeof lS.oninput=="function"),Zb=qb):Zb=!1,II=Zb&&(!document.documentMode||9<document.documentMode));var Zb,qb,lS;function X7(){Of&&(Of.detachEvent("onpropertychange",LI),Xf=Of=null)}function LI(e){if(e.propertyName==="value"&&ty(Xf)){var t=[];DI(t,Xf,e,R5(e)),_I(FK,t)}}function HK(e,t,n){e==="focusin"?(X7(),Of=t,Xf=n,Of.attachEvent("onpropertychange",LI)):e==="focusout"&&X7()}function jK(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ty(Xf)}function VK(e,t){if(e==="click")return ty(t)}function GK(e,t){if(e==="input"||e==="change")return ty(t)}function YK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xa=typeof Object.is=="function"?Object.is:YK;function Zf(e,t){if(Xa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!US.call(t,a)||!Xa(e[a],t[a]))return!1}return!0}function Z7(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function q7(e,t){var n=Z7(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Z7(n)}}function RI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?RI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function NI(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Tv(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tv(e.document)}return t}function P5(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var WK=Vl&&"documentMode"in document&&11>=document.documentMode,wh=null,YS=null,zf=null,WS=!1;function Q7(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;WS||wh==null||wh!==Tv(r)||(r=wh,"selectionStart"in r&&P5(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zf&&Zf(zf,r)||(zf=r,r=Yv(YS,"onSelect"),0<r.length&&(t=new Jv("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=wh)))}function dd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Eh={animationend:dd("Animation","AnimationEnd"),animationiteration:dd("Animation","AnimationIteration"),animationstart:dd("Animation","AnimationStart"),transitionrun:dd("Transition","TransitionRun"),transitionstart:dd("Transition","TransitionStart"),transitioncancel:dd("Transition","TransitionCancel"),transitionend:dd("Transition","TransitionEnd")},sS={},OI={};Vl&&(OI=document.createElement("div").style,"AnimationEvent"in window||(delete Eh.animationend.animation,delete Eh.animationiteration.animation,delete Eh.animationstart.animation),"TransitionEvent"in window||delete Eh.transitionend.transition);function Td(e){if(sS[e])return sS[e];if(!Eh[e])return e;var t=Eh[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in OI)return sS[e]=t[n];return e}var zI=Td("animationend"),PI=Td("animationiteration"),UI=Td("animationstart"),KK=Td("transitionrun"),$K=Td("transitionstart"),XK=Td("transitioncancel"),BI=Td("transitionend"),FI=new Map,KS="abort auxClick beforeToggle 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(" ");KS.push("scrollEnd");function ao(e,t){FI.set(e,t),_d(t,[e])}var Mv=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bi=[],Sh=0,U5=0;function ny(){for(var e=Sh,t=U5=Sh=0;t<e;){var n=bi[t];bi[t++]=null;var r=bi[t];bi[t++]=null;var a=bi[t];bi[t++]=null;var i=bi[t];if(bi[t++]=null,r!==null&&a!==null){var o=r.pending;o===null?a.next=a:(a.next=o.next,o.next=a),r.pending=a}i!==0&&HI(n,a,i)}}function ry(e,t,n,r){bi[Sh++]=e,bi[Sh++]=t,bi[Sh++]=n,bi[Sh++]=r,U5|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function B5(e,t,n,r){return ry(e,t,n,r),Av(e)}function Md(e,t){return ry(e,null,null,t),Av(e)}function HI(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,r=i.alternate,r!==null&&(r.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-Ka(n),e=i.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),i):null}function Av(e){if(50<Yf)throw Yf=0,p5=null,Error($(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ch={};function ZK(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Va(e,t,n,r){return new ZK(e,t,n,r)}function F5(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fl(e,t){var n=e.alternate;return n===null?(n=Va(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function jI(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hv(e,t,n,r,a,i){var o=0;if(r=e,typeof e=="function")F5(e)&&(o=1);else if(typeof e=="string")o=J$(e,n,Fo.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case NS:return e=Va(31,n,t,a),e.elementType=NS,e.lanes=i,e;case gh:return gd(n.children,a,i,t);case lI:o=8,a|=24;break;case IS:return e=Va(12,n,t,a|2),e.elementType=IS,e.lanes=i,e;case LS:return e=Va(13,n,t,a),e.elementType=LS,e.lanes=i,e;case RS:return e=Va(19,n,t,a),e.elementType=RS,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Pl:o=10;break e;case sI:o=9;break e;case k5:o=11;break e;case T5:o=14;break e;case Gs:o=16,r=null;break e}o=29,n=Error($(130,e===null?"null":typeof e,"")),r=null}return t=Va(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function gd(e,t,n,r){return e=Va(7,e,r,t),e.lanes=n,e}function cS(e,t,n){return e=Va(6,e,null,t),e.lanes=n,e}function VI(e){var t=Va(18,null,null,0);return t.stateNode=e,t}function dS(e,t,n){return t=Va(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var J7=new WeakMap;function Ei(e,t){if(typeof e=="object"&&e!==null){var n=J7.get(e);return n!==void 0?n:(t={value:e,source:t,stack:N7(t)},J7.set(e,t),t)}return{value:e,source:t,stack:N7(t)}}var _h=[],kh=0,Dv=null,qf=0,yi=[],xi=0,dc=null,Po=1,Uo="";function Ol(e,t){_h[kh++]=qf,_h[kh++]=Dv,Dv=e,qf=t}function GI(e,t,n){yi[xi++]=Po,yi[xi++]=Uo,yi[xi++]=dc,dc=e;var r=Po;e=Uo;var a=32-Ka(r)-1;r&=~(1<<a),n+=1;var i=32-Ka(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Po=1<<32-Ka(t)+a|n<<a|r,Uo=i+e}else Po=1<<i|n<<a|r,Uo=e}function H5(e){e.return!==null&&(Ol(e,1),GI(e,1,0))}function j5(e){for(;e===Dv;)Dv=_h[--kh],_h[kh]=null,qf=_h[--kh],_h[kh]=null;for(;e===dc;)dc=yi[--xi],yi[xi]=null,Uo=yi[--xi],yi[xi]=null,Po=yi[--xi],yi[xi]=null}function YI(e,t){yi[xi++]=Po,yi[xi++]=Uo,yi[xi++]=dc,Po=t.id,Uo=t.overflow,dc=e}var gr=null,Bt=null,Xe=!1,nc=null,Si=!1,$S=Error($(519));function uc(e){var t=Error($(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qf(Ei(t,e)),$S}function eD(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[fr]=e,t[ba]=r,n){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(n=0;n<ng.length;n++)Ue(ng[n],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),wI(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),SI(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||T9(t.textContent,n)?(r.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),r.onScroll!=null&&Ue("scroll",t),r.onScrollEnd!=null&&Ue("scrollend",t),r.onClick!=null&&(t.onclick=Ul),t=!0):t=!1,t||uc(e,!0)}function tD(e){for(gr=e.return;gr;)switch(gr.tag){case 5:case 31:case 13:Si=!1;return;case 27:case 3:Si=!0;return;default:gr=gr.return}}function hh(e){if(e!==gr)return!1;if(!Xe)return tD(e),Xe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||y5(e.type,e.memoizedProps)),n=!n),n&&Bt&&uc(e),tD(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(317));Bt=VD(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(317));Bt=VD(e)}else t===27?(t=Bt,fc(e.type)?(e=S5,S5=null,Bt=e):Bt=t):Bt=gr?_i(e.stateNode.nextSibling):null;return!0}function xd(){Bt=gr=null,Xe=!1}function uS(){var e=nc;return e!==null&&(fa===null?fa=e:fa.push.apply(fa,e),nc=null),e}function Qf(e){nc===null?nc=[e]:nc.push(e)}var XS=Ho(null),Ad=null,Bl=null;function Ws(e,t,n){At(XS,t._currentValue),t._currentValue=n}function Hl(e){e._currentValue=XS.current,tr(XS)}function ZS(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function qS(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var o=a.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),ZS(i.return,n,e),r||(o=null);break e}i=l.next}}else if(a.tag===18){if(o=a.return,o===null)throw Error($(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),ZS(o,n,e),o=null}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}}function $h(e,t,n,r){e=null;for(var a=t,i=!1;a!==null;){if(!i){if((a.flags&524288)!==0)i=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var o=a.alternate;if(o===null)throw Error($(387));if(o=o.memoizedProps,o!==null){var l=a.type;Xa(a.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(a===Sv.current){if(o=a.alternate,o===null)throw Error($(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(ag):e=[ag])}a=a.return}e!==null&&qS(t,e,n,r),t.flags|=262144}function Iv(e){for(e=e.firstContext;e!==null;){if(!Xa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wd(e){Ad=e,Bl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function br(e){return WI(Ad,e)}function Qb(e,t){return Ad===null&&wd(e),WI(e,t)}function WI(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Bl===null){if(e===null)throw Error($(308));Bl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Bl=Bl.next=t;return n}var qK=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},QK=Un.unstable_scheduleCallback,JK=Un.unstable_NormalPriority,kn={$$typeof:Pl,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function V5(){return{controller:new qK,data:new Map,refCount:0}}function mg(e){e.refCount--,e.refCount===0&&QK(JK,function(){e.controller.abort()})}var Pf=null,QS=0,Uh=0,Ih=null;function e$(e,t){if(Pf===null){var n=Pf=[];QS=0,Uh=p4(),Ih={status:"pending",value:void 0,then:function(r){n.push(r)}}}return QS++,t.then(nD,nD),t}function nD(){if(--QS===0&&Pf!==null){Ih!==null&&(Ih.status="fulfilled");var e=Pf;Pf=null,Uh=0,Ih=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function t$(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(r.status="rejected",r.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),r}var rD=ye.S;ye.S=function(e,t){o9=Ya(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&e$(e,t),rD!==null&&rD(e,t)};var bd=Ho(null);function G5(){var e=bd.current;return e!==null?e:Tt.pooledCache}function mv(e,t){t===null?At(bd,bd.current):At(bd,t.pool)}function KI(){var e=G5();return e===null?null:{parent:kn._currentValue,pool:e}}var Xh=Error($(460)),Y5=Error($(474)),ay=Error($(542)),Lv={then:function(){}};function aD(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $I(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ul,Ul),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oD(e),e;default:if(typeof t.status=="string")t.then(Ul,Ul);else{if(e=Tt,e!==null&&100<e.shellSuspendCounter)throw Error($(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=r}},function(r){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oD(e),e}throw vd=t,Xh}}function md(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(vd=n,Xh):n}}var vd=null;function iD(){if(vd===null)throw Error($(459));var e=vd;return vd=null,e}function oD(e){if(e===Xh||e===ay)throw Error($(483))}var Lh=null,Jf=0;function Jb(e){var t=Jf;return Jf+=1,Lh===null&&(Lh=[]),$I(Lh,e,t)}function Cf(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ev(e,t){throw t.$$typeof===HW?Error($(525)):(e=Object.prototype.toString.call(t),Error($(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function XI(e){function t(g,v){if(e){var b=g.deletions;b===null?(g.deletions=[v],g.flags|=16):b.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g){for(var v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function a(g,v){return g=Fl(g,v),g.index=0,g.sibling=null,g}function i(g,v,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<v?(g.flags|=67108866,v):b):(g.flags|=67108866,v)):(g.flags|=1048576,v)}function o(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function l(g,v,b,w){return v===null||v.tag!==6?(v=cS(b,g.mode,w),v.return=g,v):(v=a(v,b),v.return=g,v)}function c(g,v,b,w){var S=b.type;return S===gh?d(g,v,b.props.children,w,b.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Gs&&md(S)===v.type)?(v=a(v,b.props),Cf(v,b),v.return=g,v):(v=hv(b.type,b.key,b.props,null,g.mode,w),Cf(v,b),v.return=g,v)}function s(g,v,b,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=dS(b,g.mode,w),v.return=g,v):(v=a(v,b.children||[]),v.return=g,v)}function d(g,v,b,w,S){return v===null||v.tag!==7?(v=gd(b,g.mode,w,S),v.return=g,v):(v=a(v,b),v.return=g,v)}function u(g,v,b){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=cS(""+v,g.mode,b),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Gb:return b=hv(v.type,v.key,v.props,null,g.mode,b),Cf(b,v),b.return=g,b;case Af:return v=dS(v,g.mode,b),v.return=g,v;case Gs:return v=md(v),u(g,v,b)}if(Df(v)||Ef(v))return v=gd(v,g.mode,b,null),v.return=g,v;if(typeof v.then=="function")return u(g,Jb(v),b);if(v.$$typeof===Pl)return u(g,Qb(g,v),b);ev(g,v)}return null}function h(g,v,b,w){var S=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return S!==null?null:l(g,v,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Gb:return b.key===S?c(g,v,b,w):null;case Af:return b.key===S?s(g,v,b,w):null;case Gs:return b=md(b),h(g,v,b,w)}if(Df(b)||Ef(b))return S!==null?null:d(g,v,b,w,null);if(typeof b.then=="function")return h(g,v,Jb(b),w);if(b.$$typeof===Pl)return h(g,v,Qb(g,b),w);ev(g,b)}return null}function m(g,v,b,w,S){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return g=g.get(b)||null,l(v,g,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Gb:return g=g.get(w.key===null?b:w.key)||null,c(v,g,w,S);case Af:return g=g.get(w.key===null?b:w.key)||null,s(v,g,w,S);case Gs:return w=md(w),m(g,v,b,w,S)}if(Df(w)||Ef(w))return g=g.get(b)||null,d(v,g,w,S,null);if(typeof w.then=="function")return m(g,v,b,Jb(w),S);if(w.$$typeof===Pl)return m(g,v,b,Qb(v,w),S);ev(v,w)}return null}function p(g,v,b,w){for(var S=null,_=null,C=v,k=v=0,T=null;C!==null&&k<b.length;k++){C.index>k?(T=C,C=null):T=C.sibling;var I=h(g,C,b[k],w);if(I===null){C===null&&(C=T);break}e&&C&&I.alternate===null&&t(g,C),v=i(I,v,k),_===null?S=I:_.sibling=I,_=I,C=T}if(k===b.length)return n(g,C),Xe&&Ol(g,k),S;if(C===null){for(;k<b.length;k++)C=u(g,b[k],w),C!==null&&(v=i(C,v,k),_===null?S=C:_.sibling=C,_=C);return Xe&&Ol(g,k),S}for(C=r(C);k<b.length;k++)T=m(C,g,k,b[k],w),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?k:T.key),v=i(T,v,k),_===null?S=T:_.sibling=T,_=T);return e&&C.forEach(function(A){return t(g,A)}),Xe&&Ol(g,k),S}function f(g,v,b,w){if(b==null)throw Error($(151));for(var S=null,_=null,C=v,k=v=0,T=null,I=b.next();C!==null&&!I.done;k++,I=b.next()){C.index>k?(T=C,C=null):T=C.sibling;var A=h(g,C,I.value,w);if(A===null){C===null&&(C=T);break}e&&C&&A.alternate===null&&t(g,C),v=i(A,v,k),_===null?S=A:_.sibling=A,_=A,C=T}if(I.done)return n(g,C),Xe&&Ol(g,k),S;if(C===null){for(;!I.done;k++,I=b.next())I=u(g,I.value,w),I!==null&&(v=i(I,v,k),_===null?S=I:_.sibling=I,_=I);return Xe&&Ol(g,k),S}for(C=r(C);!I.done;k++,I=b.next())I=m(C,g,k,I.value,w),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?k:I.key),v=i(I,v,k),_===null?S=I:_.sibling=I,_=I);return e&&C.forEach(function(O){return t(g,O)}),Xe&&Ol(g,k),S}function x(g,v,b,w){if(typeof b=="object"&&b!==null&&b.type===gh&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Gb:e:{for(var S=b.key;v!==null;){if(v.key===S){if(S=b.type,S===gh){if(v.tag===7){n(g,v.sibling),w=a(v,b.props.children),w.return=g,g=w;break e}}else if(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Gs&&md(S)===v.type){n(g,v.sibling),w=a(v,b.props),Cf(w,b),w.return=g,g=w;break e}n(g,v);break}else t(g,v);v=v.sibling}b.type===gh?(w=gd(b.props.children,g.mode,w,b.key),w.return=g,g=w):(w=hv(b.type,b.key,b.props,null,g.mode,w),Cf(w,b),w.return=g,g=w)}return o(g);case Af:e:{for(S=b.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(g,v.sibling),w=a(v,b.children||[]),w.return=g,g=w;break e}else{n(g,v);break}else t(g,v);v=v.sibling}w=dS(b,g.mode,w),w.return=g,g=w}return o(g);case Gs:return b=md(b),x(g,v,b,w)}if(Df(b))return p(g,v,b,w);if(Ef(b)){if(S=Ef(b),typeof S!="function")throw Error($(150));return b=S.call(b),f(g,v,b,w)}if(typeof b.then=="function")return x(g,v,Jb(b),w);if(b.$$typeof===Pl)return x(g,v,Qb(g,b),w);ev(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,v!==null&&v.tag===6?(n(g,v.sibling),w=a(v,b),w.return=g,g=w):(n(g,v),w=cS(b,g.mode,w),w.return=g,g=w),o(g)):n(g,v)}return function(g,v,b,w){try{Jf=0;var S=x(g,v,b,w);return Lh=null,S}catch(C){if(C===Xh||C===ay)throw C;var _=Va(29,C,null,g.mode);return _.lanes=w,_.return=g,_}}}var Ed=XI(!0),ZI=XI(!1),Ys=!1;function W5(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function JS(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function rc(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ac(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ot&2)!==0){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=Av(e),HI(e,null,n),t}return ry(e,r,t,n),Av(e)}function Uf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pI(e,n)}}function hS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var e5=!1;function Bf(){if(e5){var e=Ih;if(e!==null)throw e}}function Ff(e,t,n,r){e5=!1;var a=e.updateQueue;Ys=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,s=c.next;c.next=null,o===null?i=s:o.next=s,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=s:l.next=s,d.lastBaseUpdate=c))}if(i!==null){var u=a.baseState;o=0,d=s=c=null,l=i;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(Ge&h)===h:(r&h)===h){h!==0&&h===Uh&&(e5=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var p=e,f=l;h=t;var x=n;switch(f.tag){case 1:if(p=f.payload,typeof p=="function"){u=p.call(x,u,h);break e}u=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=f.payload,h=typeof p=="function"?p.call(x,u,h):p,h==null)break e;u=Ft({},u,h);break e;case 2:Ys=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=a.callbacks,m===null?a.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(s=d=m,c=u):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;m=l,l=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(!0);d===null&&(c=u),a.baseState=c,a.firstBaseUpdate=s,a.lastBaseUpdate=d,i===null&&(a.shared.lanes=0),mc|=o,e.lanes=o,e.memoizedState=u}}function qI(e,t){if(typeof e!="function")throw Error($(191,e));e.call(t)}function QI(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qI(n[e],t)}var Bh=Ho(null),Rv=Ho(0);function lD(e,t){e=Kl,At(Rv,e),At(Bh,t),Kl=e|t.baseLanes}function t5(){At(Rv,Kl),At(Bh,Bh.current)}function K5(){Kl=Rv.current,tr(Bh),tr(Rv)}var Za=Ho(null),Ci=null;function Ks(e){var t=e.alternate;At(yn,yn.current&1),At(Za,e),Ci===null&&(t===null||Bh.current!==null||t.memoizedState!==null)&&(Ci=e)}function n5(e){At(yn,yn.current),At(Za,e),Ci===null&&(Ci=e)}function JI(e){e.tag===22?(At(yn,yn.current),At(Za,e),Ci===null&&(Ci=e)):$s(e)}function $s(){At(yn,yn.current),At(Za,Za.current)}function ja(e){tr(Za),Ci===e&&(Ci=null),tr(yn)}var yn=Ho(0);function Nv(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||w5(n)||E5(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Gl=0,De=null,St=null,Cn=null,Ov=!1,Rh=!1,Sd=!1,zv=0,eg=0,Nh=null,n$=0;function ln(){throw Error($(321))}function $5(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Xa(e[n],t[n]))return!1;return!0}function X5(e,t,n,r,a,i){return Gl=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ye.H=e===null||e.memoizedState===null?DL:o4,Sd=!1,i=n(r,a),Sd=!1,Rh&&(i=tL(t,n,r,a)),eL(e),i}function eL(e){ye.H=tg;var t=St!==null&&St.next!==null;if(Gl=0,Cn=St=De=null,Ov=!1,eg=0,Nh=null,t)throw Error($(300));e===null||Tn||(e=e.dependencies,e!==null&&Iv(e)&&(Tn=!0))}function tL(e,t,n,r){De=e;var a=0;do{if(Rh&&(Nh=null),eg=0,Rh=!1,25<=a)throw Error($(301));if(a+=1,Cn=St=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}ye.H=IL,i=t(n,r)}while(Rh);return i}function r$(){var e=ye.H,t=e.useState()[0];return t=typeof t.then=="function"?pg(t):t,e=e.useState()[0],(St!==null?St.memoizedState:null)!==e&&(De.flags|=1024),t}function Z5(){var e=zv!==0;return zv=0,e}function q5(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Q5(e){if(Ov){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ov=!1}Gl=0,Cn=St=De=null,Rh=!1,eg=zv=0,Nh=null}function Wr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?De.memoizedState=Cn=e:Cn=Cn.next=e,Cn}function xn(){if(St===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=Cn===null?De.memoizedState:Cn.next;if(t!==null)Cn=t,St=e;else{if(e===null)throw De.alternate===null?Error($(467)):Error($(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Cn===null?De.memoizedState=Cn=e:Cn=Cn.next=e}return Cn}function iy(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pg(e){var t=eg;return eg+=1,Nh===null&&(Nh=[]),e=$I(Nh,e,t),t=De,(Cn===null?t.memoizedState:Cn.next)===null&&(t=t.alternate,ye.H=t===null||t.memoizedState===null?DL:o4),e}function oy(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pg(e);if(e.$$typeof===Pl)return br(e)}throw Error($(438,String(e)))}function J5(e){var t=null,n=De.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=De.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=iy(),De.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=jW;return t.index++,n}function Yl(e,t){return typeof t=="function"?t(e):t}function pv(e){var t=xn();return e4(t,St,e)}function e4(e,t,n){var r=e.queue;if(r===null)throw Error($(311));r.lastRenderedReducer=n;var a=e.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}t.baseQueue=a=i,r.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var l=o=null,c=null,s=t,d=!1;do{var u=s.lane&-536870913;if(u!==s.lane?(Ge&u)===u:(Gl&u)===u){var h=s.revertLane;if(h===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null}),u===Uh&&(d=!0);else if((Gl&h)===h){s=s.next,h===Uh&&(d=!0);continue}else u={lane:0,revertLane:s.revertLane,gesture:null,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},c===null?(l=c=u,o=i):c=c.next=u,De.lanes|=h,mc|=h;u=s.action,Sd&&n(i,u),i=s.hasEagerState?s.eagerState:n(i,u)}else h={lane:u,revertLane:s.revertLane,gesture:s.gesture,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},c===null?(l=c=h,o=i):c=c.next=h,De.lanes|=u,mc|=u;s=s.next}while(s!==null&&s!==t);if(c===null?o=i:c.next=l,!Xa(i,e.memoizedState)&&(Tn=!0,d&&(n=Ih,n!==null)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=c,r.lastRenderedState=i}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function mS(e){var t=xn(),n=t.queue;if(n===null)throw Error($(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);Xa(i,t.memoizedState)||(Tn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function nL(e,t,n){var r=De,a=xn(),i=Xe;if(i){if(n===void 0)throw Error($(407));n=n()}else n=t();var o=!Xa((St||a).memoizedState,n);if(o&&(a.memoizedState=n,Tn=!0),a=a.queue,t4(iL.bind(null,r,a,e),[e]),a.getSnapshot!==t||o||Cn!==null&&Cn.memoizedState.tag&1){if(r.flags|=2048,Fh(9,{destroy:void 0},aL.bind(null,r,a,n,t),null),Tt===null)throw Error($(349));i||(Gl&127)!==0||rL(r,t,n)}return n}function rL(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t=iy(),De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function aL(e,t,n,r){t.value=n,t.getSnapshot=r,oL(t)&&lL(e)}function iL(e,t,n){return n(function(){oL(t)&&lL(e)})}function oL(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Xa(e,n)}catch{return!0}}function lL(e){var t=Md(e,2);t!==null&&ga(t,e,2)}function r5(e){var t=Wr();if(typeof e=="function"){var n=e;if(e=n(),Sd){Zs(!0);try{n()}finally{Zs(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:e},t}function sL(e,t,n,r){return e.baseState=n,e4(e,St,typeof r=="function"?r:Yl)}function a$(e,t,n,r,a){if(sy(e))throw Error($(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};ye.T!==null?n(!0):i.isTransition=!1,r(i),n=t.pending,n===null?(i.next=t.pending=i,cL(t,i)):(i.next=n.next,t.pending=n.next=i)}}function cL(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var i=ye.T,o={};ye.T=o;try{var l=n(a,r),c=ye.S;c!==null&&c(o,l),sD(e,t,l)}catch(s){a5(e,t,s)}finally{i!==null&&o.types!==null&&(i.types=o.types),ye.T=i}}else try{i=n(a,r),sD(e,t,i)}catch(s){a5(e,t,s)}}function sD(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){cD(e,t,r)},function(r){return a5(e,t,r)}):cD(e,t,n)}function cD(e,t,n){t.status="fulfilled",t.value=n,dL(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,cL(e,n)))}function a5(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,dL(t),t=t.next;while(t!==r)}e.action=null}function dL(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function uL(e,t){return t}function dD(e,t){if(Xe){var n=Tt.formState;if(n!==null){e:{var r=De;if(Xe){if(Bt){t:{for(var a=Bt,i=Si;a.nodeType!==8;){if(!i){a=null;break t}if(a=_i(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){Bt=_i(a.nextSibling),r=a.data==="F!";break e}}uc(r)}r=!1}r&&(t=n[0])}}return n=Wr(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uL,lastRenderedState:t},n.queue=r,n=TL.bind(null,De,r),r.dispatch=n,r=r5(!1),i=i4.bind(null,De,!1,r.queue),r=Wr(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=a$.bind(null,De,a,i,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function uD(e){var t=xn();return hL(t,St,e)}function hL(e,t,n){if(t=e4(e,t,uL)[0],e=pv(Yl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=pg(t)}catch(o){throw o===Xh?ay:o}else r=t;t=xn();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(De.flags|=2048,Fh(9,{destroy:void 0},i$.bind(null,a,n),null)),[r,i,e]}function i$(e,t){e.action=t}function hD(e){var t=xn(),n=St;if(n!==null)return hL(t,n,e);xn(),t=t.memoizedState,n=xn();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fh(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=De.updateQueue,t===null&&(t=iy(),De.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function mL(){return xn().memoizedState}function fv(e,t,n,r){var a=Wr();De.flags|=e,a.memoizedState=Fh(1|t,{destroy:void 0},n,r===void 0?null:r)}function ly(e,t,n,r){var a=xn();r=r===void 0?null:r;var i=a.memoizedState.inst;St!==null&&r!==null&&$5(r,St.memoizedState.deps)?a.memoizedState=Fh(t,i,n,r):(De.flags|=e,a.memoizedState=Fh(1|t,i,n,r))}function mD(e,t){fv(8390656,8,e,t)}function t4(e,t){ly(2048,8,e,t)}function o$(e){De.flags|=4;var t=De.updateQueue;if(t===null)t=iy(),De.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function pL(e){var t=xn().memoizedState;return o$({ref:t,nextImpl:e}),function(){if((ot&2)!==0)throw Error($(440));return t.impl.apply(void 0,arguments)}}function fL(e,t){return ly(4,2,e,t)}function gL(e,t){return ly(4,4,e,t)}function bL(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vL(e,t,n){n=n!=null?n.concat([e]):null,ly(4,4,bL.bind(null,t,e),n)}function n4(){}function yL(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$5(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xL(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$5(t,r[1]))return r[0];if(r=e(),Sd){Zs(!0);try{e()}finally{Zs(!1)}}return n.memoizedState=[r,t],r}function r4(e,t,n){return n===void 0||(Gl&1073741824)!==0&&(Ge&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=s9(),De.lanes|=e,mc|=e,n)}function wL(e,t,n,r){return Xa(n,t)?n:Bh.current!==null?(e=r4(e,n,r),Xa(e,t)||(Tn=!0),e):(Gl&42)===0||(Gl&1073741824)!==0&&(Ge&261930)===0?(Tn=!0,e.memoizedState=n):(e=s9(),De.lanes|=e,mc|=e,t)}function EL(e,t,n,r,a){var i=lt.p;lt.p=i!==0&&8>i?i:8;var o=ye.T,l={};ye.T=l,i4(e,!1,t,n);try{var c=a(),s=ye.S;if(s!==null&&s(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=t$(c,r);Hf(e,t,d,$a(e))}else Hf(e,t,r,$a(e))}catch(u){Hf(e,t,{then:function(){},status:"rejected",reason:u},$a())}finally{lt.p=i,o!==null&&l.types!==null&&(o.types=l.types),ye.T=o}}function l$(){}function i5(e,t,n,r){if(e.tag!==5)throw Error($(476));var a=SL(e).queue;EL(e,a,t,fd,n===null?l$:function(){return CL(e),n(r)})}function SL(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fd,baseState:fd,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:fd},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function CL(e){var t=SL(e);t.next===null&&(t=e.alternate.memoizedState),Hf(e,t.next.queue,{},$a())}function a4(){return br(ag)}function _L(){return xn().memoizedState}function kL(){return xn().memoizedState}function s$(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=$a();e=rc(n);var r=ac(t,e,n);r!==null&&(ga(r,t,n),Uf(r,t,n)),t={cache:V5()},e.payload=t;return}t=t.return}}function c$(e,t,n){var r=$a();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sy(e)?ML(t,n):(n=B5(e,t,n,r),n!==null&&(ga(n,e,r),AL(n,t,r)))}function TL(e,t,n){var r=$a();Hf(e,t,n,r)}function Hf(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sy(e))ML(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(a.hasEagerState=!0,a.eagerState=l,Xa(l,o))return ry(e,t,a,0),Tt===null&&ny(),!1}catch{}if(n=B5(e,t,a,r),n!==null)return ga(n,e,r),AL(n,t,r),!0}return!1}function i4(e,t,n,r){if(r={lane:2,revertLane:p4(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sy(e)){if(t)throw Error($(479))}else t=B5(e,n,r,2),t!==null&&ga(t,e,2)}function sy(e){var t=e.alternate;return e===De||t!==null&&t===De}function ML(e,t){Rh=Ov=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function AL(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pI(e,n)}}var tg={readContext:br,use:oy,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};tg.useEffectEvent=ln;var DL={readContext:br,use:oy,useCallback:function(e,t){return Wr().memoizedState=[e,t===void 0?null:t],e},useContext:br,useEffect:mD,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,fv(4194308,4,bL.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fv(4194308,4,e,t)},useInsertionEffect:function(e,t){fv(4,2,e,t)},useMemo:function(e,t){var n=Wr();t=t===void 0?null:t;var r=e();if(Sd){Zs(!0);try{e()}finally{Zs(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Wr();if(n!==void 0){var a=n(t);if(Sd){Zs(!0);try{n(t)}finally{Zs(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=c$.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=Wr();return e={current:e},t.memoizedState=e},useState:function(e){e=r5(e);var t=e.queue,n=TL.bind(null,De,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:n4,useDeferredValue:function(e,t){var n=Wr();return r4(n,e,t)},useTransition:function(){var e=r5(!1);return e=EL.bind(null,De,e.queue,!0,!1),Wr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=De,a=Wr();if(Xe){if(n===void 0)throw Error($(407));n=n()}else{if(n=t(),Tt===null)throw Error($(349));(Ge&127)!==0||rL(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,mD(iL.bind(null,r,i,e),[e]),r.flags|=2048,Fh(9,{destroy:void 0},aL.bind(null,r,i,n,t),null),n},useId:function(){var e=Wr(),t=Tt.identifierPrefix;if(Xe){var n=Uo,r=Po;n=(r&~(1<<32-Ka(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=zv++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=n$++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:a4,useFormState:dD,useActionState:dD,useOptimistic:function(e){var t=Wr();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=i4.bind(null,De,!0,n),n.dispatch=t,[e,t]},useMemoCache:J5,useCacheRefresh:function(){return Wr().memoizedState=s$.bind(null,De)},useEffectEvent:function(e){var t=Wr(),n={impl:e};return t.memoizedState=n,function(){if((ot&2)!==0)throw Error($(440));return n.impl.apply(void 0,arguments)}}},o4={readContext:br,use:oy,useCallback:yL,useContext:br,useEffect:t4,useImperativeHandle:vL,useInsertionEffect:fL,useLayoutEffect:gL,useMemo:xL,useReducer:pv,useRef:mL,useState:function(){return pv(Yl)},useDebugValue:n4,useDeferredValue:function(e,t){var n=xn();return wL(n,St.memoizedState,e,t)},useTransition:function(){var e=pv(Yl)[0],t=xn().memoizedState;return[typeof e=="boolean"?e:pg(e),t]},useSyncExternalStore:nL,useId:_L,useHostTransitionStatus:a4,useFormState:uD,useActionState:uD,useOptimistic:function(e,t){var n=xn();return sL(n,St,e,t)},useMemoCache:J5,useCacheRefresh:kL};o4.useEffectEvent=pL;var IL={readContext:br,use:oy,useCallback:yL,useContext:br,useEffect:t4,useImperativeHandle:vL,useInsertionEffect:fL,useLayoutEffect:gL,useMemo:xL,useReducer:mS,useRef:mL,useState:function(){return mS(Yl)},useDebugValue:n4,useDeferredValue:function(e,t){var n=xn();return St===null?r4(n,e,t):wL(n,St.memoizedState,e,t)},useTransition:function(){var e=mS(Yl)[0],t=xn().memoizedState;return[typeof e=="boolean"?e:pg(e),t]},useSyncExternalStore:nL,useId:_L,useHostTransitionStatus:a4,useFormState:hD,useActionState:hD,useOptimistic:function(e,t){var n=xn();return St!==null?sL(n,St,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:J5,useCacheRefresh:kL};IL.useEffectEvent=pL;function pS(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ft({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var o5={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$a(),a=rc(r);a.payload=t,n!=null&&(a.callback=n),t=ac(e,a,r),t!==null&&(ga(t,e,r),Uf(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$a(),a=rc(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ac(e,a,r),t!==null&&(ga(t,e,r),Uf(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$a(),r=rc(n);r.tag=2,t!=null&&(r.callback=t),t=ac(e,r,n),t!==null&&(ga(t,e,n),Uf(t,e,n))}};function pD(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Zf(n,r)||!Zf(a,i):!0}function fD(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&o5.enqueueReplaceState(t,t.state,null)}function Cd(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=Ft({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function LL(e){Mv(e)}function RL(e){console.error(e)}function NL(e){Mv(e)}function Pv(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function gD(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function l5(e,t,n){return n=rc(n),n.tag=3,n.payload={element:null},n.callback=function(){Pv(e,t)},n}function OL(e){return e=rc(e),e.tag=3,e}function zL(e,t,n,r){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=r.value;e.payload=function(){return a(i)},e.callback=function(){gD(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){gD(t,n,r),typeof a!="function"&&(ic===null?ic=new Set([this]):ic.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function d$(e,t,n,r,a){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&$h(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Ci===null?jv():n.alternate===null&&sn===0&&(sn=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Lv?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),_S(e,r,a)),!1;case 22:return n.flags|=65536,r===Lv?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),_S(e,r,a)),!1}throw Error($(435,n.tag))}return _S(e,r,a),jv(),!1}if(Xe)return t=Za.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==$S&&(e=Error($(422),{cause:r}),Qf(Ei(e,n)))):(r!==$S&&(t=Error($(423),{cause:r}),Qf(Ei(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ei(r,n),a=l5(e.stateNode,r,a),hS(e,a),sn!==4&&(sn=2)),!1;var i=Error($(520),{cause:r});if(i=Ei(i,n),Gf===null?Gf=[i]:Gf.push(i),sn!==4&&(sn=2),t===null)return!0;r=Ei(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=l5(n.stateNode,r,e),hS(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(ic===null||!ic.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=OL(a),zL(a,e,n,r),hS(n,a),!1}n=n.return}while(n!==null);return!1}var l4=Error($(461)),Tn=!1;function pr(e,t,n,r){t.child=e===null?ZI(t,null,n,r):Ed(t,e.child,n,r)}function bD(e,t,n,r,a){n=n.render;var i=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return wd(t),r=X5(e,t,n,o,i,a),l=Z5(),e!==null&&!Tn?(q5(e,t,a),Wl(e,t,a)):(Xe&&l&&H5(t),t.flags|=1,pr(e,t,r,a),t.child)}function vD(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!F5(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,PL(e,t,i,r,a)):(e=hv(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!s4(e,a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Zf,n(o,r)&&e.ref===t.ref)return Wl(e,t,a)}return t.flags|=1,e=Fl(i,r),e.ref=t.ref,e.return=t,t.child=e}function PL(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Zf(i,r)&&e.ref===t.ref)if(Tn=!1,t.pendingProps=r=i,s4(e,a))(e.flags&131072)!==0&&(Tn=!0);else return t.lanes=e.lanes,Wl(e,t,a)}return s5(e,t,n,r,a)}function UL(e,t,n,r){var a=r.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|n:n,e!==null){for(r=t.child=e.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;r=a&~i}else r=0,t.child=null;return yD(e,t,i,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mv(t,i!==null?i.cachePool:null),i!==null?lD(t,i):t5(),JI(t);else return r=t.lanes=536870912,yD(e,t,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(mv(t,i.cachePool),lD(t,i),$s(t),t.memoizedState=null):(e!==null&&mv(t,null),t5(),$s(t));return pr(e,t,a,n),t.child}function Lf(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function yD(e,t,n,r,a){var i=G5();return i=i===null?null:{parent:kn._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&mv(t,null),t5(),JI(t),e!==null&&$h(e,t,r,!0),t.childLanes=a,null}function gv(e,t){return t=Uv({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xD(e,t,n){return Ed(t,e.child,null,n),e=gv(t,t.pendingProps),e.flags|=2,ja(t),t.memoizedState=null,e}function u$(e,t,n){var r=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(r.mode==="hidden")return e=gv(t,r),t.lanes=536870912,Lf(null,e);if(n5(t),(e=Bt)?(e=D9(e,Si),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dc!==null?{id:Po,overflow:Uo}:null,retryLane:536870912,hydrationErrors:null},n=VI(e),n.return=t,t.child=n,gr=t,Bt=null)):e=null,e===null)throw uc(t);return t.lanes=536870912,null}return gv(t,r)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(n5(t),a)if(t.flags&256)t.flags&=-257,t=xD(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error($(558));else if(Tn||$h(e,t,n,!1),a=(n&e.childLanes)!==0,Tn||a){if(r=Tt,r!==null&&(o=fI(r,n),o!==0&&o!==i.retryLane))throw i.retryLane=o,Md(e,o),ga(r,e,o),l4;jv(),t=xD(e,t,n)}else e=i.treeContext,Bt=_i(o.nextSibling),gr=t,Xe=!0,nc=null,Si=!1,e!==null&&YI(t,e),t=gv(t,r),t.flags|=4096;return t}return e=Fl(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bv(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error($(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function s5(e,t,n,r,a){return wd(t),n=X5(e,t,n,r,void 0,a),r=Z5(),e!==null&&!Tn?(q5(e,t,a),Wl(e,t,a)):(Xe&&r&&H5(t),t.flags|=1,pr(e,t,n,a),t.child)}function wD(e,t,n,r,a,i){return wd(t),t.updateQueue=null,n=tL(t,r,n,a),eL(e),r=Z5(),e!==null&&!Tn?(q5(e,t,i),Wl(e,t,i)):(Xe&&r&&H5(t),t.flags|=1,pr(e,t,n,i),t.child)}function ED(e,t,n,r,a){if(wd(t),t.stateNode===null){var i=Ch,o=n.contextType;typeof o=="object"&&o!==null&&(i=br(o)),i=new n(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=o5,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},W5(t),o=n.contextType,i.context=typeof o=="object"&&o!==null?br(o):Ch,i.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(pS(t,n,o,r),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&o5.enqueueReplaceState(i,i.state,null),Ff(t,r,i,a),Bf(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=Cd(n,l);i.props=c;var s=i.context,d=n.contextType;o=Ch,typeof d=="object"&&d!==null&&(o=br(d));var u=n.getDerivedStateFromProps;d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||s!==o)&&fD(t,i,r,o),Ys=!1;var h=t.memoizedState;i.state=h,Ff(t,r,i,a),Bf(),s=t.memoizedState,l||h!==s||Ys?(typeof u=="function"&&(pS(t,n,u,r),s=t.memoizedState),(c=Ys||pD(t,n,c,r,h,s,o))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=o,r=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,JS(e,t),o=t.memoizedProps,d=Cd(n,o),i.props=d,u=t.pendingProps,h=i.context,s=n.contextType,c=Ch,typeof s=="object"&&s!==null&&(c=br(s)),l=n.getDerivedStateFromProps,(s=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==u||h!==c)&&fD(t,i,r,c),Ys=!1,h=t.memoizedState,i.state=h,Ff(t,r,i,a),Bf();var m=t.memoizedState;o!==u||h!==m||Ys||e!==null&&e.dependencies!==null&&Iv(e.dependencies)?(typeof l=="function"&&(pS(t,n,l,r),m=t.memoizedState),(d=Ys||pD(t,n,d,r,h,m,c)||e!==null&&e.dependencies!==null&&Iv(e.dependencies))?(s||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,m,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,m,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),i.props=r,i.state=m,i.context=c,r=d):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,bv(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=Ed(t,e.child,null,a),t.child=Ed(t,null,n,a)):pr(e,t,n,a),t.memoizedState=i.state,e=t.child):e=Wl(e,t,a),e}function SD(e,t,n,r){return xd(),t.flags|=256,pr(e,t,n,r),t.child}var fS={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gS(e){return{baseLanes:e,cachePool:KI()}}function bS(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ga),e}function BL(e,t,n){var r=t.pendingProps,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(yn.current&2)!==0),o&&(a=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(a?Ks(t):$s(t),(e=Bt)?(e=D9(e,Si),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dc!==null?{id:Po,overflow:Uo}:null,retryLane:536870912,hydrationErrors:null},n=VI(e),n.return=t,t.child=n,gr=t,Bt=null)):e=null,e===null)throw uc(t);return E5(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,a?($s(t),a=t.mode,l=Uv({mode:"hidden",children:l},a),r=gd(r,a,n,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=gS(n),r.childLanes=bS(e,o,n),t.memoizedState=fS,Lf(null,r)):(Ks(t),c5(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(Ks(t),t.flags&=-257,t=vS(e,t,n)):t.memoizedState!==null?($s(t),t.child=e.child,t.flags|=128,t=null):($s(t),l=r.fallback,a=t.mode,r=Uv({mode:"visible",children:r.children},a),l=gd(l,a,n,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,Ed(t,e.child,null,n),r=t.child,r.memoizedState=gS(n),r.childLanes=bS(e,o,n),t.memoizedState=fS,t=Lf(null,r));else if(Ks(t),E5(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var s=o.dgst;o=s,r=Error($(419)),r.stack="",r.digest=o,Qf({value:r,source:null,stack:null}),t=vS(e,t,n)}else if(Tn||$h(e,t,n,!1),o=(n&e.childLanes)!==0,Tn||o){if(o=Tt,o!==null&&(r=fI(o,n),r!==0&&r!==c.retryLane))throw c.retryLane=r,Md(e,r),ga(o,e,r),l4;w5(l)||jv(),t=vS(e,t,n)}else w5(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Bt=_i(l.nextSibling),gr=t,Xe=!0,nc=null,Si=!1,e!==null&&YI(t,e),t=c5(t,r.children),t.flags|=4096);return t}return a?($s(t),l=r.fallback,a=t.mode,c=e.child,s=c.sibling,r=Fl(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,s!==null?l=Fl(s,l):(l=gd(l,a,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,Lf(null,r),r=t.child,l=e.child.memoizedState,l===null?l=gS(n):(a=l.cachePool,a!==null?(c=kn._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=KI(),l={baseLanes:l.baseLanes|n,cachePool:a}),r.memoizedState=l,r.childLanes=bS(e,o,n),t.memoizedState=fS,Lf(e.child,r)):(Ks(t),n=e.child,e=n.sibling,n=Fl(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function c5(e,t){return t=Uv({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Uv(e,t){return e=Va(22,e,null,t),e.lanes=0,e}function vS(e,t,n){return Ed(t,e.child,null,n),e=c5(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function CD(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ZS(e.return,t,n)}function yS(e,t,n,r,a,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=a,o.treeForkCount=i)}function FL(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;r=r.children;var o=yn.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,At(yn,o),pr(e,t,r,n),r=Xe?qf:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&CD(e,n,t);else if(e.tag===19)CD(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Nv(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),yS(t,!1,a,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Nv(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}yS(t,!0,n,null,i,r);break;case"together":yS(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Wl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mc|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($h(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error($(153));if(t.child!==null){for(e=t.child,n=Fl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function s4(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Iv(e)))}function h$(e,t,n){switch(t.tag){case 3:Cv(t,t.stateNode.containerInfo),Ws(t,kn,e.memoizedState.cache),xd();break;case 27:case 5:PS(t);break;case 4:Cv(t,t.stateNode.containerInfo);break;case 10:Ws(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,n5(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ks(t),t.flags|=128,null):(n&t.child.childLanes)!==0?BL(e,t,n):(Ks(t),e=Wl(e,t,n),e!==null?e.sibling:null);Ks(t);break;case 19:var a=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||($h(e,t,n,!1),r=(n&t.childLanes)!==0),a){if(r)return FL(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),At(yn,yn.current),r)break;return null;case 22:return t.lanes=0,UL(e,t,n,t.pendingProps);case 24:Ws(t,kn,e.memoizedState.cache)}return Wl(e,t,n)}function HL(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Tn=!0;else{if(!s4(e,n)&&(t.flags&128)===0)return Tn=!1,h$(e,t,n);Tn=(e.flags&131072)!==0}else Tn=!1,Xe&&(t.flags&1048576)!==0&&GI(t,qf,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=md(t.elementType),t.type=e,typeof e=="function")F5(e)?(r=Cd(e,r),t.tag=1,t=ED(null,t,e,r,n)):(t.tag=0,t=s5(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===k5){t.tag=11,t=bD(null,t,e,r,n);break e}else if(a===T5){t.tag=14,t=vD(null,t,e,r,n);break e}}throw t=OS(e)||e,Error($(306,t,""))}}return t;case 0:return s5(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cd(r,t.pendingProps),ED(e,t,r,a,n);case 3:e:{if(Cv(t,t.stateNode.containerInfo),e===null)throw Error($(387));r=t.pendingProps;var i=t.memoizedState;a=i.element,JS(e,t),Ff(t,r,null,n);var o=t.memoizedState;if(r=o.cache,Ws(t,kn,r),r!==i.cache&&qS(t,[kn],n,!0),Bf(),r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=SD(e,t,r,n);break e}else if(r!==a){a=Ei(Error($(424)),t),Qf(a),t=SD(e,t,r,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Bt=_i(e.firstChild),gr=t,Xe=!0,nc=null,Si=!0,n=ZI(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xd(),r===a){t=Wl(e,t,n);break e}pr(e,t,r,n)}t=t.child}return t;case 26:return bv(e,t),e===null?(n=WD(t.type,null,t.pendingProps,null))?t.memoizedState=n:Xe||(n=t.type,e=t.pendingProps,r=Wv(tc.current).createElement(n),r[fr]=t,r[ba]=e,vr(r,n,e),er(r),t.stateNode=r):t.memoizedState=WD(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return PS(t),e===null&&Xe&&(r=t.stateNode=I9(t.type,t.pendingProps,tc.current),gr=t,Si=!0,a=Bt,fc(t.type)?(S5=a,Bt=_i(r.firstChild)):Bt=a),pr(e,t,t.pendingProps.children,n),bv(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((a=r=Bt)&&(r=F$(r,t.type,t.pendingProps,Si),r!==null?(t.stateNode=r,gr=t,Bt=_i(r.firstChild),Si=!1,a=!0):a=!1),a||uc(t)),PS(t),a=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,r=i.children,y5(a,i)?r=null:o!==null&&y5(a,o)&&(t.flags|=32),t.memoizedState!==null&&(a=X5(e,t,r$,null,null,n),ag._currentValue=a),bv(e,t),pr(e,t,r,n),t.child;case 6:return e===null&&Xe&&((e=n=Bt)&&(n=H$(n,t.pendingProps,Si),n!==null?(t.stateNode=n,gr=t,Bt=null,e=!0):e=!1),e||uc(t)),null;case 13:return BL(e,t,n);case 4:return Cv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ed(t,null,r,n):pr(e,t,r,n),t.child;case 11:return bD(e,t,t.type,t.pendingProps,n);case 7:return pr(e,t,t.pendingProps,n),t.child;case 8:return pr(e,t,t.pendingProps.children,n),t.child;case 12:return pr(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ws(t,t.type,r.value),pr(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,wd(t),a=br(a),r=r(a),t.flags|=1,pr(e,t,r,n),t.child;case 14:return vD(e,t,t.type,t.pendingProps,n);case 15:return PL(e,t,t.type,t.pendingProps,n);case 19:return FL(e,t,n);case 31:return u$(e,t,n);case 22:return UL(e,t,n,t.pendingProps);case 24:return wd(t),r=br(kn),e===null?(a=G5(),a===null&&(a=Tt,i=V5(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:r,cache:a},W5(t),Ws(t,kn,a)):((e.lanes&n)!==0&&(JS(e,t),Ff(t,null,null,n),Bf()),a=e.memoizedState,i=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ws(t,kn,r)):(r=i.cache,Ws(t,kn,r),r!==a.cache&&qS(t,[kn],n,!0))),pr(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error($(156,t.tag))}function Il(e){e.flags|=4}function xS(e,t,n,r,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(u9())e.flags|=8192;else throw vd=Lv,Y5}else e.flags&=-16777217}function _D(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!N9(t))if(u9())e.flags|=8192;else throw vd=Lv,Y5}function tv(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hI():536870912,e.lanes|=t,Hh|=t)}function _f(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&65011712,r|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function m$(e,t,n){var r=t.pendingProps;switch(j5(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(t),null;case 1:return Ut(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Hl(kn),Oh(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(hh(t)?Il(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,uS())),Ut(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(Il(t),i!==null?(Ut(t),_D(t,i)):(Ut(t),xS(t,a,null,r,n))):i?i!==e.memoizedState?(Il(t),Ut(t),_D(t,i)):(Ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Il(t),Ut(t),xS(t,a,e,r,n)),null;case 27:if(_v(t),n=tc.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Il(t);else{if(!r){if(t.stateNode===null)throw Error($(166));return Ut(t),null}e=Fo.current,hh(t)?eD(t,e):(e=I9(a,r,n),t.stateNode=e,Il(t))}return Ut(t),null;case 5:if(_v(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Il(t);else{if(!r){if(t.stateNode===null)throw Error($(166));return Ut(t),null}if(i=Fo.current,hh(t))eD(t,i);else{var o=Wv(tc.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?o.createElement(a,{is:r.is}):o.createElement(a)}}i[fr]=t,i[ba]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(vr(i,a,r),a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Il(t)}}return Ut(t),xS(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Il(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error($(166));if(e=tc.current,hh(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=gr,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[fr]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||T9(e.nodeValue,n)),e||uc(t,!0)}else e=Wv(e).createTextNode(r),e[fr]=t,t.stateNode=e}return Ut(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=hh(t),n!==null){if(e===null){if(!r)throw Error($(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(557));e[fr]=t}else xd(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ut(t),e=!1}else n=uS(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ja(t),t):(ja(t),null);if((t.flags&128)!==0)throw Error($(558))}return Ut(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=hh(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error($(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error($(317));a[fr]=t}else xd(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ut(t),a=!1}else a=uS(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ja(t),t):(ja(t),null)}return ja(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),tv(t,t.updateQueue),Ut(t),null);case 4:return Oh(),e===null&&f4(t.stateNode.containerInfo),Ut(t),null;case 10:return Hl(t.type),Ut(t),null;case 19:if(tr(yn),r=t.memoizedState,r===null)return Ut(t),null;if(a=(t.flags&128)!==0,i=r.rendering,i===null)if(a)_f(r,!1);else{if(sn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Nv(e),i!==null){for(t.flags|=128,_f(r,!1),e=i.updateQueue,t.updateQueue=e,tv(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)jI(n,e),n=n.sibling;return At(yn,yn.current&1|2),Xe&&Ol(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ya()>Fv&&(t.flags|=128,a=!0,_f(r,!1),t.lanes=4194304)}else{if(!a)if(e=Nv(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,tv(t,e),_f(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Xe)return Ut(t),null}else 2*Ya()-r.renderingStartTime>Fv&&n!==536870912&&(t.flags|=128,a=!0,_f(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ya(),e.sibling=null,n=yn.current,At(yn,a?n&1|2:n&1),Xe&&Ol(t,r.treeForkCount),e):(Ut(t),null);case 22:case 23:return ja(t),K5(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(Ut(t),t.subtreeFlags&6&&(t.flags|=8192)):Ut(t),n=t.updateQueue,n!==null&&tv(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&tr(bd),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Hl(kn),Ut(t),null;case 25:return null;case 30:return null}throw Error($(156,t.tag))}function p$(e,t){switch(j5(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hl(kn),Oh(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _v(t),null;case 31:if(t.memoizedState!==null){if(ja(t),t.alternate===null)throw Error($(340));xd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ja(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));xd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tr(yn),null;case 4:return Oh(),null;case 10:return Hl(t.type),null;case 22:case 23:return ja(t),K5(),e!==null&&tr(bd),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Hl(kn),null;case 25:return null;default:return null}}function jL(e,t){switch(j5(t),t.tag){case 3:Hl(kn),Oh();break;case 26:case 27:case 5:_v(t);break;case 4:Oh();break;case 31:t.memoizedState!==null&&ja(t);break;case 13:ja(t);break;case 19:tr(yn);break;case 10:Hl(t.type);break;case 22:case 23:ja(t),K5(),e!==null&&tr(bd);break;case 24:Hl(kn)}}function fg(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var i=n.create,o=n.inst;r=i(),o.destroy=r}n=n.next}while(n!==a)}}catch(l){bt(t,t.return,l)}}function hc(e,t,n){try{var r=t.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var i=a.next;r=i;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,a=t;var c=n,s=l;try{s()}catch(d){bt(a,c,d)}}}r=r.next}while(r!==i)}}catch(d){bt(t,t.return,d)}}function VL(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{QI(t,n)}catch(r){bt(e,e.return,r)}}}function GL(e,t,n){n.props=Cd(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){bt(e,t,r)}}function jf(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(a){bt(e,t,a)}}function Bo(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(a){bt(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){bt(e,t,a)}else n.current=null}function YL(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(a){bt(e,e.return,a)}}function wS(e,t,n){try{var r=e.stateNode;N$(r,e.type,n,t),r[ba]=t}catch(a){bt(e,e.return,a)}}function WL(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fc(e.type)||e.tag===4}function ES(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||WL(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fc(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function d5(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ul));else if(r!==4&&(r===27&&fc(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(d5(e,t,n),e=e.sibling;e!==null;)d5(e,t,n),e=e.sibling}function Bv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&fc(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Bv(e,t,n),e=e.sibling;e!==null;)Bv(e,t,n),e=e.sibling}function KL(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);vr(t,r,n),t[fr]=e,t[ba]=n}catch(i){bt(e,e.return,i)}}var zl=!1,_n=!1,SS=!1,kD=typeof WeakSet=="function"?WeakSet:Set,Jn=null;function f$(e,t){if(e=e.containerInfo,b5=Zv,e=NI(e),P5(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,s=0,d=0,u=e,h=null;t:for(;;){for(var m;u!==n||a!==0&&u.nodeType!==3||(l=o+a),u!==i||r!==0&&u.nodeType!==3||(c=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(m=u.firstChild)!==null;)h=u,u=m;for(;;){if(u===e)break t;if(h===n&&++s===a&&(l=o),h===i&&++d===r&&(c=o),(m=u.nextSibling)!==null)break;u=h,h=u.parentNode}u=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(v5={focusedElem:e,selectionRange:n},Zv=!1,Jn=t;Jn!==null;)if(t=Jn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Jn=e;else for(;Jn!==null;){switch(t=Jn,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var p=Cd(n.type,a);e=r.getSnapshotBeforeUpdate(p,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(f){bt(n,n.return,f)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)x5(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":x5(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error($(163))}if(e=t.sibling,e!==null){e.return=t.return,Jn=e;break}Jn=t.return}}function $L(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Rl(e,n),r&4&&fg(5,n);break;case 1:if(Rl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){bt(n,n.return,o)}else{var a=Cd(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){bt(n,n.return,o)}}r&64&&VL(n),r&512&&jf(n,n.return);break;case 3:if(Rl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{QI(e,t)}catch(o){bt(n,n.return,o)}}break;case 27:t===null&&r&4&&KL(n);case 26:case 5:Rl(e,n),t===null&&r&4&&YL(n),r&512&&jf(n,n.return);break;case 12:Rl(e,n);break;case 31:Rl(e,n),r&4&&qL(e,n);break;case 13:Rl(e,n),r&4&&QL(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=C$.bind(null,n),j$(e,n))));break;case 22:if(r=n.memoizedState!==null||zl,!r){t=t!==null&&t.memoizedState!==null||_n,a=zl;var i=_n;zl=r,(_n=t)&&!i?Nl(e,n,(n.subtreeFlags&8772)!==0):Rl(e,n),zl=a,_n=i}break;case 30:break;default:Rl(e,n)}}function XL(e){var t=e.alternate;t!==null&&(e.alternate=null,XL(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&I5(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Gt=null,pa=!1;function Ll(e,t,n){for(n=n.child;n!==null;)ZL(e,t,n),n=n.sibling}function ZL(e,t,n){if(Wa&&typeof Wa.onCommitFiberUnmount=="function")try{Wa.onCommitFiberUnmount(sg,n)}catch{}switch(n.tag){case 26:_n||Bo(n,t),Ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:_n||Bo(n,t);var r=Gt,a=pa;fc(n.type)&&(Gt=n.stateNode,pa=!1),Ll(e,t,n),Wf(n.stateNode),Gt=r,pa=a;break;case 5:_n||Bo(n,t);case 6:if(r=Gt,a=pa,Gt=null,Ll(e,t,n),Gt=r,pa=a,Gt!==null)if(pa)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(n.stateNode)}catch(i){bt(n,t,i)}else try{Gt.removeChild(n.stateNode)}catch(i){bt(n,t,i)}break;case 18:Gt!==null&&(pa?(e=Gt,HD(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Yh(e)):HD(Gt,n.stateNode));break;case 4:r=Gt,a=pa,Gt=n.stateNode.containerInfo,pa=!0,Ll(e,t,n),Gt=r,pa=a;break;case 0:case 11:case 14:case 15:hc(2,n,t),_n||hc(4,n,t),Ll(e,t,n);break;case 1:_n||(Bo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&GL(n,t,r)),Ll(e,t,n);break;case 21:Ll(e,t,n);break;case 22:_n=(r=_n)||n.memoizedState!==null,Ll(e,t,n),_n=r;break;default:Ll(e,t,n)}}function qL(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yh(e)}catch(n){bt(t,t.return,n)}}}function QL(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yh(e)}catch(n){bt(t,t.return,n)}}function g$(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kD),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kD),t;default:throw Error($(435,e.tag))}}function nv(e,t){var n=g$(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var a=_$.bind(null,e,r);r.then(a,a)}})}function ha(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(fc(l.type)){Gt=l.stateNode,pa=!1;break e}break;case 5:Gt=l.stateNode,pa=!1;break e;case 3:case 4:Gt=l.stateNode.containerInfo,pa=!0;break e}l=l.return}if(Gt===null)throw Error($(160));ZL(i,o,a),Gt=null,pa=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)JL(t,e),t=t.sibling}var ro=null;function JL(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ha(t,e),ma(e),r&4&&(hc(3,e,e.return),fg(3,e),hc(5,e,e.return));break;case 1:ha(t,e),ma(e),r&512&&(_n||n===null||Bo(n,n.return)),r&64&&zl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ro;if(ha(t,e),ma(e),r&512&&(_n||n===null||Bo(n,n.return)),r&4){var i=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(r){case"title":i=a.getElementsByTagName("title")[0],(!i||i[ug]||i[fr]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(r),a.head.insertBefore(i,a.querySelector("head > title"))),vr(i,r,n),i[fr]=e,er(i),r=i;break e;case"link":var o=$D("link","href",a).get(r+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}i=a.createElement(r),vr(i,r,n),a.head.appendChild(i);break;case"meta":if(o=$D("meta","content",a).get(r+(n.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}i=a.createElement(r),vr(i,r,n),a.head.appendChild(i);break;default:throw Error($(468,r))}i[fr]=e,er(i),r=i}e.stateNode=r}else XD(a,e.type,e.stateNode);else e.stateNode=KD(a,r,e.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?XD(a,e.type,e.stateNode):KD(a,r,e.memoizedProps)):r===null&&e.stateNode!==null&&wS(e,e.memoizedProps,n.memoizedProps)}break;case 27:ha(t,e),ma(e),r&512&&(_n||n===null||Bo(n,n.return)),n!==null&&r&4&&wS(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ha(t,e),ma(e),r&512&&(_n||n===null||Bo(n,n.return)),e.flags&32){a=e.stateNode;try{Ph(a,"")}catch(p){bt(e,e.return,p)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,wS(e,a,n!==null?n.memoizedProps:a)),r&1024&&(SS=!0);break;case 6:if(ha(t,e),ma(e),r&4){if(e.stateNode===null)throw Error($(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(p){bt(e,e.return,p)}}break;case 3:if(xv=null,a=ro,ro=Kv(t.containerInfo),ha(t,e),ro=a,ma(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Yh(t.containerInfo)}catch(p){bt(e,e.return,p)}SS&&(SS=!1,e9(e));break;case 4:r=ro,ro=Kv(e.stateNode.containerInfo),ha(t,e),ma(e),ro=r;break;case 12:ha(t,e),ma(e);break;case 31:ha(t,e),ma(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,nv(e,r)));break;case 13:ha(t,e),ma(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(cy=Ya()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,nv(e,r)));break;case 22:a=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,s=zl,d=_n;if(zl=s||a,_n=d||c,ha(t,e),_n=d,zl=s,ma(e),r&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||c||zl||_n||pd(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(i=c.stateNode,a)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var u=c.memoizedProps.style,h=u!=null&&u.hasOwnProperty("display")?u.display:null;l.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(p){bt(c,c.return,p)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(p){bt(c,c.return,p)}}}else if(t.tag===18){if(n===null){c=t;try{var m=c.stateNode;a?jD(m,!0):jD(c.stateNode,!1)}catch(p){bt(c,c.return,p)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,nv(e,n))));break;case 19:ha(t,e),ma(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,nv(e,r)));break;case 30:break;case 21:break;default:ha(t,e),ma(e)}}function ma(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(WL(r)){n=r;break}r=r.return}if(n==null)throw Error($(160));switch(n.tag){case 27:var a=n.stateNode,i=ES(e);Bv(e,i,a);break;case 5:var o=n.stateNode;n.flags&32&&(Ph(o,""),n.flags&=-33);var l=ES(e);Bv(e,l,o);break;case 3:case 4:var c=n.stateNode.containerInfo,s=ES(e);d5(e,s,c);break;default:throw Error($(161))}}catch(d){bt(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function e9(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;e9(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Rl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$L(e,t.alternate,t),t=t.sibling}function pd(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:hc(4,t,t.return),pd(t);break;case 1:Bo(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&GL(t,t.return,n),pd(t);break;case 27:Wf(t.stateNode);case 26:case 5:Bo(t,t.return),pd(t);break;case 22:t.memoizedState===null&&pd(t);break;case 30:pd(t);break;default:pd(t)}e=e.sibling}}function Nl(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,a=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Nl(a,i,n),fg(4,i);break;case 1:if(Nl(a,i,n),r=i,a=r.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(s){bt(r,r.return,s)}if(r=i,a=r.updateQueue,a!==null){var l=r.stateNode;try{var c=a.shared.hiddenCallbacks;if(c!==null)for(a.shared.hiddenCallbacks=null,a=0;a<c.length;a++)qI(c[a],l)}catch(s){bt(r,r.return,s)}}n&&o&64&&VL(i),jf(i,i.return);break;case 27:KL(i);case 26:case 5:Nl(a,i,n),n&&r===null&&o&4&&YL(i),jf(i,i.return);break;case 12:Nl(a,i,n);break;case 31:Nl(a,i,n),n&&o&4&&qL(a,i);break;case 13:Nl(a,i,n),n&&o&4&&QL(a,i);break;case 22:i.memoizedState===null&&Nl(a,i,n),jf(i,i.return);break;case 30:break;default:Nl(a,i,n)}t=t.sibling}}function c4(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&mg(n))}function d4(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mg(e))}function no(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)t9(e,t,n,r),t=t.sibling}function t9(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:no(e,t,n,r),a&2048&&fg(9,t);break;case 1:no(e,t,n,r);break;case 3:no(e,t,n,r),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mg(e)));break;case 12:if(a&2048){no(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){bt(t,t.return,c)}}else no(e,t,n,r);break;case 31:no(e,t,n,r);break;case 13:no(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?no(e,t,n,r):Vf(e,t):i._visibility&2?no(e,t,n,r):(i._visibility|=2,ph(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),a&2048&&c4(o,t);break;case 24:no(e,t,n,r),a&2048&&d4(t.alternate,t);break;default:no(e,t,n,r)}}function ph(e,t,n,r,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,l=n,c=r,s=o.flags;switch(o.tag){case 0:case 11:case 15:ph(i,o,l,c,a),fg(8,o);break;case 23:break;case 22:var d=o.stateNode;o.memoizedState!==null?d._visibility&2?ph(i,o,l,c,a):Vf(i,o):(d._visibility|=2,ph(i,o,l,c,a)),a&&s&2048&&c4(o.alternate,o);break;case 24:ph(i,o,l,c,a),a&&s&2048&&d4(o.alternate,o);break;default:ph(i,o,l,c,a)}t=t.sibling}}function Vf(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:Vf(n,r),a&2048&&c4(r.alternate,r);break;case 24:Vf(n,r),a&2048&&d4(r.alternate,r);break;default:Vf(n,r)}t=t.sibling}}var Rf=8192;function mh(e,t,n){if(e.subtreeFlags&Rf)for(e=e.child;e!==null;)n9(e,t,n),e=e.sibling}function n9(e,t,n){switch(e.tag){case 26:mh(e,t,n),e.flags&Rf&&e.memoizedState!==null&&eX(n,ro,e.memoizedState,e.memoizedProps);break;case 5:mh(e,t,n);break;case 3:case 4:var r=ro;ro=Kv(e.stateNode.containerInfo),mh(e,t,n),ro=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Rf,Rf=16777216,mh(e,t,n),Rf=r):mh(e,t,n));break;default:mh(e,t,n)}}function r9(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kf(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Jn=r,i9(r,e)}r9(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)a9(e),e=e.sibling}function a9(e){switch(e.tag){case 0:case 11:case 15:kf(e),e.flags&2048&&hc(9,e,e.return);break;case 3:kf(e);break;case 12:kf(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vv(e)):kf(e);break;default:kf(e)}}function vv(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Jn=r,i9(r,e)}r9(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hc(8,t,t.return),vv(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,vv(t));break;default:vv(t)}e=e.sibling}}function i9(e,t){for(;Jn!==null;){var n=Jn;switch(n.tag){case 0:case 11:case 15:hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:mg(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Jn=r;else e:for(n=e;Jn!==null;){r=Jn;var a=r.sibling,i=r.return;if(XL(r),r===n){Jn=null;break e}if(a!==null){a.return=i,Jn=a;break e}Jn=i}}}var b$={getCacheForType:function(e){var t=br(kn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return br(kn).controller.signal}},v$=typeof WeakMap=="function"?WeakMap:Map,ot=0,Tt=null,Be=null,Ge=0,gt=0,Ha=null,Qs=!1,Zh=!1,u4=!1,Kl=0,sn=0,mc=0,yd=0,h4=0,Ga=0,Hh=0,Gf=null,fa=null,u5=!1,cy=0,o9=0,Fv=1/0,Hv=null,ic=null,Pn=0,oc=null,jh=null,jl=0,h5=0,m5=null,l9=null,Yf=0,p5=null;function $a(){return(ot&2)!==0&&Ge!==0?Ge&-Ge:ye.T!==null?p4():gI()}function s9(){if(Ga===0)if((Ge&536870912)===0||Xe){var e=Wb;Wb<<=1,(Wb&3932160)===0&&(Wb=262144),Ga=e}else Ga=536870912;return e=Za.current,e!==null&&(e.flags|=32),Ga}function ga(e,t,n){(e===Tt&&(gt===2||gt===9)||e.cancelPendingCommit!==null)&&(Vh(e,0),Js(e,Ge,Ga,!1)),dg(e,n),((ot&2)===0||e!==Tt)&&(e===Tt&&((ot&2)===0&&(yd|=n),sn===4&&Js(e,Ge,Ga,!1)),jo(e))}function c9(e,t,n){if((ot&6)!==0)throw Error($(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||cg(e,t),a=r?w$(e,t):CS(e,t,!0),i=r;do{if(a===0){Zh&&!r&&Js(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!y$(n)){a=CS(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;a=Gf;var c=l.current.memoizedState.isDehydrated;if(c&&(Vh(l,o).flags|=256),o=CS(l,o,!1),o!==2){if(u4&&!c){l.errorRecoveryDisabledLanes|=i,yd|=i,a=4;break e}i=fa,fa=a,i!==null&&(fa===null?fa=i:fa.push.apply(fa,i))}a=o}if(i=!1,a!==2)continue}}if(a===1){Vh(e,0),Js(e,t,0,!0);break}e:{switch(r=e,i=a,i){case 0:case 1:throw Error($(345));case 4:if((t&4194048)!==t)break;case 6:Js(r,t,Ga,!Qs);break e;case 2:fa=null;break;case 3:case 5:break;default:throw Error($(329))}if((t&62914560)===t&&(a=cy+300-Ya(),10<a)){if(Js(r,t,Ga,!Qs),Qv(r,0,!0)!==0)break e;jl=t,r.timeoutHandle=A9(TD.bind(null,r,n,fa,Hv,u5,t,Ga,yd,Hh,Qs,i,"Throttled",-0,0),a);break e}TD(r,n,fa,Hv,u5,t,Ga,yd,Hh,Qs,i,null,-0,0)}}break}while(!0);jo(e)}function TD(e,t,n,r,a,i,o,l,c,s,d,u,h,m){if(e.timeoutHandle=-1,u=t.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ul},n9(t,i,u);var p=(i&62914560)===i?cy-Ya():(i&4194048)===i?o9-Ya():0;if(p=tX(u,p),p!==null){jl=i,e.cancelPendingCommit=p(AD.bind(null,e,t,i,n,r,a,o,l,c,d,u,null,h,m)),Js(e,i,o,!s);return}}AD(e,t,i,n,r,a,o,l,c)}function y$(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!Xa(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Js(e,t,n,r){t&=~h4,t&=~yd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var i=31-Ka(a),o=1<<i;r[i]=-1,a&=~o}n!==0&&mI(e,n,t)}function dy(){return(ot&6)===0?(gg(0,!1),!1):!0}function m4(){if(Be!==null){if(gt===0)var e=Be.return;else e=Be,Bl=Ad=null,Q5(e),Lh=null,Jf=0,e=Be;for(;e!==null;)jL(e.alternate,e),e=e.return;Be=null}}function Vh(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,P$(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jl=0,m4(),Tt=e,Be=n=Fl(e.current,null),Ge=t,gt=0,Ha=null,Qs=!1,Zh=cg(e,t),u4=!1,Hh=Ga=h4=yd=mc=sn=0,fa=Gf=null,u5=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var a=31-Ka(r),i=1<<a;t|=e[a],r&=~i}return Kl=t,ny(),n}function d9(e,t){De=null,ye.H=tg,t===Xh||t===ay?(t=iD(),gt=3):t===Y5?(t=iD(),gt=4):gt=t===l4?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ha=t,Be===null&&(sn=1,Pv(e,Ei(t,e.current)))}function u9(){var e=Za.current;return e===null?!0:(Ge&4194048)===Ge?Ci===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?e===Ci:!1}function h9(){var e=ye.H;return ye.H=tg,e===null?tg:e}function m9(){var e=ye.A;return ye.A=b$,e}function jv(){sn=4,Qs||(Ge&4194048)!==Ge&&Za.current!==null||(Zh=!0),(mc&134217727)===0&&(yd&134217727)===0||Tt===null||Js(Tt,Ge,Ga,!1)}function CS(e,t,n){var r=ot;ot|=2;var a=h9(),i=m9();(Tt!==e||Ge!==t)&&(Hv=null,Vh(e,t)),t=!1;var o=sn;e:do try{if(gt!==0&&Be!==null){var l=Be,c=Ha;switch(gt){case 8:m4(),o=6;break e;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var s=gt;if(gt=0,Ha=null,Th(e,l,c,s),n&&Zh){o=0;break e}break;default:s=gt,gt=0,Ha=null,Th(e,l,c,s)}}x$(),o=sn;break}catch(d){d9(e,d)}while(!0);return t&&e.shellSuspendCounter++,Bl=Ad=null,ot=r,ye.H=a,ye.A=i,Be===null&&(Tt=null,Ge=0,ny()),o}function x$(){for(;Be!==null;)p9(Be)}function w$(e,t){var n=ot;ot|=2;var r=h9(),a=m9();Tt!==e||Ge!==t?(Hv=null,Fv=Ya()+500,Vh(e,t)):Zh=cg(e,t);e:do try{if(gt!==0&&Be!==null){t=Be;var i=Ha;t:switch(gt){case 1:gt=0,Ha=null,Th(e,t,i,1);break;case 2:case 9:if(aD(i)){gt=0,Ha=null,MD(t);break}t=function(){gt!==2&>!==9||Tt!==e||(gt=7),jo(e)},i.then(t,t);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:aD(i)?(gt=0,Ha=null,MD(t)):(gt=0,Ha=null,Th(e,t,i,7));break;case 5:var o=null;switch(Be.tag){case 26:o=Be.memoizedState;case 5:case 27:var l=Be;if(o?N9(o):l.stateNode.complete){gt=0,Ha=null;var c=l.sibling;if(c!==null)Be=c;else{var s=l.return;s!==null?(Be=s,uy(s)):Be=null}break t}}gt=0,Ha=null,Th(e,t,i,5);break;case 6:gt=0,Ha=null,Th(e,t,i,6);break;case 8:m4(),sn=6;break e;default:throw Error($(462))}}E$();break}catch(d){d9(e,d)}while(!0);return Bl=Ad=null,ye.H=r,ye.A=a,ot=n,Be!==null?0:(Tt=null,Ge=0,ny(),sn)}function E$(){for(;Be!==null&&!YW();)p9(Be)}function p9(e){var t=HL(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?uy(e):Be=t}function MD(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=wD(n,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=wD(n,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:Q5(t);default:jL(n,t),t=Be=jI(t,Kl),t=HL(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?uy(e):Be=t}function Th(e,t,n,r){Bl=Ad=null,Q5(t),Lh=null,Jf=0;var a=t.return;try{if(d$(e,a,t,n,Ge)){sn=1,Pv(e,Ei(n,e.current)),Be=null;return}}catch(i){if(a!==null)throw Be=a,i;sn=1,Pv(e,Ei(n,e.current)),Be=null;return}t.flags&32768?(Xe||r===1?e=!0:Zh||(Ge&536870912)!==0?e=!1:(Qs=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),f9(t,e)):uy(t)}function uy(e){var t=e;do{if((t.flags&32768)!==0){f9(t,Qs);return}e=t.return;var n=m$(t.alternate,t,Kl);if(n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);sn===0&&(sn=5)}function f9(e,t){do{var n=p$(e.alternate,e);if(n!==null){n.flags&=32767,Be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=n}while(e!==null);sn=6,Be=null}function AD(e,t,n,r,a,i,o,l,c){e.cancelPendingCommit=null;do hy();while(Pn!==0);if((ot&6)!==0)throw Error($(327));if(t!==null){if(t===e.current)throw Error($(177));if(i=t.lanes|t.childLanes,i|=U5,tK(e,n,i,o,l,c),e===Tt&&(Be=Tt=null,Ge=0),jh=t,oc=e,jl=n,h5=i,m5=a,l9=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,k$(kv,function(){return x9(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=ye.T,ye.T=null,a=lt.p,lt.p=2,o=ot,ot|=4;try{f$(e,t,n)}finally{ot=o,lt.p=a,ye.T=r}}Pn=1,g9(),b9(),v9()}}function g9(){if(Pn===1){Pn=0;var e=oc,t=jh,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=ye.T,ye.T=null;var r=lt.p;lt.p=2;var a=ot;ot|=4;try{JL(t,e);var i=v5,o=NI(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&RI(l.ownerDocument.documentElement,l)){if(c!==null&&P5(l)){var s=c.start,d=c.end;if(d===void 0&&(d=s),"selectionStart"in l)l.selectionStart=s,l.selectionEnd=Math.min(d,l.value.length);else{var u=l.ownerDocument||document,h=u&&u.defaultView||window;if(h.getSelection){var m=h.getSelection(),p=l.textContent.length,f=Math.min(c.start,p),x=c.end===void 0?f:Math.min(c.end,p);!m.extend&&f>x&&(o=x,x=f,f=o);var g=q7(l,f),v=q7(l,x);if(g&&v&&(m.rangeCount!==1||m.anchorNode!==g.node||m.anchorOffset!==g.offset||m.focusNode!==v.node||m.focusOffset!==v.offset)){var b=u.createRange();b.setStart(g.node,g.offset),m.removeAllRanges(),f>x?(m.addRange(b),m.extend(v.node,v.offset)):(b.setEnd(v.node,v.offset),m.addRange(b))}}}}for(u=[],m=l;m=m.parentNode;)m.nodeType===1&&u.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<u.length;l++){var w=u[l];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Zv=!!b5,v5=b5=null}finally{ot=a,lt.p=r,ye.T=n}}e.current=t,Pn=2}}function b9(){if(Pn===2){Pn=0;var e=oc,t=jh,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=ye.T,ye.T=null;var r=lt.p;lt.p=2;var a=ot;ot|=4;try{$L(e,t.alternate,t)}finally{ot=a,lt.p=r,ye.T=n}}Pn=3}}function v9(){if(Pn===4||Pn===3){Pn=0,WW();var e=oc,t=jh,n=jl,r=l9;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pn=5:(Pn=0,jh=oc=null,y9(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(ic=null),D5(n),t=t.stateNode,Wa&&typeof Wa.onCommitFiberRoot=="function")try{Wa.onCommitFiberRoot(sg,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=ye.T,a=lt.p,lt.p=2,ye.T=null;try{for(var i=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];i(l.value,{componentStack:l.stack})}}finally{ye.T=t,lt.p=a}}(jl&3)!==0&&hy(),jo(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===p5?Yf++:(Yf=0,p5=e):Yf=0,gg(0,!1)}}function y9(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mg(t)))}function hy(){return g9(),b9(),v9(),x9()}function x9(){if(Pn!==5)return!1;var e=oc,t=h5;h5=0;var n=D5(jl),r=ye.T,a=lt.p;try{lt.p=32>n?32:n,ye.T=null,n=m5,m5=null;var i=oc,o=jl;if(Pn=0,jh=oc=null,jl=0,(ot&6)!==0)throw Error($(331));var l=ot;if(ot|=4,a9(i.current),t9(i,i.current,o,n),ot=l,gg(0,!1),Wa&&typeof Wa.onPostCommitFiberRoot=="function")try{Wa.onPostCommitFiberRoot(sg,i)}catch{}return!0}finally{lt.p=a,ye.T=r,y9(e,t)}}function DD(e,t,n){t=Ei(n,t),t=l5(e.stateNode,t,2),e=ac(e,t,2),e!==null&&(dg(e,2),jo(e))}function bt(e,t,n){if(e.tag===3)DD(e,e,n);else for(;t!==null;){if(t.tag===3){DD(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ic===null||!ic.has(r))){e=Ei(n,e),n=OL(2),r=ac(t,n,2),r!==null&&(zL(n,r,t,e),dg(r,2),jo(r));break}}t=t.return}}function _S(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new v$;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(u4=!0,a.add(n),e=S$.bind(null,e,t,n),t.then(e,e))}function S$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Tt===e&&(Ge&n)===n&&(sn===4||sn===3&&(Ge&62914560)===Ge&&300>Ya()-cy?(ot&2)===0&&Vh(e,0):h4|=n,Hh===Ge&&(Hh=0)),jo(e)}function w9(e,t){t===0&&(t=hI()),e=Md(e,t),e!==null&&(dg(e,t),jo(e))}function C$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),w9(e,n)}function _$(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error($(314))}r!==null&&r.delete(t),w9(e,n)}function k$(e,t){return M5(e,t)}var Vv=null,fh=null,f5=!1,Gv=!1,kS=!1,ec=0;function jo(e){e!==fh&&e.next===null&&(fh===null?Vv=fh=e:fh=fh.next=e),Gv=!0,f5||(f5=!0,M$())}function gg(e,t){if(!kS&&Gv){kS=!0;do for(var n=!1,r=Vv;r!==null;){if(!t)if(e!==0){var a=r.pendingLanes;if(a===0)var i=0;else{var o=r.suspendedLanes,l=r.pingedLanes;i=(1<<31-Ka(42|e)+1)-1,i&=a&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,ID(r,i))}else i=Ge,i=Qv(r,r===Tt?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||cg(r,i)||(n=!0,ID(r,i));r=r.next}while(n);kS=!1}}function T$(){E9()}function E9(){Gv=f5=!1;var e=0;ec!==0&&z$()&&(e=ec);for(var t=Ya(),n=null,r=Vv;r!==null;){var a=r.next,i=S9(r,t);i===0?(r.next=null,n===null?Vv=a:n.next=a,a===null&&(fh=n)):(n=r,(e!==0||(i&3)!==0)&&(Gv=!0)),r=a}Pn!==0&&Pn!==5||gg(e,!1),ec!==0&&(ec=0)}function S9(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-Ka(i),l=1<<o,c=a[o];c===-1?((l&n)===0||(l&r)!==0)&&(a[o]=eK(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Tt,n=Ge,n=Qv(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(gt===2||gt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&tS(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||cg(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&tS(r),D5(n)){case 2:case 8:n=dI;break;case 32:n=kv;break;case 268435456:n=uI;break;default:n=kv}return r=C9.bind(null,e),n=M5(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&tS(r),e.callbackPriority=2,e.callbackNode=null,2}function C9(e,t){if(Pn!==0&&Pn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hy()&&e.callbackNode!==n)return null;var r=Ge;return r=Qv(e,e===Tt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(c9(e,r,t),S9(e,Ya()),e.callbackNode!=null&&e.callbackNode===n?C9.bind(null,e):null)}function ID(e,t){if(hy())return null;c9(e,t,!0)}function M$(){U$(function(){(ot&6)!==0?M5(cI,T$):E9()})}function p4(){if(ec===0){var e=Uh;e===0&&(e=Yb,Yb<<=1,(Yb&261888)===0&&(Yb=256)),ec=e}return ec}function LD(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:cv(""+e)}function RD(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function A$(e,t,n,r,a){if(t==="submit"&&n&&n.stateNode===a){var i=LD((a[ba]||null).action),o=r.submitter;o&&(t=(t=o[ba]||null)?LD(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new Jv("action","action",null,r,a);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ec!==0){var c=o?RD(a,o):new FormData(a);i5(n,{pending:!0,data:c,method:a.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?RD(a,o):new FormData(a),i5(n,{pending:!0,data:c,method:a.method,action:i},i,c))},currentTarget:a}]})}}for(rv=0;rv<KS.length;rv++)av=KS[rv],ND=av.toLowerCase(),OD=av[0].toUpperCase()+av.slice(1),ao(ND,"on"+OD);var av,ND,OD,rv;ao(zI,"onAnimationEnd");ao(PI,"onAnimationIteration");ao(UI,"onAnimationStart");ao("dblclick","onDoubleClick");ao("focusin","onFocus");ao("focusout","onBlur");ao(KK,"onTransitionRun");ao($K,"onTransitionStart");ao(XK,"onTransitionCancel");ao(BI,"onTransitionEnd");zh("onMouseEnter",["mouseout","mouseover"]);zh("onMouseLeave",["mouseout","mouseover"]);zh("onPointerEnter",["pointerout","pointerover"]);zh("onPointerLeave",["pointerout","pointerover"]);_d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));_d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));_d("onBeforeInput",["compositionend","keypress","textInput","paste"]);_d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));_d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));_d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ng="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(" "),D$=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ng));function _9(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,s=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;i=l,a.currentTarget=s;try{i(a)}catch(d){Mv(d)}a.currentTarget=null,i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,s=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;i=l,a.currentTarget=s;try{i(a)}catch(d){Mv(d)}a.currentTarget=null,i=c}}}}function Ue(e,t){var n=t[BS];n===void 0&&(n=t[BS]=new Set);var r=e+"__bubble";n.has(r)||(k9(t,e,2,!1),n.add(r))}function TS(e,t,n){var r=0;t&&(r|=4),k9(n,e,r,t)}var iv="_reactListening"+Math.random().toString(36).slice(2);function f4(e){if(!e[iv]){e[iv]=!0,bI.forEach(function(n){n!=="selectionchange"&&(D$.has(n)||TS(n,!1,e),TS(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[iv]||(t[iv]=!0,TS("selectionchange",!1,t))}}function k9(e,t,n,r){switch(B9(t)){case 2:var a=aX;break;case 8:a=iX;break;default:a=y4}n=a.bind(null,t,n,e),a=void 0,!GS||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function MS(e,t,n,r,a){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===a)return;o=o.return}for(;l!==null;){if(o=vh(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=i=o;continue e}l=l.parentNode}}r=r.return}_I(function(){var s=i,d=R5(n),u=[];e:{var h=FI.get(e);if(h!==void 0){var m=Jv,p=e;switch(e){case"keypress":if(uv(n)===0)break e;case"keydown":case"keyup":m=_K;break;case"focusin":p="focus",m=oS;break;case"focusout":p="blur",m=oS;break;case"beforeblur":case"afterblur":m=oS;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=j7;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=mK;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=MK;break;case zI:case PI:case UI:m=gK;break;case BI:m=DK;break;case"scroll":case"scrollend":m=uK;break;case"wheel":m=LK;break;case"copy":case"cut":case"paste":m=vK;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=G7;break;case"toggle":case"beforetoggle":m=NK}var f=(t&4)!==0,x=!f&&(e==="scroll"||e==="scrollend"),g=f?h!==null?h+"Capture":null:h;f=[];for(var v=s,b;v!==null;){var w=v;if(b=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||b===null||g===null||(w=$f(v,g),w!=null&&f.push(rg(v,w,b))),x)break;v=v.return}0<f.length&&(h=new m(h,p,null,n,d),u.push({event:h,listeners:f}))}}if((t&7)===0){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==VS&&(p=n.relatedTarget||n.fromElement)&&(vh(p)||p[Wh]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=s,p=p?vh(p):null,p!==null&&(x=lg(p),f=p.tag,p!==x||f!==5&&f!==27&&f!==6)&&(p=null)):(m=null,p=s),m!==p)){if(f=j7,w="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(f=G7,w="onPointerLeave",g="onPointerEnter",v="pointer"),x=m==null?h:If(m),b=p==null?h:If(p),h=new f(w,v+"leave",m,n,d),h.target=x,h.relatedTarget=b,w=null,vh(d)===s&&(f=new f(g,v+"enter",p,n,d),f.target=b,f.relatedTarget=x,w=f),x=w,m&&p)t:{for(f=I$,g=m,v=p,b=0,w=g;w;w=f(w))b++;w=0;for(var S=v;S;S=f(S))w++;for(;0<b-w;)g=f(g),b--;for(;0<w-b;)v=f(v),w--;for(;b--;){if(g===v||v!==null&&g===v.alternate){f=g;break t}g=f(g),v=f(v)}f=null}else f=null;m!==null&&zD(u,h,m,f,!1),p!==null&&x!==null&&zD(u,x,p,f,!0)}}e:{if(h=s?If(s):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var _=$7;else if(K7(h))if(II)_=GK;else{_=jK;var C=HK}else m=h.nodeName,!m||m.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?s&&L5(s.elementType)&&(_=$7):_=VK;if(_&&(_=_(e,s))){DI(u,_,n,d);break e}C&&C(e,h,s),e==="focusout"&&s&&h.type==="number"&&s.memoizedProps.value!=null&&jS(h,"number",h.value)}switch(C=s?If(s):window,e){case"focusin":(K7(C)||C.contentEditable==="true")&&(wh=C,YS=s,zf=null);break;case"focusout":zf=YS=wh=null;break;case"mousedown":WS=!0;break;case"contextmenu":case"mouseup":case"dragend":WS=!1,Q7(u,n,d);break;case"selectionchange":if(WK)break;case"keydown":case"keyup":Q7(u,n,d)}var k;if(z5)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else xh?MI(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(TI&&n.locale!=="ko"&&(xh||T!=="onCompositionStart"?T==="onCompositionEnd"&&xh&&(k=kI()):(qs=d,N5="value"in qs?qs.value:qs.textContent,xh=!0)),C=Yv(s,T),0<C.length&&(T=new V7(T,e,null,n,d),u.push({event:T,listeners:C}),k?T.data=k:(k=AI(n),k!==null&&(T.data=k)))),(k=zK?PK(e,n):UK(e,n))&&(T=Yv(s,"onBeforeInput"),0<T.length&&(C=new V7("onBeforeInput","beforeinput",null,n,d),u.push({event:C,listeners:T}),C.data=k)),A$(u,e,s,n,d)}_9(u,t)})}function rg(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yv(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=$f(e,n),a!=null&&r.unshift(rg(e,a,i)),a=$f(e,t),a!=null&&r.push(rg(e,a,i))),e.tag===3)return r;e=e.return}return[]}function I$(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zD(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,s=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||s===null||(c=s,a?(s=$f(n,i),s!=null&&o.unshift(rg(n,s,c))):a||(s=$f(n,i),s!=null&&o.push(rg(n,s,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var L$=/\r\n?/g,R$=/\u0000|\uFFFD/g;function PD(e){return(typeof e=="string"?e:""+e).replace(L$,`
|
|
9
|
-
`).replace(R$,"")}function T9(e,t){return t=PD(t),PD(e)===t}function Et(e,t,n,r,a,i){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ph(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ph(e,""+r);break;case"className":$b(e,"class",r);break;case"tabIndex":$b(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":$b(e,n,r);break;case"style":CI(e,r,i);break;case"data":if(t!=="object"){$b(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=cv(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&Et(e,t,"name",a.name,a,null),Et(e,t,"formEncType",a.formEncType,a,null),Et(e,t,"formMethod",a.formMethod,a,null),Et(e,t,"formTarget",a.formTarget,a,null)):(Et(e,t,"encType",a.encType,a,null),Et(e,t,"method",a.method,a,null),Et(e,t,"target",a.target,a,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=cv(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Ul);break;case"onScroll":r!=null&&Ue("scroll",e);break;case"onScrollEnd":r!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error($(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error($(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=cv(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),sv(e,"popover",r);break;case"xlinkActuate":Dl(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Dl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Dl(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Dl(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Dl(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Dl(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Dl(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Dl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Dl(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":sv(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=cK.get(n)||n,sv(e,n,r))}}function g5(e,t,n,r,a,i){switch(n){case"style":CI(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error($(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error($(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Ph(e,r):(typeof r=="number"||typeof r=="bigint")&&Ph(e,""+r);break;case"onScroll":r!=null&&Ue("scroll",e);break;case"onScrollEnd":r!=null&&Ue("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ul);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vI.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[ba]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof r=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):sv(e,n,r)}}}function vr(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var r=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var o=n[i];if(o!=null)switch(i){case"src":r=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error($(137,t));default:Et(e,t,i,o,n,null)}}a&&Et(e,t,"srcSet",n.srcSet,n,null),r&&Et(e,t,"src",n.src,n,null);return;case"input":Ue("invalid",e);var l=i=o=a=null,c=null,s=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"name":a=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":s=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error($(137,t));break;default:Et(e,t,r,d,n,null)}}wI(e,i,l,c,s,o,a,!1);return;case"select":Ue("invalid",e),r=o=i=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Et(e,t,a,l,n,null)}t=i,n=o,e.multiple=!!r,t!=null?Ah(e,!!r,t,!1):n!=null&&Ah(e,!!r,n,!0);return;case"textarea":Ue("invalid",e),i=a=r=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":a=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error($(91));break;default:Et(e,t,o,l,n,null)}SI(e,r,a,i);return;case"option":for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Et(e,t,c,r,n,null));return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(r=0;r<ng.length;r++)Ue(ng[r],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(s in n)if(n.hasOwnProperty(s)&&(r=n[s],r!=null))switch(s){case"children":case"dangerouslySetInnerHTML":throw Error($(137,t));default:Et(e,t,s,r,n,null)}return;default:if(L5(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&g5(e,t,d,r,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(r=n[l],r!=null&&Et(e,t,l,r,n,null))}function N$(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,o=null,l=null,c=null,s=null,d=null;for(m in n){var u=n[m];if(n.hasOwnProperty(m)&&u!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":c=u;default:r.hasOwnProperty(m)||Et(e,t,m,null,r,u)}}for(var h in r){var m=r[h];if(u=n[h],r.hasOwnProperty(h)&&(m!=null||u!=null))switch(h){case"type":i=m;break;case"name":a=m;break;case"checked":s=m;break;case"defaultChecked":d=m;break;case"value":o=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error($(137,t));break;default:m!==u&&Et(e,t,h,m,r,u)}}HS(e,o,l,c,s,d,i,a);return;case"select":m=o=l=h=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":m=c;default:r.hasOwnProperty(i)||Et(e,t,i,null,r,c)}for(a in r)if(i=r[a],c=n[a],r.hasOwnProperty(a)&&(i!=null||c!=null))switch(a){case"value":h=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&Et(e,t,a,i,r,c)}t=l,n=o,r=m,h!=null?Ah(e,!!n,h,!1):!!r!=!!n&&(t!=null?Ah(e,!!n,t,!0):Ah(e,!!n,n?[]:"",!1));return;case"textarea":m=h=null;for(l in n)if(a=n[l],n.hasOwnProperty(l)&&a!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Et(e,t,l,null,r,a)}for(o in r)if(a=r[o],i=n[o],r.hasOwnProperty(o)&&(a!=null||i!=null))switch(o){case"value":h=a;break;case"defaultValue":m=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error($(91));break;default:a!==i&&Et(e,t,o,a,r,i)}EI(e,h,m);return;case"option":for(var p in n)h=n[p],n.hasOwnProperty(p)&&h!=null&&!r.hasOwnProperty(p)&&(p==="selected"?e.selected=!1:Et(e,t,p,null,r,h));for(c in r)h=r[c],m=n[c],r.hasOwnProperty(c)&&h!==m&&(h!=null||m!=null)&&(c==="selected"?e.selected=h&&typeof h!="function"&&typeof h!="symbol":Et(e,t,c,h,r,m));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var f in n)h=n[f],n.hasOwnProperty(f)&&h!=null&&!r.hasOwnProperty(f)&&Et(e,t,f,null,r,h);for(s in r)if(h=r[s],m=n[s],r.hasOwnProperty(s)&&h!==m&&(h!=null||m!=null))switch(s){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error($(137,t));break;default:Et(e,t,s,h,r,m)}return;default:if(L5(t)){for(var x in n)h=n[x],n.hasOwnProperty(x)&&h!==void 0&&!r.hasOwnProperty(x)&&g5(e,t,x,void 0,r,h);for(d in r)h=r[d],m=n[d],!r.hasOwnProperty(d)||h===m||h===void 0&&m===void 0||g5(e,t,d,h,r,m);return}}for(var g in n)h=n[g],n.hasOwnProperty(g)&&h!=null&&!r.hasOwnProperty(g)&&Et(e,t,g,null,r,h);for(u in r)h=r[u],m=n[u],!r.hasOwnProperty(u)||h===m||h==null&&m==null||Et(e,t,u,h,r,m)}function UD(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function O$(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var a=n[r],i=a.transferSize,o=a.initiatorType,l=a.duration;if(i&&l&&UD(o)){for(o=0,l=a.responseEnd,r+=1;r<n.length;r++){var c=n[r],s=c.startTime;if(s>l)break;var d=c.transferSize,u=c.initiatorType;d&&UD(u)&&(c=c.responseEnd,o+=d*(c<l?1:(l-s)/(c-s)))}if(--r,t+=8*(i+o)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var b5=null,v5=null;function Wv(e){return e.nodeType===9?e:e.ownerDocument}function BD(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function M9(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function y5(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var AS=null;function z$(){var e=window.event;return e&&e.type==="popstate"?e===AS?!1:(AS=e,!0):(AS=null,!1)}var A9=typeof setTimeout=="function"?setTimeout:void 0,P$=typeof clearTimeout=="function"?clearTimeout:void 0,FD=typeof Promise=="function"?Promise:void 0,U$=typeof queueMicrotask=="function"?queueMicrotask:typeof FD<"u"?function(e){return FD.resolve(null).then(e).catch(B$)}:A9;function B$(e){setTimeout(function(){throw e})}function fc(e){return e==="head"}function HD(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(a),Yh(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Wf(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Wf(n);for(var i=n.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[ug]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}else n==="body"&&Wf(e.ownerDocument.body);n=a}while(n);Yh(t)}function jD(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function x5(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":x5(n),I5(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function F$(e,t,n,r){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[ug])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=_i(e.nextSibling),e===null)break}return null}function H$(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=_i(e.nextSibling),e===null))return null;return e}function D9(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_i(e.nextSibling),e===null))return null;return e}function w5(e){return e.data==="$?"||e.data==="$~"}function E5(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function j$(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function _i(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var S5=null;function VD(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return _i(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function GD(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function I9(e,t,n){switch(t=Wv(n),e){case"html":if(e=t.documentElement,!e)throw Error($(452));return e;case"head":if(e=t.head,!e)throw Error($(453));return e;case"body":if(e=t.body,!e)throw Error($(454));return e;default:throw Error($(451))}}function Wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);I5(e)}var ki=new Map,YD=new Set;function Kv(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $l=lt.d;lt.d={f:V$,r:G$,D:Y$,C:W$,L:K$,m:$$,X:Z$,S:X$,M:q$};function V$(){var e=$l.f(),t=dy();return e||t}function G$(e){var t=Kh(e);t!==null&&t.tag===5&&t.type==="form"?CL(t):$l.r(e)}var qh=typeof document>"u"?null:document;function L9(e,t,n){var r=qh;if(r&&typeof t=="string"&&t){var a=wi(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),YD.has(a)||(YD.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement("link"),vr(t,"link",e),er(t),r.head.appendChild(t)))}}function Y$(e){$l.D(e),L9("dns-prefetch",e,null)}function W$(e,t){$l.C(e,t),L9("preconnect",e,t)}function K$(e,t,n){$l.L(e,t,n);var r=qh;if(r&&e&&t){var a='link[rel="preload"][as="'+wi(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+wi(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+wi(n.imageSizes)+'"]')):a+='[href="'+wi(e)+'"]';var i=a;switch(t){case"style":i=Gh(e);break;case"script":i=Qh(e)}ki.has(i)||(e=Ft({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ki.set(i,e),r.querySelector(a)!==null||t==="style"&&r.querySelector(bg(i))||t==="script"&&r.querySelector(vg(i))||(t=r.createElement("link"),vr(t,"link",e),er(t),r.head.appendChild(t)))}}function $$(e,t){$l.m(e,t);var n=qh;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+wi(r)+'"][href="'+wi(e)+'"]',i=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Qh(e)}if(!ki.has(i)&&(e=Ft({rel:"modulepreload",href:e},t),ki.set(i,e),n.querySelector(a)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(vg(i)))return}r=n.createElement("link"),vr(r,"link",e),er(r),n.head.appendChild(r)}}}function X$(e,t,n){$l.S(e,t,n);var r=qh;if(r&&e){var a=Mh(r).hoistableStyles,i=Gh(e);t=t||"default";var o=a.get(i);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(bg(i)))l.loading=5;else{e=Ft({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ki.get(i))&&g4(e,n);var c=o=r.createElement("link");er(c),vr(c,"link",e),c._p=new Promise(function(s,d){c.onload=s,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,yv(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},a.set(i,o)}}}function Z$(e,t){$l.X(e,t);var n=qh;if(n&&e){var r=Mh(n).hoistableScripts,a=Qh(e),i=r.get(a);i||(i=n.querySelector(vg(a)),i||(e=Ft({src:e,async:!0},t),(t=ki.get(a))&&b4(e,t),i=n.createElement("script"),er(i),vr(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function q$(e,t){$l.M(e,t);var n=qh;if(n&&e){var r=Mh(n).hoistableScripts,a=Qh(e),i=r.get(a);i||(i=n.querySelector(vg(a)),i||(e=Ft({src:e,async:!0,type:"module"},t),(t=ki.get(a))&&b4(e,t),i=n.createElement("script"),er(i),vr(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function WD(e,t,n,r){var a=(a=tc.current)?Kv(a):null;if(!a)throw Error($(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Gh(n.href),n=Mh(a).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Gh(n.href);var i=Mh(a).hoistableStyles,o=i.get(e);if(o||(a=a.ownerDocument||a,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=a.querySelector(bg(e)))&&!i._p&&(o.instance=i,o.state.loading=5),ki.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ki.set(e,n),i||Q$(a,e,n,o.state))),t&&r===null)throw Error($(528,""));return o}if(t&&r!==null)throw Error($(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qh(n),n=Mh(a).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error($(444,e))}}function Gh(e){return'href="'+wi(e)+'"'}function bg(e){return'link[rel="stylesheet"]['+e+"]"}function R9(e){return Ft({},e,{"data-precedence":e.precedence,precedence:null})}function Q$(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),vr(t,"link",n),er(t),e.head.appendChild(t))}function Qh(e){return'[src="'+wi(e)+'"]'}function vg(e){return"script[async]"+e}function KD(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+wi(n.href)+'"]');if(r)return t.instance=r,er(r),r;var a=Ft({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),er(r),vr(r,"style",a),yv(r,n.precedence,e),t.instance=r;case"stylesheet":a=Gh(n.href);var i=e.querySelector(bg(a));if(i)return t.state.loading|=4,t.instance=i,er(i),i;r=R9(n),(a=ki.get(a))&&g4(r,a),i=(e.ownerDocument||e).createElement("link"),er(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),vr(i,"link",r),t.state.loading|=4,yv(i,n.precedence,e),t.instance=i;case"script":return i=Qh(n.src),(a=e.querySelector(vg(i)))?(t.instance=a,er(a),a):(r=n,(a=ki.get(i))&&(r=Ft({},n),b4(r,a)),e=e.ownerDocument||e,a=e.createElement("script"),er(a),vr(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error($(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,yv(r,n.precedence,e));return t.instance}function yv(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,i=a,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)i=l;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function g4(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function b4(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var xv=null;function $D(e,t,n){if(xv===null){var r=new Map,a=xv=new Map;a.set(n,r)}else a=xv,r=a.get(n),r||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[ug]||i[fr]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(i):r.set(o,[i])}}return r}function XD(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function J$(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function N9(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function eX(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Gh(r.href),i=t.querySelector(bg(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=$v.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,er(i);return}i=t.ownerDocument||t,r=R9(r),(a=ki.get(a))&&g4(r,a),i=i.createElement("link"),er(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),vr(i,"link",r),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=$v.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var DS=0;function tX(e,t){return e.stylesheets&&e.count===0&&wv(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&wv(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&DS===0&&(DS=62500*O$());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&wv(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>DS?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function $v(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wv(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xv=null;function wv(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xv=new Map,t.forEach(nX,e),Xv=null,$v.call(e))}function nX(e,t){if(!(t.state.loading&4)){var n=Xv.get(e);if(n)var r=n.get(null);else{n=new Map,Xv.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var o=a[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}a=t.instance,o=a.getAttribute("data-precedence"),i=n.get(o)||r,i===r&&n.set(null,a),n.set(o,a),this.count++,r=$v.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var ag={$$typeof:Pl,Provider:null,Consumer:null,_currentValue:fd,_currentValue2:fd,_threadCount:0};function rX(e,t,n,r,a,i,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nS(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nS(0),this.hiddenUpdates=nS(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function O9(e,t,n,r,a,i,o,l,c,s,d,u){return e=new rX(e,t,n,o,c,s,d,u,l),t=1,i===!0&&(t|=24),i=Va(3,null,null,t),e.current=i,i.stateNode=e,t=V5(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},W5(i),e}function z9(e){return e?(e=Ch,e):Ch}function P9(e,t,n,r,a,i){a=z9(a),r.context===null?r.context=a:r.pendingContext=a,r=rc(t),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=ac(e,r,t),n!==null&&(ga(n,e,t),Uf(n,e,t))}function ZD(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function v4(e,t){ZD(e,t),(e=e.alternate)&&ZD(e,t)}function U9(e){if(e.tag===13||e.tag===31){var t=Md(e,67108864);t!==null&&ga(t,e,67108864),v4(e,67108864)}}function qD(e){if(e.tag===13||e.tag===31){var t=$a();t=A5(t);var n=Md(e,t);n!==null&&ga(n,e,t),v4(e,t)}}var Zv=!0;function aX(e,t,n,r){var a=ye.T;ye.T=null;var i=lt.p;try{lt.p=2,y4(e,t,n,r)}finally{lt.p=i,ye.T=a}}function iX(e,t,n,r){var a=ye.T;ye.T=null;var i=lt.p;try{lt.p=8,y4(e,t,n,r)}finally{lt.p=i,ye.T=a}}function y4(e,t,n,r){if(Zv){var a=C5(r);if(a===null)MS(e,t,r,qv,n),QD(e,r);else if(lX(a,e,t,n,r))r.stopPropagation();else if(QD(e,r),t&4&&-1<oX.indexOf(e)){for(;a!==null;){var i=Kh(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=hd(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-Ka(o);l.entanglements[1]|=c,o&=~c}jo(i),(ot&6)===0&&(Fv=Ya()+500,gg(0,!1))}}break;case 31:case 13:l=Md(i,2),l!==null&&ga(l,i,2),dy(),v4(i,2)}if(i=C5(r),i===null&&MS(e,t,r,qv,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else MS(e,t,r,null,n)}}function C5(e){return e=R5(e),x4(e)}var qv=null;function x4(e){if(qv=null,e=vh(e),e!==null){var t=lg(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=aI(t),e!==null)return e;e=null}else if(n===31){if(e=iI(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qv=e,null}function B9(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(KW()){case cI:return 2;case dI:return 8;case kv:case $W:return 32;case uI:return 268435456;default:return 32}default:return 32}}var _5=!1,lc=null,sc=null,cc=null,ig=new Map,og=new Map,Xs=[],oX="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".split(" ");function QD(e,t){switch(e){case"focusin":case"focusout":lc=null;break;case"dragenter":case"dragleave":sc=null;break;case"mouseover":case"mouseout":cc=null;break;case"pointerover":case"pointerout":ig.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":og.delete(t.pointerId)}}function Tf(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Kh(t),t!==null&&U9(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function lX(e,t,n,r,a){switch(t){case"focusin":return lc=Tf(lc,e,t,n,r,a),!0;case"dragenter":return sc=Tf(sc,e,t,n,r,a),!0;case"mouseover":return cc=Tf(cc,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return ig.set(i,Tf(ig.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,og.set(i,Tf(og.get(i)||null,e,t,n,r,a)),!0}return!1}function F9(e){var t=vh(e.target);if(t!==null){var n=lg(t);if(n!==null){if(t=n.tag,t===13){if(t=aI(n),t!==null){e.blockedOn=t,O7(e.priority,function(){qD(n)});return}}else if(t===31){if(t=iI(n),t!==null){e.blockedOn=t,O7(e.priority,function(){qD(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ev(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=C5(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);VS=r,n.target.dispatchEvent(r),VS=null}else return t=Kh(n),t!==null&&U9(t),e.blockedOn=n,!1;t.shift()}return!0}function JD(e,t,n){Ev(e)&&n.delete(t)}function sX(){_5=!1,lc!==null&&Ev(lc)&&(lc=null),sc!==null&&Ev(sc)&&(sc=null),cc!==null&&Ev(cc)&&(cc=null),ig.forEach(JD),og.forEach(JD)}function ov(e,t){e.blockedOn===t&&(e.blockedOn=null,_5||(_5=!0,Un.unstable_scheduleCallback(Un.unstable_NormalPriority,sX)))}var lv=null;function eI(e){lv!==e&&(lv=e,Un.unstable_scheduleCallback(Un.unstable_NormalPriority,function(){lv===e&&(lv=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if(typeof r!="function"){if(x4(r||n)===null)continue;break}var i=Kh(n);i!==null&&(e.splice(t,3),t-=3,i5(i,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function Yh(e){function t(c){return ov(c,e)}lc!==null&&ov(lc,e),sc!==null&&ov(sc,e),cc!==null&&ov(cc,e),ig.forEach(t),og.forEach(t);for(var n=0;n<Xs.length;n++){var r=Xs[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Xs.length&&(n=Xs[0],n.blockedOn===null);)F9(n),n.blockedOn===null&&Xs.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var a=n[r],i=n[r+1],o=a[ba]||null;if(typeof i=="function")o||eI(n);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(a=i,o=i[ba]||null)l=o.formAction;else if(x4(a)!==null)continue}else l=o.action;typeof l=="function"?n[r+1]=l:(n.splice(r,3),r-=3),eI(n)}}}function H9(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return a=o})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function w4(e){this._internalRoot=e}my.prototype.render=w4.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error($(409));var n=t.current,r=$a();P9(n,r,e,t,null,null)};my.prototype.unmount=w4.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;P9(e.current,2,null,e,null,null),dy(),t[Wh]=null}};function my(e){this._internalRoot=e}my.prototype.unstable_scheduleHydration=function(e){if(e){var t=gI();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Xs.length&&t!==0&&t<Xs[n].priority;n++);Xs.splice(n,0,e),n===0&&F9(e)}};var tI=nI.version;if(tI!=="19.2.0")throw Error($(527,tI,"19.2.0"));lt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error($(188)):(e=Object.keys(e).join(","),Error($(268,e)));return e=FW(t),e=e!==null?oI(e):null,e=e===null?null:e.stateNode,e};var cX={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:ye,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Mf=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Mf.isDisabled&&Mf.supportsFiber))try{sg=Mf.inject(cX),Wa=Mf}catch{}var Mf;py.createRoot=function(e,t){if(!rI(e))throw Error($(299));var n=!1,r="",a=LL,i=RL,o=NL;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=O9(e,1,!1,null,null,n,r,null,a,i,o,H9),e[Wh]=t.current,f4(e),new w4(t)};py.hydrateRoot=function(e,t,n){if(!rI(e))throw Error($(299));var r=!1,a="",i=LL,o=RL,l=NL,c=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=O9(e,1,!0,t,n??null,r,a,c,i,o,l,H9),t.context=z9(null),n=t.current,r=$a(),r=A5(r),a=rc(r),a.callback=null,ac(n,a,r),n=r,t.current.lanes=n,dg(t,n),jo(t),e[Wh]=t.current,f4(e),new my(t)};py.version="19.2.0"});var Y9=Fa((kpe,G9)=>{"use strict";function V9(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V9)}catch(e){console.error(e)}}V9(),G9.exports=j9()});var yg=Fa((Mpe,Z9)=>{var X9="Expected a function",K9=NaN,dX="[object Symbol]",uX=/^\s+|\s+$/g,hX=/^[-+]0x[0-9a-f]+$/i,mX=/^0b[01]+$/i,pX=/^0o[0-7]+$/i,fX=parseInt,gX=typeof global=="object"&&global&&global.Object===Object&&global,bX=typeof self=="object"&&self&&self.Object===Object&&self,vX=gX||bX||Function("return this")(),yX=Object.prototype,xX=yX.toString,wX=Math.max,EX=Math.min,E4=function(){return vX.Date.now()};function SX(e,t,n){var r,a,i,o,l,c,s=0,d=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(X9);t=$9(t)||0,fy(n)&&(d=!!n.leading,u="maxWait"in n,i=u?wX($9(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function m(_){var C=r,k=a;return r=a=void 0,s=_,o=e.apply(k,C),o}function p(_){return s=_,l=setTimeout(g,t),d?m(_):o}function f(_){var C=_-c,k=_-s,T=t-C;return u?EX(T,i-k):T}function x(_){var C=_-c,k=_-s;return c===void 0||C>=t||C<0||u&&k>=i}function g(){var _=E4();if(x(_))return v(_);l=setTimeout(g,f(_))}function v(_){return l=void 0,h&&r?m(_):(r=a=void 0,o)}function b(){l!==void 0&&clearTimeout(l),s=0,r=c=a=l=void 0}function w(){return l===void 0?o:v(E4())}function S(){var _=E4(),C=x(_);if(r=arguments,a=this,c=_,C){if(l===void 0)return p(c);if(u)return l=setTimeout(g,t),m(c)}return l===void 0&&(l=setTimeout(g,t)),o}return S.cancel=b,S.flush=w,S}function CX(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(X9);return fy(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),SX(e,t,{leading:r,maxWait:t,trailing:a})}function fy(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function _X(e){return!!e&&typeof e=="object"}function kX(e){return typeof e=="symbol"||_X(e)&&xX.call(e)==dX}function $9(e){if(typeof e=="number")return e;if(kX(e))return K9;if(fy(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=fy(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(uX,"");var n=mX.test(e);return n||pX.test(e)?fX(e.slice(2),n?2:8):hX.test(e)?K9:+e}Z9.exports=CX});var tN=Fa(eN=>{"use strict";var sm=G();function jZ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var VZ=typeof Object.is=="function"?Object.is:jZ,GZ=sm.useState,YZ=sm.useEffect,WZ=sm.useLayoutEffect,KZ=sm.useDebugValue;function $Z(e,t){var n=t(),r=GZ({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return WZ(function(){a.value=n,a.getSnapshot=t,q4(a)&&i({inst:a})},[e,n,t]),YZ(function(){return q4(a)&&i({inst:a}),e(function(){q4(a)&&i({inst:a})})},[e]),KZ(n),n}function q4(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!VZ(e,n)}catch{return!0}}function XZ(e,t){return t()}var ZZ=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?XZ:$Z;eN.useSyncExternalStore=sm.useSyncExternalStore!==void 0?sm.useSyncExternalStore:ZZ});var rN=Fa((Pge,nN)=>{"use strict";nN.exports=tN()});var Mz=Fa((kz,Tz)=>{(function(){var e=this,t={};typeof kz<"u"?Tz.exports=t:e.fuzzy=t,t.simpleFilter=function(n,r){return r.filter(function(a){return t.test(n,a)})},t.test=function(n,r){return t.match(n,r)!==null},t.match=function(n,r,a){a=a||{};var i=0,o=[],l=r.length,c=0,s=0,d=a.pre||"",u=a.post||"",h=a.caseSensitive&&r||r.toLowerCase(),m;n=a.caseSensitive&&n||n.toLowerCase();for(var p=0;p<l;p++)m=r[p],h[p]===n[i]?(m=d+m+u,i+=1,s+=1+s):s=0,c+=s,o[o.length]=m;return i===n.length?(c=h===n?1/0:c,{rendered:o.join(""),score:c}):null},t.filter=function(n,r,a){return!r||r.length===0?[]:typeof n!="string"?r:(a=a||{},r.reduce(function(i,o,l,c){var s=o;a.extract&&(s=a.extract(o));var d=t.match(n,s,a);return d!=null&&(i[i.length]={string:d.rendered,score:d.score,index:l,original:o}),i},[]).sort(function(i,o){var l=o.score-i.score;return l||i.index-o.index}))}})()});var Lz=Fa(Iz=>{"use strict";var ox=G(),pJ=rN();function fJ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gJ=typeof Object.is=="function"?Object.is:fJ,bJ=pJ.useSyncExternalStore,vJ=ox.useRef,yJ=ox.useEffect,xJ=ox.useMemo,wJ=ox.useDebugValue;Iz.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var i=vJ(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=xJ(function(){function c(m){if(!s){if(s=!0,d=m,m=r(m),a!==void 0&&o.hasValue){var p=o.value;if(a(p,m))return u=p}return u=m}if(p=u,gJ(d,m))return p;var f=r(m);return a!==void 0&&a(p,f)?(d=m,p):(d=m,u=f)}var s=!1,d,u,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,a]);var l=bJ(e,i[0],i[1]);return yJ(function(){o.hasValue=!0,o.value=l},[l]),wJ(l),l}});var Nz=Fa((v0e,Rz)=>{"use strict";Rz.exports=Lz()});var nP=Fa((T0e,tP)=>{var VJ="Expected a function",Jz=NaN,GJ="[object Symbol]",YJ=/^\s+|\s+$/g,WJ=/^[-+]0x[0-9a-f]+$/i,KJ=/^0b[01]+$/i,$J=/^0o[0-7]+$/i,XJ=parseInt,ZJ=typeof global=="object"&&global&&global.Object===Object&&global,qJ=typeof self=="object"&&self&&self.Object===Object&&self,QJ=ZJ||qJ||Function("return this")(),JJ=Object.prototype,eee=JJ.toString,tee=Math.max,nee=Math.min,Q6=function(){return QJ.Date.now()};function ree(e,t,n){var r,a,i,o,l,c,s=0,d=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(VJ);t=eP(t)||0,J6(n)&&(d=!!n.leading,u="maxWait"in n,i=u?tee(eP(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function m(_){var C=r,k=a;return r=a=void 0,s=_,o=e.apply(k,C),o}function p(_){return s=_,l=setTimeout(g,t),d?m(_):o}function f(_){var C=_-c,k=_-s,T=t-C;return u?nee(T,i-k):T}function x(_){var C=_-c,k=_-s;return c===void 0||C>=t||C<0||u&&k>=i}function g(){var _=Q6();if(x(_))return v(_);l=setTimeout(g,f(_))}function v(_){return l=void 0,h&&r?m(_):(r=a=void 0,o)}function b(){l!==void 0&&clearTimeout(l),s=0,r=c=a=l=void 0}function w(){return l===void 0?o:v(Q6())}function S(){var _=Q6(),C=x(_);if(r=arguments,a=this,c=_,C){if(l===void 0)return p(c);if(u)return l=setTimeout(g,t),m(c)}return l===void 0&&(l=setTimeout(g,t)),o}return S.cancel=b,S.flush=w,S}function J6(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function aee(e){return!!e&&typeof e=="object"}function iee(e){return typeof e=="symbol"||aee(e)&&eee.call(e)==GJ}function eP(e){if(typeof e=="number")return e;if(iee(e))return Jz;if(J6(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=J6(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(YJ,"");var n=KJ.test(e);return n||$J.test(e)?XJ(e.slice(2),n?2:8):WJ.test(e)?Jz:+e}tP.exports=ree});var vE=M(G(),1),_W=M(Y9(),1);var wo=M(G(),1);function W9(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=W9(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function H(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=W9(t))&&(r&&(r+=" "),r+=n);return r}var nB=M(yg(),1),mn=M(G(),1),$r=M(gi(),1);var TX=0;function Dt(e,t){let n=`atom${++TX}`,r={toString(){return(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=MX,r.write=AX),t&&(r.write=t),r}function MX(e){return e(this)}function AX(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}var q9=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,C4=e=>"init"in e,S4=e=>!!e.write,by=new WeakMap,_4=e=>{var t;return k4(e)&&!((t=by.get(e))!=null&&t[1])},DX=(e,t)=>{let n=by.get(e);if(n)n[1]=!0,n[0].forEach(r=>r(t));else if((import.meta.env?import.meta.env.MODE:void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},IX=e=>{if(by.has(e))return;let t=[new Set,!1];by.set(e,t);let n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},k4=e=>typeof e?.then=="function",Q9=e=>"v"in e||"e"in e,gy=e=>{if("e"in e)throw e.e;if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},tR=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},J9=(e,t,n,r,a)=>{var i;if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&r===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,a.n),_4(n.v)&&tR(t,n.v,a),(i=a.m)==null||i.t.add(t),e&&LX(e,r,t)},xg=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),Eg=(e,t,n)=>{e[t].add(n)},eR=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),Eg(e,"M",()=>{var r;(r=n.m)==null||r.l.forEach(a=>Eg(e,"M",a))}))},LX=(e,t,n)=>{let r=e.D.get(t);r&&r.add(n)},RX=(e,t)=>e.D.get(t),Dd=e=>{let t,n=!1,r=a=>{try{a()}catch(i){n||(t=i,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},nR=(...[e,t,n,r])=>{let a=(g,v,b)=>{let w="v"in v,S=v.v,_=_4(v.v)?v.v:null;if(k4(b)){IX(b);for(let C of v.d.keys())tR(g,b,e(C));v.v=b}else v.v=b;delete v.e,delete v.x,(!w||!Object.is(S,v.v))&&(++v.n,_&&DX(_,b))},i=(g,v)=>{var b;let w=e(v);if(Q9(w)&&(w.m&&!w.x||Array.from(w.d).every(([I,A])=>i(g,I).n===A)))return w;w.d.clear();let S=!0,_=I=>{if(q9(v,I)){let O=e(I);if(!Q9(O))if(C4(I))a(I,O,I.init);else throw new Error("no atom init");return gy(O)}let A=i(g,I);try{return gy(A)}finally{if(S)J9(g,v,w,I,A);else{let O=xg();J9(O,v,w,I,A),u(O,v,w),Dd(O)}}},C,k,T={get signal(){return C||(C=new AbortController),C.signal},get setSelf(){return(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!S4(v)&&console.warn("setSelf function cannot be used with read-only atom"),!k&&S4(v)&&(k=(...I)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&S&&console.warn("setSelf function cannot be called in sync"),!S)return d(v,...I)}),k}};try{let I=t(v,_,T);if(a(v,w,I),k4(I)){(b=I.onCancel)==null||b.call(I,()=>C?.abort());let A=()=>{if(w.m){let O=xg();u(O,v,w),Dd(O)}};I.then(A,A)}return w}catch(I){return delete w.v,w.e=I,delete w.x,++w.n,w}finally{S=!1}},o=g=>gy(i(void 0,g)),l=(g,v,b)=>{var w,S;let _=new Map;for(let C of((w=b.m)==null?void 0:w.t)||[]){let k=e(C);k.m&&_.set(C,k)}for(let C of b.p)_.set(C,e(C));return(S=RX(g,v))==null||S.forEach(C=>{_.set(C,e(C))}),_},c=(g,v,b)=>{let w=[],S=new Set,_=new Set,C=[[v,b]];for(;C.length>0;){let[k,T]=C[C.length-1];if(_.has(k)){C.pop();continue}if(S.has(k)){w.push([k,T,T.n]),_.add(k),T.x=!0,C.pop();continue}S.add(k);for(let[I,A]of l(g,k,T))k!==I&&!S.has(I)&&C.push([I,A])}Eg(g,"H",()=>{let k=new Set([v]);for(let T=w.length-1;T>=0;--T){let[I,A,O]=w[T],V=!1;for(let j of A.d.keys())if(j!==I&&k.has(j)){V=!0;break}V&&(i(g,I),u(g,I,A),O!==A.n&&(eR(g,I,A),k.add(I))),delete A.x}})},s=(g,v,...b)=>{let w=!0,S=C=>gy(i(g,C)),_=(C,...k)=>{let T=e(C);try{if(q9(v,C)){if(!C4(C))throw new Error("atom not writable");let I=T.n,A=k[0];a(C,T,A),u(g,C,T),I!==T.n&&(eR(g,C,T),c(g,C,T));return}else return s(g,C,...k)}finally{w||Dd(g)}};try{return n(v,S,_,...b)}finally{w=!1}},d=(g,...v)=>{let b=xg();try{return s(b,g,...v)}finally{Dd(b)}},u=(g,v,b)=>{if(b.m&&!_4(b.v)){for(let w of b.d.keys())b.m.d.has(w)||(h(g,w,e(w)).t.add(v),b.m.d.add(w));for(let w of b.m.d||[])if(!b.d.has(w)){b.m.d.delete(w);let S=m(g,w,e(w));S?.t.delete(v)}}},h=(g,v,b)=>{if(!b.m){i(g,v);for(let w of b.d.keys())h(g,w,e(w)).t.add(v);if(b.m={l:new Set,d:new Set(b.d.keys()),t:new Set},S4(v)){let w=b.m,S,_=(C,k)=>{let T=!0;S=(...I)=>{try{return s(C,v,...I)}finally{T||Dd(C)}};try{return k()}finally{T=!1}};Eg(g,"L",()=>{let C=_(g,()=>r(v,(...k)=>S(...k)));C&&(w.u=k=>_(k,C))})}}return b.m},m=(g,v,b)=>{if(b.m&&!b.m.l.size&&!Array.from(b.m.t).some(w=>{var S;return(S=e(w).m)==null?void 0:S.d.has(v)})){let w=b.m.u;w&&Eg(g,"L",()=>w(g)),delete b.m;for(let S of b.d.keys()){let _=m(g,S,e(S));_?.t.delete(v)}return}return b.m};return{get:o,set:d,sub:(g,v)=>{let b=xg(),w=e(g),_=h(b,g,w).l;return _.add(v),Dd(b),()=>{_.delete(v);let C=xg();m(C,g,w),Dd(C)}},unstable_derive:g=>nR(...g(e,t,n,r))}},NX=e=>{let t=new WeakMap,n=new Set,r,a=0,i=e.unstable_derive((c,s,d,u)=>(r=c,[h=>{let m=t.get(h);if(!m){let p=c(h);m=new Proxy(p,{set(f,x,g){return x==="m"&&n.add(h),Reflect.set(f,x,g)},deleteProperty(f,x){return x==="m"&&n.delete(h),Reflect.deleteProperty(f,x)}}),t.set(h,m)}return m},s,(h,m,p,...f)=>a?p(h,...f):d(h,m,p,...f),u])),o=i.set;return Object.assign(i,{dev4_get_internal_weak_map:()=>({get:c=>{let s=r(c);if(s.n!==0)return s}}),dev4_get_mounted_atoms:()=>n,dev4_restore_atoms:c=>{o({read:()=>null,write:(d,u)=>{++a;try{for(let[h,m]of c)C4(h)&&u(h,m)}finally{--a}}})}})},Jh=()=>{let e=new WeakMap,n=nR(r=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!r)throw new Error("Atom is undefined or null");let a=e.get(r);return a||(a={d:new Map,p:new Set,n:0},e.set(r,a)),a},(r,...a)=>r.read(...a),(r,...a)=>r.write(...a),(r,...a)=>{var i;return(i=r.onMount)==null?void 0:i.call(r,...a)});return(import.meta.env?import.meta.env.MODE:void 0)!=="production"?NX(n):n},wg,rR=()=>(wg||(wg=Jh(),(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=wg),globalThis.__JOTAI_DEFAULT_STORE__!==wg&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),wg);var Ir=M(G(),1);var OX=(0,Ir.createContext)(void 0),em=e=>{let t=(0,Ir.useContext)(OX);return e?.store||t||rR()};var M4=e=>typeof e?.then=="function",iR=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},zX=Ir.default.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(iR(e),e)}),T4=new WeakMap,aR=e=>{let t=T4.get(e);return t||(t=new Promise((n,r)=>{let a=e,i=c=>s=>{a===c&&n(s)},o=c=>s=>{a===c&&r(s)},l=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(s=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&s===c)throw new Error("[Bug] p is not updated even after cancelation");M4(s)?(T4.set(s,t),a=s,s.then(i(s),o(s)),l(s)):n(s)})};e.then(i(e),o(e)),l(e)}),T4.set(e,t)),t};function A4(e,t){let n=em(t),[[r,a,i],o]=(0,Ir.useReducer)(s=>{let d=n.get(e);return Object.is(s[0],d)&&s[1]===n&&s[2]===e?s:[d,n,e]},void 0,()=>[n.get(e),n,e]),l=r;(a!==n||i!==e)&&(o(),l=n.get(e));let c=t?.delay;if((0,Ir.useEffect)(()=>{let s=n.sub(e,()=>{if(typeof c=="number"){let d=n.get(e);M4(d)&&iR(aR(d)),setTimeout(o,c);return}o()});return o(),s},[n,e,c]),(0,Ir.useDebugValue)(l),M4(l)){let s=aR(l);return zX(s)}return l}function vy(e,t){let n=em(t);return(0,Ir.useCallback)((...a)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...a)},[n,e])}function D4(e,t){return[A4(e,t),vy(e,t)]}var cR=M(B(),1),Xl=M(G(),1);var lR=M(G(),1);var oR=new WeakMap;function sR(e,t){let n=em(t),r=PX(n);for(let[a,i]of e)(!r.has(a)||t?.dangerouslyForceHydrate)&&(r.add(a),n.set(a,i))}var PX=e=>{let t=oR.get(e);return t||(t=new WeakSet,oR.set(e,t)),t};function tm(){return tm=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},tm.apply(this,arguments)}function yy(){let e=(0,Xl.createContext)(null);function t({store:o,initialValues:l=[],children:c}){let s=(0,Xl.useRef)(o);return s.current||(s.current=Jh()),sR(l,{store:s.current}),(0,cR.jsx)(e.Provider,{value:s.current,children:c})}let n=o=>{let l=(0,Xl.useContext)(e);if(!l)throw new Error("Missing Provider from createIsolation");return em(tm({store:l},o))};return{Provider:t,useStore:n,useAtom:(o,l)=>{let c=n();return D4(o,tm({store:c},l))},useAtomValue:(o,l)=>{let c=n();return A4(o,tm({store:c},l))},useSetAtom:(o,l)=>{let c=n();return vy(o,tm({store:c},l))}}}var{read:Bpe,write:Fpe}=Dt(null);var Hpe=(0,Xl.createContext)({scope:void 0,baseStore:void 0});var pn=M(G(),1);var y=M(B(),1);var bo=M(G(),1);var CB=M(G(),1),Sx=M(B(),1),Fi=M(B(),1),_B=M(B(),1);var j1=M(B(),1);var TB=M(B(),1);var Na=M(G(),1);var MB=M(G(),1),AB=M(B(),1),Ac=M(B(),1);var hR=M(G(),1),mR=M(gi(),1);var Bn=M(G(),1);var uR=M(G(),1);function dR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Id(...e){return t=>{let n=!1,r=e.map(a=>{let i=dR(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){let i=r[a];typeof i=="function"?i():dR(e[a],null)}}}}function Yt(...e){return uR.useCallback(Id(...e),e)}var xy=M(B(),1);function Zl(e){let t=UX(e),n=Bn.forwardRef((r,a)=>{let{children:i,...o}=r,l=Bn.Children.toArray(i),c=l.find(FX);if(c){let s=c.props.children,d=l.map(u=>u===c?Bn.Children.count(s)>1?Bn.Children.only(null):Bn.isValidElement(s)?s.props.children:null:u);return(0,xy.jsx)(t,{...o,ref:a,children:Bn.isValidElement(s)?Bn.cloneElement(s,void 0,d):null})}return(0,xy.jsx)(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function UX(e){let t=Bn.forwardRef((n,r)=>{let{children:a,...i}=n;if(Bn.isValidElement(a)){let o=jX(a),l=HX(i,a.props);return a.type!==Bn.Fragment&&(l.ref=r?Id(r,o):o),Bn.cloneElement(a,l)}return Bn.Children.count(a)>1?Bn.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BX=Symbol("radix.slottable");function FX(e){return Bn.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BX}function HX(e,t){let n={...t};for(let r in t){let a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{let c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function jX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pR=M(B(),1),VX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=VX.reduce((e,t)=>{let n=Zl(`Primitive.${t}`),r=hR.forwardRef((a,i)=>{let{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,pR.jsx)(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wy(e,t){e&&mR.flushSync(()=>e.dispatchEvent(t))}var ql=M(G(),1),fR=M(B(),1);function ya(e,t=[]){let n=[];function r(i,o){let l=ql.createContext(o),c=n.length;n=[...n,o];let s=u=>{let{scope:h,children:m,...p}=u,f=h?.[e]?.[c]||l,x=ql.useMemo(()=>p,Object.values(p));return(0,fR.jsx)(f.Provider,{value:x,children:m})};s.displayName=i+"Provider";function d(u,h){let m=h?.[e]?.[c]||l,p=ql.useContext(m);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[s,d]}let a=()=>{let i=n.map(o=>ql.createContext(o));return function(l){let c=l?.[e]||i;return ql.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,GX(a,...t)]}function GX(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){let o=r.reduce((l,{useScope:c,scopeName:s})=>{let u=c(i)[`__scope${s}`];return{...l,...u}},{});return ql.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var gc=M(G(),1);var Ey=M(B(),1),YX=M(G(),1);var WX=M(B(),1);function Sy(e){let t=e+"CollectionProvider",[n,r]=ya(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=f=>{let{scope:x,children:g}=f,v=gc.default.useRef(null),b=gc.default.useRef(new Map).current;return(0,Ey.jsx)(a,{scope:x,itemMap:b,collectionRef:v,children:g})};o.displayName=t;let l=e+"CollectionSlot",c=Zl(l),s=gc.default.forwardRef((f,x)=>{let{scope:g,children:v}=f,b=i(l,g),w=Yt(x,b.collectionRef);return(0,Ey.jsx)(c,{ref:w,children:v})});s.displayName=l;let d=e+"CollectionItemSlot",u="data-radix-collection-item",h=Zl(d),m=gc.default.forwardRef((f,x)=>{let{scope:g,children:v,...b}=f,w=gc.default.useRef(null),S=Yt(x,w),_=i(d,g);return gc.default.useEffect(()=>(_.itemMap.set(w,{ref:w,...b}),()=>{_.itemMap.delete(w)})),(0,Ey.jsx)(h,{[u]:"",ref:S,children:v})});m.displayName=d;function p(f){let x=i(e+"CollectionConsumer",f);return gc.default.useCallback(()=>{let v=x.collectionRef.current;if(!v)return[];let b=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((_,C)=>b.indexOf(_.ref.current)-b.indexOf(C.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:s,ItemSlot:m},p,r]}var Jpe=!!(typeof window<"u"&&window.document&&window.document.createElement);function xe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}var Ti=M(G(),1);var gR=M(G(),1),xa=globalThis?.document?gR.useLayoutEffect:()=>{};var Cy=M(G(),1);var KX=Ti[" useInsertionEffect ".trim().toString()]||xa;function Ql({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[a,i,o]=$X({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{let d=Ti.useRef(e!==void 0);Ti.useEffect(()=>{let u=d.current;u!==l&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}let s=Ti.useCallback(d=>{if(l){let u=XX(d)?d(e):d;u!==e&&o.current?.(u)}else i(d)},[l,e,i,o]);return[c,s]}function $X({defaultProp:e,onChange:t}){let[n,r]=Ti.useState(e),a=Ti.useRef(n),i=Ti.useRef(t);return KX(()=>{i.current=t},[t]),Ti.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function XX(e){return typeof e=="function"}var wa=M(G(),1);var bR=M(G(),1);function ZX(e,t){return bR.useReducer((n,r)=>t[n][r]??n,e)}var io=e=>{let{present:t,children:n}=e,r=qX(t),a=typeof n=="function"?n({present:r.isPresent}):wa.Children.only(n),i=Yt(r.ref,QX(a));return typeof n=="function"||r.isPresent?wa.cloneElement(a,{ref:i}):null};io.displayName="Presence";function qX(e){let[t,n]=wa.useState(),r=wa.useRef(null),a=wa.useRef(e),i=wa.useRef("none"),o=e?"mounted":"unmounted",[l,c]=ZX(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return wa.useEffect(()=>{let s=_y(r.current);i.current=l==="mounted"?s:"none"},[l]),xa(()=>{let s=r.current,d=a.current;if(d!==e){let h=i.current,m=_y(s);e?c("MOUNT"):m==="none"||s?.display==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),xa(()=>{if(t){let s,d=t.ownerDocument.defaultView??window,u=m=>{let f=_y(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&f&&(c("ANIMATION_END"),!a.current)){let x=t.style.animationFillMode;t.style.animationFillMode="forwards",s=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=m=>{m.target===t&&(i.current=_y(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(s),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:wa.useCallback(s=>{r.current=s?getComputedStyle(s):null,n(s)},[])}}function _y(e){return e?.animationName||"none"}function QX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var I4=M(G(),1);var JX=I4[" useId ".trim().toString()]||(()=>{}),eZ=0;function Mi(e){let[t,n]=I4.useState(JX());return xa(()=>{e||n(r=>r??String(eZ++))},[e]),e||(t?`radix-${t}`:"")}var ky=M(G(),1),tZ=M(B(),1),nZ=ky.createContext(void 0);function nm(e){let t=ky.useContext(nZ);return e||t||"ltr"}var Jt=M(G(),1);var rm=M(G(),1);function Lr(e){let t=rm.useRef(e);return rm.useEffect(()=>{t.current=e}),rm.useMemo(()=>(...n)=>t.current?.(...n),[])}var vR=M(G(),1);function yR(e,t=globalThis?.document){let n=Lr(e);vR.useEffect(()=>{let r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var R4=M(B(),1),rZ="DismissableLayer",L4="dismissableLayer.update",aZ="dismissableLayer.pointerDownOutside",iZ="dismissableLayer.focusOutside",xR,ER=Jt.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sg=Jt.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,s=Jt.useContext(ER),[d,u]=Jt.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=Jt.useState({}),p=Yt(t,C=>u(C)),f=Array.from(s.layers),[x]=[...s.layersWithOutsidePointerEventsDisabled].slice(-1),g=f.indexOf(x),v=d?f.indexOf(d):-1,b=s.layersWithOutsidePointerEventsDisabled.size>0,w=v>=g,S=sZ(C=>{let k=C.target,T=[...s.branches].some(I=>I.contains(k));!w||T||(a?.(C),o?.(C),C.defaultPrevented||l?.())},h),_=cZ(C=>{let k=C.target;[...s.branches].some(I=>I.contains(k))||(i?.(C),o?.(C),C.defaultPrevented||l?.())},h);return yR(C=>{v===s.layers.size-1&&(r?.(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},h),Jt.useEffect(()=>{if(d)return n&&(s.layersWithOutsidePointerEventsDisabled.size===0&&(xR=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),s.layersWithOutsidePointerEventsDisabled.add(d)),s.layers.add(d),wR(),()=>{n&&s.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=xR)}},[d,h,n,s]),Jt.useEffect(()=>()=>{d&&(s.layers.delete(d),s.layersWithOutsidePointerEventsDisabled.delete(d),wR())},[d,s]),Jt.useEffect(()=>{let C=()=>m({});return document.addEventListener(L4,C),()=>document.removeEventListener(L4,C)},[]),(0,R4.jsx)(st.div,{...c,ref:p,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:xe(e.onFocusCapture,_.onFocusCapture),onBlurCapture:xe(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:xe(e.onPointerDownCapture,S.onPointerDownCapture)})});Sg.displayName=rZ;var oZ="DismissableLayerBranch",lZ=Jt.forwardRef((e,t)=>{let n=Jt.useContext(ER),r=Jt.useRef(null),a=Yt(t,r);return Jt.useEffect(()=>{let i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),(0,R4.jsx)(st.div,{...e,ref:a})});lZ.displayName=oZ;function sZ(e,t=globalThis?.document){let n=Lr(e),r=Jt.useRef(!1),a=Jt.useRef(()=>{});return Jt.useEffect(()=>{let i=l=>{if(l.target&&!r.current){let s=function(){SR(aZ,n,d,{discrete:!0})};var c=s;let d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=s,t.addEventListener("click",a.current,{once:!0})):s()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cZ(e,t=globalThis?.document){let n=Lr(e),r=Jt.useRef(!1);return Jt.useEffect(()=>{let a=i=>{i.target&&!r.current&&SR(iZ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wR(){let e=new CustomEvent(L4);document.dispatchEvent(e)}function SR(e,t,n,{discrete:r}){let a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?wy(a,i):a.dispatchEvent(i)}var Ai=M(G(),1);var MR=M(B(),1),N4="focusScope.autoFocusOnMount",O4="focusScope.autoFocusOnUnmount",CR={bubbles:!1,cancelable:!0},dZ="FocusScope",Cg=Ai.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=Ai.useState(null),s=Lr(a),d=Lr(i),u=Ai.useRef(null),h=Yt(t,f=>c(f)),m=Ai.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Ai.useEffect(()=>{if(r){let v=function(_){if(m.paused||!l)return;let C=_.target;l.contains(C)?u.current=C:bc(u.current,{select:!0})},b=function(_){if(m.paused||!l)return;let C=_.relatedTarget;C!==null&&(l.contains(C)||bc(u.current,{select:!0}))},w=function(_){if(document.activeElement===document.body)for(let k of _)k.removedNodes.length>0&&bc(l)};var f=v,x=b,g=w;document.addEventListener("focusin",v),document.addEventListener("focusout",b);let S=new MutationObserver(w);return l&&S.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),S.disconnect()}}},[r,l,m.paused]),Ai.useEffect(()=>{if(l){kR.add(m);let f=document.activeElement;if(!l.contains(f)){let g=new CustomEvent(N4,CR);l.addEventListener(N4,s),l.dispatchEvent(g),g.defaultPrevented||(uZ(gZ(AR(l)),{select:!0}),document.activeElement===f&&bc(l))}return()=>{l.removeEventListener(N4,s),setTimeout(()=>{let g=new CustomEvent(O4,CR);l.addEventListener(O4,d),l.dispatchEvent(g),g.defaultPrevented||bc(f??document.body,{select:!0}),l.removeEventListener(O4,d),kR.remove(m)},0)}}},[l,s,d,m]);let p=Ai.useCallback(f=>{if(!n&&!r||m.paused)return;let x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,g=document.activeElement;if(x&&g){let v=f.currentTarget,[b,w]=hZ(v);b&&w?!f.shiftKey&&g===w?(f.preventDefault(),n&&bc(b,{select:!0})):f.shiftKey&&g===b&&(f.preventDefault(),n&&bc(w,{select:!0})):g===v&&f.preventDefault()}},[n,r,m.paused]);return(0,MR.jsx)(st.div,{tabIndex:-1,...o,ref:h,onKeyDown:p})});Cg.displayName=dZ;function uZ(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bc(r,{select:t}),document.activeElement!==n)return}function hZ(e){let t=AR(e),n=_R(t,e),r=_R(t.reverse(),e);return[n,r]}function AR(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{let a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _R(e,t){for(let n of e)if(!mZ(n,{upTo:t}))return n}function mZ(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 pZ(e){return e instanceof HTMLInputElement&&"select"in e}function bc(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pZ(e)&&t&&e.select()}}var kR=fZ();function fZ(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=TR(e,t),e.unshift(t)},remove(t){e=TR(e,t),e[0]?.resume()}}}function TR(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gZ(e){return e.filter(t=>t.tagName!=="A")}var Ty=M(G(),1),DR=M(gi(),1);var IR=M(B(),1),bZ="Portal",_g=Ty.forwardRef((e,t)=>{let{container:n,...r}=e,[a,i]=Ty.useState(!1);xa(()=>i(!0),[]);let o=n||a&&globalThis?.document?.body;return o?DR.default.createPortal((0,IR.jsx)(st.div,{...r,ref:t}),o):null});_g.displayName=bZ;var RR=M(G(),1),z4=0;function My(){RR.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??LR()),document.body.insertAdjacentElement("beforeend",e[1]??LR()),z4++,()=>{z4===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z4--}},[])}function LR(){let 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 Ea=function(){return Ea=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ea.apply(this,arguments)};function Ay(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function NR(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ny=M(G());var Rr=M(G());var Ld="right-scroll-bar-position",Rd="width-before-scroll-bar",P4="with-scroll-bars-hidden",U4="--removed-body-scroll-bar-size";function Dy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var OR=M(G());function zR(e,t){var n=(0,OR.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var Iy=M(G());var vZ=typeof window<"u"?Iy.useLayoutEffect:Iy.useEffect,PR=new WeakMap;function B4(e,t){var n=zR(t||null,function(r){return e.forEach(function(a){return Dy(a,r)})});return vZ(function(){var r=PR.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||Dy(l,null)}),i.forEach(function(l){a.has(l)||Dy(l,o)})}PR.set(n,e)},[e]),n}function yZ(e){return e}function xZ(e,t){t===void 0&&(t=yZ);var n=[],r=!1,a={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(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var d=o;o=[],d.forEach(i)},s=function(){return Promise.resolve().then(c)};s(),n={push:function(d){o.push(d),s()},filter:function(d){return o=o.filter(d),n}}}};return a}function F4(e){e===void 0&&(e={});var t=xZ(null);return t.options=Ea({async:!0,ssr:!1},e),t}var UR=M(G()),BR=function(e){var t=e.sideCar,n=Ay(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 UR.createElement(r,Ea({},n))};BR.isSideCarExport=!0;function H4(e,t){return e.useMedium(t),BR}var Ly=F4();var j4=function(){},kg=Rr.forwardRef(function(e,t){var n=Rr.useRef(null),r=Rr.useState({onScrollCapture:j4,onWheelCapture:j4,onTouchMoveCapture:j4}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,s=e.removeScrollBar,d=e.enabled,u=e.shards,h=e.sideCar,m=e.noRelative,p=e.noIsolation,f=e.inert,x=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,b=e.gapMode,w=Ay(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,_=B4([n,t]),C=Ea(Ea({},w),a);return Rr.createElement(Rr.Fragment,null,d&&Rr.createElement(S,{sideCar:Ly,removeScrollBar:s,shards:u,noRelative:m,noIsolation:p,inert:f,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:b}),o?Rr.cloneElement(Rr.Children.only(l),Ea(Ea({},C),{ref:_})):Rr.createElement(v,Ea({},C,{className:c,ref:_}),l))});kg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kg.classNames={fullWidth:Rd,zeroRight:Ld};var Ht=M(G());var im=M(G());var jR=M(G());var FR;var HR=function(){if(FR)return FR;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wZ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=HR();return t&&e.setAttribute("nonce",t),e}function EZ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SZ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V4=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wZ())&&(EZ(t,n),SZ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var G4=function(){var e=V4();return function(t,n){jR.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}};var Tg=function(){var e=G4(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t};var CZ={left:0,top:0,right:0,gap:0},Y4=function(e){return parseInt(e||"",10)||0},_Z=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Y4(n),Y4(r),Y4(a)]},W4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return CZ;var t=_Z(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])}};var kZ=Tg(),am="data-scroll-locked",TZ=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
-
.`.concat(P4,` {
|
|
11
|
-
overflow: hidden `).concat(r,`;
|
|
12
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(am,`] {
|
|
15
|
-
overflow: hidden `).concat(r,`;
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
18
|
-
padding-left: `.concat(a,`px;
|
|
19
|
-
padding-top: `).concat(i,`px;
|
|
20
|
-
padding-right: `).concat(o,`px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
24
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(Ld,` {
|
|
28
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(Rd,` {
|
|
32
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(Ld," .").concat(Ld,` {
|
|
36
|
-
right: 0 `).concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Rd," .").concat(Rd,` {
|
|
40
|
-
margin-right: 0 `).concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(am,`] {
|
|
44
|
-
`).concat(U4,": ").concat(l,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},VR=function(){var e=parseInt(document.body.getAttribute(am)||"0",10);return isFinite(e)?e:0},MZ=function(){im.useEffect(function(){return document.body.setAttribute(am,(VR()+1).toString()),function(){var e=VR()-1;e<=0?document.body.removeAttribute(am):document.body.setAttribute(am,e.toString())}},[])},K4=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;MZ();var i=im.useMemo(function(){return W4(a)},[a]);return im.createElement(kZ,{styles:TZ(i,!t,a,n?"":"!important")})};var $4=!1;if(typeof window<"u")try{Mg=Object.defineProperty({},"passive",{get:function(){return $4=!0,!0}}),window.addEventListener("test",Mg,Mg),window.removeEventListener("test",Mg,Mg)}catch{$4=!1}var Mg,Nd=$4?{passive:!1}:!1;var AZ=function(e){return e.tagName==="TEXTAREA"},GR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!AZ(e)&&n[t]==="visible")},DZ=function(e){return GR(e,"overflowY")},IZ=function(e){return GR(e,"overflowX")},X4=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=YR(e,r);if(a){var i=WR(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},LZ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},RZ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},YR=function(e,t){return e==="v"?DZ(t):IZ(t)},WR=function(e,t){return e==="v"?LZ(t):RZ(t)},NZ=function(e,t){return e==="h"&&t==="rtl"?-1:1},KR=function(e,t,n,r,a){var i=NZ(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),s=!1,d=o>0,u=0,h=0;do{if(!l)break;var m=WR(e,l),p=m[0],f=m[1],x=m[2],g=f-x-i*p;(p||g)&&YR(e,l)&&(u+=g,h+=p);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(a&&Math.abs(u)<1||!a&&o>u)||!d&&(a&&Math.abs(h)<1||!a&&-o>h))&&(s=!0),s};var Ry=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$R=function(e){return[e.deltaX,e.deltaY]},XR=function(e){return e&&"current"in e?e.current:e},OZ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},zZ=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},PZ=0,om=[];function ZR(e){var t=Ht.useRef([]),n=Ht.useRef([0,0]),r=Ht.useRef(),a=Ht.useState(PZ++)[0],i=Ht.useState(Tg)[0],o=Ht.useRef(e);Ht.useEffect(function(){o.current=e},[e]),Ht.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var f=NR([e.lockRef.current],(e.shards||[]).map(XR),!0).filter(Boolean);return f.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),f.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=Ht.useCallback(function(f,x){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!o.current.allowPinchZoom;var g=Ry(f),v=n.current,b="deltaX"in f?f.deltaX:v[0]-g[0],w="deltaY"in f?f.deltaY:v[1]-g[1],S,_=f.target,C=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in f&&C==="h"&&_.type==="range")return!1;var k=window.getSelection(),T=k&&k.anchorNode,I=T?T===_||T.contains(_):!1;if(I)return!1;var A=X4(C,_);if(!A)return!0;if(A?S=C:(S=C==="v"?"h":"v",A=X4(C,_)),!A)return!1;if(!r.current&&"changedTouches"in f&&(b||w)&&(r.current=S),!S)return!0;var O=r.current||S;return KR(O,x,f,O==="h"?b:w,!0)},[]),c=Ht.useCallback(function(f){var x=f;if(!(!om.length||om[om.length-1]!==i)){var g="deltaY"in x?$R(x):Ry(x),v=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&OZ(S.delta,g)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(XR).filter(Boolean).filter(function(S){return S.contains(x.target)}),w=b.length>0?l(x,b[0]):!o.current.noIsolation;w&&x.cancelable&&x.preventDefault()}}},[]),s=Ht.useCallback(function(f,x,g,v){var b={name:f,delta:x,target:g,should:v,shadowParent:UZ(g)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),d=Ht.useCallback(function(f){n.current=Ry(f),r.current=void 0},[]),u=Ht.useCallback(function(f){s(f.type,$R(f),f.target,l(f,e.lockRef.current))},[]),h=Ht.useCallback(function(f){s(f.type,Ry(f),f.target,l(f,e.lockRef.current))},[]);Ht.useEffect(function(){return om.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Nd),document.addEventListener("touchmove",c,Nd),document.addEventListener("touchstart",d,Nd),function(){om=om.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,Nd),document.removeEventListener("touchmove",c,Nd),document.removeEventListener("touchstart",d,Nd)}},[]);var m=e.removeScrollBar,p=e.inert;return Ht.createElement(Ht.Fragment,null,p?Ht.createElement(i,{styles:zZ(a)}):null,m?Ht.createElement(K4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function UZ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var qR=H4(Ly,ZR);var QR=Ny.forwardRef(function(e,t){return Ny.createElement(kg,Ea({},e,{ref:t,sideCar:qR}))});QR.classNames=kg.classNames;var Ag=QR;var BZ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},lm=new WeakMap,Oy=new WeakMap,zy={},Z4=0,JR=function(e){return e&&(e.host||JR(e.parentNode))},FZ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=JR(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})},HZ=function(e,t,n,r){var a=FZ(t,Array.isArray(e)?e:[e]);zy[n]||(zy[n]=new WeakMap);var i=zy[n],o=[],l=new Set,c=new Set(a),s=function(u){!u||l.has(u)||(l.add(u),s(u.parentNode))};a.forEach(s);var d=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(r),p=m!==null&&m!=="false",f=(lm.get(h)||0)+1,x=(i.get(h)||0)+1;lm.set(h,f),i.set(h,x),o.push(h),f===1&&p&&Oy.set(h,!0),x===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return d(t),l.clear(),Z4++,function(){o.forEach(function(u){var h=lm.get(u)-1,m=i.get(u)-1;lm.set(u,h),i.set(u,m),h||(Oy.has(u)||u.removeAttribute(r),Oy.delete(u)),m||u.removeAttribute(n)}),Z4--,Z4||(lm=new WeakMap,lm=new WeakMap,Oy=new WeakMap,zy={})}},Py=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=t||BZ(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),HZ(r,a,n,"aria-hidden")):function(){return null}};var aN=M(G(),1);function iN(e){let[t,n]=aN.useState(void 0);return xa(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;let i=a[0],o,l;if("borderBoxSize"in i){let c=i.borderBoxSize,s=Array.isArray(c)?c[0]:c;o=s.inlineSize,l=s.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ce=M(G(),1);var Ca=M(G(),1);var sN=["top","right","bottom","left"];var Vo=Math.min,Kr=Math.max,Ig=Math.round,Lg=Math.floor,oo=e=>({x:e,y:e}),qZ={left:"right",right:"left",bottom:"top",top:"bottom"};function By(e,t,n){return Kr(e,Vo(t,n))}function Go(e,t){return typeof e=="function"?e(t):e}function Yo(e){return e.split("-")[0]}function Od(e){return e.split("-")[1]}function Fy(e){return e==="x"?"y":"x"}function Hy(e){return e==="y"?"height":"width"}function lo(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function jy(e){return Fy(lo(e))}function cN(e,t,n){n===void 0&&(n=!1);let r=Od(e),a=jy(e),i=Hy(a),o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Dg(o)),[o,Dg(o)]}function dN(e){let t=Dg(e);return[Uy(e),t,Uy(t)]}function Uy(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var oN=["left","right"],lN=["right","left"],QZ=["top","bottom"],JZ=["bottom","top"];function eq(e,t,n){switch(e){case"top":case"bottom":return n?t?lN:oN:t?oN:lN;case"left":case"right":return t?QZ:JZ;default:return[]}}function uN(e,t,n,r){let a=Od(e),i=eq(Yo(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Uy)))),i}function Dg(e){let t=Yo(e);return qZ[t]+e.slice(t.length)}function tq(e){return{top:0,right:0,bottom:0,left:0,...e}}function Q4(e){return typeof e!="number"?tq(e):{top:e,right:e,bottom:e,left:e}}function zd(e){let{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function hN(e,t,n){let{reference:r,floating:a}=e,i=lo(t),o=jy(t),l=Hy(o),c=Yo(t),s=i==="y",d=r.x+r.width/2-a.width/2,u=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2,m;switch(c){case"top":m={x:d,y:r.y-a.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-a.width,y:u};break;default:m={x:r.x,y:r.y}}switch(Od(t)){case"start":m[o]-=h*(n&&s?-1:1);break;case"end":m[o]+=h*(n&&s?-1:1);break}return m}async function fN(e,t){var n;t===void 0&&(t={});let{x:r,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=Go(t,e),p=Q4(m),x=l[h?u==="floating"?"reference":"floating":u],g=zd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:d,strategy:c})),v=u==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},S=zd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:b,strategy:c}):v);return{top:(g.top-S.top+p.top)/w.y,bottom:(S.bottom-g.bottom+p.bottom)/w.y,left:(g.left-S.left+p.left)/w.x,right:(S.right-g.right+p.right)/w.x}}var nq=50,gN=async(e,t,n)=>{let{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:fN},c=await(o.isRTL==null?void 0:o.isRTL(t)),s=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:u}=hN(s,r,c),h=r,m=0,p={};for(let f=0;f<i.length;f++){let x=i[f];if(!x)continue;let{name:g,fn:v}=x,{x:b,y:w,data:S,reset:_}=await v({x:d,y:u,initialPlacement:r,placement:h,strategy:a,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});d=b??d,u=w??u,p[g]={...p[g],...S},_&&m<nq&&(m++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(s=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):_.rects),{x:d,y:u}=hN(s,h,c)),f=-1)}return{x:d,y:u,placement:h,strategy:a,middlewareData:p}},bN=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:s,padding:d=0}=Go(e,t)||{};if(s==null)return{};let u=Q4(d),h={x:n,y:r},m=jy(a),p=Hy(m),f=await o.getDimensions(s),x=m==="y",g=x?"top":"left",v=x?"bottom":"right",b=x?"clientHeight":"clientWidth",w=i.reference[p]+i.reference[m]-h[m]-i.floating[p],S=h[m]-i.reference[m],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s)),C=_?_[b]:0;(!C||!await(o.isElement==null?void 0:o.isElement(_)))&&(C=l.floating[b]||i.floating[p]);let k=w/2-S/2,T=C/2-f[p]/2-1,I=Vo(u[g],T),A=Vo(u[v],T),O=I,V=C-f[p]-A,j=C/2-f[p]/2+k,K=By(O,j,V),Z=!c.arrow&&Od(a)!=null&&j!==K&&i.reference[p]/2-(j<O?I:A)-f[p]/2<0,R=Z?j<O?j-O:j-V:0;return{[m]:h[m]+R,data:{[m]:K,centerOffset:j-K-R,...Z&&{alignmentOffset:R}},reset:Z}}});var vN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;let{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:f=!0,...x}=Go(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Yo(a),v=lo(l),b=Yo(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(s.floating)),S=h||(b||!f?[Dg(l)]:dN(l)),_=p!=="none";!h&&_&&S.push(...uN(l,f,p,w));let C=[l,...S],k=await c.detectOverflow(t,x),T=[],I=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(k[g]),u){let j=cN(a,o,w);T.push(k[j[0]],k[j[1]])}if(I=[...I,{placement:a,overflows:T}],!T.every(j=>j<=0)){var A,O;let j=(((A=i.flip)==null?void 0:A.index)||0)+1,K=C[j];if(K&&(!(u==="alignment"?v!==lo(K):!1)||I.every(P=>lo(P.placement)===v?P.overflows[0]>0:!0)))return{data:{index:j,overflows:I},reset:{placement:K}};let Z=(O=I.filter(R=>R.overflows[0]<=0).sort((R,P)=>R.overflows[1]-P.overflows[1])[0])==null?void 0:O.placement;if(!Z)switch(m){case"bestFit":{var V;let R=(V=I.filter(P=>{if(_){let F=lo(P.placement);return F===v||F==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(F=>F>0).reduce((F,q)=>F+q,0)]).sort((P,F)=>P[1]-F[1])[0])==null?void 0:V[0];R&&(Z=R);break}case"initialPlacement":Z=l;break}if(a!==Z)return{reset:{placement:Z}}}return{}}}};function mN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pN(e){return sN.some(t=>e[t]>=0)}var yN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Go(e,t);switch(a){case"referenceHidden":{let o=await r.detectOverflow(t,{...i,elementContext:"reference"}),l=mN(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:pN(l)}}}case"escaped":{let o=await r.detectOverflow(t,{...i,altBoundary:!0}),l=mN(o,n.floating);return{data:{escapedOffsets:l,escaped:pN(l)}}}default:return{}}}}};var xN=new Set(["left","top"]);async function rq(e,t){let{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Yo(n),l=Od(n),c=lo(n)==="y",s=xN.has(o)?-1:1,d=i&&c?-1:1,u=Go(t,e),{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof p=="number"&&(m=l==="end"?p*-1:p),c?{x:m*d,y:h*s}:{x:h*s,y:m*d}}var wN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:a,y:i,placement:o,middlewareData:l}=t,c=await rq(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},EN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:g=>{let{x:v,y:b}=g;return{x:v,y:b}}},...s}=Go(e,t),d={x:n,y:r},u=await i.detectOverflow(t,s),h=lo(Yo(a)),m=Fy(h),p=d[m],f=d[h];if(o){let g=m==="y"?"top":"left",v=m==="y"?"bottom":"right",b=p+u[g],w=p-u[v];p=By(b,p,w)}if(l){let g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",b=f+u[g],w=f-u[v];f=By(b,f,w)}let x=c.fn({...t,[m]:p,[h]:f});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[m]:o,[h]:l}}}}}},SN=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:s=!0}=Go(e,t),d={x:n,y:r},u=lo(a),h=Fy(u),m=d[h],p=d[u],f=Go(l,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){let b=h==="y"?"height":"width",w=i.reference[h]-i.floating[b]+x.mainAxis,S=i.reference[h]+i.reference[b]-x.mainAxis;m<w?m=w:m>S&&(m=S)}if(s){var g,v;let b=h==="y"?"width":"height",w=xN.has(Yo(a)),S=i.reference[u]-i.floating[b]+(w&&((g=o.offset)==null?void 0:g[u])||0)+(w?0:x.crossAxis),_=i.reference[u]+i.reference[b]+(w?0:((v=o.offset)==null?void 0:v[u])||0)-(w?x.crossAxis:0);p<S?p=S:p>_&&(p=_)}return{[h]:m,[u]:p}}}},CN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;let{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...s}=Go(e,t),d=await o.detectOverflow(t,s),u=Yo(a),h=Od(a),m=lo(a)==="y",{width:p,height:f}=i.floating,x,g;u==="top"||u==="bottom"?(x=u,g=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=u,x=h==="end"?"top":"bottom");let v=f-d.top-d.bottom,b=p-d.left-d.right,w=Vo(f-d[x],v),S=Vo(p-d[g],b),_=!t.middlewareData.shift,C=w,k=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),_&&!h){let I=Kr(d.left,0),A=Kr(d.right,0),O=Kr(d.top,0),V=Kr(d.bottom,0);m?k=p-2*(I!==0||A!==0?I+A:Kr(d.left,d.right)):C=f-2*(O!==0||V!==0?O+V:Kr(d.top,d.bottom))}await c({...t,availableWidth:k,availableHeight:C});let T=await o.getDimensions(l.floating);return p!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Vy(){return typeof window<"u"}function Bd(e){return kN(e)?(e.nodeName||"").toLowerCase():"#document"}function Sa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function so(e){var t;return(t=(kN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kN(e){return Vy()?e instanceof Node||e instanceof Sa(e).Node:!1}function Di(e){return Vy()?e instanceof Element||e instanceof Sa(e).Element:!1}function Wo(e){return Vy()?e instanceof HTMLElement||e instanceof Sa(e).HTMLElement:!1}function _N(e){return!Vy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sa(e).ShadowRoot}function cm(e){let{overflow:t,overflowX:n,overflowY:r,display:a}=Ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function TN(e){return/^(table|td|th)$/.test(Bd(e))}function Rg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var aq=/transform|translate|scale|rotate|perspective|filter/,iq=/paint|layout|strict|content/,Pd=e=>!!e&&e!=="none",J4;function Gy(e){let t=Di(e)?Ii(e):e;return Pd(t.transform)||Pd(t.translate)||Pd(t.scale)||Pd(t.rotate)||Pd(t.perspective)||!Yy()&&(Pd(t.backdropFilter)||Pd(t.filter))||aq.test(t.willChange||"")||iq.test(t.contain||"")}function MN(e){let t=Jl(e);for(;Wo(t)&&!Fd(t);){if(Gy(t))return t;if(Rg(t))return null;t=Jl(t)}return null}function Yy(){return J4==null&&(J4=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),J4}function Fd(e){return/^(html|body|#document)$/.test(Bd(e))}function Ii(e){return Sa(e).getComputedStyle(e)}function Ng(e){return Di(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jl(e){if(Bd(e)==="html")return e;let t=e.assignedSlot||e.parentNode||_N(e)&&e.host||so(e);return _N(t)?t.host:t}function AN(e){let t=Jl(e);return Fd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wo(t)&&cm(t)?t:AN(t)}function Ud(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=AN(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=Sa(a);if(i){let l=Wy(o);return t.concat(o,o.visualViewport||[],cm(a)?a:[],l&&n?Ud(l):[])}else return t.concat(a,Ud(a,[],n))}function Wy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function RN(e){let t=Ii(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,a=Wo(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=Ig(n)!==i||Ig(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function t6(e){return Di(e)?e:e.contextElement}function dm(e){let t=t6(e);if(!Wo(t))return oo(1);let n=t.getBoundingClientRect(),{width:r,height:a,$:i}=RN(t),o=(i?Ig(n.width):n.width)/r,l=(i?Ig(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}var oq=oo(0);function NN(e){let t=Sa(e);return!Yy()||!t.visualViewport?oq:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lq(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sa(e)?!1:t}function Hd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=t6(e),o=oo(1);t&&(r?Di(r)&&(o=dm(r)):o=dm(e));let l=lq(i,n,r)?NN(i):oo(0),c=(a.left+l.x)/o.x,s=(a.top+l.y)/o.y,d=a.width/o.x,u=a.height/o.y;if(i){let h=Sa(i),m=r&&Di(r)?Sa(r):r,p=h,f=Wy(p);for(;f&&r&&m!==p;){let x=dm(f),g=f.getBoundingClientRect(),v=Ii(f),b=g.left+(f.clientLeft+parseFloat(v.paddingLeft))*x.x,w=g.top+(f.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,s*=x.y,d*=x.x,u*=x.y,c+=b,s+=w,p=Sa(f),f=Wy(p)}}return zd({width:d,height:u,x:c,y:s})}function Ky(e,t){let n=Ng(e).scrollLeft;return t?t.left+n:Hd(so(e)).left+n}function ON(e,t){let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ky(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function sq(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,i=a==="fixed",o=so(r),l=t?Rg(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},s=oo(1),d=oo(0),u=Wo(r);if((u||!u&&!i)&&((Bd(r)!=="body"||cm(o))&&(c=Ng(r)),u)){let m=Hd(r);s=dm(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}let h=o&&!u&&!i?ON(o,c):oo(0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+d.x+h.x,y:n.y*s.y-c.scrollTop*s.y+d.y+h.y}}function cq(e){return Array.from(e.getClientRects())}function dq(e){let t=so(e),n=Ng(e),r=e.ownerDocument.body,a=Kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ky(e),l=-n.scrollTop;return Ii(r).direction==="rtl"&&(o+=Kr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}var DN=25;function uq(e,t){let n=Sa(e),r=so(e),a=n.visualViewport,i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;let d=Yy();(!d||d&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}let s=Ky(r);if(s<=0){let d=r.ownerDocument,u=d.body,h=getComputedStyle(u),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(r.clientWidth-u.clientWidth-m);p<=DN&&(i-=p)}else s<=DN&&(i+=s);return{width:i,height:o,x:l,y:c}}function hq(e,t){let n=Hd(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Wo(e)?dm(e):oo(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,s=r*i.y;return{width:o,height:l,x:c,y:s}}function IN(e,t,n){let r;if(t==="viewport")r=uq(e,n);else if(t==="document")r=dq(so(e));else if(Di(t))r=hq(t,n);else{let a=NN(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return zd(r)}function zN(e,t){let n=Jl(e);return n===t||!Di(n)||Fd(n)?!1:Ii(n).position==="fixed"||zN(n,t)}function mq(e,t){let n=t.get(e);if(n)return n;let r=Ud(e,[],!1).filter(l=>Di(l)&&Bd(l)!=="body"),a=null,i=Ii(e).position==="fixed",o=i?Jl(e):e;for(;Di(o)&&!Fd(o);){let l=Ii(o),c=Gy(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||cm(o)&&!c&&zN(e,o))?r=r.filter(d=>d!==o):a=l,o=Jl(o)}return t.set(e,r),r}function pq(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e,o=[...n==="clippingAncestors"?Rg(t)?[]:mq(t,this._c):[].concat(n),r],l=IN(t,o[0],a),c=l.top,s=l.right,d=l.bottom,u=l.left;for(let h=1;h<o.length;h++){let m=IN(t,o[h],a);c=Kr(m.top,c),s=Vo(m.right,s),d=Vo(m.bottom,d),u=Kr(m.left,u)}return{width:s-u,height:d-c,x:u,y:c}}function fq(e){let{width:t,height:n}=RN(e);return{width:t,height:n}}function gq(e,t,n){let r=Wo(t),a=so(t),i=n==="fixed",o=Hd(e,!0,i,t),l={scrollLeft:0,scrollTop:0},c=oo(0);function s(){c.x=Ky(a)}if(r||!r&&!i)if((Bd(t)!=="body"||cm(a))&&(l=Ng(t)),r){let m=Hd(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else a&&s();i&&!r&&a&&s();let d=a&&!r&&!i?ON(a,l):oo(0),u=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:u,y:h,width:o.width,height:o.height}}function e6(e){return Ii(e).position==="static"}function LN(e,t){if(!Wo(e)||Ii(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return so(e)===n&&(n=n.ownerDocument.body),n}function PN(e,t){let n=Sa(e);if(Rg(e))return n;if(!Wo(e)){let a=Jl(e);for(;a&&!Fd(a);){if(Di(a)&&!e6(a))return a;a=Jl(a)}return n}let r=LN(e,t);for(;r&&TN(r)&&e6(r);)r=LN(r,t);return r&&Fd(r)&&e6(r)&&!Gy(r)?n:r||MN(e)||n}var bq=async function(e){let t=this.getOffsetParent||PN,n=this.getDimensions,r=await n(e.floating);return{reference:gq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vq(e){return Ii(e).direction==="rtl"}var UN={convertOffsetParentRelativeRectToViewportRelativeRect:sq,getDocumentElement:so,getClippingRect:pq,getOffsetParent:PN,getElementRects:bq,getClientRects:cq,getDimensions:fq,getScale:dm,isElement:Di,isRTL:vq};function BN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yq(e,t){let n=null,r,a=so(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();let s=e.getBoundingClientRect(),{left:d,top:u,width:h,height:m}=s;if(l||t(),!h||!m)return;let p=Lg(u),f=Lg(a.clientWidth-(d+h)),x=Lg(a.clientHeight-(u+m)),g=Lg(d),b={rootMargin:-p+"px "+-f+"px "+-x+"px "+-g+"px",threshold:Kr(0,Vo(1,c))||1},w=!0;function S(_){let C=_[0].intersectionRatio;if(C!==c){if(!w)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!BN(s,e.getBoundingClientRect())&&o(),w=!1}try{n=new IntersectionObserver(S,{...b,root:a.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(e)}return o(!0),i}function n6(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,s=t6(e),d=a||i?[...s?Ud(s):[],...t?Ud(t):[]]:[];d.forEach(g=>{a&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});let u=s&&l?yq(s,n):null,h=-1,m=null;o&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===s&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),s&&!c&&m.observe(s),t&&m.observe(t));let p,f=c?Hd(e):null;c&&x();function x(){let g=Hd(e);f&&!BN(f,g)&&n(),f=g,p=requestAnimationFrame(x)}return n(),()=>{var g;d.forEach(v=>{a&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),u?.(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(p)}}var FN=wN;var HN=EN,jN=vN,VN=CN,GN=yN,r6=bN;var YN=SN,a6=(e,t,n)=>{let r=new Map,a={platform:UN,...n},i={...a.platform,_c:r};return gN(e,t,{...a,platform:i})};var Mn=M(G(),1),KN=M(G(),1),$N=M(gi(),1),xq=typeof document<"u",wq=function(){},$y=xq?KN.useLayoutEffect:wq;function Xy(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,a;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(!Xy(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){let i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Xy(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function XN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WN(e,t){let n=XN(e);return Math.round(t*n)/n}function i6(e){let t=Mn.useRef(e);return $y(()=>{t.current=e}),t}function ZN(e){e===void 0&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:s}=e,[d,u]=Mn.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=Mn.useState(r);Xy(h,r)||m(r);let[p,f]=Mn.useState(null),[x,g]=Mn.useState(null),v=Mn.useCallback(P=>{P!==_.current&&(_.current=P,f(P))},[]),b=Mn.useCallback(P=>{P!==C.current&&(C.current=P,g(P))},[]),w=i||p,S=o||x,_=Mn.useRef(null),C=Mn.useRef(null),k=Mn.useRef(d),T=c!=null,I=i6(c),A=i6(a),O=i6(s),V=Mn.useCallback(()=>{if(!_.current||!C.current)return;let P={placement:t,strategy:n,middleware:h};A.current&&(P.platform=A.current),a6(_.current,C.current,P).then(F=>{let q={...F,isPositioned:O.current!==!1};j.current&&!Xy(k.current,q)&&(k.current=q,$N.flushSync(()=>{u(q)}))})},[h,t,n,A,O]);$y(()=>{s===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,u(P=>({...P,isPositioned:!1})))},[s]);let j=Mn.useRef(!1);$y(()=>(j.current=!0,()=>{j.current=!1}),[]),$y(()=>{if(w&&(_.current=w),S&&(C.current=S),w&&S){if(I.current)return I.current(w,S,V);V()}},[w,S,V,I,T]);let K=Mn.useMemo(()=>({reference:_,floating:C,setReference:v,setFloating:b}),[v,b]),Z=Mn.useMemo(()=>({reference:w,floating:S}),[w,S]),R=Mn.useMemo(()=>{let P={position:n,left:0,top:0};if(!Z.floating)return P;let F=WN(Z.floating,d.x),q=WN(Z.floating,d.y);return l?{...P,transform:"translate("+F+"px, "+q+"px)",...XN(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:q}},[n,l,Z.floating,d.x,d.y]);return Mn.useMemo(()=>({...d,update:V,refs:K,elements:Z,floatingStyles:R}),[d,V,K,Z,R])}var Eq=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?r6({element:r.current,padding:a}).fn(n):{}:r?r6({element:r,padding:a}).fn(n):{}}}},qN=(e,t)=>{let n=FN(e);return{name:n.name,fn:n.fn,options:[e,t]}},QN=(e,t)=>{let n=HN(e);return{name:n.name,fn:n.fn,options:[e,t]}},JN=(e,t)=>({fn:YN(e).fn,options:[e,t]}),eO=(e,t)=>{let n=jN(e);return{name:n.name,fn:n.fn,options:[e,t]}},tO=(e,t)=>{let n=VN(e);return{name:n.name,fn:n.fn,options:[e,t]}};var nO=(e,t)=>{let n=GN(e);return{name:n.name,fn:n.fn,options:[e,t]}};var rO=(e,t)=>{let n=Eq(e);return{name:n.name,fn:n.fn,options:[e,t]}};var aO=M(G(),1);var o6=M(B(),1),Sq="Arrow",iO=aO.forwardRef((e,t)=>{let{children:n,width:r=10,height:a=5,...i}=e;return(0,o6.jsx)(st.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,o6.jsx)("polygon",{points:"0,0 30,0 15,10"})})});iO.displayName=Sq;var oO=iO;var vc=M(B(),1);var l6="Popper",[lO,um]=ya(l6),[_q,sO]=lO(l6),cO=e=>{let{__scopePopper:t,children:n}=e,[r,a]=Ca.useState(null);return(0,vc.jsx)(_q,{scope:t,anchor:r,onAnchorChange:a,children:n})};cO.displayName=l6;var dO="PopperAnchor",uO=Ca.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...a}=e,i=sO(dO,n),o=Ca.useRef(null),l=Yt(t,o),c=Ca.useRef(null);return Ca.useEffect(()=>{let s=c.current;c.current=r?.current||o.current,s!==c.current&&i.onAnchorChange(c.current)}),r?null:(0,vc.jsx)(st.div,{...a,ref:l})});uO.displayName=dO;var s6="PopperContent",[kq,Tq]=lO(s6),hO=Ca.forwardRef((e,t)=>{let{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:s=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...f}=e,x=sO(s6,n),[g,v]=Ca.useState(null),b=Yt(t,ke=>v(ke)),[w,S]=Ca.useState(null),_=iN(w),C=_?.width??0,k=_?.height??0,T=r+(i!=="center"?"-"+i:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(s)?s:[s],O=A.length>0,V={padding:I,boundary:A.filter(Aq),altBoundary:O},{refs:j,floatingStyles:K,placement:Z,isPositioned:R,middlewareData:P}=ZN({strategy:"fixed",placement:T,whileElementsMounted:(...ke)=>n6(...ke,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[qN({mainAxis:a+k,alignmentAxis:o}),c&&QN({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?JN():void 0,...V}),c&&eO({...V}),tO({...V,apply:({elements:ke,rects:ct,availableWidth:On,availableHeight:Zt})=>{let{width:qt,height:gl}=ct.reference,Ou=ke.floating.style;Ou.setProperty("--radix-popper-available-width",`${On}px`),Ou.setProperty("--radix-popper-available-height",`${Zt}px`),Ou.setProperty("--radix-popper-anchor-width",`${qt}px`),Ou.setProperty("--radix-popper-anchor-height",`${gl}px`)}}),w&&rO({element:w,padding:l}),Dq({arrowWidth:C,arrowHeight:k}),h&&nO({strategy:"referenceHidden",...V})]}),[F,q]=fO(Z),te=Lr(p);xa(()=>{R&&te?.()},[R,te]);let ge=P.arrow?.x,be=P.arrow?.y,fe=P.arrow?.centerOffset!==0,[He,je]=Ca.useState();return xa(()=>{g&&je(window.getComputedStyle(g).zIndex)},[g]),(0,vc.jsx)("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:R?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:He,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,vc.jsx)(kq,{scope:n,placedSide:F,onArrowChange:S,arrowX:ge,arrowY:be,shouldHideArrow:fe,children:(0,vc.jsx)(st.div,{"data-side":F,"data-align":q,...f,ref:b,style:{...f.style,animation:R?void 0:"none"}})})})});hO.displayName=s6;var mO="PopperArrow",Mq={top:"bottom",right:"left",bottom:"top",left:"right"},pO=Ca.forwardRef(function(t,n){let{__scopePopper:r,...a}=t,i=Tq(mO,r),o=Mq[i.placedSide];return(0,vc.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,vc.jsx)(oO,{...a,ref:n,style:{...a.style,display:"block"}})})});pO.displayName=mO;function Aq(e){return e!==null}var Dq=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[s,d]=fO(n),u={start:"0%",center:"50%",end:"100%"}[d],h=(a.arrow?.x??0)+l/2,m=(a.arrow?.y??0)+c/2,p="",f="";return s==="bottom"?(p=o?u:`${h}px`,f=`${-c}px`):s==="top"?(p=o?u:`${h}px`,f=`${r.floating.height+c}px`):s==="right"?(p=`${-c}px`,f=o?u:`${m}px`):s==="left"&&(p=`${r.floating.width+c}px`,f=o?u:`${m}px`),{data:{x:p,y:f}}}});function fO(e){let[t,n="center"]=e.split("-");return[t,n]}var Og=cO,zg=uO,Zy=hO,qy=pO;var nr=M(G(),1);var yc=M(B(),1),c6="rovingFocusGroup.onEntryFocus",Iq={bubbles:!1,cancelable:!0},Pg="RovingFocusGroup",[d6,bO,Lq]=Sy(Pg),[Rq,hm]=ya(Pg,[Lq]),[Nq,Oq]=Rq(Pg),vO=nr.forwardRef((e,t)=>(0,yc.jsx)(d6.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,yc.jsx)(d6.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,yc.jsx)(zq,{...e,ref:t})})}));vO.displayName=Pg;var zq=nr.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:s,preventScrollOnEntryFocus:d=!1,...u}=e,h=nr.useRef(null),m=Yt(t,h),p=nm(i),[f,x]=Ql({prop:o,defaultProp:l??null,onChange:c,caller:Pg}),[g,v]=nr.useState(!1),b=Lr(s),w=bO(n),S=nr.useRef(!1),[_,C]=nr.useState(0);return nr.useEffect(()=>{let k=h.current;if(k)return k.addEventListener(c6,b),()=>k.removeEventListener(c6,b)},[b]),(0,yc.jsx)(Nq,{scope:n,orientation:r,dir:p,loop:a,currentTabStopId:f,onItemFocus:nr.useCallback(k=>x(k),[x]),onItemShiftTab:nr.useCallback(()=>v(!0),[]),onFocusableItemAdd:nr.useCallback(()=>C(k=>k+1),[]),onFocusableItemRemove:nr.useCallback(()=>C(k=>k-1),[]),children:(0,yc.jsx)(st.div,{tabIndex:g||_===0?-1:0,"data-orientation":r,...u,ref:m,style:{outline:"none",...e.style},onMouseDown:xe(e.onMouseDown,()=>{S.current=!0}),onFocus:xe(e.onFocus,k=>{let T=!S.current;if(k.target===k.currentTarget&&T&&!g){let I=new CustomEvent(c6,Iq);if(k.currentTarget.dispatchEvent(I),!I.defaultPrevented){let A=w().filter(Z=>Z.focusable),O=A.find(Z=>Z.active),V=A.find(Z=>Z.id===f),K=[O,V,...A].filter(Boolean).map(Z=>Z.ref.current);wO(K,d)}}S.current=!1}),onBlur:xe(e.onBlur,()=>v(!1))})})}),yO="RovingFocusGroupItem",xO=nr.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=Mi(),s=i||c,d=Oq(yO,n),u=d.currentTabStopId===s,h=bO(n),{onFocusableItemAdd:m,onFocusableItemRemove:p,currentTabStopId:f}=d;return nr.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),(0,yc.jsx)(d6.ItemSlot,{scope:n,id:s,focusable:r,active:a,children:(0,yc.jsx)(st.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:xe(e.onMouseDown,x=>{r?d.onItemFocus(s):x.preventDefault()}),onFocus:xe(e.onFocus,()=>d.onItemFocus(s)),onKeyDown:xe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;let g=Bq(x,d.orientation,d.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let b=h().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();let w=b.indexOf(x.currentTarget);b=d.loop?Fq(b,w+1):b.slice(w+1)}setTimeout(()=>wO(b))}}),children:typeof o=="function"?o({isCurrentTabStop:u,hasTabStop:f!=null}):o})})});xO.displayName=yO;var Pq={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uq(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bq(e,t,n){let r=Uq(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Pq[r]}function wO(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Fq(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Qy=vO,Jy=xO;var Se=M(B(),1),u6=["Enter"," "],Hq=["ArrowDown","PageUp","Home"],CO=["ArrowUp","PageDown","End"],jq=[...Hq,...CO],Vq={ltr:[...u6,"ArrowRight"],rtl:[...u6,"ArrowLeft"]},Gq={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Hg="Menu",[Bg,Yq,Wq]=Sy(Hg),[jd,h6]=ya(Hg,[Wq,um,hm]),jg=um(),_O=hm(),[kO,xc]=jd(Hg),[Kq,Vg]=jd(Hg),TO=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,l=jg(t),[c,s]=ce.useState(null),d=ce.useRef(!1),u=Lr(i),h=nm(a);return ce.useEffect(()=>{let m=()=>{d.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),(0,Se.jsx)(Og,{...l,children:(0,Se.jsx)(kO,{scope:t,open:n,onOpenChange:u,content:c,onContentChange:s,children:(0,Se.jsx)(Kq,{scope:t,onClose:ce.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};TO.displayName=Hg;var $q="MenuAnchor",m6=ce.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,a=jg(n);return(0,Se.jsx)(zg,{...a,...r,ref:t})});m6.displayName=$q;var p6="MenuPortal",[Xq,MO]=jd(p6,{forceMount:void 0}),AO=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=xc(p6,t);return(0,Se.jsx)(Xq,{scope:t,forceMount:n,children:(0,Se.jsx)(io,{present:n||i.open,children:(0,Se.jsx)(_g,{asChild:!0,container:a,children:r})})})};AO.displayName=p6;var Li="MenuContent",[Zq,f6]=jd(Li),DO=ce.forwardRef((e,t)=>{let n=MO(Li,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=xc(Li,e.__scopeMenu),o=Vg(Li,e.__scopeMenu);return(0,Se.jsx)(Bg.Provider,{scope:e.__scopeMenu,children:(0,Se.jsx)(io,{present:r||i.open,children:(0,Se.jsx)(Bg.Slot,{scope:e.__scopeMenu,children:o.modal?(0,Se.jsx)(qq,{...a,ref:t}):(0,Se.jsx)(Qq,{...a,ref:t})})})})}),qq=ce.forwardRef((e,t)=>{let n=xc(Li,e.__scopeMenu),r=ce.useRef(null),a=Yt(t,r);return ce.useEffect(()=>{let i=r.current;if(i)return Py(i)},[]),(0,Se.jsx)(g6,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:xe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Qq=ce.forwardRef((e,t)=>{let n=xc(Li,e.__scopeMenu);return(0,Se.jsx)(g6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Jq=Zl("MenuContent.ScrollLock"),g6=ce.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:s,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:h,onDismiss:m,disableOutsideScroll:p,...f}=e,x=xc(Li,n),g=Vg(Li,n),v=jg(n),b=_O(n),w=Yq(n),[S,_]=ce.useState(null),C=ce.useRef(null),k=Yt(t,C,x.onContentChange),T=ce.useRef(0),I=ce.useRef(""),A=ce.useRef(0),O=ce.useRef(null),V=ce.useRef("right"),j=ce.useRef(0),K=p?Ag:ce.Fragment,Z=p?{as:Jq,allowPinchZoom:!0}:void 0,R=F=>{let q=I.current+F,te=w().filter(ke=>!ke.disabled),ge=document.activeElement,be=te.find(ke=>ke.ref.current===ge)?.textValue,fe=te.map(ke=>ke.textValue),He=uQ(fe,q,be),je=te.find(ke=>ke.textValue===He)?.ref.current;(function ke(ct){I.current=ct,window.clearTimeout(T.current),ct!==""&&(T.current=window.setTimeout(()=>ke(""),1e3))})(q),je&&setTimeout(()=>je.focus())};ce.useEffect(()=>()=>window.clearTimeout(T.current),[]),My();let P=ce.useCallback(F=>V.current===O.current?.side&&mQ(F,O.current?.area),[]);return(0,Se.jsx)(Zq,{scope:n,searchRef:I,onItemEnter:ce.useCallback(F=>{P(F)&&F.preventDefault()},[P]),onItemLeave:ce.useCallback(F=>{P(F)||(C.current?.focus(),_(null))},[P]),onTriggerLeave:ce.useCallback(F=>{P(F)&&F.preventDefault()},[P]),pointerGraceTimerRef:A,onPointerGraceIntentChange:ce.useCallback(F=>{O.current=F},[]),children:(0,Se.jsx)(K,{...Z,children:(0,Se.jsx)(Cg,{asChild:!0,trapped:a,onMountAutoFocus:xe(i,F=>{F.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,Se.jsx)(Sg,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:s,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:h,onDismiss:m,children:(0,Se.jsx)(Qy,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:_,onEntryFocus:xe(c,F=>{g.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Se.jsx)(Zy,{role:"menu","aria-orientation":"vertical","data-state":KO(x.open),"data-radix-menu-content":"",dir:g.dir,...v,...f,ref:k,style:{outline:"none",...f.style},onKeyDown:xe(f.onKeyDown,F=>{let te=F.target.closest("[data-radix-menu-content]")===F.currentTarget,ge=F.ctrlKey||F.altKey||F.metaKey,be=F.key.length===1;te&&(F.key==="Tab"&&F.preventDefault(),!ge&&be&&R(F.key));let fe=C.current;if(F.target!==fe||!jq.includes(F.key))return;F.preventDefault();let je=w().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);CO.includes(F.key)&&je.reverse(),cQ(je)}),onBlur:xe(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(T.current),I.current="")}),onPointerMove:xe(e.onPointerMove,Fg(F=>{let q=F.target,te=j.current!==F.clientX;if(F.currentTarget.contains(q)&&te){let ge=F.clientX>j.current?"right":"left";V.current=ge,j.current=F.clientX}}))})})})})})})});DO.displayName=Li;var eQ="MenuGroup",b6=ce.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Se.jsx)(st.div,{role:"group",...r,ref:t})});b6.displayName=eQ;var tQ="MenuLabel",IO=ce.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Se.jsx)(st.div,{...r,ref:t})});IO.displayName=tQ;var ex="MenuItem",SO="menu.itemSelect",nx=ce.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...a}=e,i=ce.useRef(null),o=Vg(ex,e.__scopeMenu),l=f6(ex,e.__scopeMenu),c=Yt(t,i),s=ce.useRef(!1),d=()=>{let u=i.current;if(!n&&u){let h=new CustomEvent(SO,{bubbles:!0,cancelable:!0});u.addEventListener(SO,m=>r?.(m),{once:!0}),wy(u,h),h.defaultPrevented?s.current=!1:o.onClose()}};return(0,Se.jsx)(LO,{...a,ref:c,disabled:n,onClick:xe(e.onClick,d),onPointerDown:u=>{e.onPointerDown?.(u),s.current=!0},onPointerUp:xe(e.onPointerUp,u=>{s.current||u.currentTarget?.click()}),onKeyDown:xe(e.onKeyDown,u=>{let h=l.searchRef.current!=="";n||h&&u.key===" "||u6.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});nx.displayName=ex;var LO=ce.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=f6(ex,n),l=_O(n),c=ce.useRef(null),s=Yt(t,c),[d,u]=ce.useState(!1),[h,m]=ce.useState("");return ce.useEffect(()=>{let p=c.current;p&&m((p.textContent??"").trim())},[i.children]),(0,Se.jsx)(Bg.ItemSlot,{scope:n,disabled:r,textValue:a??h,children:(0,Se.jsx)(Jy,{asChild:!0,...l,focusable:!r,children:(0,Se.jsx)(st.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:s,onPointerMove:xe(e.onPointerMove,Fg(p=>{r?o.onItemLeave(p):(o.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:xe(e.onPointerLeave,Fg(p=>o.onItemLeave(p))),onFocus:xe(e.onFocus,()=>u(!0)),onBlur:xe(e.onBlur,()=>u(!1))})})})}),nQ="MenuCheckboxItem",RO=ce.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...a}=e;return(0,Se.jsx)(UO,{scope:e.__scopeMenu,checked:n,children:(0,Se.jsx)(nx,{role:"menuitemcheckbox","aria-checked":tx(n)?"mixed":n,...a,ref:t,"data-state":x6(n),onSelect:xe(a.onSelect,()=>r?.(tx(n)?!0:!n),{checkForDefaultPrevented:!1})})})});RO.displayName=nQ;var NO="MenuRadioGroup",[rQ,aQ]=jd(NO,{value:void 0,onValueChange:()=>{}}),OO=ce.forwardRef((e,t)=>{let{value:n,onValueChange:r,...a}=e,i=Lr(r);return(0,Se.jsx)(rQ,{scope:e.__scopeMenu,value:n,onValueChange:i,children:(0,Se.jsx)(b6,{...a,ref:t})})});OO.displayName=NO;var zO="MenuRadioItem",PO=ce.forwardRef((e,t)=>{let{value:n,...r}=e,a=aQ(zO,e.__scopeMenu),i=n===a.value;return(0,Se.jsx)(UO,{scope:e.__scopeMenu,checked:i,children:(0,Se.jsx)(nx,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":x6(i),onSelect:xe(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});PO.displayName=zO;var v6="MenuItemIndicator",[UO,iQ]=jd(v6,{checked:!1}),BO=ce.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...a}=e,i=iQ(v6,n);return(0,Se.jsx)(io,{present:r||tx(i.checked)||i.checked===!0,children:(0,Se.jsx)(st.span,{...a,ref:t,"data-state":x6(i.checked)})})});BO.displayName=v6;var oQ="MenuSeparator",FO=ce.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Se.jsx)(st.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});FO.displayName=oQ;var lQ="MenuArrow",HO=ce.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,a=jg(n);return(0,Se.jsx)(qy,{...a,...r,ref:t})});HO.displayName=lQ;var y6="MenuSub",[sQ,jO]=jd(y6),VO=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,i=xc(y6,t),o=jg(t),[l,c]=ce.useState(null),[s,d]=ce.useState(null),u=Lr(a);return ce.useEffect(()=>(i.open===!1&&u(!1),()=>u(!1)),[i.open,u]),(0,Se.jsx)(Og,{...o,children:(0,Se.jsx)(kO,{scope:t,open:r,onOpenChange:u,content:s,onContentChange:d,children:(0,Se.jsx)(sQ,{scope:t,contentId:Mi(),triggerId:Mi(),trigger:l,onTriggerChange:c,children:n})})})};VO.displayName=y6;var Ug="MenuSubTrigger",GO=ce.forwardRef((e,t)=>{let n=xc(Ug,e.__scopeMenu),r=Vg(Ug,e.__scopeMenu),a=jO(Ug,e.__scopeMenu),i=f6(Ug,e.__scopeMenu),o=ce.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,s={__scopeMenu:e.__scopeMenu},d=ce.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return ce.useEffect(()=>d,[d]),ce.useEffect(()=>{let u=l.current;return()=>{window.clearTimeout(u),c(null)}},[l,c]),(0,Se.jsx)(m6,{asChild:!0,...s,children:(0,Se.jsx)(LO,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":KO(n.open),...e,ref:Id(t,a.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:xe(e.onPointerMove,Fg(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:xe(e.onPointerLeave,Fg(u=>{d();let h=n.content?.getBoundingClientRect();if(h){let m=n.content?.dataset.side,p=m==="right",f=p?-5:5,x=h[p?"left":"right"],g=h[p?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+f,y:u.clientY},{x,y:h.top},{x:g,y:h.top},{x:g,y:h.bottom},{x,y:h.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:xe(e.onKeyDown,u=>{let h=i.searchRef.current!=="";e.disabled||h&&u.key===" "||Vq[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});GO.displayName=Ug;var YO="MenuSubContent",WO=ce.forwardRef((e,t)=>{let n=MO(Li,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=xc(Li,e.__scopeMenu),o=Vg(Li,e.__scopeMenu),l=jO(YO,e.__scopeMenu),c=ce.useRef(null),s=Yt(t,c);return(0,Se.jsx)(Bg.Provider,{scope:e.__scopeMenu,children:(0,Se.jsx)(io,{present:r||i.open,children:(0,Se.jsx)(Bg.Slot,{scope:e.__scopeMenu,children:(0,Se.jsx)(g6,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:s,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{o.isUsingKeyboardRef.current&&c.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:xe(e.onFocusOutside,d=>{d.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:xe(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:xe(e.onKeyDown,d=>{let u=d.currentTarget.contains(d.target),h=Gq[o.dir].includes(d.key);u&&h&&(i.onOpenChange(!1),l.trigger?.focus(),d.preventDefault())})})})})})});WO.displayName=YO;function KO(e){return e?"open":"closed"}function tx(e){return e==="indeterminate"}function x6(e){return tx(e)?"indeterminate":e?"checked":"unchecked"}function cQ(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function dQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uQ(e,t,n){let a=t.length>1&&Array.from(t).every(s=>s===t[0])?t[0]:t,i=n?e.indexOf(n):-1,o=dQ(e,Math.max(i,0));a.length===1&&(o=o.filter(s=>s!==n));let c=o.find(s=>s.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function hQ(e,t){let{x:n,y:r}=e,a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let l=t[i],c=t[o],s=l.x,d=l.y,u=c.x,h=c.y;d>r!=h>r&&n<(u-s)*(r-d)/(h-d)+s&&(a=!a)}return a}function mQ(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return hQ(n,t)}function Fg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var $O=TO,XO=m6,ZO=AO,qO=DO,QO=b6,JO=IO,ez=nx,tz=RO,nz=OO,rz=PO,az=BO,iz=FO,oz=HO,lz=VO,sz=GO,cz=WO;var rr={};_E(rr,{Arrow:()=>jQ,CheckboxItem:()=>PQ,Content:()=>RQ,DropdownMenu:()=>w6,DropdownMenuArrow:()=>R6,DropdownMenuCheckboxItem:()=>M6,DropdownMenuContent:()=>C6,DropdownMenuGroup:()=>_6,DropdownMenuItem:()=>T6,DropdownMenuItemIndicator:()=>I6,DropdownMenuLabel:()=>k6,DropdownMenuPortal:()=>S6,DropdownMenuRadioGroup:()=>A6,DropdownMenuRadioItem:()=>D6,DropdownMenuSeparator:()=>L6,DropdownMenuSub:()=>mz,DropdownMenuSubContent:()=>O6,DropdownMenuSubTrigger:()=>N6,DropdownMenuTrigger:()=>E6,Group:()=>NQ,Item:()=>zQ,ItemIndicator:()=>FQ,Label:()=>OQ,Portal:()=>LQ,RadioGroup:()=>UQ,RadioItem:()=>BQ,Root:()=>DQ,Separator:()=>HQ,Sub:()=>VQ,SubContent:()=>YQ,SubTrigger:()=>GQ,Trigger:()=>IQ,createDropdownMenuScope:()=>gQ});var Hn=M(G(),1);var Fn=M(B(),1),rx="DropdownMenu",[fQ,gQ]=ya(rx,[h6]),Nr=h6(),[bQ,dz]=fQ(rx),w6=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=Nr(t),s=Hn.useRef(null),[d,u]=Ql({prop:a,defaultProp:i??!1,onChange:o,caller:rx});return(0,Fn.jsx)(bQ,{scope:t,triggerId:Mi(),triggerRef:s,contentId:Mi(),open:d,onOpenChange:u,onOpenToggle:Hn.useCallback(()=>u(h=>!h),[u]),modal:l,children:(0,Fn.jsx)($O,{...c,open:d,onOpenChange:u,dir:r,modal:l,children:n})})};w6.displayName=rx;var uz="DropdownMenuTrigger",E6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=dz(uz,n),o=Nr(n);return(0,Fn.jsx)(XO,{asChild:!0,...o,children:(0,Fn.jsx)(st.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Id(t,i.triggerRef),onPointerDown:xe(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:xe(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});E6.displayName=uz;var vQ="DropdownMenuPortal",S6=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return(0,Fn.jsx)(ZO,{...r,...n})};S6.displayName=vQ;var hz="DropdownMenuContent",C6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=dz(hz,n),i=Nr(n),o=Hn.useRef(!1);return(0,Fn.jsx)(qO,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:xe(e.onCloseAutoFocus,l=>{o.current||a.triggerRef.current?.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:xe(e.onInteractOutside,l=>{let c=l.detail.originalEvent,s=c.button===0&&c.ctrlKey===!0,d=c.button===2||s;(!a.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});C6.displayName=hz;var yQ="DropdownMenuGroup",_6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(QO,{...a,...r,ref:t})});_6.displayName=yQ;var xQ="DropdownMenuLabel",k6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(JO,{...a,...r,ref:t})});k6.displayName=xQ;var wQ="DropdownMenuItem",T6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(ez,{...a,...r,ref:t})});T6.displayName=wQ;var EQ="DropdownMenuCheckboxItem",M6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(tz,{...a,...r,ref:t})});M6.displayName=EQ;var SQ="DropdownMenuRadioGroup",A6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(nz,{...a,...r,ref:t})});A6.displayName=SQ;var CQ="DropdownMenuRadioItem",D6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(rz,{...a,...r,ref:t})});D6.displayName=CQ;var _Q="DropdownMenuItemIndicator",I6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(az,{...a,...r,ref:t})});I6.displayName=_Q;var kQ="DropdownMenuSeparator",L6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(iz,{...a,...r,ref:t})});L6.displayName=kQ;var TQ="DropdownMenuArrow",R6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(oz,{...a,...r,ref:t})});R6.displayName=TQ;var mz=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:a,defaultOpen:i}=e,o=Nr(t),[l,c]=Ql({prop:r,defaultProp:i??!1,onChange:a,caller:"DropdownMenuSub"});return(0,Fn.jsx)(lz,{...o,open:l,onOpenChange:c,children:n})},MQ="DropdownMenuSubTrigger",N6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(sz,{...a,...r,ref:t})});N6.displayName=MQ;var AQ="DropdownMenuSubContent",O6=Hn.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return(0,Fn.jsx)(cz,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});O6.displayName=AQ;var DQ=w6,IQ=E6,LQ=S6,RQ=C6,NQ=_6,OQ=k6,zQ=T6,PQ=M6,UQ=A6,BQ=D6,FQ=I6,HQ=L6,jQ=R6,VQ=mz,GQ=N6,YQ=O6;var Ze={};_E(Ze,{Anchor:()=>tJ,Arrow:()=>oJ,Close:()=>iJ,Content:()=>aJ,Popover:()=>z6,PopoverAnchor:()=>P6,PopoverArrow:()=>V6,PopoverClose:()=>j6,PopoverContent:()=>H6,PopoverPortal:()=>F6,PopoverTrigger:()=>U6,Portal:()=>rJ,Root:()=>eJ,Trigger:()=>nJ,createPopoverScope:()=>WQ});var Wt=M(G(),1);var An=M(B(),1),ax="Popover",[pz,WQ]=ya(ax,[um]),Gg=um(),[KQ,wc]=pz(ax),z6=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Gg(t),c=Wt.useRef(null),[s,d]=Wt.useState(!1),[u,h]=Ql({prop:r,defaultProp:a??!1,onChange:i,caller:ax});return(0,An.jsx)(Og,{...l,children:(0,An.jsx)(KQ,{scope:t,contentId:Mi(),triggerRef:c,open:u,onOpenChange:h,onOpenToggle:Wt.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:s,onCustomAnchorAdd:Wt.useCallback(()=>d(!0),[]),onCustomAnchorRemove:Wt.useCallback(()=>d(!1),[]),modal:o,children:n})})};z6.displayName=ax;var fz="PopoverAnchor",P6=Wt.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=wc(fz,n),i=Gg(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return Wt.useEffect(()=>(o(),()=>l()),[o,l]),(0,An.jsx)(zg,{...i,...r,ref:t})});P6.displayName=fz;var gz="PopoverTrigger",U6=Wt.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=wc(gz,n),i=Gg(n),o=Yt(t,a.triggerRef),l=(0,An.jsx)(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":yz(a.open),...r,ref:o,onClick:xe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:(0,An.jsx)(zg,{asChild:!0,...i,children:l})});U6.displayName=gz;var B6="PopoverPortal",[$Q,XQ]=pz(B6,{forceMount:void 0}),F6=e=>{let{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=wc(B6,t);return(0,An.jsx)($Q,{scope:t,forceMount:n,children:(0,An.jsx)(io,{present:n||i.open,children:(0,An.jsx)(_g,{asChild:!0,container:a,children:r})})})};F6.displayName=B6;var mm="PopoverContent",H6=Wt.forwardRef((e,t)=>{let n=XQ(mm,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=wc(mm,e.__scopePopover);return(0,An.jsx)(io,{present:r||i.open,children:i.modal?(0,An.jsx)(qQ,{...a,ref:t}):(0,An.jsx)(QQ,{...a,ref:t})})});H6.displayName=mm;var ZQ=Zl("PopoverContent.RemoveScroll"),qQ=Wt.forwardRef((e,t)=>{let n=wc(mm,e.__scopePopover),r=Wt.useRef(null),a=Yt(t,r),i=Wt.useRef(!1);return Wt.useEffect(()=>{let o=r.current;if(o)return Py(o)},[]),(0,An.jsx)(Ag,{as:ZQ,allowPinchZoom:!0,children:(0,An.jsx)(bz,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:xe(e.onPointerDownOutside,o=>{let l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,s=l.button===2||c;i.current=s},{checkForDefaultPrevented:!1}),onFocusOutside:xe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),QQ=Wt.forwardRef((e,t)=>{let n=wc(mm,e.__scopePopover),r=Wt.useRef(!1),a=Wt.useRef(!1);return(0,An.jsx)(bz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));let o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),bz=Wt.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:s,onInteractOutside:d,...u}=e,h=wc(mm,n),m=Gg(n);return My(),(0,An.jsx)(Cg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:(0,An.jsx)(Sg,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:s,onDismiss:()=>h.onOpenChange(!1),children:(0,An.jsx)(Zy,{"data-state":yz(h.open),role:"dialog",id:h.contentId,...m,...u,ref:t,style:{...u.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)"}})})})}),vz="PopoverClose",j6=Wt.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=wc(vz,n);return(0,An.jsx)(st.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>a.onOpenChange(!1))})});j6.displayName=vz;var JQ="PopoverArrow",V6=Wt.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=Gg(n);return(0,An.jsx)(qy,{...a,...r,ref:t})});V6.displayName=JQ;function yz(e){return e?"open":"closed"}var eJ=z6,tJ=P6,nJ=U6,rJ=F6,aJ=H6,iJ=j6,oJ=V6;var ar={};_E(ar,{Content:()=>mJ,List:()=>uJ,Root:()=>dJ,Tabs:()=>Y6,TabsContent:()=>$6,TabsList:()=>W6,TabsTrigger:()=>K6,Trigger:()=>hJ,createTabsScope:()=>sJ});var ts=M(G(),1);var es=M(B(),1),ix="Tabs",[lJ,sJ]=ya(ix,[hm]),xz=hm(),[cJ,G6]=lJ(ix),Y6=ts.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...s}=e,d=nm(l),[u,h]=Ql({prop:r,onChange:a,defaultProp:i??"",caller:ix});return(0,es.jsx)(cJ,{scope:n,baseId:Mi(),value:u,onValueChange:h,orientation:o,dir:d,activationMode:c,children:(0,es.jsx)(st.div,{dir:d,"data-orientation":o,...s,ref:t})})});Y6.displayName=ix;var wz="TabsList",W6=ts.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,i=G6(wz,n),o=xz(n);return(0,es.jsx)(Qy,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:(0,es.jsx)(st.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});W6.displayName=wz;var Ez="TabsTrigger",K6=ts.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=G6(Ez,n),l=xz(n),c=Cz(o.baseId,r),s=_z(o.baseId,r),d=r===o.value;return(0,es.jsx)(Jy,{asChild:!0,...l,focusable:!a,active:d,children:(0,es.jsx)(st.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":s,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:xe(e.onMouseDown,u=>{!a&&u.button===0&&u.ctrlKey===!1?o.onValueChange(r):u.preventDefault()}),onKeyDown:xe(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(r)}),onFocus:xe(e.onFocus,()=>{let u=o.activationMode!=="manual";!d&&!a&&u&&o.onValueChange(r)})})})});K6.displayName=Ez;var Sz="TabsContent",$6=ts.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,l=G6(Sz,n),c=Cz(l.baseId,r),s=_z(l.baseId,r),d=r===l.value,u=ts.useRef(d);return ts.useEffect(()=>{let h=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(h)},[]),(0,es.jsx)(io,{present:a||d,children:({present:h})=>(0,es.jsx)(st.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:s,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:h&&i})})});$6.displayName=Sz;function Cz(e,t){return`${e}-trigger-${t}`}function _z(e,t){return`${e}-content-${t}`}var dJ=Y6,uJ=W6,hJ=K6,mJ=$6;var V1=M(G(),1);var DB=M(B(),1),s2=M(G(),1),LB=M(gi(),1);var R_=M(G(),1),x1=M(G(),1);var OB=M(G(),1);var zB=M(G(),1),PB=M(B(),1);var UB=M(G(),1);var BB=M(G(),1);var FB=M(B(),1),Sm=M(B(),1),Cm=M(G(),1);var vo=M(G(),1);var tl=M(B(),1),ji=M(G(),1);var p2=M(G(),1);var jB=M(B(),1),_m=M(B(),1);var f2=M(G(),1),km=M(B(),1),VB=M(B(),1);var g2=M(G(),1),os=M(B(),1);var Da=M(B(),1);var _x=M(B(),1),lr=M(B(),1);var Gm=M(G(),1);var un=M(G(),1);var GB=M(G(),1),b2=M(B(),1);var WB=M(G(),1),UC=M(B(),1),v2=M(B(),1);var y2=M(G(),1);var qB=M(B(),1),el=M(B(),1),m1=M(B(),1);var zi=M(B(),1);var kx=M(B(),1),ls=M(B(),1);var pu=M(G(),1);var eF=M(B(),1),Dc=M(B(),1),xr=M(B(),1),w1=M(G(),1),qd=M(B(),1),ie=M(B(),1);var nF=M(G(),1),rF=M(B(),1);var fu=M(B(),1);var sF=M(B(),1);var E1=M(B(),1);var xm=M(B(),1),cF=M(G(),1);var S1=M(B(),1),Wm=M(G(),1),du=M(B(),1);var wr=M(B(),1);var Qd=M(B(),1);var yF=M(G(),1),jC=M(B(),1),Pr=M(B(),1);var gu=M(B(),1);var W_=M(B(),1);var Vi=M(G(),1);var Jo=M(B(),1),MF=M(B(),1);var IF=M(Mz(),1),Jr=M(G(),1);var ea=M(G(),1);var Gx=M(B(),1);var T2=M(G(),1);var M2=M(G(),1),Yn=M(G(),1);var zF=M(G(),1);var k1=M(G(),1);var FF=M(B(),1),A2=M(B(),1),wn=M(G(),1);var jF=M(yg(),1),VF=M(G(),1);var Mm=M(G(),1);var XC=M(gi(),1);var Wd=M(B(),1),Pm=M(B(),1),ei=M(G(),1);var T1=M(G(),1),de=M(B(),1),ZC=M(G(),1);var $m=M(G(),1);var q_=M(G(),1);var Q_=M(B(),1),c1=M(B(),1),WF=M(B(),1);var Mx=M(B(),1),$F=M(B(),1);var M1=M(G(),1),Dx=M(B(),1);var A1=M(B(),1),qC=M(G(),1),QF=M(B(),1);var JF=M(B(),1),tH=M(B(),1),L2=M(B(),1),In=M(B(),1),Xm=M(G(),1),R2=M(G(),1);var Zm=M(G(),1),eu=M(B(),1),tu=M(B(),1);var ll=M(G(),1);var nH=M(B(),1),nu=M(B(),1),et=M(B(),1),Ui=M(B(),1);var rH=M(G(),1),aH=M(gi(),1);var D1=M(B(),1),Tc=M(B(),1);var O2=M(G(),1);var z2=M(G(),1);var Yg=M(G());var Az=e=>{let t,n=new Set,r=(d,u)=>{let h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){let m=t;t=u??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(p=>p(t,m))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>s,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(import.meta.env?import.meta.env.MODE: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()}},s=t=e(r,a,c);return c},Dz=e=>e?Az(e):Az;var Pz=M(G(),1),Uz=M(Nz(),1),{useDebugValue:EJ}=Pz.default,{useSyncExternalStoreWithSelector:SJ}=Uz.default,Oz=!1,CJ=e=>e;function _J(e,t=CJ,n){(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&n&&!Oz&&(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"),Oz=!0);let r=SJ(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return EJ(r),r}var zz=e=>{(import.meta.env?import.meta.env.MODE: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'`.");let t=typeof e=="function"?Dz(e):e,n=(r,a)=>_J(t,r,a);return Object.assign(n,t),n},Bz=e=>e?zz(e):zz;var Fz,Hz,jz=typeof window<"u"&&((Fz=window.document)!=null&&Fz.createElement||((Hz=window.navigator)==null?void 0:Hz.product)==="ReactNative")?Yg.default.useLayoutEffect:Yg.default.useEffect;function co(){let e=Bz(t=>({current:new Array,version:0,set:t}));return{In:({children:t})=>{let n=e(a=>a.set),r=e(a=>a.version);return jz(()=>{n(a=>({version:a.version+1}))},[]),jz(()=>(n(({current:a})=>({current:[...a,t]})),()=>n(({current:a})=>({current:a.filter(i=>i!==t)}))),[t,r]),null},Out:()=>{let t=e(n=>n.current);return Yg.default.createElement(Yg.default.Fragment,null,t)}}}var P2=M(G(),1);var Kd=M(B(),1),W=M(B(),1),uH=M(G(),1),F2=M(B(),1),mt=M(B(),1);function X6(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function kJ(e,t,n){let r=X6(t,n);if(r===0)return X6(e,t);let a=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return a=Math.max(0,Math.min(1,a)),X6(e,TJ(t,n,a))}function TJ(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function lx(e,t){return Z6(e,0,e.length,t)}function Z6(e,t,n,r,a){let i=a||[],o=e[t],l=e[n-1],c=0,s=1;for(let d=t+1;d<n-1;++d){let u=kJ(e[d],o,l);u>c&&(c=u,s=d)}return Math.sqrt(c)>r?(Z6(e,t,s+1,r,i),Z6(e,s,n,r,i)):(i.length||i.push(o),i.push(l)),i}function Vz(e,t,n,r=a=>a){return e*r(.5-t*(.5-n))}function MJ(e){return[-e[0],-e[1]]}function ho(e,t){return[e[0]+t[0],e[1]+t[1]]}function Ri(e,t){return[e[0]-t[0],e[1]-t[1]]}function uo(e,t){return[e[0]*t,e[1]*t]}function AJ(e,t){return[e[0]/t,e[1]/t]}function Wg(e){return[e[1],-e[0]]}function Gz(e,t){return e[0]*t[0]+e[1]*t[1]}function DJ(e,t){return e[0]===t[0]&&e[1]===t[1]}function IJ(e){return Math.hypot(e[0],e[1])}function LJ(e){return e[0]*e[0]+e[1]*e[1]}function Yz(e,t){return LJ(Ri(e,t))}function $z(e){return AJ(e,IJ(e))}function RJ(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Kg(e,t,n){let r=Math.sin(n),a=Math.cos(n),i=e[0]-t[0],o=e[1]-t[1],l=i*a-o*r,c=i*r+o*a;return[l+t[0],c+t[1]]}function q6(e,t,n){return ho(e,uo(Ri(t,e),n))}function Wz(e,t,n){return ho(e,uo(t,n))}var{min:pm,PI:NJ}=Math,Kz=.275,$g=NJ+1e-4;function OJ(e,t={}){let{size:n=16,smoothing:r=.5,thinning:a=.5,simulatePressure:i=!0,easing:o=R=>R,start:l={},end:c={},last:s=!1}=t,{cap:d=!0,easing:u=R=>R*(2-R)}=l,{cap:h=!0,easing:m=R=>--R*R*R+1}=c;if(e.length===0||n<=0)return[];let p=e[e.length-1].runningLength,f=l.taper===!1?0:l.taper===!0?Math.max(n,p):l.taper,x=c.taper===!1?0:c.taper===!0?Math.max(n,p):c.taper,g=Math.pow(n*r,2),v=[],b=[],w=e.slice(0,10).reduce((R,P)=>{let F=P.pressure;if(i){let q=pm(1,P.distance/n),te=pm(1,1-q);F=pm(1,R+(te-R)*(q*Kz))}return(R+F)/2},e[0].pressure),S=Vz(n,a,e[e.length-1].pressure,o),_,C=e[0].vector,k=e[0].point,T=k,I=k,A=T,O=!1;for(let R=0;R<e.length;R++){let{pressure:P}=e[R],{point:F,vector:q,distance:te,runningLength:ge}=e[R];if(R<e.length-1&&p-ge<3)continue;if(a){if(i){let Zt=pm(1,te/n),qt=pm(1,1-Zt);P=pm(1,w+(qt-w)*(Zt*Kz))}S=Vz(n,a,P,o)}else S=n/2;_===void 0&&(_=S);let be=ge<f?u(ge/f):1,fe=p-ge<x?m((p-ge)/x):1;S=Math.max(.01,S*Math.min(be,fe));let He=(R<e.length-1?e[R+1]:e[R]).vector,je=R<e.length-1?Gz(q,He):1,ke=Gz(q,C)<0&&!O,ct=je!==null&&je<0;if(ke||ct){let Zt=uo(Wg(C),S);for(let qt=1/13,gl=0;gl<=1;gl+=qt)I=Kg(Ri(F,Zt),F,$g*gl),v.push(I),A=Kg(ho(F,Zt),F,$g*-gl),b.push(A);k=I,T=A,ct&&(O=!0);continue}if(O=!1,R===e.length-1){let Zt=uo(Wg(q),S);v.push(Ri(F,Zt)),b.push(ho(F,Zt));continue}let On=uo(Wg(q6(He,q,je)),S);I=Ri(F,On),(R<=1||Yz(k,I)>g)&&(v.push(I),k=I),A=ho(F,On),(R<=1||Yz(T,A)>g)&&(b.push(A),T=A),w=P,C=q}let V=e[0].point.slice(0,2),j=e.length>1?e[e.length-1].point.slice(0,2):ho(e[0].point,[1,1]),K=[],Z=[];if(e.length===1){if(!(f||x)||s){let R=Wz(V,$z(Wg(Ri(V,j))),-(_||S)),P=[];for(let F=1/13,q=F;q<=1;q+=F)P.push(Kg(R,V,$g*2*q));return P}}else{if(!(f||x&&e.length===1))if(d)for(let P=1/13,F=P;F<=1;F+=P){let q=Kg(b[0],V,$g*F);K.push(q)}else{let P=Ri(v[0],b[0]),F=uo(P,.5),q=uo(P,.51);K.push(Ri(V,F),Ri(V,q),ho(V,q),ho(V,F))}let R=Wg(MJ(e[e.length-1].vector));if(x||f&&e.length===1)Z.push(j);else if(h){let P=Wz(j,R,S);for(let F=1/29,q=F;q<1;q+=F)Z.push(Kg(P,j,$g*3*q))}else Z.push(ho(j,uo(R,S)),ho(j,uo(R,S*.99)),Ri(j,uo(R,S*.99)),Ri(j,uo(R,S)))}return v.concat(Z,b.reverse(),K)}function zJ(e,t={}){var n;let{streamline:r=.5,size:a=16,last:i=!1}=t;if(e.length===0)return[];let o=.15+(1-r)*.85,l=Array.isArray(e[0])?e:e.map(({x:m,y:p,pressure:f=.5})=>[m,p,f]);if(l.length===2){let m=l[1];l=l.slice(0,-1);for(let p=1;p<5;p++)l.push(q6(l[0],m,p/4))}l.length===1&&(l=[...l,[...ho(l[0],[1,1]),...l[0].slice(2)]]);let c=[{point:[l[0][0],l[0][1]],pressure:l[0][2]>=0?l[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],s=!1,d=0,u=c[0],h=l.length-1;for(let m=1;m<l.length;m++){let p=i&&m===h?l[m].slice(0,2):q6(u.point,l[m],o);if(DJ(u.point,p))continue;let f=RJ(p,u.point);if(d+=f,m<h&&!s){if(d<a)continue;s=!0}u={point:p,pressure:l[m][2]>=0?l[m][2]:.5,vector:$z(Ri(u.point,p)),distance:f,runningLength:d},c.push(u)}return c[0].vector=((n=c[1])==null?void 0:n.vector)||[0,0],c}function Xz(e,t={}){return OJ(zJ(e,t),t)}var tk=M(B(),1);var yH=M(B(),1);var j2=M(G(),1),nk=M(B(),1);var SH=M(B(),1);var _H=M(B(),1);function PJ(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var UJ={};PJ(UJ,"LaserPointer",()=>Zg);function cn([e,t,n],[r,a,i]){return[e+r,t+a,n+i]}function Xg([e,t,n],[r,a,i]){return[e-r,t-a,n-i]}function Dn([e,t,n],r){return[e*r,t*r,n*r]}function fm([e,t,n]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),n]}function Or([e,t,n],r){return[Math.cos(r)*e-Math.sin(r)*t,Math.sin(r)*e+Math.cos(r)*t,n]}function BJ(e,t,n){return cn(e,Dn(Xg(t,e),n))}function Zz(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 qz(e){return Math.atan2(Math.sin(e),Math.cos(e))}function Qz([e,t]){return Math.sqrt(e**2+t**2)}function gm([e,t],[n,r]){return Math.sqrt((n-e)**2+(r-t)**2)}function FJ(e){if(e.length<2)return 0;let t=0;for(let n=1;n<=e.length-1;n++)t+=gm(e[n-1],e[n]);return t+=gm(e[e.length-2],e[e.length-1]),t}var HJ=(e,t,n)=>Math.max(t,Math.min(n,e));function jJ(e,t,n){let r=gm(t,n);if(r===0)return gm(e,t);let a=HJ(((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r**2,0,1),i=[t[0]+a*(n[0]-t[0]),t[1]+a*(n[1]-t[1]),e[2]];return gm(i,e)}function sx(e,t){if(t===0||e.length<=2)return e;let n=e[0],r=e[e.length-1],[a,i]=e.reduce(([o,l],c,s)=>{let d=jJ(c,n,r);return d>o?[d,s]:[o,l]},[0,-1]);if(a>=t){let o=e[i];return[...sx([n,...e.slice(1,i),o],t).slice(0,-1),o,...sx([o,...e.slice(i,-1),r],t).slice(1)]}else return[n,r]}var Zg=class e{static{this.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:"output",keepHead:!1,sizeMapping:()=>1}}static{this.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:t=>t>35?.5:1,maxTailLength:50}}constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},e.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){let 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=BJ(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),FJ(this.tailPoints)>e.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,a,i){return(t??this.options.size)*this.options.sizeMapping({pressure:n,runningLength:i,currentIndex:r,totalLength:a})}getStrokeOutline(t){if(this.isFresh)return[];let n=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase==="input"&&(n=sx(n,this.options.simplify));let r=n.length;if(r===0)return[];if(r===1){let C=n[0],k=this.getSize(t,C[2],0,r,0);if(k<.5)return[];let T=[];for(let I=0;I<=Math.PI*2;I+=Math.PI/16)T.push(cn(C,Dn(Or([1,0,0],I),k)));return T.push(cn(C,Dn([1,0,0],this.getSize(t,C[2],0,r,0)))),T}if(r===2){let C=n[0],k=n[1],T=this.getSize(t,C[2],0,r,0),I=this.getSize(t,k[2],0,r,0);if(T<.5||I<.5)return[];let A=[],O=Zz(C,[C[0],C[1]-100,C[2]],k);for(let V=O;V<=Math.PI+O;V+=Math.PI/16)A.push(cn(C,Dn(Or([1,0,0],V),T)));for(let V=Math.PI+O;V<=Math.PI*2+O;V+=Math.PI/16)A.push(cn(k,Dn(Or([1,0,0],V),I)));return A.push(A[0]),A}let a=[],i=[],o=0,l=0,c=0,s=0;for(let C=1;C<r-1;C++){let k=n[C-1],T=n[C],I=n[C+1],A=T[2],O=gm(k,T);s+=O,o=l+(O-l)*.2;let V=this.getSize(t,A,C,r,s);if(V===0){c=C+1;continue}let j=fm(Xg(k,T)),K=fm(Xg(I,T)),Z=Or(j,Math.PI/2),R=Or(j,-Math.PI/2),P=Or(K,Math.PI/2),F=Or(K,-Math.PI/2),q=cn(T,Dn(Z,V)),te=cn(T,Dn(R,V)),ge=cn(T,Dn(P,V)),be=cn(T,Dn(F,V)),fe=cn(Z,F),He=cn(R,P),je=cn(T,Dn(Qz(fe)===0?j:fm(fe),V)),ke=cn(T,Dn(Qz(He)===0?K:fm(He),V)),ct=qz(Zz(T,k,I)),On=e.constants.cornerDetectionMaxAngle/180*Math.PI*e.constants.cornerDetectionVariance(o);if(Math.abs(ct)<On){let Zt=Math.abs(qz(Math.PI-ct));if(Zt===0)continue;if(ct<0){i.push(te,ke);for(let qt=0;qt<=Zt;qt+=Zt/4)a.push(cn(T,Or(Dn(Z,V),qt)));for(let qt=Zt;qt>=0;qt-=Zt/4)i.push(cn(T,Or(Dn(Z,V),qt)));i.push(ke,ge)}else{a.push(q,je);for(let qt=0;qt<=Zt;qt+=Zt/4)i.push(cn(T,Or(Dn(Z,-V),-qt)));for(let qt=Zt;qt>=0;qt-=Zt/4)a.push(cn(T,Or(Dn(Z,-V),-qt)));a.push(je,be)}}else a.push(je),i.push(ke);l=o}if(c>=r-2)if(this.options.keepHead){let C=n[r-1],k=[];for(let T=0;T<=Math.PI*2;T+=Math.PI/16)k.push(cn(C,Dn(Or([1,0,0],T),this.options.size)));return k.push(cn(C,Dn([1,0,0],this.options.size))),k}else return[];let d=n[c],u=n[c+1],h=n[r-2],m=n[r-1],p=fm(Xg(u,d)),f=fm(Xg(h,m)),x=Or(p,-Math.PI/2),g=Or(f,Math.PI/2),v=this.getSize(t,d[2],0,r,0),b=[],w=this.options.keepHead?this.options.size:this.getSize(t,h[2],r-2,r,s),S=[];if(v>1){for(let C=0;C<=Math.PI;C+=Math.PI/16)b.unshift(cn(d,Or(Dn(x,v),-C)));b.unshift(cn(d,Dn(x,-v)))}else b.push(d);for(let C=0;C<=Math.PI*3;C+=Math.PI/16)S.push(cn(m,Or(Dn(g,-w),-C)));let _=[...b,...a,...S.reverse(),...i.reverse()];return b.length>0&&_.push(b[0]),this.options.simplify>0&&this.options.simplifyPhase==="output"?sx(_,this.options.simplify):_}};var kH=M(G(),1),ak=M(gi(),1);var zr=M(B(),1);var RH=M(G(),1),Rc=M(G(),1),NH=M(gi(),1);var OH=M(B(),1),as=M(B(),1),au=M(B(),1);var zH=M(G(),1);var Y2=M(G(),1);var Am=M(B(),1);var R1=M(B(),1),Mc=M(G(),1);var UH=M(B(),1),Ct=M(B(),1);var BH=M(B(),1);var N1=M(B(),1),dn=M(B(),1),Gi=M(G(),1);var Qr=M(B(),1),uu=M(B(),1);var $d=M(G(),1);var or=M(B(),1);var VH=M(B(),1),Ma=M(B(),1);var Rn=M(G(),1);var YH=M(G(),1),WH=M(G(),1),iu=M(B(),1);var e_=M(B(),1);var ZH=M(B(),1);var ou=M(B(),1);var JH=M(B(),1);var tj=M(B(),1),t_=M(B(),1),rj=M(G(),1);var W2=M(G(),1),ij=M(B(),1);var O1=M(B(),1),cs=M(B(),1),Ce=M(B(),1),ss=M(B(),1);var K2=M(G(),1);var Xd=M(B(),1),ds=M(B(),1),Pi=M(B(),1);var Mj=M(nP(),1),Ln=M(G(),1);var it=M(B(),1),qr=M(B(),1),Dj=M(G(),1),$2=M(G(),1),ti=M(G(),1);var ms=M(G(),1);var u1=M(B(),1);var ir=M(B(),1);var Uj=M(G(),1),La=M(B(),1),Bj=M(B(),1),z1=M(B(),1);var yr=M(B(),1),jj=M(G(),1),hu=M(G(),1);var Dm=M(B(),1);var Z2=M(G(),1),Ye=M(B(),1),Aa=M(B(),1);var fo=M(G(),1);var Gn=M(G(),1),$j=M(G(),1);var Qo=M(G(),1);var Ia=M(B(),1),is=M(B(),1),a_=M(B(),1),Bm=M(B(),1);var i_=M(G(),1);var Xj=M(B(),1);var qj=M(B(),1);var o_=M(B(),1);var Jj=M(B(),1),Zr=M(B(),1);var tV=M(yg(),1),yo=M(G(),1);var al=M(G(),1);var Im=M(B(),1),nV=M(B(),1),rV=M(B(),1);var aV=M(B(),1);var iV=M(B(),1);var oV=M(B(),1);var lV=M(G(),1);var sV=M(B(),1);var cV=M(B(),1);var dV=M(G(),1);var uV=M(B(),1);var hV=M(B(),1),le=M(B(),1),Nc=M(G(),1);var Bi=M(B(),1),J2=M(G(),1),Lm=M(B(),1),mV=M(G(),1);var X=M(B(),1);var Rx=M(B(),1),Ra=M(G(),1);var Qm=M(G(),1);var d_=M(B(),1),We=M(B(),1),pV=M(G(),1);var fV=M(B(),1),Vn=M(B(),1);var U1=M(B(),1),ne=M(B(),1);var B1=M(B(),1),ew=M(G(),1),u_=M(B(),1),mu=M(G(),1);var vV=M(B(),1),Oc=M(G(),1);var yV=M(B(),1),tw=M(G(),1);var wV=M(B(),1);var EV=M(gi(),1),SV=M(B(),1),Ne=M(B(),1),rw=M(G(),1),AV=M(B(),1);var p_=M(B(),1);var aw=M(B(),1),Hi=M(B(),1),_t=M(B(),1),xo=M(B(),1),go=M(B(),1),zk=M(G(),1);var LV=M(yg(),1);var Nx=M(B(),1);var Qde=M(G(),1);var Ox=M(B(),1),rB=yy(),{useAtom:Fe,useSetAtom:F1,useAtomValue:f_,useStore:hbe}=rB,lee=rB.Provider,Qa=Jh(),see=oM({"./locales/ar-SA.json":()=>import("./chunks/ar-SA-NXDWD63E-MF6HMEA4.js"),"./locales/az-AZ.json":()=>import("./chunks/az-AZ-MXSORGZV-AIGO4TNU.js"),"./locales/bg-BG.json":()=>import("./chunks/bg-BG-O6MV2KSF-X6AVO2AF.js"),"./locales/bn-BD.json":()=>import("./chunks/bn-BD-T2VJNT7N-7OMHRIGC.js"),"./locales/bn-IN.json":()=>import("./chunks/bn-IN-MMW2ORAC-EPKMNKG7.js"),"./locales/ca-ES.json":()=>import("./chunks/ca-ES-MKBCGNOG-U44SUUTN.js"),"./locales/cs-CZ.json":()=>import("./chunks/cs-CZ-V77HGUP7-OLBAKFG5.js"),"./locales/da-DK.json":()=>import("./chunks/da-DK-I5RFNTM4-QJIG2SEZ.js"),"./locales/de-CH.json":()=>import("./chunks/de-CH-WLRDEVBV-4MMJDMVD.js"),"./locales/de-DE.json":()=>import("./chunks/de-DE-DTI4WUSC-ML7C46TT.js"),"./locales/el-GR.json":()=>import("./chunks/el-GR-ZXDJ2OS4-WSCEIO6J.js"),"./locales/en.json":()=>import("./chunks/en-CTDJDZ6K-IC3QAUOI.js"),"./locales/es-ES.json":()=>import("./chunks/es-ES-DYQHAD43-XGB5X5IM.js"),"./locales/eu-ES.json":()=>import("./chunks/eu-ES-QDSYU5Y3-LA3JTIJ2.js"),"./locales/fa-IR.json":()=>import("./chunks/fa-IR-26LZG4PM-PFALMEDX.js"),"./locales/fi-FI.json":()=>import("./chunks/fi-FI-6YS4KDE4-ES5MV6P4.js"),"./locales/fr-FR.json":()=>import("./chunks/fr-FR-BRLLPTZC-VMFE22YV.js"),"./locales/gl-ES.json":()=>import("./chunks/gl-ES-OKUZTLYG-GPT42ZHV.js"),"./locales/he-IL.json":()=>import("./chunks/he-IL-26MGYIU7-VQ5XQYYY.js"),"./locales/hi-IN.json":()=>import("./chunks/hi-IN-Q4ZOGTP2-2Z766MXA.js"),"./locales/hu-HU.json":()=>import("./chunks/hu-HU-P2OXPSN5-6XDVPGTE.js"),"./locales/id-ID.json":()=>import("./chunks/id-ID-2EIKXYN6-J5GWSY2S.js"),"./locales/it-IT.json":()=>import("./chunks/it-IT-4CFKVXI2-NMBWUWFF.js"),"./locales/ja-JP.json":()=>import("./chunks/ja-JP-MAND2Z4V-GQZYXXOC.js"),"./locales/kaa.json":()=>import("./chunks/kaa-HQRTCXTJ-7D6PAKDJ.js"),"./locales/kab-KAB.json":()=>import("./chunks/kab-KAB-JKIKKTGH-TNKFXNAX.js"),"./locales/kk-KZ.json":()=>import("./chunks/kk-KZ-HXQ63ZFC-T4HCMWED.js"),"./locales/km-KH.json":()=>import("./chunks/km-KH-PKL3LSGX-HTLHEJV6.js"),"./locales/ko-KR.json":()=>import("./chunks/ko-KR-KXLREZX3-QMR52QVI.js"),"./locales/ku-TR.json":()=>import("./chunks/ku-TR-MJ4IER3X-K5CNY4UO.js"),"./locales/lt-LT.json":()=>import("./chunks/lt-LT-H6WFQ6FJ-IW25FAGX.js"),"./locales/lv-LV.json":()=>import("./chunks/lv-LV-GOCK6SJW-KTDFW5OH.js"),"./locales/mr-IN.json":()=>import("./chunks/mr-IN-IXVLDMEQ-PHM5DT7Q.js"),"./locales/my-MM.json":()=>import("./chunks/my-MM-YG6MYTTD-ZHLCMEVA.js"),"./locales/nb-NO.json":()=>import("./chunks/nb-NO-XGWJISD2-KSDFG6YU.js"),"./locales/nl-NL.json":()=>import("./chunks/nl-NL-XVDVCPNC-KVF3ZO2R.js"),"./locales/nn-NO.json":()=>import("./chunks/nn-NO-EMX5MJX5-34QKSHNR.js"),"./locales/oc-FR.json":()=>import("./chunks/oc-FR-ROEINTVO-5GP4AOYO.js"),"./locales/pa-IN.json":()=>import("./chunks/pa-IN-ZYN6SUDY-MVL7O44W.js"),"./locales/percentages.json":()=>import("./chunks/percentages-5DKR754L-DG7W23CV.js"),"./locales/pl-PL.json":()=>import("./chunks/pl-PL-6VTG7PHC-VADRWSX4.js"),"./locales/pt-BR.json":()=>import("./chunks/pt-BR-5YFKRR5G-HHF4UPO4.js"),"./locales/pt-PT.json":()=>import("./chunks/pt-PT-GEIXXZ67-TUTAUZJK.js"),"./locales/ro-RO.json":()=>import("./chunks/ro-RO-E2P6TFZI-RJFCULYF.js"),"./locales/ru-RU.json":()=>import("./chunks/ru-RU-YBIIY43T-BF27TNVK.js"),"./locales/si-LK.json":()=>import("./chunks/si-LK-673C2CI2-IOFGU4U2.js"),"./locales/sk-SK.json":()=>import("./chunks/sk-SK-CKZHQ4AP-6O5JGN26.js"),"./locales/sl-SI.json":()=>import("./chunks/sl-SI-557H2GWM-2NEHLV7W.js"),"./locales/sv-SE.json":()=>import("./chunks/sv-SE-XOPKKDWS-Q2L6KGFV.js"),"./locales/ta-IN.json":()=>import("./chunks/ta-IN-XBH7DQI3-ISSUGZAK.js"),"./locales/th-TH.json":()=>import("./chunks/th-TH-TOCWH3R4-TABEAMJA.js"),"./locales/tr-TR.json":()=>import("./chunks/tr-TR-GXW6CYY5-5NQRN52Y.js"),"./locales/uk-UA.json":()=>import("./chunks/uk-UA-IJKTNUDG-2IIL3TO5.js"),"./locales/uz-UZ.json":()=>import("./chunks/uz-UZ-TBZZEA4V-X22KVKBP.js"),"./locales/vi-VN.json":()=>import("./chunks/vi-VN-MULSGNVB-TENM65C7.js"),"./locales/zh-CN.json":()=>import("./chunks/zh-CN-MVX3E32U-S5VA2BA5.js"),"./locales/zh-HK.json":()=>import("./chunks/zh-HK-JNU5RLIE-A4VUKZFV.js"),"./locales/zh-TW.json":()=>import("./chunks/zh-TW-LENVCA6T-KFB6KHMM.js")}),cee=85,Fm={code:"en",label:"English"},g_=[Fm,...[{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",rtl:!0},{code:"bg-BG",label:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"},{code:"ca-ES",label:"Catal\xE0"},{code:"cs-CZ",label:"\u010Cesky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},{code:"es-ES",label:"Espa\xF1ol"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Fran\xE7ais"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",rtl:!0},{code:"hi-IN",label:"\u0939\u093F\u0928\u094D\u0926\u0940"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4"},{code:"ku-TR",label:"Kurd\xEE"},{code:"lt-LT",label:"Lietuvi\u0173"},{code:"lv-LV",label:"Latvie\u0161u"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokm\xE5l"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Portugu\xEAs Brasileiro"},{code:"pt-PT",label:"Portugu\xEAs"},{code:"ro-RO",label:"Rom\xE2n\u0103"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"sk-SK",label:"Sloven\u010Dina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Sloven\u0161\u010Dina"},{code:"tr-TR",label:"T\xFCrk\xE7e"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t"},{code:"mr-IN",label:"\u092E\u0930\u093E\u0920\u0940"}].filter(e=>m7[e.code]>=cee).sort((e,t)=>e.label>t.label?1:-1)],zx="__test__";qn()&&g_.unshift({code:zx,label:"test language"},{code:`${zx}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var ym=Fm,xx={},aB=async e=>{if(ym=e,document.documentElement.dir=ym.rtl?"rtl":"ltr",document.documentElement.lang=ym.code,e.code.startsWith(zx))xx={};else try{xx=await see(`./locales/${ym.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),xx=V3}Qa.set(iB,e.code)},y1=()=>ym,rP=(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},E=(e,t,n)=>{if(ym.code.startsWith(zx))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let r=e.split("."),a=rP(xx,r)||rP(V3,r)||n;if(a===void 0){let i=`Can't find translation for ${e}`;if(_s.PROD)return console.warn(i),"";throw new Error(i)}if(t)for(let i in t)a=a.replace(`{{${i}}}`,String(t[i]));return a},iB=Dt(Fm.code),Lt=()=>{let e=f_(iB);return{t:E,langCode:e}},po=e=>"var(--icon-fill-color)",oB=e=>e===se.LIGHT?"#fff":"#1e1e1e",z=(e,t=512)=>{let{width:n=512,height:r=n,mirror:a,style:i,...o}=typeof t=="number"?{width:t}:t;return(0,y.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${r}`,className:H({"rtl-mirror":a}),style:i,...o,children:typeof e=="string"?(0,y.jsx)("path",{fill:"currentColor",d:e}):e})},J={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},we={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ra={width:40,height:20},fbe=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("rect",{x:3,y:8,width:18,height:4,rx:1}),(0,y.jsx)("line",{x1:12,y1:8,x2:12,y2:21}),(0,y.jsx)("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),(0,y.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"})]}),J),lB=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),(0,y.jsx)("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),(0,y.jsx)("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),(0,y.jsx)("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),(0,y.jsx)("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),J),dee=z((0,y.jsxs)("svg",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,y.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),J),uee=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,y.jsx)("circle",{cx:"12",cy:"19",r:"1"}),(0,y.jsx)("circle",{cx:"12",cy:"5",r:"1"})]}),J),hee=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,y.jsx)("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,y.jsx)("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),J),mee=z((0,y.jsxs)("svg",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),(0,y.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),(0,y.jsx)("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),J),aP=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M6.5 9.5l3.5 -3"}),(0,y.jsx)("path",{d:"M14 5.5l3 1.5"}),(0,y.jsx)("path",{d:"M18.5 10l-2.5 7"}),(0,y.jsx)("path",{d:"M13.5 17.5l-7 -5"})]}),J),r2=z((0,y.jsxs)("g",{children:[(0,y.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"}),(0,y.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"}),(0,y.jsx)("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:(0,y.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"})}),(0,y.jsx)("g",{mask:"url(#UnlockedIcon)",children:(0,y.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"})})]}),we),b_=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.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"}),(0,y.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"}),(0,y.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"})]}),we),pee=z((0,y.jsx)("g",{fill:"currentColor",children:(0,y.jsx)("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3"})}),{width:24,height:24}),fee=z((0,y.jsxs)(y.Fragment,{children:[(0,y.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"}),(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),(0,y.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"}),gee=z((0,y.jsxs)(y.Fragment,{children:[(0,y.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"}),(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),(0,y.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"}),bee=z((0,y.jsxs)(y.Fragment,{children:[(0,y.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"}),(0,y.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"}),(0,y.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"}),gbe=z((0,y.jsx)("g",{fill:"currentColor",children:(0,y.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"}),a2=z((0,y.jsxs)("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),h1=z((0,y.jsxs)("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[(0,y.jsx)("path",{d:"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255"}),(0,y.jsx)("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),v_=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),J),y_=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"})]}),J),x_=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"})]}),J),sB=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,y.jsx)("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),(0,y.jsx)("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),J),w_=z((0,y.jsx)("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),we),vee=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),(0,y.jsx)("path",{d:"M16 7h4"}),(0,y.jsx)("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),J),H1=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.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"}),(0,y.jsx)("path",{d:"m11.25 5.417 3.333 3.333"})]}),we),Em=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),(0,y.jsx)("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),(0,y.jsx)("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),(0,y.jsx)("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),(0,y.jsx)("polyline",{points:"5 20 11 4 13 4 20 20"})]}),J),yee=z((0,y.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 7v-2h13v2"}),(0,y.jsx)("path",{d:"M10 5v14"}),(0,y.jsx)("path",{d:"M12 19h-4"}),(0,y.jsx)("path",{d:"M15 13v-1h6v1"}),(0,y.jsx)("path",{d:"M18 12v7"}),(0,y.jsx)("path",{d:"M17 19h2"})]}),J),wx=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M12.5 6.667h.01"}),(0,y.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"}),(0,y.jsx)("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),(0,y.jsx)("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),we),cB=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M18 13.3l-6.3 -6.3"})]}),J),iP=z((0,y.jsx)("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),we),oP=z((0,y.jsx)("path",{d:"M5 10h10",strokeWidth:"1.25"}),we),xee=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M21 21l-6 -6"}),(0,y.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"}),(0,y.jsx)("path",{d:"M3 4v4h4"})]}),J),us=z((0,y.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"}),we),Px=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("polyline",{points:"12 16 18 10 12 4"}),(0,y.jsx)("polyline",{points:"8 4 2 10 8 16"})]}),we),AC=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.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"}),(0,y.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"})]}),we),DC=z((0,y.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"}),we),IC=z((0,y.jsx)("g",{stroke:"currentColor",strokeLinejoin:"round",children:(0,y.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"})}),{...we,strokeWidth:1.5}),wee=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),(0,y.jsx)("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),(0,y.jsx)("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),J),i2=z((0,y.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"}),we),E_=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,y.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),(0,y.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),J),Eee=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,y.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),(0,y.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),J),lP=z((0,y.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"}),we),dB=z((0,y.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"}),we),See=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.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"}),(0,y.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"})]}),we),Cee=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),(0,y.jsx)("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),J),uB=z((0,y.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),LC=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.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"}),(0,y.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"})]}),we),_ee=z("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}),kee=z("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}),S_=z((0,y.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"}),we),bbe=z("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}),vbe=z("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"),Ex=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),(0,y.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"}),(0,y.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"})]}),J),Tee=z((0,y.jsx)("g",{strokeWidth:1.5,children:(0,y.jsx)("path",{d:"M6 18l12 -12"})}),J),hB=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M15 8h.01"}),(0,y.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"}),(0,y.jsx)("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),(0,y.jsx)("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),(0,y.jsx)("path",{d:"M19 16v6"}),(0,y.jsx)("path",{d:"M22 19l-3 3l-3 -3"})]}),J),Mee=z("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}),ybe=z("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}),xbe=z("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}),Aee=z("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"),wbe=z("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"),sP=z((0,y.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"}),we),cP=z((0,y.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"}),we),Dee=z("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}),Iee=z((0,y.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"}),we),Ebe=z("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"),Sbe=z("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}),Cbe=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M12 14v-11"}),(0,y.jsx)("path",{d:"M9 6l3 -3l3 3"})]}),J),_be=z((0,y.jsxs)(y.Fragment,{children:[(0,y.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"}),(0,y.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}),kbe=z((0,y.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}),mB=(0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M12 10l0 10"}),(0,y.jsx)("path",{d:"M12 10l4 4"}),(0,y.jsx)("path",{d:"M12 10l-4 4"}),(0,y.jsx)("path",{d:"M4 4l16 0"})]}),pB=(0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M12 5l0 14"}),(0,y.jsx)("path",{d:"M16 9l-4 -4"}),(0,y.jsx)("path",{d:"M8 9l4 -4"})]}),dP=z(pB,J),uP=z(pB,{...J,style:{transform:"rotate(180deg)"}}),hP=z(mB,J),mP=z(mB,{...J,style:{transform:"rotate(180deg)"}}),pP=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),fP=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),gP=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),bP=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),Lee=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),Ree=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),vP=z((0,y.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.jsx)("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),(0,y.jsx)("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),we),yP=z((0,y.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.jsx)("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),(0,y.jsx)("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.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"})]}),we),fB=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,y.jsx)("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),(0,y.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),(0,y.jsx)("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),J),Tbe=z("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"),Nee=z("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"),Hm=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:(0,y.jsx)("path",{d:"M15 5 5 15M5 5l10 10"})}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),Mbe=z("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}),Abe=z("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}),Dbe=z("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}),xP=pn.default.memo(({theme:e})=>z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{d:"M25 26H111V111H25",fill:po(e)}),(0,y.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:po(e),strokeWidth:"2"}),(0,y.jsx)("path",{d:"M100 100H160V160H100",fill:po(e)}),(0,y.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:po(e),strokeWidth:"2"}),(0,y.jsxs)("g",{fill:oB(e),stroke:po(e),strokeWidth:"6",children:[(0,y.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),wP=pn.default.memo(({theme:e})=>z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{d:"M25 26H111V111H25",fill:po(e)}),(0,y.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:po(e),strokeWidth:"2"}),(0,y.jsx)("path",{d:"M100 100H160V160H100",fill:po(e)}),(0,y.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:po(e),strokeWidth:"2"}),(0,y.jsxs)("g",{fill:oB(e),stroke:po(e),strokeWidth:"6",children:[(0,y.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,y.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),Oee=z((0,y.jsx)("g",{strokeWidth:1.25,children:(0,y.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"})}),we),zee=z((0,y.jsxs)(y.Fragment,{children:[(0,y.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"}),(0,y.jsx)("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:(0,y.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"})}),(0,y.jsx)("g",{mask:"url(#FillHachureIcon)",children:(0,y.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"})})]}),we),Pee=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("g",{clipPath:"url(#a)",children:[(0,y.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"}),(0,y.jsx)("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:(0,y.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"})}),(0,y.jsx)("g",{mask:"url(#FillCrossHatchIcon)",children:(0,y.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"})})]}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),Uee=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("g",{clipPath:"url(#a)",children:(0,y.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"})}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...we,fill:"currentColor"}),gB=z((0,y.jsx)(y.Fragment,{children:(0,y.jsx)("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),we),Bee=z((0,y.jsx)("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),we),Fee=z((0,y.jsx)("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),we),Ibe=pn.default.memo(({theme:e})=>z((0,y.jsx)("path",{d:"M6 10H34",stroke:po(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),Hee=z((0,y.jsxs)("g",{strokeWidth:"2",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M5 12h2"}),(0,y.jsx)("path",{d:"M17 12h2"}),(0,y.jsx)("path",{d:"M11 12h2"})]}),J),jee=z((0,y.jsxs)("g",{strokeWidth:"2",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 12v.01"}),(0,y.jsx)("path",{d:"M8 12v.01"}),(0,y.jsx)("path",{d:"M12 12v.01"}),(0,y.jsx)("path",{d:"M16 12v.01"}),(0,y.jsx)("path",{d:"M20 12v.01"})]}),J),Vee=z((0,y.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"}),we),Gee=z((0,y.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"}),we),Yee=z((0,y.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"}),we),Wee=z((0,y.jsxs)("svg",{strokeWidth:"1.5",children:[(0,y.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"}),(0,y.jsx)("path",{d:"M13.3333 3.33331V3.34331"}),(0,y.jsx)("path",{d:"M16.6667 3.33331V3.34331"}),(0,y.jsx)("path",{d:"M16.6667 6.66669V6.67669"}),(0,y.jsx)("path",{d:"M16.6667 10V10.01"}),(0,y.jsx)("path",{d:"M3.33334 13.3333V13.3433"}),(0,y.jsx)("path",{d:"M16.6667 13.3333V13.3433"}),(0,y.jsx)("path",{d:"M3.33334 16.6667V16.6767"}),(0,y.jsx)("path",{d:"M6.66666 16.6667V16.6767"}),(0,y.jsx)("path",{d:"M10 16.6667V16.6767"}),(0,y.jsx)("path",{d:"M13.3333 16.6667V16.6767"}),(0,y.jsx)("path",{d:"M16.6667 16.6667V16.6767"})]}),we),Kee=z((0,y.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),(0,y.jsx)("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),(0,y.jsx)("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),(0,y.jsx)("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),(0,y.jsx)("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),(0,y.jsx)("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),(0,y.jsx)("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),(0,y.jsx)("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),(0,y.jsx)("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),(0,y.jsx)("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),(0,y.jsx)("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),(0,y.jsx)("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),J),$ee=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,fill:"none",strokeLinecap:"round",children:[(0,y.jsx)("path",{d:"M7,11 H19"}),(0,y.jsx)("path",{d:"M25,6 L33,16 M33,6 L25,16"})]}),ra)),Xee=pn.default.memo(({flip:e=!1})=>z((0,y.jsx)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:(0,y.jsx)("path",{d:"M7,11 H33 M23,5 L33,11 L23,17"})}),ra)),Zee=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",children:[(0,y.jsx)("path",{d:"M7,11 H23",strokeWidth:2,strokeLinecap:"round"}),(0,y.jsx)("path",{d:"M23,5 L35,11 L23,17 Z"})]}),ra)),qee=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",children:[(0,y.jsx)("path",{d:"M7,11 H23"}),(0,y.jsx)("path",{d:"M23,5 L35,11 L23,17 Z"})]}),ra)),Qee=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[(0,y.jsx)("path",{d:"M7,11 H25",strokeWidth:2,strokeLinecap:"round"}),(0,y.jsx)("circle",{cx:"29",cy:"11",r:"4"})]}),ra)),Jee=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[(0,y.jsx)("path",{d:"M7,11 H25",strokeLinecap:"round"}),(0,y.jsx)("circle",{cx:"29",cy:"11",r:"4"})]}),ra)),ete=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",children:[(0,y.jsx)("path",{d:"M7,11 H21",strokeWidth:2,strokeLinecap:"round"}),(0,y.jsx)("path",{d:"M21,11 L28,5 L35,11 L28,17 Z"})]}),ra)),tte=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,strokeLinecap:"round",children:[(0,y.jsx)("path",{d:"M7,11 H21"}),(0,y.jsx)("path",{d:"M21,11 L28,5 L35,11 L28,17 Z"})]}),ra)),nte=pn.default.memo(({flip:e=!1})=>z((0,y.jsx)("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",strokeLinecap:"round",children:(0,y.jsx)("path",{d:"M11,11 H31 M31,5 V17"})}),ra)),rte=pn.default.memo(({flip:e=!1})=>z((0,y.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,y.jsx)("path",{d:"M35,11 H7 M15,5 V17"})}),ra)),ate=pn.default.memo(({flip:e=!1})=>z((0,y.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,y.jsx)("path",{d:"M35,11 H7 M15,11 L7,5 M15,11 L7,17"})}),ra)),ite=pn.default.memo(({flip:e=!1})=>z((0,y.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,y.jsx)("path",{d:"M35,11 H7 M23,5 V17 M15,11 L7,5 M15,11 L7,17"})}),ra)),ote=pn.default.memo(({flip:e=!1})=>z((0,y.jsx)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:(0,y.jsx)("path",{d:"M35,11 H7 M15,5 V17 M7,5 V17"})}),ra)),lte=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:[(0,y.jsx)("path",{d:"M35,11 H19 M11,11 H7 M7,5 V17"}),(0,y.jsx)("circle",{cx:"15",cy:"11",r:"4"})]}),ra)),ste=pn.default.memo(({flip:e=!1})=>z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:[(0,y.jsx)("path",{d:"M35,11 H27 M19,11 H7 M15,11 L7,5 M15,11 L7,17"}),(0,y.jsx)("circle",{cx:"23",cy:"11",r:"4"})]}),ra)),cte=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("g",{clipPath:"url(#a)",children:(0,y.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"})}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),dte=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("g",{clipPath:"url(#a)",children:(0,y.jsx)("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),ute=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("g",{clipPath:"url(#a)",children:(0,y.jsx)("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,y.jsx)("defs",{children:(0,y.jsx)("clipPath",{id:"a",children:(0,y.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),we),hte=z((0,y.jsx)(y.Fragment,{children:(0,y.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"})}),we),o2=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 7v-2h13v2"}),(0,y.jsx)("path",{d:"M10 5v14"}),(0,y.jsx)("path",{d:"M12 19h-4"}),(0,y.jsx)("path",{d:"M15 13v-1h6v1"}),(0,y.jsx)("path",{d:"M18 12v7"}),(0,y.jsx)("path",{d:"M17 19h2"})]}),J),mte=z((0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M7 12h10"}),(0,y.jsx)("path",{d:"M7 5v14"}),(0,y.jsx)("path",{d:"M17 5v14"}),(0,y.jsx)("path",{d:"M15 19h4"}),(0,y.jsx)("path",{d:"M15 5h4"}),(0,y.jsx)("path",{d:"M5 19h4"}),(0,y.jsx)("path",{d:"M5 5h4"})]})}),J),RC=z((0,y.jsx)(y.Fragment,{children:(0,y.jsx)("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:(0,y.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"})})}),we),bB=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M7 8l-4 4l4 4"}),(0,y.jsx)("path",{d:"M17 8l4 4l-4 4"}),(0,y.jsx)("path",{d:"M14 4l-4 16"})]}),J),vB=bB,pte=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,y.jsx)("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),(0,y.jsx)("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),J),fte=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,y.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),(0,y.jsx)("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),J),gte=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),(0,y.jsx)("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),(0,y.jsx)("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),J),bte=pn.default.memo(({theme:e})=>z((0,y.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),(0,y.jsx)("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),J)),vte=pn.default.memo(({theme:e})=>z((0,y.jsxs)("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),(0,y.jsx)("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),J)),yte=pn.default.memo(({theme:e})=>z((0,y.jsxs)("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),(0,y.jsx)("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),(0,y.jsx)("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),J)),yB=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M21 19h-18l9 -15"}),(0,y.jsx)("path",{d:"M20.615 15.171h.015"}),(0,y.jsx)("path",{d:"M19.515 11.771h.015"}),(0,y.jsx)("path",{d:"M17.715 8.671h.015"}),(0,y.jsx)("path",{d:"M15.415 5.971h.015"})]}),J),xte=z((0,y.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}),Lbe=z((0,y.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"})),C_=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),(0,y.jsx)("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),(0,y.jsx)("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),(0,y.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"})]}),J),EP=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),(0,y.jsx)("path",{d:"M7 11l5 5l5 -5"}),(0,y.jsx)("path",{d:"M12 4l0 12"})]}),J),__=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.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"})]}),J),wte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,y.jsx)("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,y.jsx)("path",{d:"M9.15 14.85l8.85 -10.85"}),(0,y.jsx)("path",{d:"M6 4l8.85 10.85"})]}),J),Ete=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),(0,y.jsx)("path",{d:"M12 17l0 .01"}),(0,y.jsx)("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),J),Rbe=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M7 4v16l13 -8z"})]}),J),Nbe=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"})]}),J),Ste=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M5 12l5 5l10 -10"})]}),J),xB=z((0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M12 9v4"}),(0,y.jsx)("path",{d:"M12 17h.01"})]}),J),Cte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M11 7l6 6"}),(0,y.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"})]}),J),NC=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M12 3l-4 7h8z"}),(0,y.jsx)("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),(0,y.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"})]}),J),Zd=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 7l16 0"}),(0,y.jsx)("path",{d:"M4 17l16 0"}),(0,y.jsx)("path",{d:"M7 4l0 16"}),(0,y.jsx)("path",{d:"M17 4l0 16"})]}),J),k_=z((0,y.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"})),_te=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),(0,y.jsx)("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),J),kte=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),(0,y.jsx)("path",{d:"M4 15l8 4l8 -4"}),(0,y.jsx)("path",{d:"M12 4v7"}),(0,y.jsx)("path",{d:"M15 8l-3 3l-3 -3"})]}),J),l2=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{d:"M4.16602 10H15.8327"}),(0,y.jsx)("path",{d:"M12.5 13.3333L15.8333 10"}),(0,y.jsx)("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),we),Rm=z((0,y.jsxs)("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[(0,y.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"}),(0,y.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),Ux=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,y.jsx)("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),(0,y.jsx)("path",{d:"M15 6l3 3"}),(0,y.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"}),(0,y.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"})]}),J),Obe=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,y.jsx)("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),(0,y.jsx)("path",{d:"M15 6l3 3"}),(0,y.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"}),(0,y.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"})]}),J),zbe=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),(0,y.jsx)("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),(0,y.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"}),(0,y.jsx)("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),(0,y.jsx)("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),(0,y.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"})]}),J),Tte=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),(0,y.jsx)("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),(0,y.jsx)("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),(0,y.jsx)("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),J),T_=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),(0,y.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"})]}),J),Mte=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),(0,y.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"}),(0,y.jsx)("path",{d:"M3 3l18 18"})]}),J),Ate=z((0,y.jsxs)("g",{stroke:"currentColor",fill:"none",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.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"}),(0,y.jsx)("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),(0,y.jsx)("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),(0,y.jsx)("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),(0,y.jsx)("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),J),Dte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.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"}),(0,y.jsx)("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),(0,y.jsx)("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),(0,y.jsx)("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),(0,y.jsx)("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),J),su=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),(0,y.jsx)("path",{d:"M21 21l-6 -6"})]}),J),Ite=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),(0,y.jsx)("path",{d:"M12 7v5l3 3"}),(0,y.jsx)("path",{d:"M19 16l-2 3h4l-2 3"})]}),J),Lte=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M12 8l0 4l2 2"}),(0,y.jsx)("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),J),Rte=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M5 10a7 7 0 0 0 14 0"}),(0,y.jsx)("path",{d:"M8 21l8 0"}),(0,y.jsx)("path",{d:"M12 17l0 4"})]}),J),Nte=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 3l18 18"}),(0,y.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"}),(0,y.jsx)("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),(0,y.jsx)("path",{d:"M8 21l8 0"}),(0,y.jsx)("path",{d:"M12 17l0 4"})]}),J),OC=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),J),Ote=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M12 20v.01"}),(0,y.jsx)("path",{d:"M16 20v.01"}),(0,y.jsx)("path",{d:"M8 20v.01"}),(0,y.jsx)("path",{d:"M4 20v.01"}),(0,y.jsx)("path",{d:"M4 16v.01"}),(0,y.jsx)("path",{d:"M4 12v.01"}),(0,y.jsx)("path",{d:"M4 8v.01"}),(0,y.jsx)("path",{d:"M4 4v.01"}),(0,y.jsx)("path",{d:"M8 4v.01"}),(0,y.jsx)("path",{d:"M12 4v.01"}),(0,y.jsx)("path",{d:"M16 4v.01"}),(0,y.jsx)("path",{d:"M20 4v.01"}),(0,y.jsx)("path",{d:"M20 8v.01"}),(0,y.jsx)("path",{d:"M20 12v.01"}),(0,y.jsx)("path",{d:"M20 16v.01"}),(0,y.jsx)("path",{d:"M20 20v.01"})]}),J),zte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M5 3v18"}),(0,y.jsx)("path",{d:"M19 21v-18"}),(0,y.jsx)("path",{d:"M5 7h14"}),(0,y.jsx)("path",{d:"M5 15h14"}),(0,y.jsx)("path",{d:"M8 13v4"}),(0,y.jsx)("path",{d:"M11 13v4"}),(0,y.jsx)("path",{d:"M16 13v4"}),(0,y.jsx)("path",{d:"M14 5v4"}),(0,y.jsx)("path",{d:"M11 5v4"}),(0,y.jsx)("path",{d:"M8 5v4"}),(0,y.jsx)("path",{d:"M3 21h18"})]}),J),Pte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 12l18 0"}),(0,y.jsx)("path",{d:"M7 16l10 0l-10 5l0 -5"}),(0,y.jsx)("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),J),Ute=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M12 3l0 18"}),(0,y.jsx)("path",{d:"M16 7l0 10l5 0l-5 -10"}),(0,y.jsx)("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),J),wB=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),(0,y.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"})]}),J),M_=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),(0,y.jsx)("path",{d:"M22 22l-3 -3"}),(0,y.jsx)("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),(0,y.jsx)("path",{d:"M3 11v-1"}),(0,y.jsx)("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),(0,y.jsx)("path",{d:"M10 3h1"}),(0,y.jsx)("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),J),Bte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),(0,y.jsx)("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),(0,y.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"}),(0,y.jsx)("path",{d:"M10 15l2 6l2 -6"}),(0,y.jsx)("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),J),Fte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),(0,y.jsx)("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),(0,y.jsx)("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),(0,y.jsx)("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),(0,y.jsx)("path",{d:"M11 21v-6l3 6v-6"})]}),J),Hte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M4 8l5 0"}),(0,y.jsx)("path",{d:"M15 8l4 0"})]}),J),jte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),(0,y.jsx)("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),(0,y.jsx)("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),(0,y.jsx)("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),J),Vte=z((0,y.jsxs)("g",{stroke:"currentColor",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"})]}),{...J,strokeWidth:1.5}),Pbe=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M21 12h-13l3 -3"}),(0,y.jsx)("path",{d:"M11 15l-3 -3"})]}),J),Gte=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.jsx)("path",{d:"M10 9l5 3l-5 3z"})]}),J),Yte=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 6h18"}),(0,y.jsx)("path",{d:"M3 12h18"}),(0,y.jsx)("path",{d:"M3 18h18"}),(0,y.jsx)("path",{d:"M6 3v18"}),(0,y.jsx)("path",{d:"M12 3v18"}),(0,y.jsx)("path",{d:"M18 3v18"})]}),J),Wte=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.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"}),(0,y.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"}),(0,y.jsx)("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),J),A_=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M6 18l12 -12"}),(0,y.jsx)("path",{d:"M18 10v-4h-4"})]}),J),D_=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),(0,y.jsx)("path",{d:"M18 4l3 3l-3 3"})]}),J),I_=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{d:"M16,12L20,9L16,6"}),(0,y.jsx)("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),J),EB=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M6 9l6 6l6 -6"})]}),J),Kte=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M6 15l6 -6l6 6"})]}),J),$te=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M6 15l6 -6l6 6"})]}),J),SP=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),(0,y.jsx)("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),J),SB=z((0,y.jsxs)("g",{children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M5 7l0 10"}),(0,y.jsx)("path",{d:"M7 5l10 0"}),(0,y.jsx)("path",{d:"M7 19l10 0"}),(0,y.jsx)("path",{d:"M19 7l0 10"})]}),J),Ube=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),(0,y.jsx)("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),J),Xte=z((0,y.jsxs)("g",{strokeWidth:1.5,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M4 6l8 0"}),(0,y.jsx)("path",{d:"M16 6l4 0"}),(0,y.jsx)("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M4 12l2 0"}),(0,y.jsx)("path",{d:"M10 12l10 0"}),(0,y.jsx)("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M4 18l11 0"}),(0,y.jsx)("path",{d:"M19 18l1 0"})]}),J),Zte=z((0,y.jsxs)("g",{strokeWidth:1,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),J),qte=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),(0,y.jsx)("path",{d:"M13.5 6.5l4 4"})]}),J),Bbe=z((0,y.jsxs)("g",{strokeWidth:1,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M11 7l-5 5l5 5"}),(0,y.jsx)("path",{d:"M17 7l-5 5l5 5"})]}),J),Qte=z((0,y.jsxs)("g",{strokeWidth:"1.75",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),(0,y.jsx)("path",{d:"M15 4l0 16"})]}),J),Fbe=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"})]}),J),Hbe=z((0,y.jsxs)("g",{strokeWidth:"1.25",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M3 4l18 0"}),(0,y.jsx)("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),(0,y.jsx)("path",{d:"M12 16l0 4"}),(0,y.jsx)("path",{d:"M9 20l6 0"}),(0,y.jsx)("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),J),Jte=(0,y.jsx)("div",{style:{width:"1rem",height:"1rem"}}),ene=z((0,y.jsxs)("g",{strokeWidth:"1.5",children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("polyline",{points:"9 6 15 12 9 18"})]}),J),tne=z((0,y.jsxs)("g",{strokeWidth:1.25,children:[(0,y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,y.jsx)("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M4 6l8 0"}),(0,y.jsx)("path",{d:"M16 6l4 0"}),(0,y.jsx)("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M4 12l2 0"}),(0,y.jsx)("path",{d:"M10 12l10 0"}),(0,y.jsx)("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),(0,y.jsx)("path",{d:"M4 18l11 0"}),(0,y.jsx)("path",{d:"M19 18l1 0"})]}),J),nne=({size:e="1em",circleWidth:t=8,synchronized:n=!1,className:r=""})=>{let a=-(CB.default.useRef(Date.now()).current%1600);return(0,Sx.jsx)("div",{className:`Spinner ${r}`,children:(0,Sx.jsx)("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":n?`${a}ms`:0},children:(0,Sx.jsx)("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},il=nne,Me=bo.default.forwardRef(({size:e="medium",visible:t=!0,className:n="",...r},a)=>{let{id:i}=za(),o=bo.default.useRef(null);bo.default.useImperativeHandle(a,()=>o.current);let l=`ToolIcon_size_${e}`,[c,s]=(0,bo.useState)(!1),d=(0,bo.useRef)(!0),u=async m=>{let p="onClick"in r&&r.onClick?.(m);if(Ls(p))try{s(!0),await p}catch(f){if(f instanceof Pb)console.warn(f);else throw f}finally{d.current&&s(!1)}};(0,bo.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let h=(0,bo.useRef)(null);if(r.type==="button"||r.type==="icon"||r.type==="submit"){let m=r.type==="icon"?"button":r.type;return(0,Fi.jsxs)("button",{className:H("ToolIcon_type_button",l,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:m,onClick:u,ref:o,disabled:c||r.isLoading||!!r.disabled,children:[(r.icon||r.label)&&(0,Fi.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!r.disabled,children:[r.icon||r.label,r.keyBindingLabel&&(0,Fi.jsx)("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel}),r.isLoading&&(0,Fi.jsx)(il,{})]}),r.showAriaLabel&&(0,Fi.jsxs)("div",{className:"ToolIcon__label",children:[r["aria-label"]," ",c&&(0,Fi.jsx)(il,{})]}),r.children]})}return(0,Fi.jsxs)("label",{className:H("ToolIcon",n),title:r.title,onPointerDown:m=>{h.current=m.pointerType||null,r.onPointerDown?.({pointerType:m.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{h.current=null})},children:[(0,Fi.jsx)("input",{className:`ToolIcon_type_radio ${l}`,type:"radio",name:r.name,"aria-label":r["aria-label"],"aria-keyshortcuts":r["aria-keyshortcuts"],"data-testid":r["data-testid"],id:`${i}-${r.id}`,onChange:()=>{r.onChange?.({pointerType:h.current})},checked:r.checked,ref:o}),(0,Fi.jsxs)("div",{className:"ToolIcon__icon",children:[r.icon,r.keyBindingLabel&&(0,Fi.jsx)("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel})]})]})});Me.displayName="ToolButton";var zC=[],ee=e=>(zC=zC.concat(e),e),rne=(e,t,n)=>{let r=new Set(Re(e.filter(d=>he(d)),t).map(d=>d.id)),a={},i=n.scene.getNonDeletedElementsMap(),o=new Set;for(let d of r){let u=pi(e,d);for(let h of u)if(!o.has(h.id)){if(jt(h)){let m=ui(h,i);m&&(a[m.id]=!0)}else a[h.id]=!0;o.add(h.id)}}let l=!0,c=e.map(d=>{if(t.selectedElementIds[d.id]){let u=jt(d)?ui(d,i):null;return d.frameId&&r.has(d.frameId)?(l=!1,a[d.id]=!0,d):u?.frameId&&r.has(u?.frameId)?d:(d.boundElements&&d.boundElements.forEach(h=>{let m=n.scene.getNonDeletedElementsMap().get(h.id);m&&ze(m)&&n.scene.mutateElement(m,{startBinding:d.id===m.startBinding?.elementId?null:m.startBinding,endBinding:d.id===m.endBinding?.elementId?null:m.endBinding})}),pe(d,{isDeleted:!0}))}return d.frameId&&r.has(d.frameId)?(l=!1,jt(d)||(a[d.id]=!0),pe(d,{frameId:null})):jt(d)&&t.selectedElementIds[d.containerId]?pe(d,{isDeleted:!0}):d}),s=t.editingGroupId;if(l&&t.editingGroupId){let d=wt(c,t.editingGroupId).filter(u=>!u.isDeleted);if(d.length>1)d[0]&&(a[d[0].id]=!0);else{s=null,d[0]&&(a[d[0].id]=!0);let u=d[0];if(u){let h=u.groupIds.findIndex(p=>p===t.editingGroupId),m=u.groupIds[h+1];if(m){let p=wt(c,m).filter(f=>!f.isDeleted);p.length>1&&(s=m,p.forEach(f=>{a[f.id]=!0}))}}}}return{elements:c,appState:{...t,...bn({selectedElementIds:a,editingGroupId:s},c,t,null)}}},CP=(e,t)=>{if(e.editingGroupId){let n=wt(Pe(t),e.editingGroupId);if(n.length)return{...e,selectedElementIds:{[n[0].id]:!0}}}return e},kB=ee({name:"deleteSelectedElements",label:"labels.delete",icon:us,trackEvent:{category:"element",action:"delete"},perform:(e,t,n,r)=>{if(t.selectedLinearElement?.isEditing){let{elementId:o,selectedPointsIndices:l}=t.selectedLinearElement,c=r.scene.getNonDeletedElementsMap(),s=ae.getElement(o,c);if(!s||l==null)return!1;if(l.length>=s.points.length){let d=e.map(h=>h.id===s.id?pe(h,{isDeleted:!0}):h),u=CP(t,d);return{elements:d,appState:{...u,selectedLinearElement:null},captureUpdate:U.IMMEDIATELY}}return ae.deletePoints(s,r,l),{elements:e,appState:{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:l?.[0]>0?[l[0]-1]:[0]}},captureUpdate:U.IMMEDIATELY}}let{elements:a,appState:i}=rne(e,t,r);return vb(a,a.filter(o=>o.isDeleted)),i=CP(i,a),{elements:a,appState:{...i,activeTool:tt(t,{type:r.state.preferredSelectionTool.type}),multiElement:null,newElement:null,activeEmbeddable:null,selectedLinearElement:null},captureUpdate:vn(Pe(e),t)?U.IMMEDIATELY:U.EVENTUALLY}},keyTest:(e,t,n)=>(e.key===D.BACKSPACE||e.key===D.DELETE)&&!e[D.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let a=cl()==="mobile";return(0,_B.jsx)(Me,{type:"button",icon:us,title:E("labels.delete"),"aria-label":E("labels.delete"),onClick:()=>n(null),disabled:!vn(Pe(e),t),style:{...a&&t.openPopup!=="compactOtherProperties"?vl:{}}})}}),Y=e=>e.replace(/\b(Opt(?:ion)?|Alt)\b/i,E(la?"keys.option":"keys.alt")).replace(/\bShift\b/i,E("keys.shift")).replace(/\b(Enter|Return)\b/i,E("keys.enter")).replace(/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,E(la?"keys.cmd":"keys.ctrl")).replace(/\b(Esc(?:ape)?)\b/i,E("keys.escape")).replace(/\b(Space(?:bar)?)\b/i,E("keys.spacebar")).replace(/\b(Del(?:ete)?)\b/i,E("keys.delete")),ane=ee({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:uP,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:wA(e,t,r.scene),appState:t,captureUpdate:U.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[D.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ee.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>(0,j1.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${E("labels.sendBackward")} \u2014 ${Y("CtrlOrCmd+[")}`,children:uP})}),ine=ee({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:dP,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:EA(e,t,r.scene),appState:t,captureUpdate:U.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[D.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ee.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>(0,j1.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${E("labels.bringForward")} \u2014 ${Y("CtrlOrCmd+]")}`,children:dP})}),one=ee({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:mP,trackEvent:{category:"element"},perform:(e,t)=>({elements:SA(e,t),appState:t,captureUpdate:U.IMMEDIATELY}),keyTest:e=>la?e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.BRACKET_LEFT:e[D.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ee.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>(0,j1.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${E("labels.sendToBack")} \u2014 ${Y(la?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")}`,children:mP})}),lne=ee({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:hP,trackEvent:{category:"element"},perform:(e,t)=>({elements:CA(e,t),appState:t,captureUpdate:U.IMMEDIATELY}),keyTest:e=>la?e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.BRACKET_RIGHT:e[D.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ee.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>(0,j1.jsx)("button",{type:"button",className:"zIndexButton",onClick:n=>e(null),title:`${E("labels.bringToFront")} \u2014 ${Y(la?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")}`,children:hP})}),sne=ee({name:"selectAll",label:"labels.selectAll",icon:Ote,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,n,r)=>{if(t.selectedLinearElement?.isEditing)return!1;let a=e.filter(i=>!i.isDeleted&&!(oe(i)&&i.containerId)&&!i.locked).reduce((i,o)=>(i[o.id]=!0,i),{});return{appState:{...t,...bn({editingGroupId:null,selectedElementIds:a},Pe(e),t,r),selectedLinearElement:Object.keys(a).length===1&&Te(e[0])?new ae(e[0],me(e)):null},captureUpdate:U.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.A}),cne=ee({name:"duplicateSelection",label:"labels.duplicateSelection",icon:AC,trackEvent:{category:"element"},perform:(e,t,n,r)=>{if(t.selectedElementsAreBeingDragged)return!1;if(t.selectedLinearElement?.isEditing)try{let o=ae.duplicateSelectedPoints(t,r.scene);return{elements:e,appState:o,captureUpdate:U.IMMEDIATELY}}catch{return!1}let{duplicatedElements:a,elementsWithDuplicates:i}=Hs({type:"in-place",elements:e,idsOfElementsToDuplicate:me(Re(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),appState:t,randomizeSeed:!0,overrides:({origElement:o,origIdToDuplicateId:l})=>{let c=o.frameId&&l.get(o.frameId);return{x:o.x+BE/2,y:o.y+BE/2,frameId:c??o.frameId}}});if(r.props.onDuplicate&&i){let o=r.props.onDuplicate(i,e);o&&(i=o)}return{elements:Oo(i,me(a)),appState:{...t,...Eb(a,Pe(i),t)},captureUpdate:U.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.D,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let a=cl()==="mobile";return(0,TB.jsx)(Me,{type:"button",icon:AC,title:`${E("labels.duplicateSelection")} \u2014 ${Y("CtrlOrCmd+D")}`,"aria-label":E("labels.duplicateSelection"),onClick:()=>n(null),disabled:!vn(Pe(e),t),style:{...a&&t.openPopup!=="compactOtherProperties"?vl:{}}})}}),dne=new Set(["command_palette","export"]),at=(e,t,n,r)=>{try{if(typeof window>"u"||_s.VITE_WORKER_ID||_s.VITE_APP_ENABLE_TRACKING!=="true"||!dne.has(e)||qn())return;_s.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(a){console.error("error during analytics",a)}},L_=(0,MB.forwardRef)((e,t)=>{let{title:n,className:r,testId:a,active:i,standalone:o,icon:l,onClick:c}=e;return(0,AB.jsx)("button",{type:"button",ref:t,title:n,"data-testid":a,className:H(r,{standalone:o,active:i}),onClick:c,style:e.style,children:l},n)}),ol=e=>(0,Ac.jsx)(Ac.Fragment,{children:e.options.map(t=>e.type==="button"?(0,Ac.jsx)(L_,{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):(0,Ac.jsxs)("label",{className:H({active:e.value===t.value}),title:t.text,children:[(0,Ac.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))}),IB=()=>(0,DB.jsx)("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),RB=R_.default.createContext(null),pt=()=>R_.default.useContext(RB),NB=e=>{let[t,n]=(0,x1.useState)(null),r=En(),{theme:a}=pt(),{container:i}=za();return(0,x1.useLayoutEffect)(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",r.formFactor==="phone"),t.classList.toggle("theme--dark",a===se.DARK))},[t,a,r.formFactor,e?.className]),(0,x1.useLayoutEffect)(()=>{let o=e?.parentSelector?i?.querySelector(e.parentSelector):document.body;if(!o)return;let l=document.createElement("div");return o.appendChild(l),n(l),()=>{o.removeChild(l)}},[i,e?.parentSelector]),t};function N_(e,t,n){(0,OB.useEffect)(()=>{function r(a){let i=a;if(!e.current)return;let o=n?.(i,e.current);if(o!==!0){if(o===!1)return t(i);e.current.contains(i.target)||!document.documentElement.contains(i.target)||i.target.closest("[data-radix-portal]")||i.target===document.documentElement&&document.body.style.pointerEvents==="none"||i.target.closest("[data-prevent-outside-click]")||t(i)}}return document.addEventListener(Q.POINTER_DOWN,r),document.addEventListener(Q.TOUCH_START,r),()=>{document.removeEventListener(Q.POINTER_DOWN,r),document.removeEventListener(Q.TOUCH_START,r)}},[e,t,n])}var c2=e=>{let t=(0,zB.useRef)(e);return Object.assign(t.current,e),t.current},d2=Dt(null),une=({onCancel:e,onChange:t,onSelect:n,colorPickerType:r})=>{let a=NB({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),i=pt(),o=nw(),l=Wi(),c=Re(o,i),s=c2({app:l,onCancel:e,onChange:t,onSelect:n,selectedElements:c}),{container:d}=za();(0,s2.useEffect)(()=>{let h=u.current;if(!h||!l.canvas||!a)return;let m=!1,p=l.canvas.getContext("2d"),f=({clientX:_,clientY:C})=>{let k=p.getImageData((_-i.offsetLeft)*window.devicePixelRatio,(C-i.offsetTop)*window.devicePixelRatio,1,1).data;return yM(k[0],k[1],k[2])},x=({clientX:_,clientY:C,altKey:k})=>{h.style.top=`${C+20}px`,h.style.left=`${_+20}px`;let T=f({clientX:_,clientY:C});m&&s.onChange(r,T,s.selectedElements,{altKey:k}),h.style.background=T},g=()=>{s.onCancel()},v=(_,C)=>{s.onSelect(_,C)},b=_=>{m=!0,_.stopImmediatePropagation()},w=_=>{m=!1,d?.focus(),_.stopImmediatePropagation(),_.preventDefault(),v(f(_),_)},S=_=>{_.key===D.ESCAPE&&(_.preventDefault(),_.stopImmediatePropagation(),g())};return a.tabIndex=-1,a.focus(),x({clientX:s.app.lastViewportPosition.x,clientY:s.app.lastViewportPosition.y,altKey:!1}),a.addEventListener(Q.KEYDOWN,S),a.addEventListener(Q.POINTER_DOWN,b),a.addEventListener(Q.POINTER_UP,w),window.addEventListener("pointermove",x,{passive:!0}),window.addEventListener(Q.BLUR,g),()=>{m=!1,a.removeEventListener(Q.KEYDOWN,S),a.removeEventListener(Q.POINTER_DOWN,b),a.removeEventListener(Q.POINTER_UP,w),window.removeEventListener("pointermove",x),window.removeEventListener(Q.BLUR,g)}},[s,l.canvas,a,r,d,i.offsetLeft,i.offsetTop]);let u=(0,s2.useRef)(null);return N_(u,()=>{e()},h=>!!h.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),a?(0,LB.createPortal)((0,PB.jsx)("div",{ref:u,className:"excalidraw-eye-dropper-preview"}),a):null},Ja=BB.default.forwardRef(({children:e,padding:t,className:n,style:r},a)=>(0,FB.jsx)("div",{className:H("Island",n),style:{"--padding":t,...r},ref:a,children:e})),jm=UB.default.forwardRef(({className:e,container:t,children:n,style:r,onClose:a,onKeyDown:i,onFocusOutside:o,onPointerLeave:l,onPointerDownOutside:c,preventAutoFocusOnTouch:s=!1},d)=>{let u=En(),h=u.formFactor==="phone"&&!u.isLandscape;return(0,Sm.jsx)(Ze.Portal,{container:t,children:(0,Sm.jsxs)(Ze.Content,{ref:d,className:H("focus-visible-none",e),"data-prevent-outside-click":!0,side:h?"bottom":"right",align:h?"center":"start",alignOffset:-16,sideOffset:20,collisionBoundary:t??void 0,style:{zIndex:"var(--zIndex-ui-styles-popup)",marginLeft:u.formFactor==="phone"?"0.5rem":void 0},onPointerLeave:l,onKeyDown:i,onFocusOutside:o,onPointerDownOutside:c,onOpenAutoFocus:m=>{s&&u.isTouchScreen&&m.preventDefault()},onCloseAutoFocus:m=>{m.stopPropagation(),m.preventDefault(),t&&!$M(document.activeElement)&&t.focus(),a()},children:[(0,Sm.jsx)(Ja,{padding:3,style:r,children:n}),(0,Sm.jsx)(Ze.Arrow,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),u2=()=>document.querySelector(".excalidraw-wysiwyg"),O_=()=>{let e=u2();return e?{start:e.selectionStart,end:e.selectionEnd}:null},z_=e=>{setTimeout(()=>{let t=u2();t&&(t.focus(),e&&(t.selectionStart=e.start,t.selectionEnd=e.end))},0)},h2=(e,t,n,r)=>{t&&r&&r();let a=t&&n?O_():null;e(),t&&n&&z_(a)},hne=()=>{let[e,t]=(0,Cm.useState)(null),n=(0,Cm.useCallback)(()=>{let i=O_();t(i)},[]),r=(0,Cm.useCallback)(()=>{setTimeout(()=>{let i=u2();i&&(i.focus(),e&&(i.selectionStart=e.start,i.selectionEnd=e.end,t(null)))},0)},[e]),a=(0,Cm.useCallback)(()=>{t(null)},[]);return{saveCaretPosition:n,restoreCaretPosition:r,clearSavedPosition:a,hasSavedPosition:!!e}},mne=(e=100)=>{let t=u2();if(t){let n=t.onblur;t.onblur=null,setTimeout(()=>{t.onblur=n},e)}},m2=({palette:e,color:t})=>{if(!t)return null;for(let[n,r]of Object.entries(e))if(Array.isArray(r)){let a=r.indexOf(t);if(a>-1)return{colorName:n,shade:a}}else if(r===t)return{colorName:n,shade:null};return null},PC=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),HB=({color:e,palette:t})=>!Object.values(t).flat().includes(e),pne=(e,t,n)=>{let r={elementBackground:"backgroundColor",elementStroke:"strokeColor"},a=e.filter(o=>{if(o.isDeleted)return!1;let l=o[r[t]];return HB({color:l,palette:n})}),i=new Map;return a.forEach(o=>{let l=o[r[t]];i.has(l)?i.set(l,i.get(l)+1):i.set(l,1)}),[...i.entries()].sort((o,l)=>l[1]-o[1]).map(o=>o[0]).slice(0,hM)},Vm=Dt(null),fne=({color:e,onChange:t,label:n,colorPickerType:r,placeholder:a})=>{let i=En(),[o,l]=(0,vo.useState)(e),[c,s]=Fe(Vm);(0,vo.useEffect)(()=>{l(e)},[e]);let d=(0,vo.useCallback)(f=>{let x=f.toLowerCase(),g=xM(x);g&&t(g),l(x)},[t]),u=(0,vo.useRef)(null),h=(0,vo.useRef)(null);(0,vo.useEffect)(()=>{u.current&&u.current.focus()},[c]);let[m,p]=Fe(d2);return(0,vo.useEffect)(()=>()=>{p(null)},[p]),(0,tl.jsxs)("div",{className:"color-picker__input-label",children:[(0,tl.jsx)("div",{className:"color-picker__input-hash",children:"#"}),(0,tl.jsx)("input",{ref:c==="hex"?u:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":n,onChange:f=>{d(f.target.value)},value:(o||"").replace(/^#/,""),onBlur:()=>{l(e)},tabIndex:-1,onFocus:()=>s("hex"),onKeyDown:f=>{f.key!==D.TAB&&(f.key===D.ESCAPE&&h.current?.focus(),f.stopPropagation())},placeholder:a}),i.formFactor!=="phone"&&(0,tl.jsxs)(tl.Fragment,{children:[(0,tl.jsx)("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),(0,tl.jsx)("div",{ref:h,className:H("excalidraw-eye-dropper-trigger",{selected:m}),onClick:()=>p(f=>f?null:{keepOpenOnAlt:!1,onSelect:x=>t(x),colorPickerType:r}),title:`${E("labels.eyeDropper")} \u2014 ${D.I.toLocaleUpperCase()} or ${Y("Alt")} `,children:Cte})]})]})},gne=({color:e,keyLabel:t,isShade:n=!1})=>(0,jB.jsxs)("div",{className:"color-picker__button__hotkey-label",style:{color:Kc(e)?"#fff":"#000"},children:[n&&"\u21E7",t]}),P_=gne,bne=({colors:e,color:t,onChange:n,label:r})=>{let[a,i]=Fe(Vm),o=(0,p2.useRef)(null);return(0,p2.useEffect)(()=>{o.current&&o.current.focus()},[t,a]),(0,_m.jsx)("div",{className:"color-picker-content--default",children:e.map((l,c)=>(0,_m.jsxs)("button",{ref:t===l?o:void 0,tabIndex:-1,type:"button",className:H("color-picker__button color-picker__button--large has-outline",{active:t===l,"is-transparent":l==="transparent"||!l}),onClick:()=>{n(l),i("custom")},title:l,"aria-label":r,style:{"--swatch-color":l},children:[(0,_m.jsx)("div",{className:"color-picker__button-outline"}),(0,_m.jsx)(P_,{color:l,keyLabel:c+1})]},c))})},vne=({palette:e,color:t,onChange:n,activeShade:r,showHotKey:a=!0})=>{let i=m2({color:t,palette:e}),[o,l]=Fe(Vm),c=(0,f2.useRef)(null);return(0,f2.useEffect)(()=>{c.current&&o==="baseColors"&&c.current.focus()},[i?.colorName,o]),(0,km.jsx)("div",{className:"color-picker-content--default",children:Object.entries(e).map(([s,d],u)=>{let h=(Array.isArray(d)?d[r]:d)||"transparent",m=PC[u],p=E(`colors.${s.replace(/\d+/,"")}`,null,"");return(0,km.jsxs)("button",{ref:i?.colorName===s?c:void 0,tabIndex:-1,type:"button",className:H("color-picker__button color-picker__button--large has-outline",{active:i?.colorName===s,"is-transparent":h==="transparent"||!h}),onClick:()=>{n(h),l("baseColors")},title:`${p}${h.startsWith("#")?` ${h}`:""} \u2014 ${m}`,"aria-label":`${p} \u2014 ${m}`,style:h?{"--swatch-color":h}:void 0,"data-testid":`color-${s}`,children:[(0,km.jsx)("div",{className:"color-picker__button-outline"}),a&&(0,km.jsx)(P_,{color:h,keyLabel:m})]},s)})})},yne=vne,xne=({children:e})=>(0,VB.jsx)("div",{className:"color-picker__heading",children:e}),Cx=xne,wne=({color:e,onChange:t,palette:n,showHotKey:r})=>{let a=m2({color:e||"transparent",palette:n}),[i,o]=Fe(Vm),l=(0,g2.useRef)(null);if((0,g2.useEffect)(()=>{l.current&&i==="shades"&&l.current.focus()},[a,i]),a){let{colorName:c,shade:s}=a,d=n[c];if(Array.isArray(d))return(0,os.jsx)("div",{className:"color-picker-content--default shades",children:d.map((u,h)=>(0,os.jsxs)("button",{ref:h===s&&i==="shades"?l:void 0,tabIndex:-1,type:"button",className:H("color-picker__button color-picker__button--large has-outline",{active:h===s}),"aria-label":"Shade",title:`${c} - ${h+1}`,style:u?{"--swatch-color":u}:void 0,onClick:()=>{t(u),o("shades")},children:[(0,os.jsx)("div",{className:"color-picker__button-outline"}),r&&(0,os.jsx)(P_,{color:u,keyLabel:h+1,isShade:!0})]},h))})}return(0,os.jsxs)("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[(0,os.jsx)("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),(0,os.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:E("colorPicker.noShades")})]})},eC=(e,t,n)=>{let r=Math.ceil(n/Wc);switch(t=t??-1,e){case"ArrowLeft":{let a=t-1;return a<0?n-1:a}case"ArrowRight":return(t+1)%n;case"ArrowDown":{let a=t+Wc;return a>=n?t%Wc:a}case"ArrowUp":{let a=t-Wc,i=a<0?Wc*r+a:a;return i>=n?void 0:i}}},Ene=({e,colorObj:t,onChange:n,palette:r,customColors:a,setActiveColorPickerSection:i,activeShade:o})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let l=Number(e.code.slice(-1))-1;return n(r[t.colorName][l]),i("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&a[Number(e.key)-1])return n(a[Number(e.key)-1]),i("custom"),!0;if(PC.includes(e.key)){let l=PC.indexOf(e.key),c=Object.keys(r)[l],s=r[c],d=Array.isArray(s)?s[o]:s;return n(d),i("baseColors"),!0}return!1},Sne=({event:e,activeColorPickerSection:t,palette:n,color:r,onChange:a,customColors:i,setActiveColorPickerSection:o,updateData:l,activeShade:c,onEyeDropperToggle:s,onEscape:d})=>{if(e[D.CTRL_OR_CMD])return!1;if(e.key===D.ESCAPE)return d(e),!0;if(e.key===D.ALT)return s(!0),!0;if(e.key===D.I)return s(),!0;let u=m2({color:r,palette:n});if(e.key===D.TAB){let h={custom:!!i.length,baseColors:!0,shades:u?.shade!=null,hex:!0},m=Object.entries(h).reduce((v,[b,w])=>(w&&v.push(b),v),[]),p=m.indexOf(t),f=e.shiftKey?-1:1,x=p+f>m.length-1?0:p+f<0?m.length-1:p+f,g=m[x];return g&&o(g),g==="custom"?a(i[0]):g==="baseColors"&&(Object.entries(n).find(([v,b])=>Array.isArray(b)?b.includes(r):b===r?v:null)||a(_r.black)),e.preventDefault(),e.stopPropagation(),!0}if(Ene({e,colorObj:u,onChange:a,palette:n,customColors:i,setActiveColorPickerSection:o,activeShade:c}))return!0;if(t==="shades"&&u){let{shade:h}=u,m=eC(e.key,h,Wc);if(m!==void 0)return a(n[u.colorName][m]),!0}if(t==="baseColors"&&u){let{colorName:h}=u,m=Object.keys(n),p=m.indexOf(h),f=eC(e.key,p,m.length);if(f!==void 0){let x=m[f],g=n[x];return a(Array.isArray(g)?g[c]:g),!0}}if(t==="custom"){let h=r!=null?i.indexOf(r):0,m=eC(e.key,h,i.length);if(m!==void 0){let p=i[m];return a(p),!0}}return!1},Cne=ji.default.forwardRef(({color:e,onChange:t,type:n,elements:r,palette:a,updateData:i,children:o,showTitle:l,onEyeDropperToggle:c,onEscape:s,showHotKey:d=!0},u)=>{let h=l?n==="elementStroke"?E("labels.stroke"):n==="elementBackground"?E("labels.background"):null:null,[m]=ji.default.useState(()=>n==="canvasBackground"?[]:pne(r,n,a)),[p,f]=Fe(Vm),x=m2({color:e,palette:a});(0,ji.useEffect)(()=>{if(!p){let w=!!e&&HB({color:e,palette:a}),S=w&&!m.includes(e);f(S?null:w?"custom":x?.shade!=null?"shades":"baseColors")}},[p,e,a,f,x,m]);let[g,v]=(0,ji.useState)(x?.shade??(n==="elementBackground"?fM:pM));(0,ji.useEffect)(()=>{x?.shade!=null&&v(x.shade);let w=S=>{S.key===D.ALT&&c(!1)};return document.addEventListener(Q.KEYUP,w,{capture:!0}),()=>{document.removeEventListener(Q.KEYUP,w,{capture:!0})}},[x,c]);let b=ji.default.useRef(null);return(0,ji.useImperativeHandle)(u,()=>b.current),(0,ji.useEffect)(()=>{b?.current?.focus()},[]),(0,Da.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":E("labels.colorPicker"),children:(0,Da.jsxs)("div",{ref:b,onKeyDown:w=>{Sne({event:w,activeColorPickerSection:p,palette:a,color:e,onChange:t,onEyeDropperToggle:c,customColors:m,setActiveColorPickerSection:f,updateData:i,activeShade:g,onEscape:s})&&(w.preventDefault(),w.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[h&&(0,Da.jsx)("div",{className:"color-picker__title",children:h}),!!m.length&&(0,Da.jsxs)("div",{children:[(0,Da.jsx)(Cx,{children:E("colorPicker.mostUsedCustomColors")}),(0,Da.jsx)(bne,{colors:m,color:e,label:E("colorPicker.mostUsedCustomColors"),onChange:t})]}),(0,Da.jsxs)("div",{children:[(0,Da.jsx)(Cx,{children:E("colorPicker.colors")}),(0,Da.jsx)(yne,{color:e,palette:a,onChange:t,activeShade:g,showHotKey:d})]}),(0,Da.jsxs)("div",{children:[(0,Da.jsx)(Cx,{children:E("colorPicker.shades")}),(0,Da.jsx)(wne,{color:e,onChange:t,palette:a,showHotKey:d})]}),o]})})}),_ne=({onChange:e,type:t,activeColor:n,topPicks:r})=>{let a;return t==="elementStroke"&&(a=P0),t==="elementBackground"&&(a=U0),t==="canvasBackground"&&(a=B0),r&&(a=r),a?(0,_x.jsx)("div",{className:"color-picker__top-picks",children:a.map(i=>(0,_x.jsx)("button",{className:H("color-picker__button",{active:i===n,"is-transparent":i==="transparent"||!i,"has-outline":!Kc(i,Up)}),style:{"--swatch-color":i},type:"button",title:i,onClick:()=>e(i),"data-testid":`color-top-pick-${i}`,children:(0,_x.jsx)("div",{className:"color-picker__button-outline"})},i))}):(console.error("Invalid type for TopPicks"),null)},kne=({type:e,color:t,onChange:n,label:r,elements:a,palette:i=_r,updateData:o,getOpenPopup:l,appState:c})=>{let{container:s}=za(),d=cl(),u=d!=="full",h=d==="mobile",[,m]=Fe(Vm),[p,f]=Fe(d2),x=(0,lr.jsxs)("div",{children:[(0,lr.jsx)(Cx,{children:E("colorPicker.hexCode")}),(0,lr.jsx)(fne,{color:t||"",label:r,onChange:b=>{n(b)},colorPickerType:e,placeholder:E("colorPicker.color")})]}),g=(0,V1.useRef)(null),v=()=>{g.current?.focus()};return(0,lr.jsx)(jm,{container:s,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!c.editingTextElement,onFocusOutside:b=>{sa(b.target)||v(),b.preventDefault()},onPointerDownOutside:b=>{p&&b.preventDefault()},onClose:()=>{l()===e&&o({openPopup:null}),m(null),c.editingTextElement&&setTimeout(()=>{let b=document.querySelector(".excalidraw-wysiwyg");b&&b.focus()},0)},children:i?(0,lr.jsx)(Cne,{ref:g,palette:i,color:t,onChange:b=>{let w=c.editingTextElement?O_():null;n(b),c.editingTextElement&&w&&z_(w)},onEyeDropperToggle:b=>{f(w=>b?(w=w||{keepOpenOnAlt:!0,onSelect:n,colorPickerType:e},w.keepOpenOnAlt=!0,w):b===!1||w?null:{keepOpenOnAlt:!1,onSelect:n,colorPickerType:e})},onEscape:b=>{p?f(null):o({openPopup:null})},type:e,elements:a,updateData:o,showTitle:u,showHotKey:!h,children:x}):x})},Tne=({label:e,color:t,type:n,mode:r="background",onToggle:a,editingTextElement:i})=>{let o=cl(),l=o!=="full",c=o==="mobile",s=d=>{d.preventDefault(),d.stopPropagation(),i&&mne(),a()};return(0,lr.jsxs)(Ze.Trigger,{type:"button",className:H("color-picker__button active-color properties-trigger",{"is-transparent":!t||t==="transparent","has-outline":!t||!Kc(t,Up),"compact-sizing":l,"mobile-border":c}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:E(n==="elementStroke"?"labels.showStroke":"labels.showBackground"),"data-openpopup":n,onClick:s,children:[(0,lr.jsx)("div",{className:"color-picker__button-outline",children:!t&&Tee}),l&&t&&r==="stroke"&&(0,lr.jsx)("div",{className:"color-picker__button-background",children:(0,lr.jsx)("span",{style:{color:t&&Kc(t,Up)?"#fff":"#111"},children:Zte})})]})},U_=({type:e,color:t,onChange:n,label:r,elements:a,palette:i=_r,topPicks:o,updateData:l,appState:c})=>{let s=(0,V1.useRef)(c.openPopup);(0,V1.useEffect)(()=>{s.current=c.openPopup},[c.openPopup]);let d=cl()!=="full";return(0,lr.jsx)("div",{children:(0,lr.jsxs)("div",{role:"dialog","aria-modal":"true",className:H("color-picker-container",{"color-picker-container--no-top-picks":d}),children:[!d&&(0,lr.jsx)(_ne,{activeColor:t,onChange:n,type:e,topPicks:o}),!d&&(0,lr.jsx)(IB,{}),(0,lr.jsxs)(Ze.Root,{open:c.openPopup===e,onOpenChange:u=>{u&&l({openPopup:e})},children:[(0,lr.jsx)(Tne,{color:t,label:r,type:e,mode:e==="elementStroke"?"stroke":"background",editingTextElement:!!c.editingTextElement,onToggle:()=>{c.openPopup===e?l({openPopup:null}):c.openPopup?l({openPopup:e}):l({openPopup:e})}}),c.openPopup===e&&(0,lr.jsx)(kne,{type:e,color:t,onChange:n,label:r,elements:a,palette:i,updateData:l,getOpenPopup:()=>s.current,appState:c})]})]})})},YB=GB.default.forwardRef(({className:e,placeholder:t,onChange:n},r)=>(0,b2.jsxs)("div",{className:H("QuickSearch__wrapper",e),children:[su,(0,b2.jsx)("input",{ref:r,className:"QuickSearch__input",type:"text",placeholder:t,onChange:a=>n(a.target.value.trim().toLowerCase())})]})),KB=({className:e,placeholder:t,children:n})=>{let r=!WB.Children.count(n);return(0,UC.jsx)("div",{className:H("ScrollableList__wrapper",e),role:"menu",children:r?(0,UC.jsx)("div",{className:"empty",children:t}):n})},$B=({children:e,className:t="",style:n,title:r})=>(0,v2.jsxs)("div",{className:`dropdown-menu-group ${t}`,style:n,children:[r&&(0,v2.jsx)("p",{className:"dropdown-menu-group-title",children:r}),e]}),BC=$B;$B.displayName="DropdownMenuGroup";var XB=y2.default.createContext({}),x2=(e="",t=!1,n=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} ${t?"dropdown-menu-item--selected":""} ${n?"dropdown-menu-item--hovered":""}`.trim(),ZB=e=>{let t=(0,y2.useContext)(XB);return Rs(e,n=>{t.onSelect?.(n)})},QB=({children:e,...t})=>(0,qB.jsx)("span",{...t,style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...t.style},children:e}),Mne=({textStyle:e,icon:t,shortcut:n,children:r,badge:a})=>{let i=En();return(0,el.jsxs)(el.Fragment,{children:[t&&(0,el.jsx)("div",{className:"dropdown-menu-item__icon",children:t}),(0,el.jsx)("div",{style:e,className:"dropdown-menu-item__text",children:(0,el.jsx)(QB,{children:r})}),a&&(0,el.jsx)("div",{className:"dropdown-menu-item__badge",children:a}),n&&i.formFactor!=="phone"&&(0,el.jsx)("div",{className:"dropdown-menu-item__shortcut",children:n})]})},w2=Mne,B_=({icon:e,badge:t,value:n,children:r,shortcut:a,className:i,selected:o,onSelect:l,...c})=>{let s=ZB(l);return(0,m1.jsx)(rr.Item,{className:"radix-menu-item",onSelect:s,asChild:!0,children:(0,m1.jsx)("button",{...c,value:n,className:x2(i,o),title:c.title??c["aria-label"],children:(0,m1.jsx)(w2,{icon:e,shortcut:a,badge:t,children:r})})})};B_.displayName="DropdownMenuItem";var o1={GREEN:"green",RED:"red",BLUE:"blue"},F_=({type:e=o1.BLUE,children:t})=>{let{theme:n}=$1(),r={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:n===se.LIGHT?"1.5px solid white":"none"};switch(e){case o1.GREEN:Object.assign(r,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case o1.RED:Object.assign(r,{backgroundColor:"pink",color:"darkred"});break;case o1.BLUE:default:Object.assign(r,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return(0,m1.jsx)("div",{className:"DropDownMenuItemBadge",style:r,children:t})};F_.displayName="DropdownMenuItemBadge";B_.Badge=F_;var Yi=B_,Ane=({event:e,inputRef:t,hoveredFont:n,filteredFonts:r,onClose:a,onSelect:i,onHover:o})=>{if(!e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===D.F)return t.current?.focus(),!0;if(e.key===D.ESCAPE)return a(),!0;if(e.key===D.ENTER)return n?.value&&i(n.value),!0;if(e.key===D.ARROW_DOWN)return n?.next?o(n.next.value):r[0]?.value&&o(r[0].value),!0;if(e.key===D.ARROW_UP)return n?.prev?o(n.prev.value):r[r.length-1]?.value&&o(r[r.length-1].value),!0},Dne=e=>{switch(e){case Ot.Excalifont:case Ot.Virgil:return H1;case Ot.Nunito:case Ot.Helvetica:return RC;case Ot["Lilita One"]:return mte;case Ot["Comic Shanns"]:case Ot.Cascadia:return vB;default:return RC}},Ine=un.default.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:n,onHover:r,onLeave:a,onOpen:i,onClose:o})=>{let{container:l}=za(),c=Wi(),{fonts:s}=c,{showDeprecatedFonts:d}=K1(),u=cl(),[h,m]=(0,un.useState)(""),p=(0,un.useRef)(null),f=(0,un.useMemo)(()=>Array.from(lh.registered.entries()).filter(([A,{metadata:O}])=>!O.private&&!O.fallback).map(([A,{metadata:O,fontFaces:V}])=>{let j={value:A,icon:Dne(A),text:V[0]?.fontFace?.family??"Unknown"};return O.deprecated&&Object.assign(j,{deprecated:O.deprecated,badge:{type:o1.RED,placeholder:E("fontList.badge.old")}}),j}).sort((A,O)=>A.text.toLowerCase()>O.text.toLowerCase()?1:-1),[]),x=(0,un.useMemo)(()=>new Set(s.getSceneFamilies()),[e]),g=(0,un.useMemo)(()=>f.filter(A=>x.has(A.value)),[f,x]),v=(0,un.useMemo)(()=>f.filter(A=>!x.has(A.value)&&(d||!A.deprecated)),[f,x,d]),b=(0,un.useMemo)(()=>n8([...g,...v].filter(A=>A.text?.toLowerCase().includes(h))),[g,v,h]),w=(0,un.useMemo)(()=>{let A;return t?A=b.find(O=>O.value===t):e&&(A=b.find(O=>O.value===e)),!A&&h&&(b[0]?.value?r(b[0].value):a()),A},[t,e,h,b,r,a]),S=(0,un.useCallback)(A=>{let O=null;if(c.state.editingTextElement){let V=document.querySelector(".excalidraw-wysiwyg");V&&(O={start:V.selectionStart,end:V.selectionEnd})}n(A),c.state.editingTextElement&&O&&setTimeout(()=>{let V=document.querySelector(".excalidraw-wysiwyg");V&&O&&(V.focus(),V.selectionStart=O.start,V.selectionEnd=O.end)},0)},[n,c.state.editingTextElement]),_=(0,un.useCallback)(A=>{Ane({event:A,inputRef:p,hoveredFont:w,filteredFonts:b,onSelect:S,onHover:r,onClose:o})&&(A.preventDefault(),A.stopPropagation())},[w,b,S,r,o]);(0,un.useEffect)(()=>(i(),()=>{o()}),[]);let C=(0,un.useMemo)(()=>b.filter(A=>x.has(A.value)),[b,x]),k=(0,un.useMemo)(()=>b.filter(A=>!x.has(A.value)),[b,x]),T=({font:A,order:O})=>{let V=(0,un.useRef)(null),j=A.value===w?.value,K=A.value===e;return(0,un.useEffect)(()=>{j&&(O===0?V.current?.scrollIntoView?.({block:"end"}):V.current?.scrollIntoView?.({block:"nearest"}))},[j,O]),(0,zi.jsx)("button",{ref:V,type:"button",value:A.value,className:x2("",K,j),title:A.text,tabIndex:K?0:-1,onClick:Z=>{S(Number(Z.currentTarget.value))},onMouseMove:()=>{w?.value!==A.value&&r(A.value)},children:(0,zi.jsx)(w2,{icon:A.icon,badge:A.badge&&(0,zi.jsx)(F_,{type:A.badge.type,children:A.badge.placeholder}),textStyle:{fontFamily:qc({fontFamily:A.value})},children:A.text})})},I=[];return C.length&&I.push((0,zi.jsx)(BC,{title:E("fontList.sceneFonts"),children:C.map((A,O)=>(0,zi.jsx)(T,{font:A,order:O},A.value))},"group_1")),k.length&&I.push((0,zi.jsx)(BC,{title:E("fontList.availableFonts"),children:k.map((A,O)=>(0,zi.jsx)(T,{font:A,order:O+C.length},A.value))},"group_2")),(0,zi.jsxs)(jm,{className:"properties-content",container:l,style:{width:"15rem"},onClose:()=>{o(),c.state.editingTextElement&&setTimeout(()=>{let A=document.querySelector(".excalidraw-wysiwyg");A&&A.focus()},0)},onPointerLeave:a,onKeyDown:_,preventAutoFocusOnTouch:!!c.state.editingTextElement,children:[u==="full"&&(0,zi.jsx)(YB,{ref:p,placeholder:E("quickSearch.placeholder"),onChange:Qc(m,20)}),(0,zi.jsx)(KB,{className:"dropdown-menu fonts manual-hover",placeholder:E("fontList.empty"),children:I.length?I:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),Lne=({selectedFontFamily:e,isOpened:t=!1,compactMode:n=!1})=>{let r=fn(),a=n?{...vl,width:"2rem",height:"2rem"}:{};return(0,kx.jsx)(Ze.Trigger,{asChild:!0,children:(0,kx.jsx)("div",{"data-openpopup":"fontFamily",className:"properties-trigger",children:(0,kx.jsx)(L_,{standalone:!0,icon:Em,title:E("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{r(i=>({openPopup:i.openPopup==="fontFamily"?null:i.openPopup}))},style:{border:"none",...a}})})})},JB=[{value:Ot.Excalifont,icon:H1,text:E("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:Ot.Nunito,icon:RC,text:E("labels.normal"),testId:"font-family-normal"},{value:Ot["Comic Shanns"],icon:vB,text:E("labels.code"),testId:"font-family-code"}],nye=new Set(JB.map(e=>e.value)),Rne=Gm.default.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:n,onSelect:r,onHover:a,onLeave:i,onPopupChange:o,compactMode:l=!1})=>{let c=(0,Gm.useMemo)(()=>JB,[]),s=(0,Gm.useCallback)(d=>{d&&r(d)},[r]);return(0,ls.jsxs)("div",{role:"dialog","aria-modal":"true",className:H("FontPicker__container",{"FontPicker__container--compact":l}),children:[!l&&(0,ls.jsx)("div",{className:"buttonList",children:(0,ls.jsx)(ol,{type:"button",options:c,value:t,onClick:s})}),!l&&(0,ls.jsx)(IB,{}),(0,ls.jsxs)(Ze.Root,{open:e,onOpenChange:o,children:[(0,ls.jsx)(Lne,{selectedFontFamily:t,isOpened:e,compactMode:l}),e&&(0,ls.jsx)(Ine,{selectedFontFamily:t,hoveredFontFamily:n,onSelect:s,onHover:a,onLeave:i,onOpen:()=>o(!0),onClose:()=>o(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),G1=({className:e,icon:t,size:n="1em"})=>(0,eF.jsx)("span",{className:e,style:{width:n,height:"100%",margin:"0 0.5ex 0 0.5ex",display:"inline-flex",lineHeight:0,verticalAlign:"middle",flex:"0 0 auto"},children:t}),Nne=({label:e,open:t,openTrigger:n,children:r,className:a,showCollapsedIcon:i=!0})=>(0,Dc.jsxs)(Dc.Fragment,{children:[(0,Dc.jsxs)("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:a,onClick:n,children:[e,i&&(0,Dc.jsx)(G1,{icon:t?Kte:EB})]}),t&&(0,Dc.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:r})]}),FC=Nne,One=Dt(!1),cx=4,zne="default",Pne=e=>e.flatMap(t=>t.options),_P=(e,t)=>{for(let n of e){let r=n.options.find(t);if(r)return r}return null},Une=(e,t)=>e.some(n=>n.options.some(t)),Bne=e=>e.flatMap(t=>Array.from({length:Math.ceil(t.options.length/cx)},(n,r)=>t.options.slice(r*cx,r*cx+cx)));function Fne({visibleSections:e,hiddenSections:t=[],value:n,label:r,onChange:a,onClose:i}){let o=En(),{container:l}=za(),[c,s]=Fe(One),d=[...e,...t],u=Pne(d),h=Bne([...e,...c?t:[]]),m=g=>{let v=u.find(b=>b.keyBinding===g.key.toLowerCase());if(!(g.metaKey||g.altKey||g.ctrlKey)&&v)a(v.value),g.preventDefault();else if(g.key===D.TAB){let b=u.findIndex(S=>S.value===n),w=g.shiftKey?(u.length+b-1)%u.length:(b+1)%u.length;a(u[w].value)}else if(Zc(g.key)){let b=y1().rtl,w=u.findIndex(S=>S.value===n);if(w!==-1){let S=u.length,_=w;switch(g.key){case(b?D.ARROW_LEFT:D.ARROW_RIGHT):_=(w+1)%S;break;case(b?D.ARROW_RIGHT:D.ARROW_LEFT):_=(S+w-1)%S;break;case D.ARROW_DOWN:{let C=h.findIndex(T=>T.some(I=>I.value===n)),k=h[C];if(C!==-1&&k){let T=k.findIndex(O=>O.value===n),I=h[(C+1)%h.length],A=I[Math.min(T,I.length-1)]??u[w];a(A.value),g.preventDefault(),g.nativeEvent.stopImmediatePropagation(),g.stopPropagation();return}break}case D.ARROW_UP:{let C=h.findIndex(T=>T.some(I=>I.value===n)),k=h[C];if(C!==-1&&k){let T=k.findIndex(O=>O.value===n),I=h[(h.length+C-1)%h.length],A=I[Math.min(T,I.length-1)]??u[w];a(A.value),g.preventDefault(),g.nativeEvent.stopImmediatePropagation(),g.stopPropagation();return}break}}a(u[_].value)}g.preventDefault()}else(g.key===D.ESCAPE||g.key===D.ENTER)&&(g.preventDefault(),i());g.nativeEvent.stopImmediatePropagation(),g.stopPropagation()};(0,pu.useEffect)(()=>{Une(t,g=>g.value===n)&&s(!0)},[n,t,s]);let p=g=>(0,xr.jsx)("div",{className:"picker-content",children:g.map(v=>(0,xr.jsxs)("button",{type:"button",className:H("picker-option",{active:n===v.value}),onClick:()=>{a(v.value)},title:v.keyBinding?`${v.text} \u2014 ${v.keyBinding.toUpperCase()}`:v.text,"aria-label":v.text||"none","aria-keyshortcuts":v.keyBinding||void 0,ref:b=>{n===v.value&&setTimeout(()=>{b?.focus()},0)},children:[v.icon,v.keyBinding&&(0,xr.jsx)("span",{className:"picker-keybinding",children:v.keyBinding})]},v.text))}),f=g=>g.map((v,b)=>v.name===zne?(0,xr.jsx)(pu.default.Fragment,{children:p(v.options)},`${v.name}-${b}`):(0,xr.jsxs)("div",{className:"picker-section",children:[(0,xr.jsx)("div",{className:"picker-section-label",children:v.name}),p(v.options)]},`${v.name}-${b}`)),x=o.formFactor==="phone";return(0,xr.jsx)(Ze.Content,{side:x?"right":"bottom",align:"start",sideOffset:x?8:12,style:{zIndex:"var(--zIndex-ui-styles-popup)"},onKeyDown:m,collisionBoundary:l??void 0,children:(0,xr.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,children:(0,xr.jsxs)("div",{className:"picker-sections",children:[f(e),t.length>0&&(0,xr.jsx)(FC,{label:E("labels.more_options"),open:c,openTrigger:()=>{s(g=>!g)},className:"picker-collapsible",children:(0,xr.jsx)("div",{className:"picker-sections",children:f(t)})})]})})})}function kP({value:e,label:t,visibleSections:n,hiddenSections:r,onChange:a}){let[i,o]=pu.default.useState(!1),l=(0,pu.useMemo)(()=>_P(n,c=>c.value===e)??_P(r??[],c=>c.value===e),[n,r,e]);return(0,xr.jsx)("div",{children:(0,xr.jsxs)(Ze.Root,{open:i,onOpenChange:c=>o(c),children:[(0,xr.jsx)(Ze.Trigger,{type:"button","aria-label":t,onClick:()=>o(!i),className:i?"active":"",children:l?.icon}),i&&(0,xr.jsx)(Fne,{visibleSections:n,hiddenSections:r,value:e,label:t,onChange:a,onClose:()=>{o(!1)}})]})})}var Hne=({updateData:e,app:t,testId:n})=>{let r=w1.default.useRef(null),a=w1.default.useRef(null),i=t.scene.getSelectedElements(t.state),o=!0,l=i.at(0),c=i.reduce((s,d)=>(s!=null&&s!==d.opacity&&(o=!1),s==null||s>d.opacity?d.opacity:s),l?.opacity??null)??t.state.currentItemOpacity;return(0,w1.useEffect)(()=>{if(r.current&&a.current){let s=r.current,d=a.current,u=s.offsetWidth,h=15,m=c/100*(u-h)+h/2;d.style.left=`${m}px`,s.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${c}%, var(--button-bg) ${c}%, var(--button-bg) 100%)`}},[c]),(0,qd.jsxs)("label",{className:"control-label",children:[E("labels.opacity"),(0,qd.jsxs)("div",{className:"range-wrapper",children:[(0,qd.jsx)("input",{style:{"--color-slider-track":o?void 0:"var(--button-bg)"},ref:r,type:"range",min:"0",max:"100",step:"10",onChange:s=>{e(+s.target.value)},value:c,className:"range-input","data-testid":n}),(0,qd.jsx)("div",{className:"value-bubble",ref:a,children:c!==0?c:null}),(0,qd.jsx)("div",{className:"zero-label",children:"0"})]})]})},tF=.1,Ym=e=>{let t=Xc(e.editorInterface);return{stylesPanelMode:t,isCompact:t!=="full",isMobile:t==="mobile"}},ta=(e,t,n,r=!1)=>{let a=me(Re(e,t,{includeBoundTextElement:r}));return e.map(i=>a.get(i.id)||i.id===t.editingTextElement?.id?n(i):i)},na=function(e,t,n,r,a){let i=t.state.editingTextElement,o=Pe(e),l=null;if(i&&(l=n(i)),!l)if(vn(o,t.state)){let c=t.scene.getSelectedElements(t.state),s=r===!0?c:c.filter(d=>r(d));l=ab(s,n)??(typeof a=="function"?a(!0):a)}else l=typeof a=="function"?a(!1):a;return l},jne=(e,t,n)=>jt(t)||!t.autoResize?t:n.mutateElement(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}),H_=(e,t,n,r,a)=>{let i=new Set,o=ta(e,t,l=>{if(oe(l)){let c=r(l);i.add(c);let s=pe(l,{fontSize:c});return on(s,n.scene.getContainerElement(l),n.scene),s=jne(l,s,n.scene),s}return l},!0);return Re(e,t,{includeBoundTextElement:!0}).forEach(l=>{oe(l)&&mi(l,n.scene)}),{elements:o,appState:{...t,currentItemFontSize:i.size===1?[...i][0]:a??t.currentItemFontSize},captureUpdate:U.IMMEDIATELY}},oye=ee({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,n)=>({...n?.currentItemStrokeColor&&{elements:ta(e,t,r=>rf(r.type)?pe(r,{strokeColor:n.currentItemStrokeColor}):r,!0)},appState:{...t,...n},captureUpdate:n?.currentItemStrokeColor?U.IMMEDIATELY:U.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>{let{stylesPanelMode:i}=Ym(r);return(0,ie.jsxs)(ie.Fragment,{children:[i==="full"&&(0,ie.jsx)("h3",{"aria-hidden":"true",children:E("labels.stroke")}),(0,ie.jsx)(U_,{topPicks:P0,palette:gM,type:"elementStroke",label:E("labels.stroke"),color:na(e,r,o=>o.strokeColor,!0,o=>o?null:t.currentItemStrokeColor),onChange:o=>n({currentItemStrokeColor:o}),elements:e,appState:t,updateData:n})]})}}),lye=ee({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,n,r)=>{if(!n?.currentItemBackgroundColor)return{appState:{...t,...n},captureUpdate:U.EVENTUALLY};let a,i=r.scene.getSelectedElements(t);if(!Hr(n.currentItemBackgroundColor)&&i.every(o=>Pt(o)&&b8(o.points))){let o=me(i);a=e.map(l=>o.has(l.id)&&Pt(l)?pe(l,{backgroundColor:n.currentItemBackgroundColor,...kb(l,!0)}):l)}else a=ta(e,t,o=>pe(o,{backgroundColor:n.currentItemBackgroundColor}));return{elements:a,appState:{...t,...n},captureUpdate:U.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>{let{stylesPanelMode:i}=Ym(r);return(0,ie.jsxs)(ie.Fragment,{children:[i==="full"&&(0,ie.jsx)("h3",{"aria-hidden":"true",children:E("labels.background")}),(0,ie.jsx)(U_,{topPicks:U0,palette:bM,type:"elementBackground",label:E("labels.background"),color:na(e,r,o=>o.backgroundColor,!0,o=>o?null:t.currentItemBackgroundColor),onChange:o=>n({currentItemBackgroundColor:o}),elements:e,appState:t,updateData:n})]})}}),sye=ee({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,n,r)=>(at("element","changeFillStyle",`${n} (${r.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),{elements:ta(e,t,a=>pe(a,{fillStyle:n})),appState:{...t,currentItemFillStyle:n},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let a=Re(e,t),i=a.length>0&&a.every(o=>o.fillStyle==="zigzag");return(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.fill")}),(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{type:"button",options:[{value:"hachure",text:`${E(i?"labels.zigzag":"labels.hachure")} (${Y("Alt-Click")})`,icon:i?Oee:zee,active:i?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:E("labels.crossHatch"),icon:Pee,testId:"fill-cross-hatch"},{value:"solid",text:E("labels.solid"),icon:Uee,testId:"fill-solid"}],value:na(e,r,o=>o.fillStyle,o=>o.hasOwnProperty("fillStyle"),o=>o?null:t.currentItemFillStyle),onClick:(o,l)=>{let c=l.altKey&&o==="hachure"&&a.every(s=>s.fillStyle==="hachure")?"zigzag":o;n(c)}})})]})}}),cye=ee({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:ta(e,t,r=>pe(r,{strokeWidth:n})),appState:{...t,currentItemStrokeWidth:n},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.strokeWidth")}),(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{group:"stroke-width",options:[{value:K0.thin,text:E("labels.thin"),icon:gB,testId:"strokeWidth-thin"},{value:K0.bold,text:E("labels.bold"),icon:Bee,testId:"strokeWidth-bold"},{value:K0.extraBold,text:E("labels.extraBold"),icon:Fee,testId:"strokeWidth-extraBold"}],value:na(e,r,i=>i.strokeWidth,i=>i.hasOwnProperty("strokeWidth"),i=>i?null:t.currentItemStrokeWidth),onChange:i=>n(i)})})]})}),dye=ee({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:ta(e,t,r=>pe(r,{seed:wl(),roughness:n})),appState:{...t,currentItemRoughness:n},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.sloppiness")}),(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{group:"sloppiness",options:[{value:0,text:E("labels.architect"),icon:Vee},{value:1,text:E("labels.artist"),icon:Gee},{value:2,text:E("labels.cartoonist"),icon:Yee}],value:na(e,r,i=>i.roughness,i=>i.hasOwnProperty("roughness"),i=>i?null:t.currentItemRoughness),onChange:i=>n(i)})})]})}),uye=ee({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:ta(e,t,r=>pe(r,{strokeStyle:n})),appState:{...t,currentItemStrokeStyle:n},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.strokeStyle")}),(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{group:"strokeStyle",options:[{value:"solid",text:E("labels.strokeStyle_solid"),icon:gB},{value:"dashed",text:E("labels.strokeStyle_dashed"),icon:Hee},{value:"dotted",text:E("labels.strokeStyle_dotted"),icon:jee}],value:na(e,r,i=>i.strokeStyle,i=>i.hasOwnProperty("strokeStyle"),i=>i?null:t.currentItemStrokeStyle),onChange:i=>n(i)})})]})}),hye=ee({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,n)=>({elements:ta(e,t,r=>pe(r,{opacity:n}),!0),appState:{...t,currentItemOpacity:n},captureUpdate:U.IMMEDIATELY}),PanelComponent:({app:e,updateData:t})=>(0,ie.jsx)(Hne,{updateData:t,app:e,testId:"opacity"})}),mye=ee({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,n,r)=>H_(e,t,r,()=>(ut(n,"actionChangeFontSize: Expected a font size value"),n),n),PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>{let{isCompact:i}=Ym(r);return(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.fontSize")}),(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{group:"font-size",options:[{value:li.sm,text:E("labels.small"),icon:cte,testId:"fontSize-small"},{value:li.md,text:E("labels.medium"),icon:dte,testId:"fontSize-medium"},{value:li.lg,text:E("labels.large"),icon:ute,testId:"fontSize-large"},{value:li.xl,text:E("labels.veryLarge"),icon:hte,testId:"fontSize-veryLarge"}],value:na(e,r,o=>{if(oe(o))return o.fontSize;let l=Le(o,r.scene.getNonDeletedElementsMap());return l?l.fontSize:null},o=>oe(o)||Le(o,r.scene.getNonDeletedElementsMap())!==null,o=>o?null:t.currentItemFontSize||ks),onChange:o=>{h2(()=>n(o),i,!!t.editingTextElement,a?.onPreventClose)}})})]})}}),TP=ee({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:o2,trackEvent:!1,perform:(e,t,n,r)=>H_(e,t,r,a=>Math.round(1/(1+tF)*a.fontSize)),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&(e.key===D.CHEVRON_LEFT||e.key===D.COMMA)}),MP=ee({name:"increaseFontSize",label:"labels.increaseFontSize",icon:o2,trackEvent:!1,perform:(e,t,n,r)=>H_(e,t,r,a=>Math.round(a.fontSize*(1+tF))),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&(e.key===D.CHEVRON_RIGHT||e.key===D.PERIOD)}),pye=ee({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,n,r)=>{let{cachedElements:a,resetAll:i,resetContainers:o,...l}=n;if(i)return{elements:ta(e,t,p=>{let f=a?.get(p.id);return f?pe(p,{...f}):p},!0),appState:{...t,...l},captureUpdate:U.NEVER};ut(n,"actionChangeFontFamily: value must be defined");let{currentItemFontFamily:c,currentHoveredFontFamily:s}=n,d=U.EVENTUALLY,u,h=!1;if(c)u=c,d=U.IMMEDIATELY;else if(s){u=s,d=U.EVENTUALLY;let p=Re(e,t,{includeBoundTextElement:!0}).filter(f=>oe(f));if(p.length>200)h=!0;else{let f=0,x=0;for(;f<p.length&&x<5e3;){let g=p[f];x+=g?.originalText.length||0,f++}x>5e3&&(h=!0)}}let m={appState:{...t,...l},captureUpdate:d};if(u&&!h){let p=new Map,f=new Set,x=!1,g=Array.from(lh.loadedFontsCache.values()),v=Object.entries(Ot).find(([S,_])=>_===u)?.[0];s&&v&&g.some(S=>S.startsWith(v))&&(x=!0),Object.assign(m,{elements:ta(e,t,S=>{if(oe(S)&&(S.fontFamily!==u||c)){let _=pe(S,{fontFamily:u,lineHeight:jr(u)}),C=a?.get(S.containerId||"")||{},k=r.scene.getContainerElement(S);return o&&k&&C&&r.scene.mutateElement(k,{...C}),x||(f=new Set([...f,...Array.from(_.originalText)])),p.set(_,k),_}return S},!0)});let b=`10px ${qc({fontFamily:u})}`,w=Array.from(f.values()).join();if(x||window.document.fonts.check(b,w))for(let[S,_]of p)on(S,_,r.scene);else window.document.fonts.load(b,w).then(S=>{for(let[_,C]of p){let k=r.scene.getElement(_.id),T=C?r.scene.getElement(C.id):null;k&&on(k,T,r.scene)}r.fonts.onLoaded(S)})}return m},PanelComponent:({elements:e,appState:t,app:n,updateData:r})=>{let a=(0,Na.useRef)(new Map),i=(0,Na.useRef)(null),[o,l]=(0,Na.useState)({}),c=(0,Na.useRef)(!0),{stylesPanelMode:s,isCompact:d}=Ym(n),u=(0,Na.useMemo)(()=>{let h=(m,p)=>na(m,n,f=>{if(oe(f))return f.fontFamily;let x=Le(f,p);return x?x.fontFamily:null},f=>oe(f)||Le(f,p)!==null,f=>f?null:t.currentItemFontFamily||Fu);return o.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?h(Array.from(a.current?.values()??[]),a.current):!o.openPopup&&t.openPopup!=="fontFamily"?h(e,n.scene.getNonDeletedElementsMap()):i.current},[o.openPopup,t,e,n]);return(0,Na.useEffect)(()=>{i.current=u},[u]),(0,Na.useEffect)(()=>{Object.keys(o).length&&(r(o),l({}))},[o]),(0,Na.useEffect)(()=>(c.current=!1,()=>{c.current=!0}),[]),(0,ie.jsxs)(ie.Fragment,{children:[s==="full"&&(0,ie.jsx)("legend",{children:E("labels.fontFamily")}),(0,ie.jsx)(Rne,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:u,hoveredFontFamily:t.currentHoveredFontFamily,compactMode:s!=="full",onSelect:h=>{h2(()=>{l({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:h}),a.current.clear()},d,!!t.editingTextElement)},onHover:h=>{l({currentHoveredFontFamily:h,cachedElements:new Map(a.current),resetContainers:!0})},onLeave:()=>{l({currentHoveredFontFamily:null,cachedElements:new Map(a.current),resetAll:!0})},onPopupChange:h=>{if(h){a.current.clear();let{editingTextElement:m}=t;if(m?.type==="text"){let p=n.scene.getElement(m.id);a.current.set(m.id,pe(p||m,{},!0))}else{let p=Re(e,t,{includeBoundTextElement:!0});for(let f of p)a.current.set(f.id,pe(f,{},!0))}l({...o,openPopup:"fontFamily"})}else{let m={currentHoveredFontFamily:null,cachedElements:new Map(a.current),resetAll:!0};l({...m}),a.current.clear(),d&&t.editingTextElement&&z_(null)}}})]})}}),fye=ee({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,n,r)=>({elements:ta(e,t,a=>{if(oe(a)){let i=pe(a,{textAlign:n});return on(i,r.scene.getContainerElement(a),r.scene),i}return a},!0),appState:{...t,currentItemTextAlign:n},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>{let i=r.scene.getNonDeletedElementsMap(),{isCompact:o}=Ym(r);return(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.textAlign")}),(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{group:"text-align",options:[{value:"left",text:E("labels.left"),icon:pte,testId:"align-left"},{value:"center",text:E("labels.center"),icon:fte,testId:"align-horizontal-center"},{value:"right",text:E("labels.right"),icon:gte,testId:"align-right"}],value:na(e,r,l=>{if(oe(l))return l.textAlign;let c=Le(l,i);return c?c.textAlign:null},l=>oe(l)||Le(l,i)!==null,l=>l?null:t.currentItemTextAlign),onChange:l=>{h2(()=>n(l),o,!!t.editingTextElement,a?.onPreventClose)}})})]})}}),gye=ee({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:ta(e,t,a=>{if(oe(a)){let i=pe(a,{verticalAlign:n});return on(i,r.scene.getContainerElement(a),r.scene),i}return a},!0),appState:{...t},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r,data:a})=>{let{isCompact:i}=Ym(r);return(0,ie.jsx)("fieldset",{children:(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{group:"text-align",options:[{value:si.TOP,text:E("labels.alignTop"),icon:(0,ie.jsx)(bte,{theme:t.theme}),testId:"align-top"},{value:si.MIDDLE,text:E("labels.centerVertically"),icon:(0,ie.jsx)(yte,{theme:t.theme}),testId:"align-middle"},{value:si.BOTTOM,text:E("labels.alignBottom"),icon:(0,ie.jsx)(vte,{theme:t.theme}),testId:"align-bottom"}],value:na(e,r,o=>{if(oe(o)&&o.containerId)return o.verticalAlign;let l=Le(o,r.scene.getNonDeletedElementsMap());return l?l.verticalAlign:null},o=>oe(o)||Le(o,r.scene.getNonDeletedElementsMap())!==null,o=>o?null:si.MIDDLE),onChange:o=>{h2(()=>n(o),i,!!t.editingTextElement,a?.onPreventClose)}})})})}}),bye=ee({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,n)=>({elements:ta(e,t,r=>ze(r)?r:pe(r,{roundness:n==="round"?{type:Os(r.type)?zt.ADAPTIVE_RADIUS:zt.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:n},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r,renderAction:a})=>{let i=nf(Pe(e),t).some(o=>o.roundness?.type===zt.LEGACY);return(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.edges")}),(0,ie.jsxs)("div",{className:"buttonList",children:[(0,ie.jsx)(ol,{group:"edges",options:[{value:"sharp",text:E("labels.sharp"),icon:Wee},{value:"round",text:E("labels.round"),icon:Kee}],value:na(e,r,o=>i?null:o.roundness?"round":"sharp",o=>!Oe(o)&&o.hasOwnProperty("roundness"),o=>o?null:t.currentItemRoundness),onChange:o=>n(o)}),a("togglePolygon")]})]})}}),AP=e=>({visibleSections:[{name:"default",options:[{value:null,text:E("labels.arrowhead_none"),keyBinding:"q",icon:(0,ie.jsx)($ee,{flip:e})},{value:"arrow",text:E("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,ie.jsx)(Xee,{flip:e})},{value:"triangle",text:E("labels.arrowhead_triangle"),icon:(0,ie.jsx)(Zee,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:E("labels.arrowhead_triangle_outline"),icon:(0,ie.jsx)(qee,{flip:e}),keyBinding:"r"}]}],hiddenSections:[{name:"default",options:[{value:"circle",text:E("labels.arrowhead_circle"),keyBinding:"a",icon:(0,ie.jsx)(Qee,{flip:e})},{value:"circle_outline",text:E("labels.arrowhead_circle_outline"),keyBinding:"s",icon:(0,ie.jsx)(Jee,{flip:e})},{value:"diamond",text:E("labels.arrowhead_diamond"),icon:(0,ie.jsx)(ete,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:E("labels.arrowhead_diamond_outline"),icon:(0,ie.jsx)(tte,{flip:e}),keyBinding:"f"},{value:"bar",text:E("labels.arrowhead_bar"),keyBinding:"z",icon:(0,ie.jsx)(nte,{flip:e})}]},{name:E("labels.cardinality"),options:[{value:"cardinality_one",text:E("labels.arrowhead_cardinality_one"),icon:(0,ie.jsx)(rte,{flip:e}),keyBinding:"x"},{value:"cardinality_many",text:E("labels.arrowhead_cardinality_many"),icon:(0,ie.jsx)(ate,{flip:e}),keyBinding:"c"},{value:"cardinality_one_or_many",text:E("labels.arrowhead_cardinality_one_or_many"),icon:(0,ie.jsx)(ite,{flip:e}),keyBinding:"v"},{value:"cardinality_exactly_one",text:E("labels.arrowhead_cardinality_exactly_one"),icon:(0,ie.jsx)(ote,{flip:e}),keyBinding:null},{value:"cardinality_zero_or_one",text:E("labels.arrowhead_cardinality_zero_or_one"),icon:(0,ie.jsx)(lte,{flip:e}),keyBinding:null},{value:"cardinality_zero_or_many",text:E("labels.arrowhead_cardinality_zero_or_many"),icon:(0,ie.jsx)(ste,{flip:e}),keyBinding:null}]}]}),vye=ee({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,n)=>(ut(n,"actionChangeArrowhead: value must be defined"),{elements:ta(e,t,r=>{if(Te(r)){let{position:a,type:i}=n;if(a==="start")return pe(r,{startArrowhead:i});if(a==="end")return pe(r,{endArrowhead:i})}return r}),appState:{...t,[n.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type},captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let a=y1().rtl,i=(0,Na.useMemo)(()=>AP(!a),[a]),o=(0,Na.useMemo)(()=>AP(!!a),[a]);return(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.arrowheads")}),(0,ie.jsxs)("div",{className:"iconSelectList buttonList",children:[(0,ie.jsx)(kP,{visibleSections:i.visibleSections,hiddenSections:i.hiddenSections,label:"arrowhead_start",value:na(e,r,l=>Te(l)&&cf(l.type)?M3(l.startArrowhead):t.currentItemStartArrowhead,!0,l=>l?null:t.currentItemStartArrowhead),onChange:l=>n({position:"start",type:l})}),(0,ie.jsx)(kP,{visibleSections:o.visibleSections,hiddenSections:o.hiddenSections,label:"arrowhead_end",value:na(e,r,l=>Te(l)&&cf(l.type)?M3(l.endArrowhead):t.currentItemEndArrowhead,!0,l=>l?null:t.currentItemEndArrowhead),onChange:l=>n({position:"end",type:l})})]})]})}}),yye=ee({name:"changeArrowProperties",label:"Change arrow properties",trackEvent:!1,perform:(e,t,n,r)=>!1,PanelComponent:({elements:e,appState:t,updateData:n,app:r,renderAction:a})=>(0,ie.jsxs)("div",{className:"selected-shape-actions",children:[a("changeArrowhead"),a("changeArrowType")]})}),xye=ee({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,n,r)=>{let a=ta(e,t,l=>{if(!Oe(l))return l;let c=r.scene.getNonDeletedElementsMap(),s=ae.getPointAtIndexGlobalCoordinates(l,0,c),d=ae.getPointAtIndexGlobalCoordinates(l,-1,c),u=pe(l,{x:n===an.elbow?s[0]:l.x,y:n===an.elbow?s[1]:l.y,roundness:n===an.round?{type:zt.PROPORTIONAL_RADIUS}:null,elbowed:n===an.elbow,angle:n===an.elbow?0:l.angle,points:n===an.elbow||l.elbowed?[ae.pointFromAbsoluteCoords({...l,x:s[0],y:s[1],angle:0},s,c),ae.pointFromAbsoluteCoords({...l,x:s[0],y:s[1],angle:0},d,c)]:l.points});if(ze(u)){u.fixedSegments=null;let h=r.scene.getNonDeletedElementsMap();r.dismissLinearEditor();let m=ae.getPointAtIndexGlobalCoordinates(u,0,h),p=ae.getPointAtIndexGlobalCoordinates(u,-1,h),f=u.startBinding&&h.get(u.startBinding.elementId),x=u.endBinding&&h.get(u.endBinding.elementId),g=f&&u.startBinding?{...u.startBinding,...s3(u,f,"start",h,t.isBindingEnabled)}:null,v=x&&u.endBinding?{...u.endBinding,...s3(u,x,"end",h,t.isBindingEnabled)}:null;u={...u,startBinding:g,endBinding:v,...gb(u,h,{points:[m,p].map(b=>N(b[0]-u.x,b[1]-u.y)),startBinding:g,endBinding:v,fixedSegments:null})}}else{let h=r.scene.getNonDeletedElementsMap();if(u.startBinding){let m=h.get(u.startBinding.elementId);m&&o3(u,m,t.bindMode==="inside"?"inside":"orbit","start",r.scene)}if(u.endBinding){let m=h.get(u.endBinding.elementId);m&&o3(u,m,t.bindMode==="inside"?"inside":"orbit","end",r.scene)}}return u}),i={...t,currentItemArrowType:n},o=t.selectedLinearElement?.elementId;if(o){let l=a.find(c=>c.id===o);l&&(i.selectedLinearElement=new ae(l,me(e)))}return{elements:a,appState:i,captureUpdate:U.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,ie.jsxs)("fieldset",{children:[(0,ie.jsx)("legend",{children:E("labels.arrowtypes")}),(0,ie.jsx)("div",{className:"buttonList",children:(0,ie.jsx)(ol,{group:"arrowtypes",options:[{value:an.sharp,text:E("labels.arrowtype_sharp"),icon:A_,testId:"sharp-arrow"},{value:an.round,text:E("labels.arrowtype_round"),icon:I_,testId:"round-arrow"},{value:an.elbow,text:E("labels.arrowtype_elbowed"),icon:D_,testId:"elbow-arrow"}],value:na(e,r,a=>Oe(a)?a.elbowed?an.elbow:a.roundness?an.round:an.sharp:null,a=>Oe(a),a=>a?null:t.currentItemArrowType),onChange:a=>n(a)})})]})}),p1=()=>{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},aF=(e,t,n="bottom")=>{let r=e.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight,o=5,l=t.left+t.width/2-r.width/2;l<0?l=o:l+r.width>=a&&(l=a-r.width-o);let c;n==="bottom"?(c=t.top+t.height+o,c+r.height>=i&&(c=t.top-r.height-o)):(c=t.top-r.height-o,c<0&&(c=t.top+t.height+o)),Object.assign(e.style,{top:`${c}px`,left:`${l}px`})},Vne=(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 a=e.getBoundingClientRect();aF(t,a)},cu=({children:e,label:t,long:n=!1,style:r,disabled:a})=>((0,nF.useEffect)(()=>()=>p1().classList.remove("excalidraw-tooltip--visible"),[]),a?null:(0,rF.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:i=>Vne(i.currentTarget,p1(),t,n),onPointerLeave:()=>p1().classList.remove("excalidraw-tooltip--visible"),style:r,children:e})),iF='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',Gne='<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"/>',oF='<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"/>',Yne=`data:${_e.svg},${encodeURIComponent(`${iF}${oF}</svg>`)}`,Wne=`data:${_e.svg},${encodeURIComponent(`${iF}${Gne}${oF}</svg>`)}`,mo=e=>{e&&(e.style.cursor="")},ht=(e,t)=>{e&&(e.style.cursor=t)},Ko,DP,lF=(e,t)=>{let n=()=>{let r=t===se.DARK;Ko=document.createElement("canvas"),Ko.theme=t,Ko.height=20,Ko.width=20;let a=Ko.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(Ko.width/2,Ko.height/2,5,0,2*Math.PI),a.fillStyle=r?"#000":"#fff",a.fill(),a.strokeStyle=r?"#fff":"#000",a.stroke(),DP=Ko.toDataURL(_e.svg)};(!Ko||Ko.theme!==t)&&n(),ht(e,`url(${DP}) ${20/2} ${20/2}, auto`)},Xo=(e,t)=>{if(e)if(t.activeTool.type==="selection")mo(e);else if(oh(t))e.style.cursor=Ve.GRAB;else if(to(t))lF(e,t.theme);else if(t.activeTool.type==="laser"){let n=t.theme===se.LIGHT?Yne:Wne;e.style.cursor=`url(${n}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Ve.AUTO):e.style.cursor=Ve.CROSSHAIR},Yd=({viewportX:e,viewportY:t,nextZoom:n},r)=>{let a=e-r.offsetLeft,i=t-r.offsetTop,o=r.zoom.value,l=r.scrollX+(a-a/o),c=r.scrollY+(i-i/o),s=-(a-a/n),d=-(i-i/n);return{scrollX:l+s,scrollY:c+d,zoom:{value:n}}},Mye=ee({name:"changeViewBackgroundColor",label:"labels.canvasBackground",trackEvent:!1,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,n)=>({appState:{...t,...n},captureUpdate:n?.viewBackgroundColor?U.IMMEDIATELY:U.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r,data:a})=>(0,fu.jsx)(U_,{palette:null,topPicks:B0,label:E("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:i=>n({viewBackgroundColor:i}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:n})}),f1=ee({name:"clearCanvas",label:"labels.clearCanvas",icon:us,trackEvent:{category:"canvas"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map(a=>pe(a,{isDeleted:!0})),appState:{...ih(),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,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:r.state.preferredSelectionTool.type}:t.activeTool},captureUpdate:U.IMMEDIATELY})}),IP=ee({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:iP,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...Yd({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ml(t.zoom.value+Hu)},t),userToFollow:null},captureUpdate:U.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,fu.jsx)(Me,{type:"button",className:"zoom-in-button zoom-button",icon:iP,title:`${E("buttons.zoomIn")} \u2014 ${Y("CtrlOrCmd++")}`,"aria-label":E("buttons.zoomIn"),disabled:t.zoom.value>=HE,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Ee.EQUAL||e.code===Ee.NUM_ADD)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),LP=ee({name:"zoomOut",label:"buttons.zoomOut",icon:oP,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...Yd({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ml(t.zoom.value-Hu)},t),userToFollow:null},captureUpdate:U.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,fu.jsx)(Me,{type:"button",className:"zoom-out-button zoom-button",icon:oP,title:`${E("buttons.zoomOut")} \u2014 ${Y("CtrlOrCmd+-")}`,"aria-label":E("buttons.zoomOut"),disabled:t.zoom.value<=FE,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Ee.MINUS||e.code===Ee.NUM_SUBTRACT)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),RP=ee({name:"resetZoom",label:"buttons.resetZoom",icon:xee,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...Yd({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ml(1)},t),userToFollow:null},captureUpdate:U.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,fu.jsx)(cu,{label:E("buttons.resetZoom"),style:{height:"100%"},children:(0,fu.jsxs)(Me,{type:"button",className:"reset-zoom-button zoom-button",title:E("buttons.resetZoom"),"aria-label":E("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Ee.ZERO||e.code===Ee.NUM_ZERO)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),Kne=(e,t,n=1)=>{let[r,a,i,o]=e,l=i-r,c=t.width/l,s=o-a,d=t.height/s,u=Math.min(c,d)*nn(n,.1,1);return Math.min(u,1)},$ne=({bounds:e,appState:t,canvasOffsets:n,fitToViewport:r=!1,viewportZoomFactor:a=1,minZoom:i=-1/0,maxZoom:o=1/0})=>{a=nn(a,FE,HE);let[l,c,s,d]=e,u=(l+s)/2,h=(c+d)/2,m=n?.left??0,p=n?.top??0,f=n?.right??0,x=n?.bottom??0,g=t.width-m-f,v=t.height-p-x,b;if(r){let _=s-l,C=d-c;b=Math.min(g/_,v/C)*a}else b=Kne(e,{width:g,height:v},a);let w=Ml(nn(lM(b,Hu,"floor"),i,o)),S=VA({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},offsets:n,zoom:{value:w}});return{appState:{...t,scrollX:S.scrollX,scrollY:S.scrollY,zoom:{value:w}},captureUpdate:U.EVENTUALLY}},E2=({canvasOffsets:e,targetElements:t,appState:n,fitToViewport:r,viewportZoomFactor:a,minZoom:i,maxZoom:o})=>{let l=Qe(Pe(t));return $ne({canvasOffsets:e,bounds:l,appState:n,fitToViewport:r,viewportZoomFactor:a,minZoom:i,maxZoom:o})},Aye=ee({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:M_,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return E2({targetElements:a.length?a:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===Ee.TWO&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]}),Dye=ee({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:M_,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return E2({targetElements:a.length?a:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===Ee.THREE&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]}),Iye=ee({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:M_,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>E2({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()}),keyTest:e=>e.code===Ee.ONE&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]}),Bx=ee({name:"toggleTheme",label:(e,t)=>t.theme===se.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:(e,t)=>e.theme===se.LIGHT?DC:IC,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n)=>({appState:{...t,theme:n||(t.theme===se.LIGHT?se.DARK:se.LIGHT)},captureUpdate:U.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Ee.D,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.toggleTheme}),Lye=ee({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t,n,r)=>{let a;return to(t)?a=tt(t,{...t.activeTool.lastActiveTool||{type:r.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):a=tt(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:a},captureUpdate:U.IMMEDIATELY}},keyTest:e=>e.key===D.E}),Rye=ee({name:"toggleLassoTool",label:"toolBar.lasso",icon:h1,trackEvent:{category:"toolbar"},predicate:(e,t,n,r)=>r.state.preferredSelectionTool.type!=="lasso",perform:(e,t,n,r)=>{let a;return t.activeTool.type!=="lasso"?(a=tt(t,{type:"lasso",fromSelection:!1}),ht(r.interactiveCanvas,Ve.CROSSHAIR)):a=tt(t,{type:"selection"}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:a},captureUpdate:U.NEVER}}}),Xne=ee({name:"toggleHandTool",label:"toolBar.hand",trackEvent:{category:"toolbar"},icon:C_,viewMode:!1,perform:(e,t,n,r)=>{let a;return oh(t)?a=tt(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(a=tt(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),ht(r.interactiveCanvas,Ve.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:a},captureUpdate:U.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[D.CTRL_OR_CMD]&&e.key===D.H}),zye=ee({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,n,r)=>{let a=tt(t,{type:"embeddable"});return Xo(r.canvas,{...t,activeTool:a}),{elements:e,appState:{...t,activeTool:tt(t,{type:"embeddable"})},captureUpdate:U.EVENTUALLY}}}),qa=ee({name:"finalize",label:"",trackEvent:!1,perform:(e,t,n,r)=>{let a=e,{interactiveCanvas:i,focusContainer:o,scene:l}=r,c=l.getNonDeletedElementsMap();if(n&&t.selectedLinearElement){let{event:h,sceneCoords:m}=n,p=ae.getElement(t.selectedLinearElement.elementId,c);ut(p,"Arrow element should exist if selectedLinearElement is set"),ut(m,"sceneCoords should be defined if actionFinalize is called with event");let f=ae.handlePointerUp(h,t.selectedLinearElement,t,r.scene);if(Mr(p)&&!t.selectedLinearElement.segmentMidPointHoveredCoords){let x=!!t.newElement,g=(x||!t.selectedLinearElement.selectedPointsIndices?[p.points.length-1]:t.selectedLinearElement.selectedPointsIndices).reduce((v,b)=>(v.set(b,{point:ae.pointFromAbsoluteCoords(p,N(m.x-f.pointerOffset.x,m.y-f.pointerOffset.y),c)}),v),new Map)??new Map;bb(p,g,m.x-f.pointerOffset.x,m.y-f.pointerOffset.y,l,t,{newArrow:x,altKey:h.altKey,angleLocked:Gp(h)})}else Pt(p)&&t.selectedLinearElement?.isEditing&&!t.newElement&&!n3(p.points)&&l.mutateElement(p,{polygon:!1});if(f!==t.selectedLinearElement){p&&No(p)&&(a=a.map(g=>g.id===p.id?pe(g,{isDeleted:!0}):g));let x=t.activeTool?.locked;return{elements:p.points.length<2||No(p)?e.map(g=>g.id===p.id?pe(g,{isDeleted:!0}):g):a,appState:{...t,cursorButton:"up",selectedLinearElement:x?null:{...f,selectedPointsIndices:null,isEditing:!1,initialState:{...f.initialState,lastClickedPoint:-1},pointerOffset:{x:0,y:0}},selectionElement:null,suggestedBinding:null,newElement:null,multiElement:null},captureUpdate:U.IMMEDIATELY}}}window.document.activeElement instanceof HTMLElement&&o();let s=null;if(t.multiElement)s=t.multiElement;else if(t.newElement?.type==="freedraw"||Mr(t.newElement))s=t.newElement;else if(Object.keys(t.selectedElementIds).length===1){let h=c.get(Object.keys(t.selectedElementIds)[0]);h&&(s=h)}if(s){if(t.selectedLinearElement&&t.multiElement&&s.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:h}=s,{lastCommittedPoint:m}=t.selectedLinearElement;(!m||h[h.length-1]!==m)&&l.mutateElement(s,{points:s.points.slice(0,-1)})}if(s&&No(s)&&(a=a.map(h=>h.id===s?.id?pe(h,{isDeleted:!0}):h)),Te(s)||td(s)){if(Xp(s.points,t.zoom.value)&&(Pt(s)||td(s))){let h=s.points,m=h[0],p=h.map((f,x)=>x===h.length-1?N(m[0],m[1]):f);Pt(s)?l.mutateElement(s,{points:p,polygon:!0}):l.mutateElement(s,{points:p})}Pt(s)&&!n3(s.points)&&l.mutateElement(s,{polygon:!1})}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!s)&&mo(i);let d;t.activeTool.type==="eraser"?d=tt(t,{...t.activeTool.lastActiveTool||{type:r.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):d=tt(t,{type:r.state.preferredSelectionTool.type});let u=s&&Te(s)?new ae(s,me(a)):t.selectedLinearElement;return u=u&&{...u,isEditing:t.newElement?!1:u.isEditing,initialState:{...u.initialState,lastClickedPoint:-1,origin:null}},{elements:a,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&s?t.activeTool:d,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBinding:null,selectedElementIds:s&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[s.id]:!0}:t.selectedElementIds,selectedLinearElement:u},captureUpdate:U.IMMEDIATELY}},keyTest:(e,t)=>e.key===D.ESCAPE&&(t.selectedLinearElement?.isEditing||!t.newElement&&t.multiElement===null)||(e.key===D.ESCAPE||e.key===D.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:n})=>(0,sF.jsx)(Me,{type:"button",icon:Aee,title:E("buttons.done"),"aria-label":E("buttons.done"),onClick:t,visible:e.multiElement!=null,size:n?.size||"medium",style:{pointerEvents:"all"}})}),j_=({children:e,checked:t,onChange:n,className:r})=>(0,E1.jsxs)("div",{className:H("Checkbox",r,{"is-checked":t}),onClick:a=>{n(!t,a),a.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,E1.jsx)("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:uB}),(0,E1.jsx)("div",{className:"Checkbox-label",children:e})]}),Zne=e=>{let t=e.title||(e.value===se.DARK?E("buttons.lightMode"):E("buttons.darkMode"));return(0,xm.jsx)(Me,{type:"icon",icon:e.value===se.LIGHT?NP.MOON:NP.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===se.DARK?se.LIGHT:se.DARK),"data-testid":"toggle-dark-mode"})},NP={SUN:(0,xm.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,xm.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:(0,xm.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,xm.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"})})},qne=e=>{let{id:t}=za(),[n,r]=(0,cF.useState)(e.value),a=o=>{e.ignoreFocus||e8(o.target);let l=o.target.value;l!==e.value&&e.onChange(l)},i=o=>{if(o.key===D.ENTER){if(o.preventDefault(),o.nativeEvent.isComposing||o.keyCode===229)return;o.currentTarget.blur()}};return(0,S1.jsxs)("div",{className:"ProjectName",children:[(0,S1.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),(0,S1.jsx)("input",{type:"text",className:"TextInput",onBlur:a,onKeyDown:i,id:`${t}-filename`,value:n,onChange:o=>r(o.target.value)})]})},Qne=5e3,Jne=({progress:e})=>(0,du.jsx)("div",{className:"Toast__progress-bar",children:(0,du.jsx)("div",{className:"Toast__progress-bar-fill",style:{width:`${Math.min(5,Math.round(e*100))}%`}})}),ere=({message:e,onClose:t,closable:n=!1,duration:r=Qne,style:a})=>{let i=(0,Wm.useRef)(0),o=r!==1/0,l=(0,Wm.useCallback)(()=>{o&&(i.current=window.setTimeout(()=>t(),r))},[t,r,o]);return(0,Wm.useEffect)(()=>{if(o)return l(),()=>clearTimeout(i.current)},[l,e,r,o]),(0,du.jsxs)("div",{className:"Toast",role:"status",onMouseEnter:o?()=>clearTimeout(i?.current):void 0,onMouseLeave:o?l:void 0,style:a,children:[(0,du.jsx)("div",{className:"Toast__message",children:e}),n&&(0,du.jsx)(Me,{icon:Hm,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},dF=Object.assign(ere,{ProgressBar:Jne}),oxe="clipboard"in navigator&&"readText"in navigator.clipboard,V_="clipboard"in navigator&&"writeText"in navigator.clipboard,G_="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,tre=e=>!!([Ts.excalidraw,Ts.excalidrawClipboard,Ts.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),nre=({types:e,files:t})=>{!e&&!t&&console.warn("createPasteEvent: no types or files provided");let n=new ClipboardEvent(Q.PASTE,{clipboardData:new DataTransfer});if(e)for(let[r,a]of Object.entries(e)){if(typeof a!="string"){t=t||[],t.push(a);continue}try{if(n.clipboardData?.items.add(a,r),n.clipboardData?.getData(r)!==a)throw new Error(`Failed to set "${r}" as clipboardData item`)}catch(i){throw new Error(i.message)}}if(t){let r=-1;for(let a of t){r++;try{if(n.clipboardData?.items.add(a),n.clipboardData?.files[r]!==a)throw new Error(`Failed to set file "${a.name}" as clipboardData item`)}catch(i){throw new Error(i.message)}}}return n},rre=({elements:e,files:t})=>{let n=me(e),r=new Set(e.filter(l=>he(l))),a=!1,i=e.reduce((l,c)=>(Ns(c)&&(a=!0,t&&t[c.fileId]&&(l[c.fileId]=t[c.fileId])),l),{});a&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let o={type:Ts.excalidrawClipboard,elements:e.map(l=>{if(id(l,n)&&!r.has(id(l,n))){let c=eo(l);return Ar(c,n,{frameId:null}),c}return l}),files:t?i:void 0};return JSON.stringify(o)},are=async(e,t,n)=>{let r=rre({elements:e,files:t});await Y1({[_e.excalidrawClipboard]:r,[_e.text]:r},n)};function uF(e){let t=[];for(let n of e.childNodes)if(n.nodeType===3){let r=n.textContent?.trim();r&&t.push({type:"text",value:r})}else if(n instanceof HTMLImageElement){let r=n.getAttribute("src");r&&r.startsWith("http")&&t.push({type:"imageUrl",value:r})}else t=t.concat(uF(n));return t}var ire=e=>{let t=e.value;try{let n=new DOMParser().parseFromString(t,_e.html),r=uF(n.body);if(r.length)return{type:"mixedContent",value:r}}catch(n){console.error(`error in parseHTMLFromPaste: ${n.message}`)}return null},ore=async()=>{let e={},t;try{t=await navigator.clipboard?.read()}catch(n){try{if(navigator.clipboard?.readText){console.warn(`navigator.clipboard.readText() failed (${n.message}). Failling back to navigator.clipboard.read()`);let r=await navigator.clipboard?.readText();if(r)return{[_e.text]:r}}}catch(r){if(navigator.clipboard?.read)console.warn(`navigator.clipboard.readText() failed (${r.message}). Failling back to navigator.clipboard.read()`);else{if(r.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${r.message}`),e;throw r}}throw n}for(let n of t)for(let r of n.types)if(rb(kM,r))try{if(r===_e.text||r===_e.html)e[r]=await(await n.getType(r)).text();else if(t7(r)){let a=await n.getType(r),i=h7(a,r,void 0);e[r]=i}else throw new I3(`Unsupported clipboard type: ${r}`)}catch(a){console.warn(a instanceof I3?a.message:`Cannot retrieve ${r} from clipboardItem: ${a.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},lre=async(e,t=!1)=>{try{let n=e.findByType(_e.html),r=!t&&n&&ire(n);return r?r.value.every(a=>a.type==="text")?{type:"text",value:e.getData(_e.text)??r.value.map(a=>a.value).join(`
|
|
50
|
-
`).trim()}:r:{type:"text",value:(e.getData(_e.text)||"").trim()}}catch{return{type:"text",value:""}}},sre=function(e){return this.find(t=>t.type===e)||null},cre=function(e){return this.find(t=>t.type===e)?.value??null},dre=function(){return this.filter(e=>e.kind==="file")},ure=e=>{let t;mF(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let n=new Set;for(let r of Array.from(t||[]))n.has(r.type)||n.add(r.type);return n},Fx=async e=>{let t;mF(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let n=(await Promise.all(Array.from(t||[]).map(async r=>{if(r.kind==="file"){let a=r.getAsFile();if(a){let i=await u7(r);return a=await Bb(a),{type:a.type,kind:"file",file:a,fileHandle:i}}}else if(r.kind==="string"){let{type:a}=r,i;return"clipboardData"in e&&e.clipboardData?i=e.clipboardData?.getData(a):i=await new Promise(o=>{r.getAsString(l=>o(l))}),{type:a,kind:"string",value:i}}return null}))).filter(r=>r!=null);return Object.assign(n,{findByType:sre,getData:cre,getFiles:dre})},hF=async(e,t=!1)=>{let n=await lre(e,t);if(n.type==="mixedContent")return{mixedContent:n.value};try{let r=JSON.parse(n.value),a=r.type===Ts.excalidrawClipboardWithAPI;if(tre(r))return{elements:r.elements,files:r.files,text:t?JSON.stringify(r.elements,null,2):void 0,programmaticAPI:a}}catch{}return{text:n.value}},hre=async e=>{try{await navigator.clipboard.write([new ClipboardItem({[_e.png]:e})])}catch(t){if(Ls(e))await navigator.clipboard.write([new ClipboardItem({[_e.png]:await e})]);else throw t}},Y1=async(e,t)=>{e=e||"";let n=Object.entries(typeof e=="string"?{[_e.text]:e}:e);try{if(t){for(let[a,i]of n)if(t.clipboardData?.setData(a,i),t.clipboardData?.getData(a)!==i)throw new Error("Failed to setData on clipboardEvent");return}}catch(a){console.error(a)}let r=n.find(([a])=>a===_e.text);if(V_&&r)try{await navigator.clipboard.writeText(r[1]);return}catch(a){console.error(a)}if(r&&!mre(r[1]))throw new Error("Error copying to clipboard.")},mre=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 a=!1;try{n.select(),n.setSelectionRange(0,n.value.length),a=document.execCommand("copy")}catch(i){console.error(i)}return n.remove(),a},mF=e=>e.type===Q.PASTE||e.type===Q.COPY||e.type===Q.CUT,S2=(e,{selectedElementIds:t},n)=>{e=Pe(e);let r=n&&vn(e,{selectedElementIds:t}),a=null,i=r?Re(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return r&&(i.length===1&&he(i[0])?(a=i[0],i=Cb(e,a)):i.length>1&&(i=Re(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:a,exportedElements:qi(i)}},C2=async(e,t,n,r,{exportBackground:a,exportPadding:i=Ms,viewBackgroundColor:o,name:l=n.name||zM,fileHandle:c=null,exportingFrame:s=null})=>{if(t.length===0)throw new Error(E("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let u=gf(t,{exportBackground:a,exportWithDarkMode:n.exportWithDarkMode,viewBackgroundColor:o,exportPadding:i,exportScale:n.exportScale,exportEmbedScene:n.exportEmbedScene&&e==="svg"},r,{exportingFrame:s});if(e==="svg")return R3(u.then(h=>new Blob([NM+h.outerHTML],{type:_e.svg})),{description:"Export to SVG",name:l,extension:n.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[Hp.svg],fileHandle:c});if(e==="clipboard-svg"){let h=await u.then(m=>m.outerHTML);try{await Y1(h)}catch{throw new Error(E("errors.copyToSystemClipboardFailed"))}return}}let d=P3(t,n,r,{exportBackground:a,viewBackgroundColor:o,exportPadding:i,exportingFrame:s});if(e==="png"){let u=bf(d);return n.exportEmbedScene&&(u=u.then(h=>import("./chunks/image-32MOCVDX-JN2EUMQG.js").then(({encodePngMetadata:m})=>m({blob:h,metadata:YA(t,n,r,"local")})))),R3(u,{description:"Export to PNG",name:l,extension:n.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[Hp.png],fileHandle:c})}else if(e==="clipboard")try{let u=bf(d);await hre(u)}catch(u){throw console.warn(u),u.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(E("canvasError.canvasTooBig")):yl&&u.name==="TypeError"?new Error(`${E("alerts.couldNotCopyToClipboard")}
|
|
51
|
-
|
|
52
|
-
${E("hints.firefox_clipboard_write")}`):new Error(E("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},pre=async(e,t,n)=>{let r=JA(t);if(Math.random()<1)throw new Error("OLALALALA");if(!e7(r))throw new Error("fileHandle should exist and should be of type svg or png when resaving");let{elements:a,appState:i,files:o}=await e,{exportBackground:l,viewBackgroundColor:c}=i;i={...i,exportEmbedScene:!0};let{exportedElements:s,exportingFrame:d}=S2(a,i,!1);return await C2(r,s,i,o,{exportBackground:l,viewBackgroundColor:c,name:n,fileHandle:t,exportingFrame:d}),{fileHandle:t}},fre=ee({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,n)=>({appState:{...t,name:n},captureUpdate:U.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:n,data:r,app:a})=>(0,wr.jsx)(qne,{label:E("labels.fileTitle"),value:a.getName(),onChange:i=>t(i),ignoreFocus:r?.ignoreFocus??!1})}),gre=ee({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,n)=>({appState:{...t,exportScale:n},captureUpdate:U.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=Pe(e),a=vn(r,t)?Re(r,t):r;return(0,wr.jsx)(wr.Fragment,{children:G0.map(i=>{let[o,l]=QA(a,Ms,i),c=`${E("imageExportDialog.label.scale")} ${i}x (${o}x${l})`;return(0,wr.jsx)(Me,{size:"small",type:"radio",icon:`${i}x`,name:"export-canvas-scale",title:c,"aria-label":c,id:"export-canvas-scale",checked:i===t.exportScale,onChange:()=>n(i)},i)})})}}),bre=ee({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,n)=>({appState:{...t,exportBackground:n},captureUpdate:U.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,wr.jsx)(j_,{checked:e.exportBackground,onChange:n=>t(n),children:E("imageExportDialog.label.withBackground")})}),pF=ee({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,n)=>({appState:{...t,exportEmbedScene:n},captureUpdate:U.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,wr.jsxs)(j_,{checked:e.exportEmbedScene,onChange:n=>t(n),children:[E("imageExportDialog.label.embedScene"),(0,wr.jsx)(cu,{label:E("imageExportDialog.tooltip.embedScene"),long:!0,children:(0,wr.jsx)("div",{className:"excalidraw-tooltip-icon",children:Dee})})]})}),Tm=!1,tC=(e,t)=>{let n=t.message??E("progressDialog.defaultMessage");e.setAppState({toast:{message:t.progress!=null?(0,wr.jsxs)(wr.Fragment,{children:[n,(0,wr.jsx)(dF.ProgressBar,{progress:t.progress})]}):n,duration:1/0}})};async function vre(e,t){if(t.app.state.isLoading&&(tC(t.app,{progress:null}),await t.app.onStateChange({predicate:n=>!n.isLoading})),e!=null&&typeof e=="object"&&Symbol.asyncIterator in e){for await(let n of e){if(t.signal.aborted){e.return();return}if(n.type==="progress")tC(t.app,{message:n.message,progress:n.progress??null});else if(n.type==="done")return}return}e instanceof Promise&&(tC(t.app,{progress:null}),await e)}function fF(e,t,n,r){let a=new AbortController,i=a.signal,o=new Promise(async l=>{try{r.props.onExport&&await vre(r.props.onExport("json",{elements:e,appState:t,files:n},{signal:i}),{app:r,signal:i})}catch(c){c?.name==="AbortError"?console.warn(`onExport() aborted by host app (signal aborted: ${i.aborted})`):console.error("Error during props.onExport() handling",c)}l({elements:e,appState:t,files:r.files})});return{abortController:a,data:o}}var Hx=ee({name:"saveToActiveFile",label:"buttons.save",icon:i2,trackEvent:{category:"export"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{if(Tm)return!1;Tm=!0;let a=t.fileHandle,i=r.getName(),{abortController:o,data:l}=fF(e,t,r.files,r);try{let{fileHandle:c}=B3(a)?await pre(l,a,i):await N3({data:l,filename:i,fileHandle:a});return{captureUpdate:U.NEVER,appState:{fileHandle:c,toast:{message:a&&c?.name?E("toast.fileSavedToFilename").replace("{filename}",`"${c.name}"`):E("toast.fileSaved"),duration:1500}}}}catch(c){return o.abort(),c?.name!=="AbortError"?console.error(c):console.warn(c),{captureUpdate:U.NEVER,appState:{toast:null}}}finally{Tm=!1}},keyTest:e=>e.key===D.S&&e[D.CTRL_OR_CMD]&&!e.shiftKey}),gF=ee({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:i2,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,n,r)=>{if(Tm)return!1;Tm=!0;let{abortController:a,data:i}=fF(e,t,r.files,r);try{let{fileHandle:o}=await N3({data:i,filename:r.getName(),fileHandle:null});return{captureUpdate:U.NEVER,appState:{openDialog:null,fileHandle:o,toast:{message:E("toast.fileSaved"),duration:3e3}}}}catch(o){return a.abort(),o?.name!=="AbortError"?console.error(o):console.warn(o),{captureUpdate:U.NEVER,appState:{toast:null}}}finally{Tm=!1}},keyTest:e=>e.key.toLowerCase()===D.S&&e.shiftKey&&e[D.CTRL_OR_CMD],PanelComponent:({updateData:e})=>(0,wr.jsx)(Me,{type:"button",icon:kee,title:E("buttons.saveAs"),"aria-label":E("buttons.saveAs"),showAriaLabel:En().formFactor==="phone",hidden:!zb,onClick:()=>e(null),"data-testid":"save-as-button"})}),HC=ee({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:a,appState:i,files:o}=await WA(t,e);return{elements:a,appState:i,files:o,captureUpdate:U.IMMEDIATELY}}catch(a){return a?.name==="AbortError"?(console.warn(a),!1):{elements:e,appState:{...t,errorMessage:a.message},files:r.files,captureUpdate:U.EVENTUALLY}}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.O}),yre=ee({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,n,r)=>(r.sessionExportThemeOverride=n?se.DARK:se.LIGHT,{appState:{...t,exportWithDarkMode:n},captureUpdate:U.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,wr.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,wr.jsx)(Zne,{value:e.exportWithDarkMode?se.DARK:se.LIGHT,onChange:n=>{t(n===se.DARK)},title:E("imageExportDialog.label.darkMode")})})}),bF="{}",xre=ee({name:"copyStyles",label:"labels.copyStyles",icon:wB,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=[],i=e.find(o=>t.selectedElementIds[o.id]);if(a.push(i),i&&gn(i)){let o=Le(i,r.scene.getNonDeletedElementsMap());a.push(o)}return i&&(bF=JSON.stringify(a)),{appState:{...t,toast:{message:E("toast.copyStyles")}},captureUpdate:U.EVENTUALLY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.C}),wre=ee({name:"pasteStyles",label:"labels.pasteStyles",icon:wB,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=JSON.parse(bF),i=a[0],o=a[1];if(!t3(i))return{elements:e,captureUpdate:U.EVENTUALLY};let l=Re(e,t,{includeBoundTextElement:!0}),c=l.map(s=>s.id);return{elements:e.map(s=>{if(c.includes(s.id)){let d=i;if(oe(s)&&s.containerId&&(d=o),!d)return s;let u=pe(s,{backgroundColor:d?.backgroundColor,strokeWidth:d?.strokeWidth,strokeColor:d?.strokeColor,strokeStyle:d?.strokeStyle,fillStyle:d?.fillStyle,opacity:d?.opacity,roughness:d?.roughness,roundness:d.roundness?f8(d.roundness.type,s)?d.roundness:g8(s):null});if(oe(u)){let h=d.fontSize||ks,m=d.fontFamily||Fu;u=pe(u,{fontSize:h,fontFamily:m,textAlign:d.textAlign||H0,lineHeight:d.lineHeight||jr(m)});let p=null;u.containerId&&(p=l.find(f=>oe(u)&&f.id===u.containerId)||null),on(u,p,r.scene)}return u.type==="arrow"&&Oe(d)&&(u=pe(u,{startArrowhead:d.startArrowhead,endArrowhead:d.endArrowhead})),he(s)&&(u=pe(u,{roundness:null,backgroundColor:"transparent"})),u}return s}),captureUpdate:U.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.V}),Y_=ee({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:Eee,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,n,{focusContainer:r})=>(t.openDialog?.name==="help"&&r(),{appState:{...t,openDialog:t.openDialog?.name==="help"?null:{name:"help"},openMenu:null,openPopup:null},captureUpdate:U.EVENTUALLY}),keyTest:e=>e.key===D.QUESTION_MARK}),Ere=e=>{if(e.length>=2){let t=e[0].groupIds;for(let n of t)if(e.reduce((r,a)=>r&&Zu(a,n),!0))return!0}return!1},OP=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return r.length>=2&&!Ere(r)&&!_b(r)},Sre=ee({name:"group",label:"labels.group",icon:e=>(0,Qd.jsx)(xP,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=Y8(r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(a.length<2)return{appState:t,elements:e,captureUpdate:U.EVENTUALLY};let i=Ji(t);if(i.length===1){let f=i[0],x=new Set(wt(e,f).map(v=>v.id)),g=new Set(a.map(v=>v.id));if(new Set([...Array.from(x),...Array.from(g)]).size===x.size)return{appState:t,elements:e,captureUpdate:U.EVENTUALLY}}let o=[...e];new Set(a.map(f=>f.frameId)).size>1&&V8(a).forEach((f,x)=>{Sb(f,r.scene.getNonDeletedElementsMap())});let l=ca(),c=me(a);o=o.map(f=>c.get(f.id)?pe(f,{groupIds:U8(f.groupIds,l,t.editingGroupId)}):f);let s=wt(o,l),d=s[s.length-1],u=o.lastIndexOf(d),h=o.slice(u+1),m=o.slice(0,u).filter(f=>!Zu(f,l)),p=Oo([...m,...s,...h],me(s));return{appState:{...t,...O8(l,{...t,selectedGroupIds:{}},Pe(o))},elements:p,captureUpdate:U.IMMEDIATELY}},predicate:(e,t,n,r)=>OP(e,t,r),keyTest:e=>!e.shiftKey&&e[D.CTRL_OR_CMD]&&e.key===D.G,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,Qd.jsx)(Me,{hidden:!OP(e,t,r),type:"button",icon:(0,Qd.jsx)(xP,{theme:t.theme}),onClick:()=>n(null),title:`${E("labels.group")} \u2014 ${Y("CtrlOrCmd+G")}`,"aria-label":E("labels.group"),visible:vn(Pe(e),t)})}),Cre=ee({name:"ungroup",label:"labels.ungroup",icon:e=>(0,Qd.jsx)(wP,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=Ji(t),i=me(e);if(a.length===0)return{appState:t,elements:e,captureUpdate:U.EVENTUALLY};let o=[...e],l=[];o=o.map(u=>{jt(u)&&l.push(u.id);let h=B8(u.groupIds,t.selectedGroupIds);return h.length===u.groupIds.length?u:pe(u,{groupIds:h})});let c=bn(t,Pe(o),t,null),s=r.scene.getSelectedElements(t),d=new Set(s.filter(u=>u.frameId).map(u=>u.frameId));return G8(e).filter(u=>d.has(u.id)).forEach(u=>{u&&(o=Io(o,da(o,u,t,i),u,r))}),c.selectedElementIds=Object.entries(c.selectedElementIds).reduce((u,[h,m])=>(m&&!l.includes(h)&&(u[h]=!0),u),{}),{appState:{...t,...c},elements:o,captureUpdate:U.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[D.CTRL_OR_CMD]&&e.key===D.G.toUpperCase(),predicate:(e,t)=>Ji(t).length>0,PanelComponent:({elements:e,appState:t,updateData:n})=>(0,Qd.jsx)(Me,{type:"button",hidden:Ji(t).length===0,icon:(0,Qd.jsx)(wP,{theme:t.theme}),onClick:()=>n(null),title:`${E("labels.ungroup")} \u2014 ${Y("CtrlOrCmd+Shift+G")}`,"aria-label":E("labels.ungroup"),visible:vn(Pe(e),t)})}),vF=(e,t,n,r,a,i,o)=>{e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+a-i),e.quadraticCurveTo(t+r,n+a,t+r-i,n+a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t,n+a,t,n+a-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),e.fill(),o&&(e.strokeStyle=o),e.stroke()};function _re(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 _2=(e,t)=>`hsl(${Math.abs(_re(t?.id||e))%37*10}, 100%, 83%)`,kre=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},Tre=({context:e,renderConfig:t,appState:n,normalizedWidth:r,normalizedHeight:a})=>{for(let[i,o]of t.remotePointerViewportCoords){let{x:l,y:c}=o,s=n.collaborators.get(i);l-=n.offsetLeft,c-=n.offsetTop;let d=11,u=14,h=l<0||l>r-d||c<0||c>a-u;l=Math.max(l,0),l=Math.min(l,r-d),c=Math.max(c,0),c=Math.min(c,a-u);let m=_2(i,s);e.save(),e.strokeStyle=m,e.fillStyle=m;let p=t.remotePointerUserStates.get(i),f=h||p===X0.IDLE||p===X0.AWAY;f&&(e.globalAlpha=.3),t.remotePointerButton.get(i)==="down"&&(e.beginPath(),e.arc(l,c,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(l,c,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=m,e.stroke(),e.closePath());let x=n.theme===se.DARK?"#2f6330":_M,g=s?.isSpeaking;g&&(e.fillStyle=x,e.strokeStyle=x,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(l,c),e.lineTo(l+0,c+14),e.lineTo(l+4,c+9),e.lineTo(l+11,c+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=Fp,e.strokeStyle=Fp,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(l,c),e.lineTo(l+0,c+14),e.lineTo(l+4,c+9),e.lineTo(l+11,c+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=m,e.strokeStyle=m,e.lineWidth=2,e.lineJoin="round",e.beginPath(),f?(e.moveTo(l-1,c-1),e.lineTo(l-1,c+15),e.lineTo(l+5,c+10),e.lineTo(l+12,c+9),e.closePath(),e.fill()):(e.moveTo(l,c),e.lineTo(l+0,c+14),e.lineTo(l+4,c+9),e.lineTo(l+11,c+8),e.closePath(),e.fill(),e.stroke());let v=t.remotePointerUsernames.get(i)||"";if(!h&&v){e.font="600 12px sans-serif";let b=(g?l+0:l)+d/2,w=(g?c+0:c)+u+2,S=5,_=3,C=e.measureText(v),k=C.actualBoundingBoxDescent+C.actualBoundingBoxAscent,T=Math.max(k,12),I=b-1,A=w-1,O=C.width+2+S*2+2,V=T+2+_*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(I,A,O,V,8),e.fillStyle=m,e.fill(),e.strokeStyle=Fp,e.stroke(),g&&(e.beginPath(),e.roundRect(I-2,A-2,O+4,V+4,8),e.strokeStyle=x,e.stroke())):vF(e,I,A,O,V,8,Fp),e.fillStyle=CM,e.fillText(v,b+S+1,w+_+C.actualBoundingBoxAscent+Math.floor((T-k)/2)+2),g){e.fillStyle=x;let j=8,K=8,Z=5;e.fillRect(I+O+K,A+(V/2-j/2),2,j),e.fillRect(I+O+K+Z,A+(V/2-j*2/2),2,j*2),e.fillRect(I+O+K+Z*2,A+(V/2-j/2),2,j)}}e.restore(),e.closePath()}},zP=({color:e,onClick:t,name:n,src:r,className:a})=>{let i=kre(n),[o,l]=(0,yF.useState)(!1),c=!o&&r,s=c?void 0:{background:e};return(0,jC.jsx)("div",{className:H("Avatar",a),style:s,onClick:t,children:c?(0,jC.jsx)("img",{className:"Avatar-img",src:r,alt:i,referrerPolicy:"no-referrer",onError:()=>l(!0)}):i})},Txe=ee({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,n)=>(ut(n,"actionGoToCollaborator: collaborator should be defined when actionGoToCollaborator is called"),!n.socketId||t.userToFollow?.socketId===n.socketId||n.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:U.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:n.socketId,username:n.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:U.EVENTUALLY}),PanelComponent:({updateData:e,data:t,appState:n})=>{let{socketId:r,collaborator:a,withName:i,isBeingFollowed:o}=t,l=_2(r,a),c=H({"is-followed":o,"is-current-user":a.isCurrentUser===!0,"is-speaking":a.isSpeaking,"is-in-call":a.isInCall,"is-muted":a.isMuted}),s=a.isInCall?a.isSpeaking?(0,Pr.jsxs)("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:E("userList.hint.isSpeaking"),children:[(0,Pr.jsx)("div",{}),(0,Pr.jsx)("div",{}),(0,Pr.jsx)("div",{})]}):a.isMuted?(0,Pr.jsx)("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:E("userList.hint.micMuted"),children:Nte}):(0,Pr.jsx)("div",{title:E("userList.hint.inCall"),children:Rte}):null;return i?(0,Pr.jsxs)("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${c}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(a),children:[(0,Pr.jsx)(zP,{color:l,onClick:()=>{},name:a.username||"",src:a.avatarUrl,className:c}),(0,Pr.jsx)("div",{className:"UserList__collaborator-name",children:a.username}),(0,Pr.jsxs)("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[o&&(0,Pr.jsx)("div",{className:"UserList__collaborator-status-icon-is-followed",title:E("userList.hint.followStatus"),children:T_}),s]})]}):(0,Pr.jsxs)("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${c}`,children:[(0,Pr.jsx)(zP,{color:l,onClick:()=>{e(a)},name:a.username||"",src:a.avatarUrl,className:c}),s&&(0,Pr.jsx)("div",{className:"UserList__collaborator-status-icon",children:s})]})}}),Mre=ee({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let i of $0)if(a.some(o=>o.type===i))return{captureUpdate:U.EVENTUALLY,appState:{...t,errorMessage:E(`errors.libraryElementTypeError.${i}`)}};return r.library.getLatestLibrary().then(i=>r.library.setLibrary([{id:ca(),status:"unpublished",elements:a.map(eo),created:Date.now()},...i])).then(()=>({captureUpdate:U.EVENTUALLY,appState:{...t,toast:{message:E("toast.addedToLibrary")}}})).catch(i=>({captureUpdate:U.EVENTUALLY,appState:{...t,errorMessage:i.message}}))},label:"labels.addToLibrary"}),Oa=(e,t)=>{let n=t.scene.getSelectedElements(e);return wb(n,t.scene.getNonDeletedElementsMap(),e).length>1&&!n.some(r=>he(r))},Km=(e,t,n,r)=>{let a=n.scene.getSelectedElements(t),i=aA(a,r,n.scene,t),o=me(i);return Lo(e.map(l=>o.get(l.id)||l),t,n)},Uxe=ee({name:"alignTop",label:"labels.alignTop",icon:pP,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Oa(t,r),perform:(e,t,n,r)=>({appState:t,elements:Km(e,t,r,{position:"start",axis:"y"}),captureUpdate:U.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,gu.jsx)(Me,{hidden:!Oa(t,r),type:"button",icon:pP,onClick:()=>n(null),title:`${E("labels.alignTop")} \u2014 ${Y("CtrlOrCmd+Shift+Up")}`,"aria-label":E("labels.alignTop"),visible:vn(Pe(e),t)})}),Bxe=ee({name:"alignBottom",label:"labels.alignBottom",icon:fP,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Oa(t,r),perform:(e,t,n,r)=>({appState:t,elements:Km(e,t,r,{position:"end",axis:"y"}),captureUpdate:U.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,gu.jsx)(Me,{hidden:!Oa(t,r),type:"button",icon:fP,onClick:()=>n(null),title:`${E("labels.alignBottom")} \u2014 ${Y("CtrlOrCmd+Shift+Down")}`,"aria-label":E("labels.alignBottom"),visible:vn(Pe(e),t)})}),Fxe=ee({name:"alignLeft",label:"labels.alignLeft",icon:gP,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Oa(t,r),perform:(e,t,n,r)=>({appState:t,elements:Km(e,t,r,{position:"start",axis:"x"}),captureUpdate:U.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,gu.jsx)(Me,{hidden:!Oa(t,r),type:"button",icon:gP,onClick:()=>n(null),title:`${E("labels.alignLeft")} \u2014 ${Y("CtrlOrCmd+Shift+Left")}`,"aria-label":E("labels.alignLeft"),visible:vn(Pe(e),t)})}),Hxe=ee({name:"alignRight",label:"labels.alignRight",icon:bP,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Oa(t,r),perform:(e,t,n,r)=>({appState:t,elements:Km(e,t,r,{position:"end",axis:"x"}),captureUpdate:U.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,gu.jsx)(Me,{hidden:!Oa(t,r),type:"button",icon:bP,onClick:()=>n(null),title:`${E("labels.alignRight")} \u2014 ${Y("CtrlOrCmd+Shift+Right")}`,"aria-label":E("labels.alignRight"),visible:vn(Pe(e),t)})}),jxe=ee({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:vP,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Oa(t,r),perform:(e,t,n,r)=>({appState:t,elements:Km(e,t,r,{position:"center",axis:"y"}),captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,gu.jsx)(Me,{hidden:!Oa(t,r),type:"button",icon:vP,onClick:()=>n(null),title:E("labels.centerVertically"),"aria-label":E("labels.centerVertically"),visible:vn(Pe(e),t)})}),Vxe=ee({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:yP,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Oa(t,r),perform:(e,t,n,r)=>({appState:t,elements:Km(e,t,r,{position:"center",axis:"x"}),captureUpdate:U.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,gu.jsx)(Me,{hidden:!Oa(t,r),type:"button",icon:yP,onClick:()=>n(null),title:E("labels.centerHorizontally"),"aria-label":E("labels.centerHorizontally"),visible:vn(Pe(e),t)})}),xF=(e,t)=>{let n=t.scene.getSelectedElements(e);return wb(n,t.scene.getNonDeletedElementsMap(),e).length>2&&!n.some(r=>he(r))},wF=(e,t,n,r)=>{let a=n.scene.getSelectedElements(t),i=cA(a,n.scene.getNonDeletedElementsMap(),r,t,n.scene),o=me(i);return Lo(e.map(l=>o.get(l.id)||l),t,n)},qxe=ee({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:wF(e,t,r,{space:"between",axis:"x"}),captureUpdate:U.IMMEDIATELY}),keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.H,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,W_.jsx)(Me,{hidden:!xF(t,r),type:"button",icon:Lee,onClick:()=>n(null),title:`${E("labels.distributeHorizontally")} \u2014 ${Y("Alt+H")}`,"aria-label":E("labels.distributeHorizontally"),visible:vn(Pe(e),t)})}),Qxe=ee({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:wF(e,t,r,{space:"between",axis:"y"}),captureUpdate:U.IMMEDIATELY}),keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.V,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,W_.jsx)(Me,{hidden:!xF(t,r),type:"button",icon:Ree,onClick:()=>n(null),title:`${E("labels.distributeVertically")} \u2014 ${Y("Alt+V")}`,"aria-label":E("labels.distributeVertically"),visible:vn(Pe(e),t)})}),Are=ee({name:"flipHorizontal",label:"labels.flipHorizontal",icon:Ute,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:Lo(EF(e,r.scene.getNonDeletedElementsMap(),t,"horizontal",r),t,r),appState:t,captureUpdate:U.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===Ee.H}),Dre=ee({name:"flipVertical",label:"labels.flipVertical",icon:Pte,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:Lo(EF(e,r.scene.getNonDeletedElementsMap(),t,"vertical",r),t,r),appState:t,captureUpdate:U.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===Ee.V&&!e[D.CTRL_OR_CMD]}),EF=(e,t,n,r,a)=>{let i=Re(Pe(e),n,{includeBoundTextElement:!0,includeElementsInFrames:!0}),o=Ire(i,t,r,a),l=me(o);return e.map(c=>l.get(c.id)||c)},Ire=(e,t,n,r)=>{if(e.every(h=>Oe(h)&&(h.startBinding||h.endBinding)))return e.map(h=>{let m=h;return pe(m,{startArrowhead:m.endArrowhead,endArrowhead:m.startArrowhead})});let{midX:a,midY:i}=Tl(e);zA(e,t,"nw",r.scene,new Map(Array.from(t.values()).map(h=>[h.id,eo(h)])),{flipByX:n==="horizontal",flipByY:n==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),tf(e.filter(Oe),r.scene,r.state);let{elbowArrows:o,otherElements:l}=e.reduce((h,m)=>ze(m)?{...h,elbowArrows:h.elbowArrows.concat(m)}:{...h,otherElements:h.otherElements.concat(m)},{elbowArrows:[],otherElements:[]}),{midX:c,midY:s}=Tl(e),[d,u]=[a-c,i-s];return l.forEach(h=>r.scene.mutateElement(h,{x:h.x+d,y:h.y+u})),o.forEach(h=>r.scene.mutateElement(h,{x:h.x+d,y:h.y+u})),e},Tx=ee({name:"copy",label:"labels.copy",icon:AC,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await are(a,r.files,n)}catch(i){return{captureUpdate:U.EVENTUALLY,appState:{...t,errorMessage:i.message}}}return{captureUpdate:U.EVENTUALLY}},keyTest:void 0}),PP=ee({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let a;try{a=await ore()}catch(i){return i.name==="AbortError"||i.name==="NotAllowedError"?!1:(console.error(`actionPaste ${i.name}: ${i.message}`),yl?{captureUpdate:U.EVENTUALLY,appState:{...t,errorMessage:E("hints.firefox_clipboard_write")}}:{captureUpdate:U.EVENTUALLY,appState:{...t,errorMessage:E("errors.asyncPasteFailedOnRead")}})}try{r.pasteFromClipboard(nre({types:a}))}catch(i){return console.error(i),{captureUpdate:U.EVENTUALLY,appState:{...t,errorMessage:E("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:U.EVENTUALLY}},keyTest:void 0}),UP=ee({name:"cut",label:"labels.cut",icon:wte,trackEvent:{category:"element"},perform:(e,t,n,r)=>(Tx.perform(e,t,n,r),kB.perform(e,t,null,r)),keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.X}),BP=ee({name:"copyAsSvg",label:"labels.copyAsSvg",icon:Bte,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:U.EVENTUALLY};let{exportedElements:a,exportingFrame:i}=S2(e,t,!0);try{await C2("clipboard-svg",a,t,r.files,{...t,exportingFrame:i,name:r.getName()});let o=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:E("toast.copyToClipboardAsSvg",{exportSelection:o.length?E("toast.selection"):E("toast.canvas"),exportColorScheme:t.exportWithDarkMode?E("buttons.darkMode"):E("buttons.lightMode")})}},captureUpdate:U.EVENTUALLY}}catch(o){return console.error(o),{appState:{errorMessage:o.message},captureUpdate:U.EVENTUALLY}}},predicate:e=>V_&&e.length>0,keywords:["svg","clipboard","copy"]}),FP=ee({name:"copyAsPng",label:"labels.copyAsPng",icon:Fte,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:U.EVENTUALLY};let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:i,exportingFrame:o}=S2(e,t,!0);try{return await C2("clipboard",i,t,r.files,{...t,exportingFrame:o,name:r.getName()}),{appState:{...t,toast:{message:E("toast.copyToClipboardAsPng",{exportSelection:a.length?E("toast.selection"):E("toast.canvas"),exportColorScheme:t.exportWithDarkMode?E("buttons.darkMode"):E("buttons.lightMode")})}},captureUpdate:U.EVENTUALLY}}catch(l){return console.error(l),{appState:{...t,errorMessage:l.message},captureUpdate:U.EVENTUALLY}}},predicate:e=>G_&&e.length>0,keyTest:e=>e.code===Ee.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),HP=ee({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{Y1(ef(a))}catch{throw new Error(E("errors.copyToSystemClipboardFailed"))}return{captureUpdate:U.EVENTUALLY}},predicate:(e,t,n,r)=>V_&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(oe),keywords:["text","clipboard","copy"]}),VC=ee({name:"gridMode",icon:Yte,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:U.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[D.CTRL_OR_CMD]&&e.code===Ee.QUOTE}),jx=ee({name:"zenMode",label:"buttons.zenMode",icon:jte,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:U.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,n,r)=>r.editorInterface.formFactor!=="phone"&&typeof n.zenModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.Z}),SF=ee({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:Hte,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:U.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,n)=>typeof n.objectsSnapModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.S}),CF=ee({name:"arrowBinding",label:"labels.arrowBinding",viewMode:!1,trackEvent:{category:"canvas",predicate:e=>e.bindingPreference==="disabled"},perform(e,t){let n=t.bindingPreference==="enabled"?"disabled":"enabled";return{appState:{...t,bindingPreference:n,isBindingEnabled:n==="enabled"},captureUpdate:U.NEVER}},checked:e=>e.bindingPreference==="enabled"}),_F=ee({name:"midpointSnapping",label:"labels.midpointSnapping",viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.isMidpointSnappingEnabled},perform(e,t){return{appState:{...t,isMidpointSnappingEnabled:!this.checked(t)},captureUpdate:U.NEVER}},checked:e=>e.isMidpointSnappingEnabled}),Vx=ee({name:"stats",label:"stats.fullTitle",icon:zte,viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:U.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.SLASH}),Lre=ee({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>r.scene.getSelectedElements(t).some(a=>gn(a)),perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t),i=r.scene.getNonDeletedElementsMap();return a.forEach(o=>{let l=Le(o,i);if(l){let{width:c,height:s}=kt(l.originalText,Mt(l),l.lineHeight),d=E8(o.id);w8(o.id);let{x:u,y:h}=zs(o,l,i);r.scene.mutateElement(l,{containerId:null,width:c,height:s,text:l.originalText,x:u,y:h}),r.scene.mutateElement(o,{boundElements:o.boundElements?.filter(m=>m.id!==l.id),height:d||o.height})}}),{elements:e,appState:t,captureUpdate:U.IMMEDIATELY}}}),Rre=ee({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);if(a.length===2){let i=oe(a[0])||oe(a[1]),o;if(Sl(a[0])?o=a[0]:Sl(a[1])&&(o=a[1]),i&&o&&Le(o,r.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t),i,o;oe(a[0])&&Sl(a[1])?(i=a[0],o=a[1]):(i=a[1],o=a[0]),r.scene.mutateElement(i,{containerId:o.id,verticalAlign:si.MIDDLE,textAlign:WE.CENTER,autoResize:!0,angle:Oe(o)?0:o?.angle??0}),r.scene.mutateElement(o,{boundElements:(o.boundElements||[]).concat({type:"text",id:i.id})});let l=o.height;return on(i,o,r.scene),Zp(o.id,l),{elements:Nre(e,o,i),appState:{...t,selectedElementIds:{[o.id]:!0}},captureUpdate:U.IMMEDIATELY}}}),Nre=(e,t,n)=>{let r=e.slice(),a=r.findIndex(o=>o.id===n.id);r.splice(a,1);let i=r.findIndex(o=>o.id===t.id);return r.splice(i+1,0,n),Oo(r,me([t,n])),r},Ore=(e,t,n)=>{let r=e.slice(),a=r.findIndex(o=>o.id===t.id);r.splice(a,1);let i=r.findIndex(o=>o.id===n.id);return r.splice(i,0,t),Oo(r,me([t,n])),r},zre=ee({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t),i=a.some(o=>oe(o)&&!jt(o));return a.length>0&&i},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t),i=e.slice(),o={};for(let l of a)if(oe(l)&&!jt(l)){let c=ua({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...l.boundElements||[],{id:l.id,type:"text"}],angle:l.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:Os("rectangle")?zt.ADAPTIVE_RADIUS:zt.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:l.x-YE,y:l.y-YE,width:Wu(l.width,"rectangle"),height:Wu(l.height,"rectangle"),groupIds:l.groupIds,frameId:l.frameId});if(l.boundElements?.length){let s=l.boundElements.filter(d=>d.type==="arrow").map(d=>d.id);i.filter(d=>s.includes(d.id)).forEach(d=>{let u=d.startBinding,h=d.endBinding;u?.elementId===l.id&&(u={...u,elementId:c.id}),h?.elementId===l.id&&(h={...h,elementId:c.id}),(u||h)&&r.scene.mutateElement(d,{startBinding:u,endBinding:h})})}r.scene.mutateElement(l,{containerId:c.id,verticalAlign:si.MIDDLE,boundElements:null,textAlign:WE.CENTER,autoResize:!0}),on(l,c,r.scene),i=Ore([...i,c],c,l),o[c.id]=!0}return{elements:i,appState:{...t,selectedElementIds:o},captureUpdate:U.IMMEDIATELY}}}),K_=380,Pre=42,GC=5,kF=85,Ure=500,YC=!1,dx=new Map,Bre=({element:e,scene:t,setAppState:n,onLinkOpen:r,setToast:a,updateEmbedValidationStatus:i})=>{let o=t.getNonDeletedElementsMap(),l=$1(),c=K1(),s=En(),d=e.link||"",[u,h]=(0,Vi.useState)(d),m=(0,Vi.useRef)(null),p=l.showHyperlinkPopup==="editor",f=(0,Vi.useCallback)(()=>{if(!m.current)return;let w=Qi(m.current.value)||null;if(!e.link&&w&&at("hyperlink","create"),Tr(e)){if(l.activeEmbeddable?.element===e&&n({activeEmbeddable:null}),!w){t.mutateElement(e,{link:null}),i(e,!1);return}if(!nh(w,c.validateEmbeddable))w&&a({message:E("toast.unableToEmbed"),closable:!0}),e.link&&dx.set(e.id,e.link),t.mutateElement(e,{link:w}),i(e,!1);else{let{width:S,height:_}=e,C=sd(w);C?.error instanceof URIError&&a({message:E("toast.unrecognizedLinkFormat"),closable:!0});let k=C?C.intrinsicSize.w/C.intrinsicSize.h:1,T=dx.get(e.id)!==e.link;t.mutateElement(e,{...T?{width:C?.type==="video"?S>_?S:_*k:S,height:C?.type==="video"&&S>_?S/k:_}:{},link:w}),i(e,!0),dx.has(e.id)&&dx.delete(e.id)}}else t.mutateElement(e,{link:w})},[e,t,a,c.validateEmbeddable,l.activeEmbeddable,n,i]);(0,Vi.useLayoutEffect)(()=>()=>{f()},[f]),(0,Vi.useEffect)(()=>{p&&m?.current&&!(s.formFactor==="phone"||s.isTouchScreen)&&m.current.select()},[p,s.formFactor,s.isTouchScreen]),(0,Vi.useEffect)(()=>{let w=null,S=_=>{p||(w&&clearTimeout(w),jre(e,o,l,N(_.clientX,_.clientY))&&(w=window.setTimeout(()=>{n({showHyperlinkPopup:!1})},Ure)))};return window.addEventListener(Q.POINTER_MOVE,S,!1),()=>{window.removeEventListener(Q.POINTER_MOVE,S,!1),w&&clearTimeout(w)}},[l,e,p,n,o]);let x=(0,Vi.useCallback)(()=>{at("hyperlink","delete"),t.mutateElement(e,{link:null}),n({showHyperlinkPopup:!1})},[n,e,t]),g=()=>{at("hyperlink","edit","popup-ui"),n({showHyperlinkPopup:"editor"})},{x:v,y:b}=TF(e,l,o);return l.contextMenu||l.selectedElementsAreBeingDragged||l.resizingElement||l.isRotating||l.openMenu||l.viewModeEnabled?null:(0,Jo.jsxs)("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${b}px`,left:`${v}px`,width:K_,padding:GC},children:[p?(0,Jo.jsx)("input",{className:H("excalidraw-hyperlinkContainer-input"),placeholder:E("labels.link.hint"),ref:m,value:u,onChange:w=>h(w.target.value),autoFocus:!0,onKeyDown:w=>{w.stopPropagation(),w[D.CTRL_OR_CMD]&&w.key===D.K&&w.preventDefault(),(w.key===D.ENTER||w.key===D.ESCAPE)&&(f(),n({showHyperlinkPopup:"info"}))}}):e.link?(0,Jo.jsx)("a",{href:Qi(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:ib(e.link)?"_self":"_blank",onClick:w=>{if(e.link&&r){let S=tb(Q.EXCALIDRAW_LINK,w.nativeEvent);r({...e,link:Qi(e.link)},S),S.defaultPrevented&&w.preventDefault()}},rel:"noopener noreferrer",children:e.link}):(0,Jo.jsx)("div",{className:"excalidraw-hyperlinkContainer-link",children:E("labels.link.empty")}),(0,Jo.jsxs)("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!p&&(0,Jo.jsx)(Me,{type:"button",title:E("buttons.edit"),"aria-label":E("buttons.edit"),label:E("buttons.edit"),onClick:g,className:"excalidraw-hyperlinkContainer--edit",icon:H1}),(0,Jo.jsx)(Me,{type:"button",title:E("labels.linkToElement"),"aria-label":E("labels.linkToElement"),label:E("labels.linkToElement"),onClick:()=>{n({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:SB}),d&&!Tr(e)&&(0,Jo.jsx)(Me,{type:"button",title:E("buttons.remove"),"aria-label":E("buttons.remove"),label:E("buttons.remove"),onClick:x,className:"excalidraw-hyperlinkContainer--remove",icon:us})]})]})},TF=(e,t,n)=>{let[r,a]=Qn(e,n),{x:i,y:o}=zn({sceneX:r+e.width/2,sceneY:a},t),l=i-t.offsetLeft-K_/2,c=o-t.offsetTop-kF;return{x:l,y:c}},jP=(e,t)=>{let n=Re(e,t);return Tr(n[0])?"labels.link.editEmbed":n[0]?.link?"labels.link.edit":"labels.link.create"},g1=null,Fre=(e,t,n)=>{g1&&clearTimeout(g1),g1=window.setTimeout(()=>Hre(e,t,n),LM)},Hre=(e,t,n)=>{if(!e.link)return;let r=p1();r.classList.add("excalidraw-tooltip--visible"),r.style.maxWidth="20rem",r.textContent=ld(e.link)?E("labels.link.goToElement"):e.link;let[a,i,o,l]=Qn(e,n),[c,s,d,u]=$A([a,i,o,l],e.angle,t),h=zn({sceneX:c,sceneY:s},t);aF(r,{left:h.x,top:h.y,width:d,height:u},"top"),at("hyperlink","tooltip","link-icon"),YC=!0},VP=()=>{g1&&clearTimeout(g1),YC&&(YC=!1,p1().classList.remove("excalidraw-tooltip--visible"))},jre=(e,t,n,[r,a])=>{let{x:i,y:o}=dt({clientX:r,clientY:a},n),l=15/n.zoom.value;if(pb(N(i,o),e,t))return!1;let[c,s,d]=Qn(e,t);if(i>=c&&i<=d&&o>=s-kF&&o<=s)return!1;let{x:u,y:h}=TF(e,n,t);return!(r>=u-l&&r<=u+K_+GC*2+l&&a>=h-l&&a<=h+l+GC*2+Pre)},AF=ee({name:"hyperlink",label:(e,t)=>jP(e,t),icon:LC,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:U.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.K,predicate:(e,t)=>Re(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=Re(e,t);return(0,MF.jsx)(Me,{type:"button",icon:LC,"aria-label":E(jP(e,t)),title:`${Tr(e[0])?E("labels.link.labelEmbed"):E("labels.link.label")} - ${Y("CtrlOrCmd+K")}`,onClick:()=>n(null),selected:r.length===1&&!!r[0].link})}}),nC=e=>e.every(t=>!t.locked),DF=ee({name:"toggleElementLock",label:(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return nC(r)?"labels.elementLock.lock":"labels.elementLock.unlock"},icon:(e,t)=>{let n=Re(t,e);return nC(n)?b_:r2},trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return a.length>0&&!a.some(i=>i.locked&&i.frameId)},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!a.length)return!1;let i=nC(a),o=me(a),l=a.length>1&&xb(a),c=a.length===1||l?null:ca(),s={...t.lockedMultiSelections};if(i)s={...t.lockedMultiSelections,...c?{[c]:!0}:{}};else if(l){let x=a[0].groupIds.at(-1);delete s[x]}let d=e.map(x=>{if(!o.has(x.id))return x;let g=x.groupIds;return i?c&&(g=[...g,c]):g=g.filter(v=>!t.lockedMultiSelections[v]),pe(x,{locked:i,groupIds:g.length!==x.groupIds.length?g:x.groupIds})}),u=me(d),h=i?{}:Object.fromEntries(a.map(x=>[x.id,!0])),m=a.map(x=>u.get(x.id)||x),p=i?{}:ad(m,t),f=i?c||(l?a[0].groupIds.at(-1):a[0].id):null;return{elements:d,appState:{...t,selectedElementIds:h,selectedGroupIds:p,selectedLinearElement:i?null:t.selectedLinearElement,lockedMultiSelections:s,activeLockedId:f},captureUpdate:U.IMMEDIATELY}},keyTest:(e,t,n,r)=>e.key.toLocaleLowerCase()===D.L&&e[D.CTRL_OR_CMD]&&e.shiftKey&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),Vre=ee({name:"unlockAllElements",trackEvent:{category:"canvas"},viewMode:!1,icon:r2,predicate:(e,t)=>Re(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let n=e.filter(o=>o.locked),r=e.map(o=>{if(o.locked){let l=o.groupIds.filter(c=>!t.lockedMultiSelections[c]);return pe(o,{locked:!1,groupIds:o.groupIds.length!==l.length?l:o.groupIds})}return o}),a=me(r),i=n.map(o=>a.get(o.id)||o);return{elements:r,appState:{...t,selectedElementIds:Object.fromEntries(n.map(o=>[o.id,!0])),selectedGroupIds:ad(i,t),lockedMultiSelections:{},activeLockedId:null},captureUpdate:U.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),Gre=8,Yre=10,l1=["rectangle","diamond","ellipse"],s1=["line","sharpArrow","curvedArrow","elbowArrow"],Wre=new Set(l1),Kre=new Set(s1),Nm=e=>Wre.has(e),Yx=e=>e==="arrow"||Kre.has(e),rs=Dt(null),C1=new Map,_1=new Map,$re=({app:e})=>{let t=e.scene.getSelectedElements(e.state),n=(0,ea.useRef)(null);return(0,ea.useEffect)(()=>{if(t.length===0){e.updateEditorAtom(rs,null);return}let r=k2(t);r&&!n.current?n.current=r:(n.current&&!r||n.current&&r!==n.current)&&(e.updateEditorAtom(rs,null),n.current=null)},[t,e]),(0,ea.useEffect)(()=>()=>{C1.clear(),_1.clear()},[]),(0,Gx.jsx)(Xre,{app:e,elements:t})},Xre=({app:e,elements:t})=>{let n=k2(t),r=(0,ea.useMemo)(()=>n==="generic"?NF(t):[],[n,t]),a=(0,ea.useMemo)(()=>n==="linear"?KC(t):[],[n,t]),i=n==="generic"?r.every(u=>u.type===r[0].type):n==="linear"?a.every(u=>rd(u)===rd(a[0])):!1,[o,l]=(0,ea.useState)({x:0,y:0}),c=(0,ea.useRef)(""),s=(0,ea.useRef)(null);(0,ea.useEffect)(()=>{let u=[...r,...a].sort((x,g)=>x.id.localeCompare(g.id)),h=`
|
|
53
|
-
${e.state.scrollX}${e.state.scrollY}${e.state.offsetTop}${e.state.offsetLeft}${e.state.zoom.value}${u.map(x=>x.id).join(",")}`;if(h===c.current)return;c.current=h;let m;if(u.length===1){let[x,,,g,v,b]=Qn(u[0],e.scene.getNonDeletedElementsMap());m=Ie(N(x,g),N(v,b),u[0].angle)}else{let{minX:x,maxY:g}=Tl(u);m=N(x,g)}let{x:p,y:f}=zn({sceneX:m[0],sceneY:m[1]},e.state);l({x:p,y:f})},[r,a,e.scene,e.state]),(0,ea.useEffect)(()=>{for(let u of a){let h=WC(u.id,eae(u));_1.has(h)||_1.set(h,u)}},[a]),(0,ea.useEffect)(()=>{for(let u of r)if(!C1.has(u.id)){let h=Le(u,e.scene.getNonDeletedElementsMap());h&&C1.set(u.id,{fontSize:h.fontSize})}},[r,e.scene]);let d=n==="linear"?[["line",w_],["sharpArrow",A_],["curvedArrow",I_],["elbowArrow",D_]]:n==="generic"?[["rectangle",v_],["diamond",y_],["ellipse",x_]]:[];return(0,Gx.jsx)("div",{ref:s,tabIndex:-1,style:{position:"absolute",top:`${o.y+(Yre+8)*e.state.zoom.value-e.state.offsetTop}px`,left:`${o.x-e.state.offsetLeft-Gre}px`,zIndex:2},className:vt.CONVERT_ELEMENT_TYPE_POPUP,children:d.map(([u,h])=>{let m=i&&(n==="generic"&&r[0].type===u||n==="linear"&&rd(a[0])===u);return(0,Gx.jsx)(Me,{className:"Shape",type:"radio",icon:h,checked:m,name:"convertElementType-option",title:u,keyBindingLabel:"","aria-label":u,"data-testid":`toolbar-${u}`,onChange:()=>{e.state.activeTool.type!==u&&at("convertElementType",u,"ui"),LF(e,{conversionType:n,nextType:u}),s.current?.focus()}},`${t[0].id}${t[0].version}_${u}`)})})},Zre=(e,t,n)=>{let r=Jp(e,t),a=mb(e,t),i=Cl(t.text,Mt(t),r),o=kt(i,Mt(t),t.lineHeight),l=t.fontSize;for(;(o.width>r||o.height>a)&&l>0;){l-=1;let c={...t,fontSize:l};o=kt(t.text,Mt(c),t.lineHeight)}Ar(t,n.getNonDeletedElementsMap(),{fontSize:l,width:o.width,height:o.height}),on(t,e,n)},LF=(e,{conversionType:t,nextType:n,direction:r="right"})=>{if(!t)return!1;let a=e.scene.getSelectedElements(e.state),i=a.reduce((l,c)=>({...l,[c.id]:!0}),{}),o=r==="right"?1:-1;if(t==="generic"){let l=NF(a),c=l.every(s=>s.type===l[0].type)?l1.indexOf(l[0].type):-1;if(n=n??l1[(c+l1.length+o)%l1.length],n&&Nm(n)){let s={};for(let u of l){let h=YP(u,n,e);s[h.id]=h}let d=[];for(let u of e.scene.getElementsIncludingDeleted())s[u.id]?d.push(s[u.id]):d.push(u);e.scene.replaceAllElements(d);for(let u of Object.values(s)){let h=Le(u,e.scene.getNonDeletedElementsMap());h&&(C1.get(u.id)&&Ar(h,e.scene.getNonDeletedElementsMap(),{fontSize:C1.get(u.id)?.fontSize??h.fontSize}),Zre(u,h,e.scene))}e.setState(u=>({selectedElementIds:i,activeTool:tt(u,{type:"selection"})}))}}if(t==="linear"){let l=KC(a);if(!n){let s=ab(l,rd),d=s?s1.indexOf(s):-1;n=s1[(d+s1.length+o)%s1.length]}if(Yx(n)){let s=[],d=e.scene.getElementsMapIncludingDeleted();for(let u of l){let h=_1.get(WC(u.id,n));if(h&&rd(h)===n)d.set(h.id,h),s.push(h);else{let m=YP(u,n,e);d.set(m.id,m),s.push(m)}}e.scene.replaceAllElements(d);for(let u of s)if(Te(u))if(ze(u)){let h=qre(u);if(h.length<2)continue;let m=[];for(let f=1;f<h.length-2;f++)m.push({start:h[f],end:h[f+1],index:f+1});let p=gb(u,e.scene.getNonDeletedElementsMap(),{points:h,fixedSegments:m});Ar(u,e.scene.getNonDeletedElementsMap(),{...p,endArrowhead:"arrow"})}else{let h=QM(["line","sharpArrow","curvedArrow"],m=>_1.get(WC(u.id,m)));if(h){let m=h.points;e.scene.mutateElement(u,{points:m})}}}let c=KC(e.scene.getSelectedElements(e.state));e.setState(s=>({selectedElementIds:i,selectedLinearElement:c.length===1?new ae(c[0],e.scene.getNonDeletedElementsMap()):null,activeTool:tt(s,{type:"selection"})}))}return!0},k2=e=>{if(e.length===0)return null;let t=!1;for(let n of e){if(Nm(n.type))return"generic";RF(n)&&(t=!0)}return t?"linear":null},RF=e=>Te(e)&&(!Oe(e)||!p8(e)&&!gn(e)),WC=(e,t)=>`${e}:${t}`,NF=e=>e.filter(t=>Nm(t.type)),KC=e=>e.filter(t=>RF(t)),ux=20,vm=(e,t)=>e[0]===t[0],rC=(e,t)=>e[1]===t[1],GP=(e,t)=>vm(e,t)?Math.abs(e[1]-t[1]):Math.abs(e[0]-t[0]),qre=e=>{let t=[e.points[0]],n=Qre(e.points);for(let i=1;i<n.length;++i){let o=t[t.length-1],l=[...n[i]];Math.abs(l[0]-o[0])<ux?l[0]=o[0]:Math.abs(l[1]-o[1])<ux&&(l[1]=o[1]),vm(o,l)||rC(o,l)||t.push(N(o[0],l[1])),t.push(l)}let r=[t[0]];for(let i=1;i<t.length-1;++i)vm(t[i-1],t[i])&&vm(t[i],t[i+1])||rC(t[i-1],t[i])&&rC(t[i],t[i+1])||r.push(t[i]);r.push(t[t.length-1]);let a=[r[0]];for(let i=1;i<r.length-1;++i){let o=a[a.length-1],l=r[i],c=r[i+1],s=vm(o,l),d=vm(l,c);if(s!==d){let u=GP(o,l),h=GP(l,c);if(u<ux||h<ux){if(h<u)s?c[0]=o[0]:c[1]=o[1];else if(d)for(let m=a.length-1;m>=0&&a[m][0]===o[0];--m)a[m][0]=l[0];else for(let m=a.length-1;m>=0&&a[m][1]===o[1];--m)a[m][1]=l[1];continue}}a.push(l)}return a.push(r[r.length-1]),a},Qre=e=>{if(e.length===0)return[];let t=[e[0]];for(let n=1;n<e.length;n++){let[r,a]=t[t.length-1],[i,o]=e[n];(r!==i||a!==o)&&t.push(e[n])}return t},YP=(e,t,n)=>{if(!Jre(e.type,t)){if(!r8())throw Error(`Invalid conversion from ${e.type} to ${t}.`);return e}if(e.type===t)return e;if(Ro.delete(e),Nm(t)){let r=_l(ua({...e,type:t,roundness:t==="diamond"&&e.roundness?{type:Os(t)?zt.ADAPTIVE_RADIUS:zt.PROPORTIONAL_RADIUS}:e.roundness}));return Us(r,n.scene,n.state),r}if(Yx(t))switch(t){case"line":return _l(Vr({...e,type:"line"}));case"sharpArrow":return _l(th({...e,type:"arrow",elbowed:!1,roundness:null,startArrowhead:n.state.currentItemStartArrowhead,endArrowhead:n.state.currentItemEndArrowhead}));case"curvedArrow":return _l(th({...e,type:"arrow",elbowed:!1,roundness:{type:zt.PROPORTIONAL_RADIUS},startArrowhead:n.state.currentItemStartArrowhead,endArrowhead:n.state.currentItemEndArrowhead}));case"elbowArrow":return _l(th({...e,type:"arrow",elbowed:!0,fixedSegments:null,roundness:null}))}return nb(t,`unhandled conversion type: ${t}`),e},Jre=(e,t)=>!!(Nm(e)&&Nm(t)||Yx(e)&&Yx(t)),eae=e=>Te(e)?rd(e):e.type,tae=$re,nae=ee({name:"toggleShapeSwitch",label:"labels.shapeSwitch",icon:()=>null,viewMode:!0,trackEvent:{category:"shape_switch",action:"toggle"},keywords:["change","switch","swap"],perform(e,t,n,r){return Qa.set(rs,{type:"panel"}),{captureUpdate:U.NEVER}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>k2(e)!==null}),OF=ee({name:"copyElementLink",label:"labels.copyElementLink",icon:__,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let a=Re(e,t);try{if(window.location){let i=Ib(a,t);return i?(await Y1(r.props.generateLinkForSelection?r.props.generateLinkForSelection(i.id,i.type):Db(i.id,i.type)),{appState:{toast:{message:E("toast.elementLinkCopied"),closable:!0}},captureUpdate:U.EVENTUALLY}):{appState:t,elements:e,app:r,captureUpdate:U.EVENTUALLY}}}catch(i){console.error(i)}return{appState:t,elements:e,app:r,captureUpdate:U.EVENTUALLY}},predicate:(e,t)=>Lb(Re(e,t))}),rae=ee({name:"linkToElement",label:"labels.linkToElement",icon:SB,perform:(e,t,n,r)=>{let a=Re(e,t);return a.length!==1||!Lb(a)?{elements:e,appState:t,app:r,captureUpdate:U.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:Re(e,t)[0].id}},captureUpdate:U.IMMEDIATELY}},predicate:(e,t,n,r)=>{let a=Re(e,t);return t.openDialog?.name!=="elementLinkSelector"&&a.length===1&&Lb(a)},trackEvent:!1}),aae={toggleTheme:[Y("Shift+Alt+D")],saveScene:[Y("CtrlOrCmd+S")],loadScene:[Y("CtrlOrCmd+O")],clearCanvas:[Y("CtrlOrCmd+Delete")],imageExport:[Y("CtrlOrCmd+Shift+E")],commandPalette:[Y("CtrlOrCmd+/"),Y("CtrlOrCmd+Shift+P")],cut:[Y("CtrlOrCmd+X")],copy:[Y("CtrlOrCmd+C")],paste:[Y("CtrlOrCmd+V")],copyStyles:[Y("CtrlOrCmd+Alt+C")],pasteStyles:[Y("CtrlOrCmd+Alt+V")],selectAll:[Y("CtrlOrCmd+A")],deleteSelectedElements:[Y("Delete")],duplicateSelection:[Y("CtrlOrCmd+D"),Y(`Alt+${E("helpDialog.drag")}`)],sendBackward:[Y("CtrlOrCmd+[")],bringForward:[Y("CtrlOrCmd+]")],sendToBack:[Y(la?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Y(la?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Y("Shift+Alt+C")],group:[Y("CtrlOrCmd+G")],ungroup:[Y("CtrlOrCmd+Shift+G")],gridMode:[Y("CtrlOrCmd+'")],zenMode:[Y("Alt+Z")],objectsSnapMode:[Y("Alt+S")],stats:[Y("Alt+/")],addToLibrary:[],flipHorizontal:[Y("Shift+H")],flipVertical:[Y("Shift+V")],viewMode:[Y("Alt+R")],hyperlink:[Y("CtrlOrCmd+K")],toggleElementLock:[Y("CtrlOrCmd+Shift+L")],resetZoom:[Y("CtrlOrCmd+0")],zoomOut:[Y("CtrlOrCmd+-")],zoomIn:[Y("CtrlOrCmd++")],zoomToFitSelection:[Y("Shift+3")],zoomToFit:[Y("Shift+1")],zoomToFitSelectionInViewport:[Y("Shift+2")],toggleEraserTool:[Y("E")],toggleHandTool:[Y("H")],setFrameAsActiveTool:[Y("F")],saveFileToDisk:[Y("CtrlOrCmd+S")],saveToActiveFile:[Y("CtrlOrCmd+S")],toggleShortcuts:[Y("?")],searchMenu:[Y("CtrlOrCmd+F")],wrapSelectionInFrame:[],toolLock:[Y("Q")]},hn=(e,t=0)=>{let n=aae[e];return n&&n.length>0?n[t]||n[0]:""},iae="\\u0300-\\u036f",oae="\\ufe20-\\ufe2f",lae="\\u20d0-\\u20ff",sae=iae+oae+lae,cae=`[${sae}]`,dae=RegExp(cae,"g"),uae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hae={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"E",\u00E6:"e",\u00DE:"T",\u00FE:"t",\u00DF:"s",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"I",\u0133:"i",\u0152:"E",\u0153:"e",\u0149:"n",\u017F:"s"},b1=e=>e.replace(uae,t=>hae[t]||t).replace(dae,""),mae=()=>{let[e,t]=(0,M2.useState)(null),n=(0,M2.useCallback)(r=>t(r),[]);return[e,n]},$_=({elements:e,appState:t,files:n,maxWidthOrHeight:r,getDimensions:a,exportPadding:i,exportingFrame:o})=>{let l=cd(e,null,{deleteInvisibleElements:!0}),c=sh(t,null),{exportBackground:s,viewBackgroundColor:d}=c;return P3(l,{...c,offsetTop:0,offsetLeft:0,width:0,height:0},n||{},{exportBackground:s,exportPadding:i,viewBackgroundColor:d,exportingFrame:o},(u,h)=>{let m=document.createElement("canvas");if(r){typeof a=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let f=Math.max(u,h),x=r<f?r/f:t?.exportScale??1;return m.width=u*x,m.height=h*x,{canvas:m,scale:x}}let p=a?.(u,h)||{width:u,height:h};return m.width=p.width,m.height=p.height,{canvas:m,scale:p.scale??1}})};var PF=async({elements:e,appState:t=ih(),files:n={},exportPadding:r,renderEmbeddables:a,exportingFrame:i,skipInliningFonts:o,reuseImages:l})=>{let c=cd(e,null,{deleteInvisibleElements:!0}),s={...sh(t,null),exportPadding:r};return gf(c,s,n,{exportingFrame:i,renderEmbeddables:a,skipInliningFonts:o,reuseImages:l})};var UF=Dt(new Map),WP=async e=>await PF({elements:e,appState:{exportBackground:!1,viewBackgroundColor:_r.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),BF=(e,t,n,r)=>{let[a,i]=(0,k1.useState)();return(0,k1.useEffect)(()=>{if(t)if(e){let o=n.get(e);o?i(o):(async()=>{let l=await WP(t);l.querySelector(".style-fonts")?.remove(),l&&(n.set(e,l),i(l))})()}else(async()=>{let o=await WP(t);i(o)})()},[e,t,n,i]),(0,k1.useEffect)(()=>{let o=r.current;if(o)return a&&(o.innerHTML=a.outerHTML),()=>{o.innerHTML=""}},[a,r]),a},X_=()=>{let[e]=Fe(UF);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(n=>e.delete(n))},svgCache:e}};var pae=new di,Om=Dt({status:"loaded",isInitialized:!1,libraryItems:[]}),qg=e=>qi(e),fae=(e,t)=>!e.find(n=>n.elements.length!==t.elements.length?!1:n.elements.every((r,a)=>r.id===t.elements[a].id&&r.versionNonce===t.elements[a].versionNonce)),gae=(e,t)=>{let n=[];for(let r of t)fae(e,r)&&n.push(r);return[...n,...e]},bae=(e,t)=>{let n=me(t),r={deletedItems:new Map,addedItems:new Map,updatedItems:new Map};for(let i of e)n.has(i.id)||r.deletedItems.set(i.id,i);let a=me(e);for(let i of t){let o=a.get(i.id);o?KP(o)!==KP(i)&&r.updatedItems.set(i.id,i):r.addedItems.set(i.id,i)}return r},vae=class{constructor(e){L(this,"currLibraryItems",[]),L(this,"prevLibraryItems",qg(this.currLibraryItems)),L(this,"app"),L(this,"updateQueue",[]),L(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),L(this,"notifyListeners",()=>{if(this.updateQueue.length>0)Qa.set(Om,t=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:t.isInitialized}));else{Qa.set(Om,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let t=this.prevLibraryItems;this.prevLibraryItems=qg(this.currLibraryItems);let n=qg(this.currLibraryItems);this.app.props.onLibraryChange?.(n),pae.trigger(bae(t,n),n)}catch(t){console.error(t)}}}),L(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],Qa.set(UF,new Map)}),L(this,"resetLibrary",()=>this.setLibrary([])),L(this,"getLatestLibrary",()=>new Promise(async t=>{try{let n=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(qg(n))}catch{return t(this.currLibraryItems)}})),L(this,"updateLibrary",async({libraryItems:t,prompt:n=!1,merge:r=!1,openLibraryMenu:a=!1,defaultStatus:i="unpublished"})=>(a&&this.app.setState({openSidebar:{name:kr.name,tab:jp}}),this.setLibrary(()=>new Promise(async(o,l)=>{try{let c=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),s;c instanceof Blob?s=await i7(c,i):s=U3(c,i),!n||window.confirm(E("alerts.confirmAddLibrary",{numShapes:s.length}))?(n&&this.app.focusContainer(),o(r?gae(this.currLibraryItems,s):s)):l(new Pb)}catch(c){l(c)}})))),L(this,"setLibrary",t=>{let n=new Promise(async(r,a)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=qg(await t),r(this.currLibraryItems)}catch(i){a(i)}}).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}},yae=vae,Z_=e=>{let t=Math.ceil(Math.sqrt(e.length)),n=[],r=h=>e.slice(h*t,h*t+t).reduce((m,p)=>{let{height:f}=Tl(p.elements);return Math.max(m,f)},0),a=h=>{let m=0,p=0,f=0;for(let x of e){if(m%t===0&&(p=0),p===h){let{width:g}=Tl(x.elements);f=Math.max(f,g)}m++,p++}return f},i=0,o=0,l=0,c=0,s=0,d=0,u=0;for(let h of e){s&&s%t===0&&(o+=l+50,i=0,d=0,u++),d===0&&(l=r(u)),c=a(d);let{minX:m,minY:p,width:f,height:x}=Tl(h.elements),g=(c-f)/2,v=(l-x)/2;n.push(...h.elements.map(b=>({...b,x:b.x+i+g-m,y:b.y+o+v-p}))),i+=c+50,s++,d++}return n};var hx=class $C{constructor(t){L(this,"adapter"),this.adapter=t}static async getLibraryItems(t,n,r=!0){let a=()=>new Promise(async(i,o)=>{try{let l=await t.load({source:n});i(U3(l?.libraryItems||[],"published"))}catch(l){o(l)}});return r?$C.queue.push(a):a()}getLibraryItems(t){return $C.getLibraryItems(this.adapter,t,!1)}};L(hx,"queue",new BM),L(hx,"run",async(e,t)=>{let n=new hx(e);return hx.queue.push(()=>t(n))});var KP=e=>`${e.id}:${e.name||""}:${A3(e.elements)}`;var xae=({theme:e,id:t,libraryReturnUrl:n})=>{let r=n||window.location.origin+window.location.pathname;return(0,FF.jsx)("a",{className:"library-menu-browse-button",href:`${_s.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${r}&useHash=true&token=${t}&theme=${e}&version=${Y0.excalidrawLibrary}`,target:"_excalidraw_libraries",children:E("labels.libraries")})},wae=xae,HF=({libraryReturnUrl:e,theme:t,id:n,style:r,children:a,className:i})=>(0,A2.jsxs)("div",{className:H("library-menu-control-buttons",i),style:r,children:[(0,A2.jsx)(wae,{id:n,libraryReturnUrl:e,theme:t}),a]}),Eae=Dt(0),Sae=e=>{let[t,n]=Fe(Eae);return(0,VF.useEffect)(()=>{let{current:r}=e;if(!r)return;let a=(0,jF.default)(()=>{let{scrollTop:i}=r;n(i)},200);return r.addEventListener("scroll",a),()=>{a.cancel(),r.removeEventListener("scroll",a)}},[e,n]),t},Cae=({label:e,onClick:t,className:n,children:r,actionType:a,type:i="button",isLoading:o,...l})=>{let c=a?`Dialog__action-button--${a}`:"";return(0,Wd.jsxs)("button",{className:H("Dialog__action-button",c,n),type:i,"aria-label":e,onClick:t,...l,children:[r&&(0,Wd.jsx)("div",{style:o?{visibility:"hidden"}:{},children:r}),(0,Wd.jsx)("div",{style:o?{visibility:"hidden"}:{},children:e}),o&&(0,Wd.jsx)("div",{style:{position:"absolute",inset:0},children:(0,Wd.jsx)(il,{})})]})},zm=Cae,_ae=e=>{let{onConfirm:t,onCancel:n,children:r,confirmText:a=E("buttons.confirm"),cancelText:i=E("buttons.cancel"),className:o="",...l}=e,c=fn(),s=F1(J_),{container:d}=za();return(0,Pm.jsxs)(So,{onCloseRequest:n,size:"small",...l,className:`confirm-dialog ${o}`,children:[r,(0,Pm.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,Pm.jsx)(zm,{label:i,onClick:()=>{c({openMenu:null}),s(!1),(0,XC.flushSync)(()=>{n()}),d?.focus()}}),(0,Pm.jsx)(zm,{label:a,onClick:()=>{c({openMenu:null}),s(!1),(0,XC.flushSync)(()=>{t()}),d?.focus()},actionType:"danger"})]})]})},GF=_ae,Jd=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}}};L(Jd,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),L(Jd,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var kae=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,Tae=/{{([\w-]+)}}/,Mae=/<([\w-]+)>/,Aae=/<\/([\w-]+)>/,Dae=(e,t)=>{let n=[{name:"",children:[]}];return e.split(kae).filter(Boolean).forEach(r=>{let a=r.match(Mae),i=r.match(Aae),o=r.match(Tae);if(a!==null){let l=a[1];t.hasOwnProperty(l)?n.push({name:l,children:[]}):console.warn(`Trans: missed to pass in prop ${l} for interpolating ${e}`)}else if(i!==null)if(i[1]===n[n.length-1].name){let l=n.pop(),c=T1.default.createElement(T1.default.Fragment,{},...l.children),s=t[l.name];typeof s=="function"&&n[n.length-1].children.push(s(c))}else console.warn(`Trans: unexpected end tag ${r} for interpolating ${e}`);else if(o!==null){let l=o[1];t.hasOwnProperty(l)?n[n.length-1].children.push(t[l]):console.warn(`Trans: key ${l} 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},Iae=({i18nKey:e,children:t,...n})=>{let{t:r}=Lt();return T1.default.createElement(T1.default.Fragment,{},...Dae(r(e),n))},nl=Iae,Lae=async e=>{let t=Math.round(8),n=Math.max(Math.round(128/64),2),r=qM(e,6),a=document.createElement("canvas");a.width=r[0].length*128+(r[0].length+1)*(t*2)-t*2,a.height=r.length*128+(r.length+1)*(t*2)-t*2;let i=a.getContext("2d");i.fillStyle="#fff",i.fillRect(0,0,a.width,a.height);for(let[o,l]of e.entries()){let c=await $_({elements:l.elements,files:null,maxWidthOrHeight:128}),{width:s,height:d}=c,u=Math.floor(o/6)*(128+t*2),h=o%6*(128+t*2);i.drawImage(c,h+(128-s)/2+t,u+(128-d)/2+t),i.lineWidth=n,i.strokeStyle="#ced4da",i.strokeRect(h+t/2,u+t/2,128+t,128+t)}return await H3(new File([await bf(a)],"preview",{type:_e.png}),{outputType:_e.jpg,maxWidthOrHeight:5e3})},Rae=({libItem:e,appState:t,index:n,onChange:r,onRemove:a})=>{let i=(0,ei.useRef)(null),o=(0,ei.useRef)(null);return(0,ei.useEffect)(()=>{let l=i.current;l&&(async()=>{let c=await PF({elements:e.elements,appState:{...t,viewBackgroundColor:"#fff",exportBackground:!0},files:null,skipInliningFonts:!0});l.innerHTML=c.outerHTML})()},[e.elements,t]),(0,de.jsxs)("div",{className:"single-library-item",children:[e.status==="published"&&(0,de.jsx)("span",{className:"single-library-item-status",children:E("labels.statusPublished")}),(0,de.jsx)("div",{ref:i,className:"single-library-item__svg"}),(0,de.jsx)(Me,{"aria-label":E("buttons.remove"),type:"button",icon:Hm,className:"single-library-item--remove",onClick:a.bind(null,e.id),title:E("buttons.remove")}),(0,de.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,de.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,de.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,de.jsx)("span",{style:{fontWeight:500,color:"#868e96"},children:E("publishDialog.itemName")}),(0,de.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,de.jsx)("input",{type:"text",ref:o,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:l=>{r(l.target.value,n)}})]}),(0,de.jsx)("span",{className:"error",children:e.error})]})]})},Nae=({onClose:e,libraryItems:t,appState:n,onSuccess:r,onError:a,updateItemsInStorage:i,onRemove:o})=>{let[l,c]=(0,ei.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[s,d]=(0,ei.useState)(!1);(0,ei.useEffect)(()=>{let b=Jd.get(Ds.PUBLISH_LIBRARY);b&&c(b)},[]);let[u,h]=(0,ei.useState)(t.slice());(0,ei.useEffect)(()=>{h(t.slice())},[t]);let m=b=>{c({...l,[b.target.name]:b.target.value})},p=async b=>{b.preventDefault(),d(!0);let w=[],S=!1;if(u.forEach(A=>{let O="";A.name||(O=E("publishDialog.errors.required"),S=!0),w.push({...A,error:O})}),S){h(w),d(!1);return}let _=await Lae(u),C={type:Ts.excalidrawLibrary,version:Y0.excalidrawLibrary,source:TM(),libraryItems:u},k=JSON.stringify(C,null,2),T=new Blob([k],{type:"application/json"}),I=new FormData;I.append("excalidrawLib",T),I.append("previewImage",_),I.append("previewImageType",_.type),I.append("title",l.name),I.append("authorName",l.authorName),I.append("githubHandle",l.githubHandle),I.append("name",l.name),I.append("description",l.description),I.append("twitterHandle",l.twitterHandle),I.append("website",l.website),fetch(`${_s.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:I}).then(A=>A.ok?A.json().then(({url:O})=>{Jd.delete(Ds.PUBLISH_LIBRARY),r({url:O,authorName:l.authorName,items:u})}):A.json().catch(()=>{throw new Error(A.statusText||"something went wrong")}).then(O=>{throw new Error(O.message||A.statusText||"something went wrong")}),A=>{console.error(A),a(A),d(!1)}).catch(A=>{console.error(A),a(A),d(!1)})},f=()=>{let b=[];return u.forEach((w,S)=>{b.push((0,de.jsx)("div",{className:"single-library-item-wrapper",children:(0,de.jsx)(Rae,{libItem:w,appState:n,index:S,onChange:(_,C)=>{let k=u.slice();k[C].name=_,h(k)},onRemove:o})},S))}),(0,de.jsx)("div",{className:"selected-library-items",children:b})},x=(0,ei.useCallback)(()=>{i(u),Jd.set(Ds.PUBLISH_LIBRARY,l),e()},[u,e,i,l]),g=!!t.length,v=t.some(b=>b.status==="published");return(0,de.jsx)(So,{onCloseRequest:x,title:E("publishDialog.title"),className:"publish-library",children:g?(0,de.jsxs)("form",{onSubmit:p,children:[(0,de.jsx)("div",{className:"publish-library-note",children:(0,de.jsx)(nl,{i18nKey:"publishDialog.noteDescription",link:b=>(0,de.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener",children:b})})}),(0,de.jsx)("span",{className:"publish-library-note",children:(0,de.jsx)(nl,{i18nKey:"publishDialog.noteGuidelines",link:b=>(0,de.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:b})})}),(0,de.jsx)("div",{className:"publish-library-note",children:E("publishDialog.noteItems")}),v&&(0,de.jsx)("span",{className:"publish-library-note publish-library-warning",children:E("publishDialog.republishWarning")}),f(),(0,de.jsxs)("div",{className:"publish-library__fields",children:[(0,de.jsxs)("label",{children:[(0,de.jsxs)("div",{children:[(0,de.jsx)("span",{children:E("publishDialog.libraryName")}),(0,de.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,de.jsx)("input",{type:"text",name:"name",required:!0,value:l.name,onChange:m,placeholder:E("publishDialog.placeholder.libraryName")})]}),(0,de.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,de.jsxs)("div",{children:[(0,de.jsx)("span",{children:E("publishDialog.libraryDesc")}),(0,de.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,de.jsx)("textarea",{name:"description",rows:4,required:!0,value:l.description,onChange:m,placeholder:E("publishDialog.placeholder.libraryDesc")})]}),(0,de.jsxs)("label",{children:[(0,de.jsxs)("div",{children:[(0,de.jsx)("span",{children:E("publishDialog.authorName")}),(0,de.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,de.jsx)("input",{type:"text",name:"authorName",required:!0,value:l.authorName,onChange:m,placeholder:E("publishDialog.placeholder.authorName")})]}),(0,de.jsxs)("label",{children:[(0,de.jsx)("span",{children:E("publishDialog.githubUsername")}),(0,de.jsx)("input",{type:"text",name:"githubHandle",value:l.githubHandle,onChange:m,placeholder:E("publishDialog.placeholder.githubHandle")})]}),(0,de.jsxs)("label",{children:[(0,de.jsx)("span",{children:E("publishDialog.twitterUsername")}),(0,de.jsx)("input",{type:"text",name:"twitterHandle",value:l.twitterHandle,onChange:m,placeholder:E("publishDialog.placeholder.twitterHandle")})]}),(0,de.jsxs)("label",{children:[(0,de.jsx)("span",{children:E("publishDialog.website")}),(0,de.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:E("publishDialog.errors.website"),value:l.website,onChange:m,placeholder:E("publishDialog.placeholder.website")})]}),(0,de.jsx)("span",{className:"publish-library-note",children:(0,de.jsx)(nl,{i18nKey:"publishDialog.noteLicense",link:b=>(0,de.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:b})})})]}),(0,de.jsxs)("div",{className:"publish-library__buttons",children:[(0,de.jsx)(zm,{label:E("buttons.saveLibNames"),onClick:x,"data-testid":"cancel-clear-canvas-button"}),(0,de.jsx)(zm,{type:"submit",label:E("buttons.submit"),actionType:"primary",isLoading:s})]})]}):(0,de.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:E("publishDialog.atleastOneLibItem")})})},Oae=Nae,zae=(0,q_.forwardRef)(({children:e,gap:t,align:n,justifyContent:r,className:a,style:i},o)=>(0,Q_.jsx)("div",{className:H("Stack Stack_horizontal",a),style:{"--gap":t,alignItems:n,justifyContent:r,...i},ref:o,children:e})),Pae=(0,q_.forwardRef)(({children:e,gap:t,align:n,justifyContent:r,className:a,style:i},o)=>(0,Q_.jsx)("div",{className:H("Stack Stack_vertical",a),style:{"--gap":t,justifyItems:n,justifyContent:r,...i},ref:o,children:e})),rl={Row:zae,Col:Pae},YF=({children:e,onClickOutside:t,className:n="",onSelect:r,open:a=!0,align:i="end",style:o})=>{let l=En(),c=(0,$m.useRef)(null),s=c2({onClickOutside:t});N_(c,(0,$m.useCallback)(u=>{c.current?.closest(`.${vt.DROPDOWN_MENU_EVENT_WRAPPER}`)?.contains(u.target)||s.onClickOutside?.()},[s])),(0,$m.useEffect)(()=>{if(!a)return;let u=m=>{m.key===D.ESCAPE&&(m.stopImmediatePropagation(),s.onClickOutside?.())},h={capture:!0};return document.addEventListener(Q.KEYDOWN,u,h),()=>{document.removeEventListener(Q.KEYDOWN,u,h)}},[s,a]);let d=H(`dropdown-menu ${n}`,{"dropdown-menu--mobile":l.formFactor==="phone"}).trim();return(0,c1.jsx)(XB.Provider,{value:{onSelect:r},children:(0,c1.jsx)(rr.Content,{ref:c,className:d,style:o,"data-testid":"dropdown-menu",align:i,sideOffset:8,onCloseAutoFocus:u=>u.preventDefault(),children:l.formFactor==="phone"?(0,c1.jsx)(rl.Col,{className:"dropdown-menu-container",children:e}):(0,c1.jsx)(Ja,{className:"dropdown-menu-container",padding:2,children:e})})})};YF.displayName="DropdownMenuContent";var Uae=YF,Bae=({children:e,className:t="",selected:n,...r})=>(0,WF.jsx)("div",{...r,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${n?"dropdown-menu-item--selected":""}`.trim(),children:e}),Fae=Bae,KF=({icon:e,shortcut:t,href:n,children:r,onSelect:a,className:i="",selected:o,rel:l="noopener",...c})=>{let s=ZB(a);return(0,Mx.jsx)(rr.Item,{className:"radix-menu-item",onSelect:s,asChild:!0,children:(0,Mx.jsx)("a",{...c,href:n,target:"_blank",rel:`noopener ${l}`,className:x2(i,o),title:c.title??c["aria-label"],children:(0,Mx.jsx)(w2,{icon:e,shortcut:t,children:r})})})},Ax=KF;KF.displayName="DropdownMenuItemLink";var XF=()=>(0,$F.jsx)("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:"6px 0",flex:"0 0 auto"}}),Hae=XF;XF.displayName="DropdownMenuSeparator";var aC=-4,jae=4,ZF=({children:e,className:t})=>{let n=En(),r=H(`dropdown-menu dropdown-submenu ${t}`,{"dropdown-menu--mobile":n.formFactor==="phone"}).trim(),a=(0,M1.useCallback)(s=>{if(s){let d=s.closest(".dropdown-menu-container")?.getBoundingClientRect();if(d){let u=s.getBoundingClientRect().width,h=window.innerWidth-d.right;h<u+20&&(o(h-u+aC),c(aC+8))}}},[]),[i,o]=(0,M1.useState)(jae),[l,c]=(0,M1.useState)(aC);return(0,Dx.jsx)(rr.SubContent,{className:r,sideOffset:i,alignOffset:l,collisionPadding:8,ref:a,children:n.formFactor==="phone"?(0,Dx.jsx)(rl.Col,{className:"dropdown-menu-container",children:e}):(0,Dx.jsx)(Ja,{className:"dropdown-menu-container",padding:2,style:{zIndex:1},children:e})})},Vae=ZF;ZF.displayName="DropdownMenuSubContent";var qF=({children:e,icon:t,shortcut:n,className:r})=>(0,A1.jsxs)(rr.SubTrigger,{className:`${x2(r)} dropdown-menu__submenu-trigger`,children:[(0,A1.jsx)(w2,{icon:t,shortcut:n,children:e}),(0,A1.jsx)("div",{className:"dropdown-menu__submenu-trigger-icon",children:ene})]}),Gae=qF;qF.displayName="DropdownMenuSubTrigger";var D2=e=>t=>qC.default.Children.toArray(t).find(r=>qC.default.isValidElement(r)&&typeof r.type!="string"&&r?.type.displayName&&r.type.displayName===e)||null,Yae=D2("DropdownMenuTrigger"),Wae=D2("DropdownMenuContent"),Kae=D2("DropdownMenuSubTrigger"),$ae=D2("DropdownMenuSubContent"),I2=({children:e})=>{let t=Kae(e),n=$ae(e);return(0,QF.jsxs)(rr.Sub,{children:[t,n]})};I2.Trigger=Gae;I2.Content=Vae;I2.displayName="DropdownMenuSub";var v1=I2,eH=({className:e="",children:t,onToggle:n,title:r,...a})=>{let i=En(),o=H(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":i.formFactor==="phone"}).trim();return(0,JF.jsx)(rr.Trigger,{className:o,onClick:n,type:"button","data-testid":"dropdown-menu-button",title:r,...a,children:t})},Xae=eH;eH.displayName="DropdownMenuTrigger";var Zae=e=>(0,tH.jsx)(Yi,{...e,icon:e.checked?uB:Jte}),fs=Zae,Eo=({children:e,open:t})=>{let n=Yae(e),r=Wae(e),a=r&&ZC.default.isValidElement(r)?ZC.default.cloneElement(r,{open:t}):r;return(0,L2.jsx)(rr.Root,{open:t,modal:!1,children:(0,L2.jsxs)("div",{className:vt.DROPDOWN_MENU_EVENT_WRAPPER,style:{display:"contents"},children:[n,a]})})};Eo.Trigger=Xae;Eo.Content=Uae;Eo.Item=Yi;Eo.ItemCheckbox=fs;Eo.ItemLink=Ax;Eo.ItemCustom=Fae;Eo.Group=BC;Eo.Separator=Hae;Eo.Sub=v1;var Ae=Eo;Eo.displayName="DropdownMenu";var qae=(e,t)=>e.filter(n=>t.includes(n.id)),Qae=({setAppState:e,selectedItems:t,library:n,onRemoveFromLibrary:r,resetLibrary:a,onSelectItems:i,appState:o,className:l})=>{let[c]=Fe(Om),[s,d]=Fe(J_),u=()=>{let I=t.length?E("alerts.removeItemsFromsLibrary",{count:t.length}):E("alerts.resetLibrary"),A=t.length?E("confirmDialog.removeItemsFromLib"):E("confirmDialog.resetLibrary");return(0,In.jsx)(GF,{onConfirm:()=>{t.length?r():a(),m(!1)},onCancel:()=>{m(!1)},title:A,children:(0,In.jsx)("p",{children:I})})},[h,m]=(0,Mm.useState)(!1),p=!!t.length,f=p?c.libraryItems.filter(I=>t.includes(I.id)):c.libraryItems,x=E(p?"buttons.remove":"buttons.resetLibrary"),[g,v]=(0,Mm.useState)(!1),[b,w]=(0,Mm.useState)(null),S=(0,Mm.useCallback)(()=>(0,In.jsxs)(So,{onCloseRequest:()=>w(null),title:E("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[(0,In.jsx)("p",{children:(0,In.jsx)(nl,{i18nKey:"publishSuccessDialog.content",authorName:b.authorName,link:I=>(0,In.jsx)("a",{href:b?.url,target:"_blank",rel:"noopener noreferrer",children:I})})}),(0,In.jsx)(Me,{type:"button",title:E("buttons.close"),"aria-label":E("buttons.close"),label:E("buttons.close"),onClick:()=>w(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[w,b]),_=(I,A)=>{v(!1),w({url:I.url,authorName:I.authorName});let O=A.slice();O.forEach(V=>{t.includes(V.id)&&(V.status="published")}),n.setLibrary(O)},C=async()=>{try{await n.updateLibrary({libraryItems:L3({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(I){if(I?.name==="AbortError"){console.warn(I);return}e({errorMessage:E("errors.importLibraryError")})}},k=async()=>{let I=p?f:await n.getLatestLibrary();KA(I).catch(J0).catch(A=>{e({errorMessage:A.message})})},T=()=>(0,In.jsxs)(Ae,{open:s,children:[(0,In.jsx)(Ae.Trigger,{onToggle:()=>d(!s),children:uee}),(0,In.jsxs)(Ae.Content,{onClickOutside:()=>d(!1),onSelect:()=>d(!1),className:"library-menu",children:[!p&&(0,In.jsx)(Ae.Item,{onSelect:C,icon:S_,"data-testid":"lib-dropdown--load",children:E("buttons.load")}),!!f.length&&(0,In.jsx)(Ae.Item,{onSelect:k,icon:i2,"data-testid":"lib-dropdown--export",children:E("buttons.export")}),p&&(0,In.jsx)(Ae.Item,{icon:xte,onSelect:()=>v(!0),"data-testid":"lib-dropdown--remove",children:E("buttons.publishLibrary")}),!!f.length&&(0,In.jsx)(Ae.Item,{onSelect:()=>m(!0),icon:us,children:x})]})]});return(0,In.jsxs)("div",{className:H("library-menu-dropdown-container",l),children:[T(),t.length>0&&(0,In.jsx)("div",{className:"library-actions-counter",children:t.length}),h&&u(),g&&(0,In.jsx)(Oae,{onClose:()=>v(!1),libraryItems:qae(c.libraryItems,t),appState:o,onSuccess:I=>_(I,c.libraryItems),onError:I=>window.alert(I),updateItemsInStorage:()=>n.setLibrary(c.libraryItems),onRemove:I=>i(t.filter(A=>A!==I))}),b&&S()]})},Jae=({selectedItems:e,onSelectItems:t,className:n})=>{let{library:r}=Wi(),{clearLibraryCache:a,deleteItemsFromLibraryCache:i}=X_(),o=pt(),l=fn(),[c]=Fe(Om),s=async d=>{let u=d.filter(h=>!e.includes(h.id));r.setLibrary(u).catch(()=>{l({errorMessage:E("alerts.errorRemovingFromLibrary")})}),i(e),t([])};return(0,In.jsx)(Qae,{appState:o,setAppState:l,selectedItems:e,onSelectItems:t,library:r,onRemoveFromLibrary:()=>s(c.libraryItems),resetLibrary:()=>{r.resetLibrary(),a()},className:n})};function eie(){return[!1,(0,R2.useCallback)(e=>e(),[])]}var tie=R2.default.useTransition||eie,nie=(0,Zm.memo)(({id:e,elements:t,isPending:n,onClick:r,selected:a,onToggle:i,onDrag:o,svgCache:l})=>{let c=(0,Zm.useRef)(null),s=BF(e,t,l,c),[d,u]=(0,Zm.useState)(!1),h=En().formFactor==="phone",m=n&&(0,eu.jsx)("div",{className:"library-unit__adder",children:dee});return(0,eu.jsxs)("div",{className:H("library-unit",{"library-unit__active":t,"library-unit--hover":t&&d,"library-unit--selected":a,"library-unit--skeleton":!s}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[(0,eu.jsx)("div",{className:H("library-unit__dragger",{"library-unit__pulse":!!n}),ref:c,draggable:!!t,onClick:t||n?p=>{e&&p.shiftKey?i(e,p):r(e)}:void 0,onDragStart:p=>{if(!e){p.preventDefault();return}u(!1),o(e,p)}}),m,e&&t&&(d||h||a)&&(0,eu.jsx)(j_,{checked:a,onChange:(p,f)=>i(e,f),className:"library-unit__checkbox"})]})}),rie=()=>(0,eu.jsx)("div",{className:"library-unit library-unit--skeleton"}),iC=({children:e})=>(0,tu.jsx)("div",{className:"library-menu-items-container__grid",children:e}),mx=(0,Xm.memo)(({items:e,onItemSelectToggle:t,onItemDrag:n,isItemSelected:r,onClick:a,svgCache:i,itemsRenderedPerBatch:o})=>{let[,l]=tie(),[c,s]=(0,Xm.useState)(0);return(0,Xm.useEffect)(()=>{c<e.length&&l(()=>{s(c+o)})},[c,e.length,l,o]),(0,tu.jsx)(tu.Fragment,{children:e.map((d,u)=>u<c?(0,tu.jsx)(nie,{elements:d?.elements,isPending:!d?.id&&!!d?.elements,onClick:a,svgCache:i,id:d?.id,selected:r(d.id),onToggle:t,onDrag:n},d?.id??u):(0,tu.jsx)(rie,{},u))})}),hs=({type:e="button",onSelect:t,selected:n,children:r,className:a="",...i})=>(0,nH.jsx)("button",{onClick:Rs(i.onClick,o=>{t()}),type:e,className:H("excalidraw-button",a,{selected:n}),...i,children:r}),N2=(0,ll.forwardRef)(({onChange:e,label:t,fullWidth:n,placeholder:r,readonly:a,selectOnRender:i,onKeyDown:o,isRedacted:l=!1,icon:c,className:s,type:d,...u},h)=>{let m=(0,ll.useRef)(null);(0,ll.useImperativeHandle)(h,()=>m.current),(0,ll.useLayoutEffect)(()=>{i&&(m.current?.focus(),m.current?.select())},[i]);let[p,f]=(0,ll.useState)(!1);return(0,nu.jsxs)("div",{className:H("ExcTextField",s,{"ExcTextField--fullWidth":n,"ExcTextField--hasIcon":!!c}),onClick:()=>{m.current?.focus()},children:[c,t&&(0,nu.jsx)("div",{className:"ExcTextField__label",children:t}),(0,nu.jsxs)("div",{className:H("ExcTextField__input",{"ExcTextField__input--readonly":a}),children:[(0,nu.jsx)("input",{className:H({"is-redacted":"value"in u&&u.value&&l&&!p}),readOnly:a,value:"value"in u?u.value:void 0,defaultValue:"defaultValue"in u?u.defaultValue:void 0,placeholder:r,ref:m,onChange:x=>e?.(x.target.value),onKeyDown:o,type:d}),l&&(0,nu.jsx)(hs,{onSelect:()=>f(!p),style:{border:0,userSelect:"none"},children:p?Mte:T_})]})]})}),aie=17,iie=64;function oie({isLoading:e,libraryItems:t,onAddToLibrary:n,onInsertLibraryItems:r,pendingElements:a,theme:i,id:o,libraryReturnUrl:l,onSelectItems:c,selectedItems:s}){let d=En(),u=(0,wn.useRef)(null),h=Sae(u);(0,wn.useEffect)(()=>{h>0&&u.current?.scrollTo(0,h)},[]);let{svgCache:m}=X_(),[p,f]=(0,wn.useState)(null),[x,g]=(0,wn.useState)(""),v=!t.length&&!a.length,b=!v&&!!x.trim(),w=(0,wn.useMemo)(()=>{let R=b1(x.trim().toLowerCase());return R?t.filter(P=>{let F=P.name||"";return F.trim()&&b1(F.toLowerCase()).includes(R)}):[]},[t,x]),S=(0,wn.useMemo)(()=>t.filter(R=>R.status!=="published"),[t]),_=(0,wn.useMemo)(()=>t.filter(R=>R.status==="published"),[t]),C=(0,wn.useCallback)((R,P)=>{let F=!s.includes(R),q=[...S,..._];if(F){if(P.shiftKey&&p){let te=q.findIndex(ke=>ke.id===p),ge=q.findIndex(ke=>ke.id===R);if(te===-1||ge===-1){c([...s,R]);return}let be=me(s),fe=Math.min(te,ge),He=Math.max(te,ge),je=q.reduce((ke,ct,On)=>((On>=fe&&On<=He||be.has(ct.id))&&ke.push(ct.id),ke),[]);c(je)}else c([...s,R]);f(R)}else f(null),c(s.filter(te=>te!==R))},[p,c,_,s,S]);(0,wn.useEffect)(()=>{s.length||f(null)},[s]);let k=(0,wn.useCallback)(R=>{let P;return s.includes(R)?P=t.filter(F=>s.includes(F.id)):P=t.filter(F=>F.id===R),P.map(F=>({...F,elements:Hs({type:"everything",elements:F.elements,randomizeSeed:!0}).duplicatedElements}))},[t,s]),T=(0,wn.useCallback)((R,P)=>{let F={itemIds:s.includes(R)?s:[R]};P.dataTransfer.setData(_e.excalidrawlibIds,JSON.stringify(F))},[s]),I=(0,wn.useCallback)(R=>R?s.includes(R):!1,[s]),A=(0,wn.useCallback)(()=>{n(a)},[a,n]),O=(0,wn.useCallback)(R=>{R&&r(k(R))},[k,r]),V=m.size>=(w.length?w:t).length?iie:aie,j=(0,wn.useRef)(null);(0,wn.useEffect)(()=>{XM(()=>{j.current?.focus()})},[]);let K=!b&&(0,et.jsxs)(et.Fragment,{children:[!v&&(0,et.jsx)("div",{className:"library-menu-items-container__header",children:E("labels.personalLib")}),!a.length&&!S.length?(0,et.jsxs)("div",{className:"library-menu-items__no-items",children:[!_.length&&(0,et.jsx)("div",{className:"library-menu-items__no-items__label",children:E("library.noItems")}),(0,et.jsx)("div",{className:"library-menu-items__no-items__hint",children:_.length>0?E("library.hint_emptyPrivateLibrary"):E("library.hint_emptyLibrary")})]}):(0,et.jsxs)(iC,{children:[a.length>0&&(0,et.jsx)(mx,{itemsRenderedPerBatch:V,items:[{id:null,elements:a}],onItemSelectToggle:C,onItemDrag:T,onClick:A,isItemSelected:I,svgCache:m}),(0,et.jsx)(mx,{itemsRenderedPerBatch:V,items:S,onItemSelectToggle:C,onItemDrag:T,onClick:O,isItemSelected:I,svgCache:m})]}),_.length>0&&(0,et.jsx)("div",{className:"library-menu-items-container__header",style:{marginTop:"0.75rem"},children:E("labels.excalidrawLib")}),_.length>0&&(0,et.jsx)(iC,{children:(0,et.jsx)(mx,{itemsRenderedPerBatch:V,items:_,onItemSelectToggle:C,onItemDrag:T,onClick:O,isItemSelected:I,svgCache:m})})]}),Z=b&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)("div",{className:"library-menu-items-container__header",children:[E("library.search.heading"),!e&&(0,et.jsxs)("div",{className:"library-menu-items-container__header__hint",style:{cursor:"pointer"},onPointerDown:R=>R.preventDefault(),onClick:R=>{g("")},children:[(0,et.jsx)("kbd",{children:"esc"})," to clear"]})]}),w.length>0?(0,et.jsx)(iC,{children:(0,et.jsx)(mx,{itemsRenderedPerBatch:V,items:w,onItemSelectToggle:C,onItemDrag:T,onClick:O,isItemSelected:I,svgCache:m})}):(0,et.jsxs)("div",{className:"library-menu-items__no-items",children:[(0,et.jsx)("div",{className:"library-menu-items__no-items__hint",children:E("library.search.noResults")}),(0,et.jsx)(hs,{onPointerDown:R=>R.preventDefault(),onSelect:()=>{g("")},style:{width:"auto",marginTop:"1rem"},children:E("library.search.clearSearch")})]})]});return(0,et.jsxs)("div",{className:"library-menu-items-container",style:a.length||S.length||_.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[(0,et.jsxs)("div",{className:"library-menu-items-header",children:[!v&&(0,et.jsx)(N2,{ref:j,type:"search",className:H("library-menu-items-container__search",{hideCancelButton:d.formFactor!=="phone"}),placeholder:E("library.search.inputPlaceholder"),value:x,onChange:R=>g(R)}),(0,et.jsx)(Jae,{selectedItems:s,onSelectItems:c,className:"library-menu-dropdown-container--in-heading"})]}),(0,et.jsxs)(rl.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:_.length>0?1:"0 1 auto",margin:v?"auto":0},ref:u,children:[e&&(0,et.jsx)("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:(0,et.jsx)(il,{})}),K,Z,v&&(0,et.jsx)(HF,{style:{padding:"16px 0",width:"100%"},id:o,libraryReturnUrl:l,theme:i})]})]})}var J_=Dt(!1),$P=({children:e})=>(0,Ui.jsx)("div",{className:"layer-ui__library",children:e}),lie=(0,Yn.memo)(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:n,setAppState:r,libraryReturnUrl:a,library:i,id:o,theme:l,selectedItems:c,onSelectItems:s})=>{let[d]=Fe(Om),u=(0,Yn.useCallback)(p=>{(async(f,x)=>{at("element","addToLibrary","ui");for(let v of $0)if(f.some(b=>b.type===v))return r({errorMessage:E(`errors.libraryElementTypeError.${v}`)});let g=[{status:"unpublished",elements:f,id:ca(),created:Date.now()},...x];n(),i.setLibrary(g).catch(()=>{r({errorMessage:E("alerts.errorAddingToLibrary")})})})(p,d.libraryItems)},[n,i,r,d.libraryItems]),h=(0,Yn.useMemo)(()=>d.libraryItems,[d]);if(d.status==="loading"&&!d.isInitialized)return(0,Ui.jsx)($P,{children:(0,Ui.jsx)("div",{className:"layer-ui__library-message",children:(0,Ui.jsxs)("div",{children:[(0,Ui.jsx)(il,{size:"2em"}),(0,Ui.jsx)("span",{children:E("labels.libraryLoadingMessage")})]})})});let m=d.libraryItems.length>0||t.length>0;return(0,Ui.jsxs)($P,{children:[(0,Ui.jsx)(oie,{isLoading:d.status==="loading",libraryItems:h,onAddToLibrary:u,onInsertLibraryItems:e,pendingElements:t,id:o,libraryReturnUrl:a,theme:l,onSelectItems:s,selectedItems:c}),m&&(0,Ui.jsx)(HF,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:o,libraryReturnUrl:a,theme:l})]})}),oC=(e,t)=>({elements:e,pending:Re(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),sie=(e,t)=>{let n=nw(),[r,a]=(0,Yn.useState)(()=>oC(n,e.selectedElementIds)),i=(0,Yn.useRef)(new Map);return(0,Yn.useEffect)(()=>{for(let o of r.pending)i.current.set(o.id,o.version)},[r.pending]),(0,Yn.useEffect)(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&a(o=>{if(!Qt(o.selectedElementIds,e.selectedElementIds))return i.current.clear(),oC(n,e.selectedElementIds);let l=t.scene.getNonDeletedElementsMap();for(let c of Object.keys(e.selectedElementIds)){let s=l.get(c)?.version;if(s&&s!==i.current.get(c))return oC(n,e.selectedElementIds)}return o})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,n]),r.pending},cie=(0,Yn.memo)(()=>{let e=Wi(),{onInsertElements:t}=e,n=K1(),r=pt(),a=fn(),[i,o]=(0,Yn.useState)([]),l=(0,Yn.useMemo)(()=>e.library,[e.library]),c=sie(r,e);(0,Yn.useEffect)(()=>xt(document,Q.KEYDOWN,u=>{if(u.key===D.ESCAPE&&u.target instanceof HTMLElement){let h=u.target;if(h.closest(`.${vt.SIDEBAR}`))i.length>0?(u.stopPropagation(),o([])):sa(h)&&h instanceof HTMLInputElement&&!h.value&&(u.stopPropagation(),a({openSidebar:null}),e.focusContainer());else if(i.length>0){let{x:m,y:p}=e.lastViewportPosition;document.elementFromPoint(m,p)?.closest(`.${vt.SIDEBAR}`)&&(u.stopPropagation(),o([]))}}},{capture:!0}),[i,a,e]);let s=(0,Yn.useCallback)(u=>{t(Z_(u)),e.focusContainer()},[t,e]),d=(0,Yn.useCallback)(()=>{a({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[a]);return(0,Ui.jsx)(lie,{pendingElements:c,onInsertLibraryItems:s,onAddToLibrary:d,setAppState:a,libraryReturnUrl:n.libraryReturnUrl,library:l,id:e.id,theme:r.theme,selectedItems:i,onSelectItems:o})}),die=e=>{let{closeOnClickOutside:t=!0}=e,n=NB({className:"excalidraw-modal-container"}),r=(0,rH.useRef)(document.body.classList.contains("excalidraw-animations-disabled"));if(!n)return null;let a=i=>{i.key===D.ESCAPE&&(i.nativeEvent.stopImmediatePropagation(),i.stopPropagation(),e.onCloseRequest())};return(0,aH.createPortal)((0,D1.jsxs)("div",{className:H("Modal",e.className,{"animations-disabled":r.current}),role:"dialog","aria-modal":"true",onKeyDown:a,"aria-labelledby":e.labelledBy,children:[(0,D1.jsx)("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),(0,D1.jsx)("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),n)};function uie(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;default:return 800}}var So=e=>{let[t,n]=mae(),[r]=(0,T2.useState)(document.activeElement),{id:a}=za(),i=En().formFactor==="phone";(0,T2.useEffect)(()=>{if(!t)return;let s=$p(t);setTimeout(()=>{s.length>0&&e.autofocus!==!1&&(s[1]||s[0]).focus()});let d=u=>{if(u.key===D.TAB){let h=$p(t),{activeElement:m}=document,p=h.findIndex(f=>f===m);p===0&&u.shiftKey?(h[h.length-1].focus(),u.preventDefault()):p===h.length-1&&!u.shiftKey&&(h[0].focus(),u.preventDefault())}};return t.addEventListener("keydown",d),()=>t.removeEventListener("keydown",d)},[t,e.autofocus]);let o=fn(),l=F1(J_),c=()=>{o({openMenu:null}),l(!1),r.focus(),e.onCloseRequest()};return(0,Tc.jsx)(die,{className:H("Dialog",e.className,{"Dialog--fullscreen":i}),labelledBy:"dialog-title",maxWidth:uie(e.size),onCloseRequest:c,closeOnClickOutside:e.closeOnClickOutside,children:(0,Tc.jsxs)(Ja,{ref:n,children:[e.title&&(0,Tc.jsx)("h2",{id:`${a}-dialog-title`,className:"Dialog__title",children:(0,Tc.jsx)("span",{className:"Dialog__titleContent",children:e.title})}),i&&(0,Tc.jsx)("button",{className:"Dialog__close",onClick:c,title:E("buttons.close"),"aria-label":E("buttons.close"),type:"button",children:Hm}),(0,Tc.jsx)("div",{className:"Dialog__content",children:e.children})]})})},QC=[{icon:C_,value:"hand",key:D.H,numericKey:null,fillable:!1,toolbar:!0},{icon:a2,value:"selection",key:D.V,numericKey:D[1],fillable:!0,toolbar:!0},{icon:v_,value:"rectangle",key:D.R,numericKey:D[2],fillable:!0,toolbar:!0},{icon:y_,value:"diamond",key:D.D,numericKey:D[3],fillable:!0,toolbar:!0},{icon:x_,value:"ellipse",key:D.O,numericKey:D[4],fillable:!0,toolbar:!0},{icon:sB,value:"arrow",key:D.A,numericKey:D[5],fillable:!0,toolbar:!0},{icon:w_,value:"line",key:D.L,numericKey:D[6],fillable:!0,toolbar:!0},{icon:H1,value:"freedraw",key:[D.P,D.X],numericKey:D[7],fillable:!1,toolbar:!0},{icon:Em,value:"text",key:D.T,numericKey:D[8],fillable:!1,toolbar:!0},{icon:wx,value:"image",key:null,numericKey:D[9],fillable:!1,toolbar:!0},{icon:cB,value:"eraser",key:D.E,numericKey:D[0],fillable:!1,toolbar:!0},{icon:Rm,value:"laser",key:D.K,numericKey:null,fillable:!1,toolbar:!1}],iH=e=>e.state.preferredSelectionTool.type==="lasso"?[{value:"lasso",icon:a2,key:D.V,numericKey:D[1],fillable:!0,toolbar:!0},...QC.slice(1)]:QC,hie=(e,t)=>iH(t).find((n,r)=>n.numericKey!=null&&e===n.numericKey.toString()||n.key&&(typeof n.key=="string"?n.key===e:n.key.includes(e)))?.value||null,oH=z2.default.createContext(null),Br=()=>z2.default.useContext(oH),mie=yy(),pie=()=>z2.default.useMemo(()=>({MainMenuTunnel:co(),WelcomeScreenMenuHintTunnel:co(),WelcomeScreenToolbarHintTunnel:co(),WelcomeScreenHelpHintTunnel:co(),WelcomeScreenCenterTunnel:co(),FooterCenterTunnel:co(),DefaultSidebarTriggerTunnel:co(),DefaultSidebarTabTriggersTunnel:co(),OverwriteConfirmDialogTunnel:co(),TTDDialogTriggerTunnel:co(),tunnelsJotai:mie}),[]),Wx=ee({name:"viewMode",label:"labels.viewMode",icon:T_,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:U.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,n)=>typeof n.viewModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Ee.R}),Ix=({app:e,options:t,activeTool:n,defaultOption:r,className:a="Shape",namePrefix:i,title:o,"data-testid":l,onToolChange:c,displayedOption:s,fillable:d=!1})=>{let[u,h]=(0,P2.useState)(!1),m=n.type,p=s.type===m,f=32/2+10,{container:x}=za();return!t.some(g=>g.type===m)&&u&&h(!1),(0,P2.useEffect)(()=>{let g=e.onPointerDownEmitter.on(()=>{h(!1)});return()=>g?.()},[e]),(0,Kd.jsxs)(Ze.Root,{open:u,children:[(0,Kd.jsx)(Ze.Trigger,{asChild:!0,children:(0,Kd.jsx)(Me,{className:H(a,{fillable:d,active:t.some(g=>g.type===n.type)}),type:"radio",icon:s.icon,checked:p,name:"editor-current-shape",title:o,"aria-label":o,"data-testid":l,onPointerDown:()=>{h(g=>!g),c(r)}})}),(0,Kd.jsx)(Ze.Content,{className:"tool-popover-content",sideOffset:f,collisionBoundary:x??void 0,children:t.map(({type:g,icon:v,title:b})=>(0,Kd.jsx)(Me,{className:H(a,{active:m===g}),type:"radio",icon:v,checked:m===g,name:`${i}-option`,title:b||$e(g),keyBindingLabel:"","aria-label":b||$e(g),"data-testid":`toolbar-${g}`,onChange:()=>{e.state.activeTool.type!==g&&at("toolbar",g,"ui"),e.setActiveTool({type:g}),c?.(g)}},g))})]})},ek=H([vt.SHAPE_ACTIONS_THEME_SCOPE,"properties-content"]),U2=(e,t)=>{let n=t[0]?.type||null;for(let r of t)if(r.type!==n){n=null;break}return rf(e.activeTool.type)&&n!=="image"&&n!=="frame"&&n!=="magicframe"||t.some(r=>rf(r.type))},B2=(e,t)=>kl(e.activeTool.type)||t.some(n=>kl(n.type)),fie=({appState:e,elementsMap:t,renderAction:n,app:r})=>{let a=nf(t,e),i=!1;a.length===2&&(gn(a[0])||gn(a[1]))&&(i=!0);let o=!!(e.editingTextElement||e.newElement),l=En(),c=document.documentElement.getAttribute("dir")==="rtl",s=kl(e.activeTool.type)&&!Hr(e.currentItemBackgroundColor)||a.some(p=>kl(p.type)&&!Hr(p.backgroundColor)),d=a.length===1||i,u=!e.selectedLinearElement?.isEditing&&a.length===1&&Te(a[0])&&!ze(a[0]),h=!e.croppingElementId&&a.length===1&&ft(a[0]),m=!i&&Oa(e,r);return(0,W.jsxs)("div",{className:"selected-shape-actions",children:[(0,W.jsx)("div",{children:U2(e,a)&&n("changeStrokeColor")}),B2(e,a)&&(0,W.jsx)("div",{children:n("changeBackgroundColor")}),s&&n("changeFillStyle"),(af(e.activeTool.type)||a.some(p=>af(p.type)))&&n("changeStrokeWidth"),(e.activeTool.type==="freedraw"||a.some(p=>p.type==="freedraw"))&&n("changeStrokeShape"),(of(e.activeTool.type)||a.some(p=>of(p.type)))&&(0,W.jsxs)(W.Fragment,{children:[n("changeStrokeStyle"),n("changeSloppiness")]}),(lf(e.activeTool.type)||a.some(p=>lf(p.type)))&&(0,W.jsx)(W.Fragment,{children:n("changeRoundness")}),(sf(e.activeTool.type)||a.some(p=>sf(p.type)))&&(0,W.jsx)(W.Fragment,{children:n("changeArrowType")}),(e.activeTool.type==="text"||a.some(oe))&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("fieldset",{children:n("changeFontFamily")}),n("changeFontSize"),(e.activeTool.type==="text"||i3(a,t))&&n("changeTextAlign")]}),a3(a,t)&&n("changeVerticalAlign"),(cf(e.activeTool.type)||a.some(p=>cf(p.type)))&&(0,W.jsx)(W.Fragment,{children:n("changeArrowhead")}),n("changeOpacity"),(0,W.jsxs)("fieldset",{children:[(0,W.jsx)("legend",{children:E("labels.layers")}),(0,W.jsxs)("div",{className:"buttonList",children:[n("sendToBack"),n("sendBackward"),n("bringForward"),n("bringToFront")]})]}),m&&!i&&(0,W.jsxs)("fieldset",{children:[(0,W.jsx)("legend",{children:E("labels.align")}),(0,W.jsxs)("div",{className:"buttonList",children:[c?(0,W.jsxs)(W.Fragment,{children:[n("alignRight"),n("alignHorizontallyCentered"),n("alignLeft")]}):(0,W.jsxs)(W.Fragment,{children:[n("alignLeft"),n("alignHorizontallyCentered"),n("alignRight")]}),a.length>2&&n("distributeHorizontally"),(0,W.jsx)("div",{style:{flexBasis:"100%",height:0}}),(0,W.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[n("alignTop"),n("alignVerticallyCentered"),n("alignBottom"),a.length>2&&n("distributeVertically")]})]})]}),!o&&a.length>0&&(0,W.jsxs)("fieldset",{children:[(0,W.jsx)("legend",{children:E("labels.actions")}),(0,W.jsxs)("div",{className:"buttonList",children:[l.formFactor!=="phone"&&n("duplicateSelection"),l.formFactor!=="phone"&&n("deleteSelectedElements"),n("group"),n("ungroup"),d&&n("hyperlink"),h&&n("cropEditor"),u&&n("toggleLinearEditor")]})]})]})},lH=({appState:e,renderAction:t,setAppState:n,targetElements:r,container:a})=>{let i=kl(e.activeTool.type)&&!Hr(e.currentItemBackgroundColor)||r.some(c=>kl(c.type)&&!Hr(c.backgroundColor)),o=r.length>0||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser"&&e.activeTool.type!=="lasso",l=e.openPopup==="compactStrokeStyles";return o?(0,W.jsx)("div",{className:"compact-action-item",children:(0,W.jsxs)(Ze.Root,{open:l,onOpenChange:c=>{n(c?{openPopup:"compactStrokeStyles"}:{openPopup:null})},children:[(0,W.jsx)(Ze.Trigger,{asChild:!0,children:(0,W.jsx)("button",{type:"button",className:H("compact-action-button properties-trigger",{active:l}),title:E("labels.stroke"),onClick:c=>{c.preventDefault(),c.stopPropagation(),n({openPopup:l?null:"compactStrokeStyles"})},children:Xte})}),l&&(0,W.jsx)(jm,{className:ek,container:a,style:{maxWidth:"13rem"},onClose:()=>{},children:(0,W.jsxs)("div",{className:"selected-shape-actions",children:[i&&t("changeFillStyle"),(af(e.activeTool.type)||r.some(c=>af(c.type)))&&t("changeStrokeWidth"),(of(e.activeTool.type)||r.some(c=>of(c.type)))&&(0,W.jsxs)(W.Fragment,{children:[t("changeStrokeStyle"),t("changeSloppiness")]}),(lf(e.activeTool.type)||r.some(c=>lf(c.type)))&&t("changeRoundness"),t("changeOpacity")]})})]})}):null},sH=({appState:e,renderAction:t,setAppState:n,targetElements:r,container:a,app:i})=>{let o=sf(e.activeTool.type)||r.some(c=>sf(c.type)),l=e.openPopup==="compactArrowProperties";return o?(0,W.jsx)("div",{className:"compact-action-item",children:(0,W.jsxs)(Ze.Root,{open:l,onOpenChange:c=>{n(c?{openPopup:"compactArrowProperties"}:{openPopup:null})},children:[(0,W.jsx)(Ze.Trigger,{asChild:!0,children:(0,W.jsx)("button",{type:"button",className:H("compact-action-button properties-trigger",{active:l}),title:E("labels.arrowtypes"),onClick:c=>{c.preventDefault(),c.stopPropagation(),n({openPopup:l?null:"compactArrowProperties"})},children:(()=>{let c=na(r,i,s=>Oe(s)?s.elbowed?"elbow":s.roundness?"round":"sharp":null,s=>Oe(s),s=>s?null:e.currentItemArrowType);return c==="elbow"?D_:c==="round"?I_:A_})()})}),l&&(0,W.jsx)(jm,{container:a,className:"properties-content",style:{maxWidth:"13rem"},onClose:()=>{},children:t("changeArrowProperties")})]})}):null},cH=({appState:e,renderAction:t,setAppState:n,targetElements:r,container:a,elementsMap:i})=>{let{saveCaretPosition:o,restoreCaretPosition:l}=hne(),c=e.openPopup==="compactTextProperties";return(0,W.jsx)("div",{className:"compact-action-item",children:(0,W.jsxs)(Ze.Root,{open:c,onOpenChange:s=>{s?(e.editingTextElement&&o(),n({openPopup:"compactTextProperties"})):(n({openPopup:null}),e.editingTextElement&&l())},children:[(0,W.jsx)(Ze.Trigger,{asChild:!0,children:(0,W.jsx)("button",{type:"button",className:H("compact-action-button properties-trigger",{active:c}),title:E("labels.textAlign"),onClick:s=>{s.preventDefault(),s.stopPropagation(),c?n({openPopup:null}):(e.editingTextElement&&o(),n({openPopup:"compactTextProperties"}))},children:yee})}),e.openPopup==="compactTextProperties"&&(0,W.jsx)(jm,{className:ek,container:a,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!e.editingTextElement,onClose:()=>{e.editingTextElement&&l()},children:(0,W.jsxs)("div",{className:"selected-shape-actions",children:[(e.activeTool.type==="text"||r.some(oe))&&t("changeFontSize"),(e.activeTool.type==="text"||i3(r,i))&&t("changeTextAlign"),a3(r,i)&&t("changeVerticalAlign")]})})]})})},dH=({appState:e,renderAction:t,targetElements:n,setAppState:r,container:a,app:i,showDuplicate:o,showDelete:l})=>{let c=!!(e.editingTextElement||e.newElement),s=!e.croppingElementId&&n.length===1&&ft(n[0]),d=n.length===1,u=Oa(e,i),h=!1;n.length===2&&(gn(n[0])||gn(n[1]))&&(h=!0);let m=document.documentElement.getAttribute("dir")==="rtl",p=e.openPopup==="compactOtherProperties";return c||n.length===0?null:(0,W.jsx)("div",{className:"compact-action-item",children:(0,W.jsxs)(Ze.Root,{open:p,onOpenChange:f=>{r(f?{openPopup:"compactOtherProperties"}:{openPopup:null})},children:[(0,W.jsx)(Ze.Trigger,{asChild:!0,children:(0,W.jsx)("button",{type:"button",className:H("compact-action-button properties-trigger",{active:p}),title:E("labels.actions"),onClick:f=>{f.preventDefault(),f.stopPropagation(),r({openPopup:p?null:"compactOtherProperties"})},children:hee})}),p&&(0,W.jsx)(jm,{className:ek,container:a,style:{maxWidth:"12rem",justifyContent:"center",alignItems:"center"},onClose:()=>{},children:(0,W.jsxs)("div",{className:"selected-shape-actions",children:[(0,W.jsxs)("fieldset",{children:[(0,W.jsx)("legend",{children:E("labels.layers")}),(0,W.jsxs)("div",{className:"buttonList",children:[t("sendToBack"),t("sendBackward"),t("bringForward"),t("bringToFront")]})]}),u&&!h&&(0,W.jsxs)("fieldset",{children:[(0,W.jsx)("legend",{children:E("labels.align")}),(0,W.jsxs)("div",{className:"buttonList",children:[m?(0,W.jsxs)(W.Fragment,{children:[t("alignRight"),t("alignHorizontallyCentered"),t("alignLeft")]}):(0,W.jsxs)(W.Fragment,{children:[t("alignLeft"),t("alignHorizontallyCentered"),t("alignRight")]}),n.length>2&&t("distributeHorizontally"),(0,W.jsx)("div",{style:{flexBasis:"100%",height:0}}),(0,W.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[t("alignTop"),t("alignVerticallyCentered"),t("alignBottom"),n.length>2&&t("distributeVertically")]})]})]}),(0,W.jsxs)("fieldset",{children:[(0,W.jsx)("legend",{children:E("labels.actions")}),(0,W.jsxs)("div",{className:"buttonList",children:[t("group"),t("ungroup"),d&&t("hyperlink"),s&&t("cropEditor"),o&&t("duplicateSelection"),l&&t("deleteSelectedElements")]})]})]})})]})})},gie=({appState:e,renderAction:t,targetElements:n})=>!e.selectedLinearElement?.isEditing&&n.length===1&&Te(n[0])&&!ze(n[0])?(0,W.jsx)("div",{className:"compact-action-item",children:t("toggleLinearEditor")}):null,bie=({appState:e,elementsMap:t,renderAction:n,app:r,setAppState:a})=>{let i=nf(t,e),{container:o}=za(),l=!!(e.editingTextElement||e.newElement),c=!e.selectedLinearElement?.isEditing&&i.length===1&&Te(i[0])&&!ze(i[0]);return(0,W.jsxs)("div",{className:"compact-shape-actions",children:[U2(e,i)&&(0,W.jsx)("div",{className:H("compact-action-item"),children:n("changeStrokeColor")}),B2(e,i)&&(0,W.jsx)("div",{className:"compact-action-item",children:n("changeBackgroundColor")}),(0,W.jsx)(lH,{appState:e,renderAction:n,setAppState:a,targetElements:i,container:o}),(0,W.jsx)(sH,{appState:e,renderAction:n,setAppState:a,targetElements:i,container:o,app:r}),c&&(0,W.jsx)("div",{className:"compact-action-item",children:n("toggleLinearEditor")}),(e.activeTool.type==="text"||i.some(oe))&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{className:"compact-action-item",children:n("changeFontFamily")}),(0,W.jsx)(cH,{appState:e,renderAction:n,setAppState:a,targetElements:i,container:o,elementsMap:t})]}),!l&&i.length>0&&(0,W.jsx)("div",{className:"compact-action-item",children:n("duplicateSelection")}),!l&&i.length>0&&(0,W.jsx)("div",{className:"compact-action-item",children:n("deleteSelectedElements")}),(0,W.jsx)(dH,{appState:e,renderAction:n,targetElements:i,setAppState:a,container:o,app:r})]})},vie=({appState:e,elementsMap:t,renderAction:n,app:r,setAppState:a})=>{let i=nf(t,e),{container:o}=za(),l=(0,O2.useRef)(null),c=l.current?.getBoundingClientRect()?.width??0,s=9,d=6,u=32,h=s*u+(s-1)*d,m=u+d,p=c>=h+m,f=c>=h+2*m;return(0,W.jsxs)(Ja,{className:"compact-shape-actions mobile-shape-actions",style:{flexDirection:"row",boxShadow:"none",padding:0,zIndex:2,backgroundColor:"transparent",height:u*1.35,marginBottom:4,alignItems:"center",gap:d,pointerEvents:"none"},ref:l,children:[(0,W.jsxs)("div",{style:{display:"flex",flexDirection:"row",gap:d,flex:1},children:[U2(e,i)&&(0,W.jsx)("div",{className:H("compact-action-item"),children:n("changeStrokeColor")}),B2(e,i)&&(0,W.jsx)("div",{className:"compact-action-item",children:n("changeBackgroundColor")}),(0,W.jsx)(lH,{appState:e,renderAction:n,setAppState:a,targetElements:i,container:o}),(0,W.jsx)(sH,{appState:e,renderAction:n,setAppState:a,targetElements:i,container:o,app:r}),(0,W.jsx)(gie,{appState:e,renderAction:n,targetElements:i}),(e.activeTool.type==="text"||i.some(oe))&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{className:"compact-action-item",children:n("changeFontFamily")}),(0,W.jsx)(cH,{appState:e,renderAction:n,setAppState:a,targetElements:i,container:o,elementsMap:t})]}),(0,W.jsx)(dH,{appState:e,renderAction:n,targetElements:i,setAppState:a,container:o,app:r,showDuplicate:!f,showDelete:!p})]}),(0,W.jsxs)("div",{style:{display:"flex",flexDirection:"row",gap:d},children:[(0,W.jsx)("div",{className:"compact-action-item",children:n("undo")}),(0,W.jsx)("div",{className:"compact-action-item",children:n("redo")}),f&&(0,W.jsx)("div",{className:"compact-action-item",children:n("duplicateSelection")}),p&&(0,W.jsx)("div",{className:"compact-action-item",children:n("deleteSelectedElements")})]})]})},yie=({activeTool:e,setAppState:t,app:n,UIOptions:r})=>{let[a,i]=(0,O2.useState)(!1),o=cl(),l=o==="full",c=o==="compact",s=[{type:"selection",icon:a2,title:$e(E("toolBar.selection"))},{type:"lasso",icon:h1,title:$e(E("toolBar.lasso"))}],d=e.type==="frame",u=e.type==="laser",h=l&&e.type==="lasso"&&n.state.preferredSelectionTool.type!=="lasso",m=e.type==="embeddable",{TTDDialogTriggerTunnel:p}=Br();return(0,W.jsxs)(W.Fragment,{children:[iH(n).map(({value:f,icon:x,key:g,numericKey:v,fillable:b,toolbar:w})=>{if(w===!1||r.tools?.[f]===!1)return null;let S=E(`toolBar.${f}`),_=g&&$e(typeof g=="string"?g:g[0]),C=_?`${_} ${E("helpDialog.or")} ${v}`:`${v}`,k=f==="hand"?void 0:v||_;return(f==="selection"||f==="lasso")&&c?(0,W.jsx)(Ix,{app:n,options:s,activeTool:e,defaultOption:n.state.preferredSelectionTool.type,namePrefix:"selectionType",title:$e(E("toolBar.selection")),"data-testid":"toolbar-selection",onToolChange:T=>{(T==="selection"||T==="lasso")&&(n.setActiveTool({type:T}),t({preferredSelectionTool:{type:T,initialized:!0}}))},displayedOption:s.find(T=>T.type===n.state.preferredSelectionTool.type)||s[0],fillable:e.type==="selection"},"selection-popover"):(0,W.jsx)(Me,{className:H("Shape",{fillable:b}),type:"radio",icon:x,checked:e.type===f,name:"editor-current-shape",title:`${$e(S)} \u2014 ${C}`,keyBindingLabel:k,"aria-label":$e(S),"aria-keyshortcuts":C,"data-testid":`toolbar-${f}`,onPointerDown:({pointerType:T})=>{!n.state.penDetected&&T==="pen"&&n.togglePenMode(!0),f==="selection"&&(n.state.activeTool.type==="selection"?n.setActiveTool({type:"lasso"}):n.setActiveTool({type:"selection"}))},onChange:({pointerType:T})=>{n.state.activeTool.type!==f&&at("toolbar",f,"ui"),f==="image"?n.setActiveTool({type:f}):n.setActiveTool({type:f})}},f)}),(0,W.jsx)("div",{className:"App-toolbar__divider"}),(0,W.jsxs)(Ae,{open:a,children:[(0,W.jsx)(Ae.Trigger,{className:H("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":d||m||h||u&&!n.props.isCollaborating}),onToggle:()=>{i(!a),t({openMenu:null,openPopup:null})},title:E("toolBar.extraTools"),children:d?Zd:m?Px:u&&!n.props.isCollaborating?Rm:h?h1:NC}),(0,W.jsxs)(Ae.Content,{onClickOutside:()=>i(!1),onSelect:()=>i(!1),className:"App-toolbar__extra-tools-dropdown",children:[(0,W.jsx)(Ae.Item,{onSelect:()=>n.setActiveTool({type:"frame"}),icon:Zd,shortcut:D.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:d,children:E("toolBar.frame")}),(0,W.jsx)(Ae.Item,{onSelect:()=>n.setActiveTool({type:"embeddable"}),icon:Px,"data-testid":"toolbar-embeddable",selected:m,children:E("toolBar.embeddable")}),(0,W.jsx)(Ae.Item,{onSelect:()=>n.setActiveTool({type:"laser"}),icon:Rm,"data-testid":"toolbar-laser",selected:u,shortcut:D.K.toLocaleUpperCase(),children:E("toolBar.laser")}),l&&(0,W.jsx)(Ae.Item,{onSelect:()=>n.setActiveTool({type:"lasso"}),icon:h1,"data-testid":"toolbar-lasso",selected:h,children:E("toolBar.lasso")}),(0,W.jsx)("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),n.props.aiEnabled!==!1&&(0,W.jsx)(p.Out,{}),(0,W.jsx)(Ae.Item,{onSelect:()=>n.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:k_,"data-testid":"toolbar-embeddable",children:E("toolBar.mermaidToExcalidraw")}),n.props.aiEnabled!==!1&&n.plugins.diagramToCode&&(0,W.jsx)(Ae.Item,{onSelect:()=>n.onMagicframeToolSelect(),icon:Ux,"data-testid":"toolbar-magicframe",badge:(0,W.jsx)(Ae.Item.Badge,{children:"AI"}),children:E("toolBar.magicframe")})]})]})]})},xie=({renderAction:e,zoom:t})=>(0,W.jsx)(rl.Col,{gap:1,className:vt.ZOOM_ACTIONS,children:(0,W.jsxs)(rl.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),wie=({renderAction:e,className:t})=>(0,W.jsxs)("div",{className:`undo-redo-buttons ${t}`,children:[(0,W.jsx)("div",{className:"undo-button-container",children:(0,W.jsx)(cu,{label:E("buttons.undo"),children:e("undo")})}),(0,W.jsx)("div",{className:"redo-button-container",children:(0,W.jsxs)(cu,{label:E("buttons.redo"),children:[" ",e("redo")]})})]}),Eie=({actionManager:e,showExitZenModeBtn:t})=>(0,W.jsx)("button",{type:"button",className:H("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(jx),children:E("buttons.exitZenMode")}),Sie=({actionManager:e})=>(0,W.jsx)("button",{type:"button",className:"disable-view-mode",onClick:()=>e.executeAction(Wx),children:qte}),XP=e=>{let t=(0,uH.useRef)({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...n)=>t.current.userFn(...n)),t.current.stableFn},H2=Dt(null),Cie=()=>{let[e,t]=Fe(H2),n=Sn();return e&&e==="clearCanvas"?(0,F2.jsx)(GF,{onConfirm:()=>{n.executeAction(f1),t(null)},onCancel:()=>t(null),title:E("clearCanvasDialog.title"),children:(0,F2.jsxs)("p",{className:"clear-canvas__content",children:[" ",E("alerts.clearReset")]})}):null},hH={};kE(hH,{toggleTheme:()=>_ie});var _ie={...Bx,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(Bx,"commandPalette")}},kie=Dt(null),Kt={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links",library:"Library"},ZP=e=>{switch(e){case Kt.app:return 1;case Kt.export:return 2;case Kt.editor:return 3;case Kt.tools:return 4;case Kt.elements:return 5;case Kt.links:return 6;default:return 10}},Lx=({shortcut:e,className:t,children:n})=>{let r=e.replace("++","+$").split("+");return(0,mt.jsxs)("div",{className:H("shortcut",t),children:[r.map((a,i)=>(0,mt.jsx)("div",{className:"shortcut-wrapper",children:(0,mt.jsx)("div",{className:"shortcut-key",children:a==="$"?"+":a})},a)),(0,mt.jsx)("div",{className:"shortcut-desc",children:n})]})},mH=e=>!e.altKey&&e[D.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===D.P||e.key===D.SLASH),lEe=Object.assign(e=>{let t=pt(),n=fn();return(0,Jr.useEffect)(()=>{let r=a=>{mH(a)&&(a.preventDefault(),a.stopPropagation(),n(i=>{let o=i.openDialog?.name==="commandPalette"?null:{name:"commandPalette"};return o&&at("command_palette","open","shortcut"),{openDialog:o}}))};return window.addEventListener(Q.KEYDOWN,r,{capture:!0}),()=>window.removeEventListener(Q.KEYDOWN,r,{capture:!0})},[n]),t.openDialog?.name!=="commandPalette"?null:(0,mt.jsx)(Tie,{...e})},{defaultItems:hH});function Tie({customCommandPaletteItems:e}){let t=Wi(),n=pt(),r=fn(),a=K1(),i=Sn(),[o,l]=Fe(kie),[c,s]=(0,Jr.useState)(null),d=(0,Jr.useRef)(null),u=c2({uiAppState:n,customCommandPaletteItems:e,appProps:a}),[h]=Fe(Om),m=(0,Jr.useMemo)(()=>h.libraryItems?.filter(k=>!!k.name).map(k=>({label:k.name,icon:(0,mt.jsx)(Mie,{id:k.id,elements:k.elements}),category:"Library",order:ZP("Library"),haystack:b1(k.name),perform:()=>{t.onInsertElements(Z_([k]))}}))||[],[t,h.libraryItems]);(0,Jr.useEffect)(()=>{let{uiAppState:k,customCommandPaletteItems:T,appProps:I}=u,A=K=>{let Z="";return K.label&&(typeof K.label=="function"?Z=E(K.label(t.scene.getNonDeletedElements(),k,t)):Z=E(K.label)),Z},O=K=>typeof K.icon=="function"?K.icon(k,t.scene.getNonDeletedElements()):K.icon,V=[],j=(K,Z,R)=>{let P={label:A(K),icon:O(K),category:Z,shortcut:hn(K.name),keywords:K.keywords,predicate:K.predicate,viewMode:K.viewMode,perform:()=>{i.executeAction(K,"commandPalette")}};return R?R(P,K):P};if(k&&t.scene&&i){let K=[i.actions.group,i.actions.ungroup,i.actions.cut,i.actions.copy,i.actions.deleteSelectedElements,i.actions.wrapSelectionInFrame,i.actions.copyStyles,i.actions.pasteStyles,i.actions.bringToFront,i.actions.bringForward,i.actions.sendBackward,i.actions.sendToBack,i.actions.alignTop,i.actions.alignBottom,i.actions.alignLeft,i.actions.alignRight,i.actions.alignVerticallyCentered,i.actions.alignHorizontallyCentered,i.actions.duplicateSelection,i.actions.flipHorizontal,i.actions.flipVertical,i.actions.zoomToFitSelection,i.actions.zoomToFitSelectionInViewport,i.actions.increaseFontSize,i.actions.decreaseFontSize,i.actions.toggleLinearEditor,i.actions.cropEditor,i.actions.togglePolygon,AF,OF,rae].map(te=>j(te,Kt.elements,(ge,be)=>({...ge,predicate:be.predicate?be.predicate:(fe,He,je,ke)=>Re(fe,He).length>0}))),Z=[i.actions.toggleHandTool,i.actions.setFrameAsActiveTool,i.actions.toggleLassoTool].map(te=>j(te,Kt.tools)),R=[i.actions.undo,i.actions.redo,i.actions.zoomIn,i.actions.zoomOut,i.actions.resetZoom,i.actions.zoomToFit,i.actions.zenMode,i.actions.viewMode,i.actions.gridMode,i.actions.objectsSnapMode,i.actions.toggleShortcuts,i.actions.selectAll,i.actions.toggleElementLock,i.actions.unlockAllElements,i.actions.stats].map(te=>j(te,Kt.editor)),P=[i.actions.saveToActiveFile,i.actions.saveFileToDisk,i.actions.copyAsPng,i.actions.copyAsSvg].map(te=>j(te,Kt.export));V=[...K,...R,{label:A(f1),icon:O(f1),shortcut:hn(f1.name),category:Kt.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{Qa.set(H2,"clearCanvas")}},{label:E("buttons.exportImage"),category:Kt.export,icon:hB,shortcut:hn("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{r({openDialog:{name:"imageExport"}})}},...P];let F=[{label:E("toolBar.library"),category:Kt.app,icon:lB,viewMode:!1,perform:()=>{k.openSidebar?r({openSidebar:null}):r({openSidebar:{name:kr.name,tab:kr.defaultTab}})}},{label:E("search.title"),category:Kt.app,icon:su,viewMode:!0,perform:()=>{i.executeAction(vH)}},{label:E("labels.shapeSwitch"),category:Kt.elements,icon:OC,perform:()=>{i.executeAction(nae)}},{label:E("labels.changeStroke"),keywords:["color","outline"],category:Kt.elements,icon:Ex,viewMode:!1,predicate:(te,ge)=>{let be=Re(te,ge);return be.length>0&&U2(ge,be)},perform:()=>{r(te=>({openPopup:"elementStroke"}))}},{label:E("labels.changeBackground"),keywords:["color","fill"],icon:Ex,category:Kt.elements,viewMode:!1,predicate:(te,ge)=>{let be=Re(te,ge);return be.length>0&&B2(ge,be)},perform:()=>{r(te=>({openPopup:"elementBackground"}))}},{label:E("labels.canvasBackground"),keywords:["color"],icon:Ex,category:Kt.editor,viewMode:!1,perform:()=>{r(te=>({openMenu:te.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...QC.reduce((te,ge)=>{let{value:be,icon:fe,key:He,numericKey:je}=ge;if(I.UIOptions.tools?.[be]===!1)return te;let ke=He&&$e(typeof He=="string"?He:He[0])||je,ct={label:E(`toolBar.${be}`),category:Kt.tools,shortcut:ke,icon:fe,keywords:["toolbar"],viewMode:!1,perform:({event:On})=>{be==="image"?t.setActiveTool({type:be}):t.setActiveTool({type:be})}};return te.push(ct),te},[]),...Z,{label:E("toolBar.lock"),category:Kt.tools,icon:k.activeTool.locked?b_:r2,shortcut:D.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${E("labels.textToDiagram")}...`,category:Kt.tools,icon:Dte,viewMode:!1,predicate:I.aiEnabled,perform:()=>{r(te=>({...te,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${E("toolBar.mermaidToExcalidraw")}...`,category:Kt.tools,icon:k_,viewMode:!1,predicate:I.aiEnabled,perform:()=>{r(te=>({...te,openDialog:{name:"ttd",tab:"mermaid"}}))}}],q=[...V,...F,...T||[]].map(te=>({...te,icon:te.icon||OC,order:te.order??ZP(te.category),haystack:`${b1(te.label.toLocaleLowerCase())} ${te.keywords?.join(" ")||""}`}));s(q),l([...q,...m].find(te=>te.label===o?.label)??null)}},[u,t,i,s,o?.label,l,r,m]);let[p,f]=(0,Jr.useState)(""),[x,g]=(0,Jr.useState)(null),[v,b]=(0,Jr.useState)({}),w=k=>{r({openDialog:null},k),f("")},S=(k,T)=>{n.openDialog?.name==="commandPalette"&&(T.stopPropagation(),T.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),w(()=>{k.perform({actionManager:i,event:T}),l(k),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},_=XP(k=>k.viewMode===!1&&n.viewModeEnabled?!1:typeof k.predicate=="function"?k.predicate(t.scene.getNonDeletedElements(),n,a,t):k.predicate===void 0||k.predicate),C=XP(k=>{let T=sa(k.target)||mH(k)||k.key===D.ESCAPE;if(T&&k.key!==D.ARROW_UP&&k.key!==D.ARROW_DOWN&&k.key!==D.ENTER)return;let I=Object.values(v).flat(),A=o&&!p&&_(o);if(k.key===D.ARROW_UP){k.preventDefault();let O=I.findIndex(K=>K.label===x?.label);if(A){if(O===0){g(o);return}if(x===o){let K=I[I.length-1];K&&g(K);return}}let V;O===-1?V=I.length-1:V=O===0?I.length-1:(O-1)%I.length;let j=I[V];j&&g(j);return}if(k.key===D.ARROW_DOWN){k.preventDefault();let O=I.findIndex(K=>K.label===x?.label);if(A){if(!x||O===I.length-1){g(o);return}if(x===o){let K=I[0];K&&g(K);return}}let V=(O+1)%I.length,j=I[V];j&&g(j);return}if(k.key===D.ENTER&&x&&setTimeout(()=>{S(x,k)}),!T){if(k.stopPropagation(),/^[a-zA-Z0-9]$/.test(k.key)){d?.current?.focus();return}k.preventDefault()}});return(0,Jr.useEffect)(()=>(window.addEventListener(Q.KEYDOWN,C,{capture:!0}),()=>window.removeEventListener(Q.KEYDOWN,C,{capture:!0})),[C]),(0,Jr.useEffect)(()=>{if(!c)return;let k=O=>{let V={};for(let j of O)V[j.category]?V[j.category].push(j):V[j.category]=[j];return V},T=p?.length>1?[...c.filter(_).sort((O,V)=>O.order-V.order),...m]:c.filter(_).sort((O,V)=>O.order-V.order),I=!p&&o&&_(o);if(!p){b(k(I?T.filter(O=>O.label!==o?.label):T)),g(I?o:T[0]||null);return}let A=b1(p.toLocaleLowerCase().replace(/[<>_| -]/g,""));T=IF.default.filter(A,T,{extract:O=>O.haystack??""}).sort((O,V)=>V.score-O.score).map(O=>O.original),b(k(T)),g(T[0]??null)},[p,c,_,o,m]),(0,mt.jsxs)(So,{onCloseRequest:()=>w(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[(0,mt.jsx)(N2,{value:p,placeholder:E("commandPalette.search.placeholder"),onChange:k=>{f(k)},selectOnRender:!0,ref:d}),t.editorInterface.formFactor!=="phone"&&(0,mt.jsxs)("div",{className:"shortcuts-wrapper",children:[(0,mt.jsx)(Lx,{shortcut:"\u2191\u2193",children:E("commandPalette.shortcuts.select")}),(0,mt.jsx)(Lx,{shortcut:"\u21B5",children:E("commandPalette.shortcuts.confirm")}),(0,mt.jsx)(Lx,{shortcut:Y("Esc"),children:E("commandPalette.shortcuts.close")})]}),(0,mt.jsxs)("div",{className:"commands",children:[o&&!p&&(0,mt.jsxs)("div",{className:"command-category",children:[(0,mt.jsxs)("div",{className:"command-category-title",children:[E("commandPalette.recents"),(0,mt.jsx)("div",{className:"icon",style:{marginLeft:"6px"},children:Ite})]}),(0,mt.jsx)(qP,{command:o,isSelected:o.label===x?.label,onClick:k=>S(o,k),disabled:!_(o),onMouseMove:()=>g(o),showShortcut:t.editorInterface.formFactor!=="phone",appState:n})]}),Object.keys(v).length>0?Object.keys(v).map((k,T)=>(0,mt.jsxs)("div",{className:"command-category",children:[(0,mt.jsx)("div",{className:"command-category-title",children:k}),v[k].map(I=>(0,mt.jsx)(qP,{command:I,isSelected:I.label===x?.label,onClick:A=>S(I,A),onMouseMove:()=>g(I),showShortcut:t.editorInterface.formFactor!=="phone",appState:n,size:k==="Library"?"large":"small"},I.label))]},k)):c?(0,mt.jsxs)("div",{className:"no-match",children:[(0,mt.jsx)("div",{className:"icon",children:su})," ",E("commandPalette.search.noMatch")]}):null]})]})}var Mie=({id:e,elements:t})=>{let n=(0,Jr.useRef)(null),{svgCache:r}=X_();return BF(e,t,r,n),(0,mt.jsx)("div",{className:"library-item-icon",ref:n})},qP=({command:e,isSelected:t,disabled:n,onMouseMove:r,onClick:a,showShortcut:i,appState:o,size:l="small"})=>{let c=()=>{};return(0,mt.jsxs)("div",{className:H("command-item",{"item-selected":t,"item-disabled":n,"command-item-large":l==="large"}),ref:s=>{t&&!n&&s?.scrollIntoView?.({block:"nearest"})},onClick:n?c:a,onMouseMove:n?c:r,title:n?E("commandPalette.itemNotAvailable"):"",children:[(0,mt.jsxs)("div",{className:"name",children:[e.icon&&(0,mt.jsx)(G1,{className:"icon",size:"var(--icon-size, 1rem)",icon:typeof e.icon=="function"?e.icon(o,[]):e.icon}),(0,mt.jsx)(QB,{children:e.label})]}),i&&e.shortcut&&(0,mt.jsx)(Lx,{shortcut:e.shortcut})]})},Aie=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},Die=e=>!!e&&e.type==="embeddable",Iie=e=>!!e&&e.type==="iframe",Lie=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),Rie=e=>e!=null&&e.type==="text",Nie=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),Oie=e=>e!=null&&Uie(e.type),zie=e=>e!=null&&e.type==="arrow",Pie=e=>zie(e)&&e.elbowed,Uie=e=>e==="arrow"||e==="line",Bie=e=>e!==null&&"containerId"in e&&e.containerId!==null&&Rie(e),pH=(e,t=1)=>{if(e.length>=3){let[n,r]=[e[0],e[e.length-1]];return Cr(n,r)<=Bu/t}return!1},lC=(e,t)=>{if(t.roundness?.type===zt.PROPORTIONAL_RADIUS||t.roundness?.type===zt.LEGACY)return e*W0;if(t.roundness?.type===zt.ADAPTIVE_RADIUS){let n=t.roundness?.value??OM,r=n/W0;return e<=r?e*W0:n}return 0},u5e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),fH=[1,0],Fie=[0,1],gH=[-1,0],Hie=[0,-1],jie=e=>{let[t,n]=e,r=Math.abs(t),a=Math.abs(n);return t>a?fH:t<=-a?gH:n>r?Fie:Hie},Vie=(e,t)=>jie(Pu(e,t)),QP=(e,t)=>Gie(Vie(e,t)),JP=(e,t)=>e[0]===t[0]&&e[1]===t[1],Gie=e=>JP(e,fH)||JP(e,gH),J5e=10/1.5,Yie=e=>{let t=Math.floor(e.width/2)+1,n=0,r=e.width,a=Math.floor(e.height/2)+1,i=t,o=e.height;return[t,n,r,a,i,o,0,a]},Wie=20,Kie=15,$ie=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"cardinality_many":case"cardinality_one_or_many":case"cardinality_zero_or_many":return Kie;case"cardinality_one":case"cardinality_exactly_one":case"cardinality_zero_or_one":return Wie;default:return 15}},Xie=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},_a=(e,t,n,r,a=0)=>{if(r===null||t.length<1)return null;let i=Aie(t[0]);if(i.length<1)return null;let o=n==="start"?1:i.length-1,l=i[o].data;ut(l.length===6,"Op data length is not 6");let c=N(l[4],l[5]),s=N(l[2],l[3]),d=N(l[0],l[1]),u=i[o-1],h=N(0,0);if(u.op==="move"){let R=sM(u.data);ut(R!=null,"Op data is not a point"),h=R}else u.op==="bcurveTo"&&(h=N(u.data[4],u.data[5]));let m=(R,P)=>Math.pow(1-R,3)*c[P]+3*R*Math.pow(1-R,2)*s[P]+3*Math.pow(R,2)*(1-R)*d[P]+h[P]*Math.pow(R,3),[p,f]=n==="start"?h:c,[x,g]=[m(.3,0),m(.3,1)],v=Math.hypot(p-x,f-g),b=(p-x)/v,w=(f-g)/v,S=$ie(r),_=0;{let[R,P]=n==="end"?e.points[e.points.length-1]:e.points[0],[F,q]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];_=Math.hypot(R-F,P-q)}let C=Math.min(S,_*(r==="diamond"||r==="diamond_outline"?.25:.5)),k=p-b*C*a,T=f-w*C*a,I=k-b*C,A=T-w*C;if(r==="circle"||r==="circle_outline"){let R=Math.hypot(A-T,I-k)+e.strokeWidth-2;return[k,T,R]}let O=Xie(r);if(r==="cardinality_many"||r==="cardinality_one_or_many"){let[R,P]=Ie(N(k,T),N(I,A),Ao(-O)),[F,q]=Ie(N(k,T),N(I,A),Ao(O));return[I,A,R,P,F,q]}let[V,j]=Ie(N(I,A),N(k,T),-O*Math.PI/180),[K,Z]=Ie(N(I,A),N(k,T),Ao(O));if(r==="diamond"||r==="diamond_outline"){let R,P;if(n==="start"){let[F,q]=e.points.length>1?e.points[1]:[0,0];[R,P]=Ie(N(k+C*2,T),N(k,T),Math.atan2(q-T,F-k))}else{let[F,q]=e.points.length>1?e.points[e.points.length-2]:[0,0];[R,P]=Ie(N(k-C*2,T),N(k,T),Math.atan2(T-q,k-F))}return[k,T,V,j,R,P,K,Z]}return[k,T,V,j,K,Z]};var O4e=(function(){let e=null,t=null,n=null,r=(i,o,l,c)=>{if(n!==void 0&&o===t&&i===e&&l.editingGroupId===n?.editingGroupId)return n;let s={};for(let h of i){let m=h.groupIds;if(l.editingGroupId){let p=m.indexOf(l.editingGroupId);p>-1&&(m=m.slice(0,p))}if(m.length>0){let p=m[m.length-1];s[p]=!0}}let d={},u=o.reduce((h,m)=>{if(m.isDeleted)return h;let p=m.groupIds.find(f=>s[f]);return p&&(h[m.id]=!0,Array.isArray(d[p])?d[p].push(m.id):d[p]=[m.id]),h},{});for(let h of Object.keys(d))d[h].length<2&&s[h]&&(s[h]=!1);return t=o,e=i,n={editingGroupId:l.editingGroupId,selectedGroupIds:s,selectedElementIds:eU({...l.selectedElementIds,...u},c)},n},a=(i,o,l,c)=>{let s=c?c.scene.getSelectedElements({selectedElementIds:i.selectedElementIds,elements:o}):Zie(o,i);return s.length?r(s,o,i,l):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:eU(i.selectedElementIds,l)}};return a.clearCache=()=>{t=null,e=null,n=null},a})(),z4e=(function(){let e=null,t=null,n=null,r=(a,i)=>(n!=null&&a===e&&i.selectedElementIds===t||(n=a.some(o=>i.selectedElementIds[o.id]),e=a,t=i.selectedElementIds),n);return r.clearCache=()=>{e=null,t=null,n=null},r})(),Zie=(e,t,n)=>{let r=new Set,a=[];for(let i of e.values()){if(t.selectedElementIds[i.id]){a.push(i),r.add(i.id);continue}if(n?.includeBoundTextElement&&Bie(i)&&t.selectedElementIds[i?.containerId]){a.push(i),r.add(i.id);continue}}if(n?.includeElementsInFrames){let i=[];return a.forEach(o=>{Nie(o)&&qie(e,o.id).forEach(l=>!r.has(l.id)&&i.push(l)),i.push(o)}),i}return a},eU=(e,t)=>Qt(t.selectedElementIds,e)?t.selectedElementIds:e,qie=(e,t)=>{let n=[];for(let r of e.values())r.frameId===t&&n.push(r);return n},Qie=typeof document<"u"?document.createElement("img"):{src:""};Qie.src=`data:${_e.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 Jie=typeof document<"u"?document.createElement("img"):{src:""};Jie.src=`data:${_e.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 tU=new WeakMap,eoe=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",Ni=class{};L(Ni,"rg",new FA),L(Ni,"cache",new WeakMap),L(Ni,"get",(e,t)=>{let n=Ni.cache.get(e);if(n&&(t===null||n.theme===t))return n.shape}),L(Ni,"delete",e=>{Ni.cache.delete(e),tU.delete(e)}),L(Ni,"destroy",()=>{Ni.cache=new WeakMap}),L(Ni,"generateElementShape",(e,t)=>{let n=t?.isExporting?void 0:Ni.get(e,t?t.theme:null);if(n!==void 0)return n;tU.delete(e);let r=roe(e,Ni.rg,t||{isExporting:!1,canvasBackgroundColor:_r.white,embedsValidationStatus:null,theme:se.LIGHT});return t?.isExporting||Ni.cache.set(e,{shape:r,theme:t?.theme||se.LIGHT}),r});var toe=e=>[8,8+e],bH=e=>[1.5,6+e];function noe(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&&eoe(e.type)||Oie(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var Ec=(e,t=!1,n=!1)=>{let r={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?toe(e.strokeWidth):e.strokeStyle==="dotted"?bH(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:noe(e),stroke:n?Do(e.strokeColor):e.strokeColor,preserveVertices:t||e.roughness<As.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return r.fillStyle=e.fillStyle,r.fill=Hr(e.backgroundColor)?void 0:n?Do(e.backgroundColor):e.backgroundColor,e.type==="ellipse"&&(r.curveFitting=1),r;case"line":case"freedraw":return pH(e.points)&&(r.fillStyle=e.fillStyle,r.fill=e.backgroundColor==="transparent"?void 0:n?Do(e.backgroundColor):e.backgroundColor),r;case"arrow":return r;default:throw new Error(`Unimplemented type ${e.type}`)}},nU=(e,t,n)=>Lie(e)&&(t||Die(e)&&n?.get(e.id)!==!0)&&Hr(e.backgroundColor)&&Hr(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:Iie(e)?{...e,strokeColor:Hr(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Hr(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,Qg=(e,t,n)=>{if(t===null)return[];let[,,r,a,i,o]=t;return[e.line(r,a,i,o,n)]},px=(e,t,n)=>{if(t===null)return[];let[r,a,i,o,l,c]=t;return[e.line(i,o,r,a,n),e.line(l,c,r,a,n)]},Vd=(e,t)=>{let n={...t};if(e.strokeStyle==="dotted"){let r=bH(e.strokeWidth-1);n.strokeLineDash=[r[0],r[1]-1]}else delete n.strokeLineDash;return n.roughness=Math.min(1,n.roughness||0),n},sC=(e,t,n,r,a,i=1)=>{if(r===null)return[];let[o,l,c]=r,s={...t,fill:a,fillStyle:"solid",stroke:n,roughness:Math.min(.5,t.roughness||0)};return delete s.strokeLineDash,[e.circle(o,l,c*i,s)]},rU=(e,t,n,r,a,i,o,l)=>{if(r===null)return[];let c=l?Do(e.strokeColor):e.strokeColor,s=l?Do(o):o,d=-.25,u=.8;switch(r){case"circle":case"circle_outline":return sC(a,i,c,_a(e,t,n,r),r==="circle_outline"?s:c);case"triangle":case"triangle_outline":{let h=_a(e,t,n,r);if(h===null)return[];let[m,p,f,x,g,v]=h,b={...i,fill:r==="triangle_outline"?s:c,fillStyle:"solid",roughness:Math.min(1,i.roughness||0)};return delete b.strokeLineDash,[a.polygon([[m,p],[f,x],[g,v],[m,p]],b)]}case"diamond":case"diamond_outline":{let h=_a(e,t,n,r);if(h===null)return[];let[m,p,f,x,g,v,b,w]=h,S={...i,fill:r==="diamond_outline"?s:c,fillStyle:"solid",roughness:Math.min(1,i.roughness||0)};return delete S.strokeLineDash,[a.polygon([[m,p],[f,x],[g,v],[b,w],[m,p]],S)]}case"cardinality_one":return Qg(a,_a(e,t,n,r),Vd(e,i));case"cardinality_many":return px(a,_a(e,t,n,r),Vd(e,i));case"cardinality_one_or_many":{let h=Vd(e,i);return[...px(a,_a(e,t,n,"cardinality_many"),h),...Qg(a,_a(e,t,n,"cardinality_one",d),h)]}case"cardinality_exactly_one":{let h=Vd(e,i);return[...Qg(a,_a(e,t,n,"cardinality_one",-.5),h),...Qg(a,_a(e,t,n,"cardinality_one"),h)]}case"cardinality_zero_or_one":{let h=Vd(e,i);return[...sC(a,i,c,_a(e,t,n,"circle_outline",1.5),s,u),...Qg(a,_a(e,t,n,"cardinality_one",-.5),h)]}case"cardinality_zero_or_many":{let h=Vd(e,i);return[...px(a,_a(e,t,n,"cardinality_many"),h),...sC(a,i,c,_a(e,t,n,"circle_outline",1.5),s,u)]}default:return px(a,_a(e,t,n,r),Vd(e,i))}},roe=(e,t,{isExporting:n,canvasBackgroundColor:r,embedsValidationStatus:a,theme:i})=>{let o=i===se.DARK;switch(e.type){case"rectangle":case"iframe":case"embeddable":{let l;if(e.roundness){let c=e.width,s=e.height,d=lC(Math.min(c,s),e);l=t.path(`M ${d} 0 L ${c-d} 0 Q ${c} 0, ${c} ${d} L ${c} ${s-d} Q ${c} ${s}, ${c-d} ${s} L ${d} ${s} Q 0 ${s}, 0 ${s-d} L 0 ${d} Q 0 0, ${d} 0`,Ec(nU(e,n,a),!0,o))}else l=t.rectangle(0,0,e.width,e.height,Ec(nU(e,n,a),!1,o));return l}case"diamond":{let l,[c,s,d,u,h,m,p,f]=Yie(e);if(e.roundness){let x=lC(Math.abs(c-p),e),g=lC(Math.abs(u-s),e);l=t.path(`M ${c+x} ${s+g} L ${d-x} ${u-g}
|
|
54
|
-
C ${d} ${u}, ${d} ${u}, ${d-x} ${u+g}
|
|
55
|
-
L ${h+x} ${m-g}
|
|
56
|
-
C ${h} ${m}, ${h} ${m}, ${h-x} ${m-g}
|
|
57
|
-
L ${p+x} ${f+g}
|
|
58
|
-
C ${p} ${f}, ${p} ${f}, ${p+x} ${f-g}
|
|
59
|
-
L ${c-x} ${s+g}
|
|
60
|
-
C ${c} ${s}, ${c} ${s}, ${c+x} ${s+g}`,Ec(e,!0,o))}else l=t.polygon([[c,s],[d,u],[h,m],[p,f]],Ec(e,!1,o));return l}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,Ec(e,!1,o));case"line":case"arrow":{let l,c=Ec(e,!1,o),s=e.points.length?e.points:[N(0,0)];if(Pie(e)?s.every(d=>Math.abs(d[0])<=1e6&&Math.abs(d[1])<=1e6)?l=[t.path(aoe(s,16),Ec(e,!0,o))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(s)),l=[]):e.roundness?l=[t.curve(s,c)]:c.fill?l=[t.polygon(s,c)]:l=[t.linearPath(s,c)],e.type==="arrow"){let{startArrowhead:d=null,endArrowhead:u="arrow"}=e;if(d!==null){let h=rU(e,l,"start",d,t,c,r,o);l.push(...h)}if(u!==null){let h=rU(e,l,"end",u,t,c,r,o);l.push(...h)}}return l}case"freedraw":{let l=[];if(pH(e.points)){let c=lx(e.points,.75);l.push(t.curve(c,{...Ec(e,!1,o),stroke:"none"}))}return l.push(ioe(e)),l}case"frame":case"magicframe":case"text":case"image":return null;default:return nb(e,`generateElementShape(): Unimplemented type ${e?.type}`),null}},aoe=(e,t)=>{let n=[];for(let a=1;a<e.length-1;a+=1){let i=e[a-1],o=e[a+1],l=e[a],c=QP(l,i),s=QP(o,l),d=Math.min(t,Cr(e[a],o)/2,Cr(e[a],i)/2);c?i[0]<l[0]?n.push([e[a][0]-d,e[a][1]]):n.push([e[a][0]+d,e[a][1]]):i[1]<l[1]?n.push([e[a][0],e[a][1]-d]):n.push([e[a][0],e[a][1]+d]),n.push(e[a]),s?o[0]<l[0]?n.push([e[a][0]-d,e[a][1]]):n.push([e[a][0]+d,e[a][1]]):o[1]<l[1]?n.push([e[a][0],e[a][1]-d]):n.push([e[a][0],e[a][1]+d])}let r=[`M ${e[0][0]} ${e[0][1]}`];for(let a=0;a<n.length;a+=3)r.push(`L ${n[a][0]} ${n[a][1]}`),r.push(`Q ${n[a+1][0]} ${n[a+1][1]}, ${n[a+2][0]} ${n[a+2][1]}`);return r.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),r.join(" ")},ioe=e=>soe(ooe(e)),ooe=e=>{let t=e.simulatePressure?e.points:e.points.length?e.points.map(([n,r],a)=>[n,r,e.pressures[a]]):[[0,0,.5]];return Xz(t,{simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:n=>Math.sin(n*Math.PI/2),last:!0})},aU=(e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2],loe=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g,soe=e=>{if(!e.length)return"";let t=e.length-1;return e.reduce((n,r,a,i)=>(a===t?n.push(r,aU(r,i[0]),"L",i[0],"Z"):n.push(r,aU(r,i[a+1])),n),["M",e[0],"Q"]).join(" ").replace(loe,"$1")},coe=(e,t,n=!1)=>{let r=!1;for(let a in t){let i=t[a];if(typeof i<"u"){if(e[a]===i&&(typeof i!="object"||i===null))continue;r=!0}}return!r&&!n?e:{...e,...t,version:t.version??e.version+1,versionNonce:t.versionNonce??wl(),updated:t8()}},fx=ee({name:"toggleLinearEditor",category:Kt.elements,label:(e,t,n)=>n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0]?.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit",keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return!!(!t.selectedLinearElement?.isEditing&&a.length===1&&Te(a[0])&&!ze(a[0]))},perform(e,t,n,r){let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];ut(a,"No selected element found"),ut(t.selectedLinearElement,"No selected linear element found"),ut(a.id===t.selectedLinearElement.elementId,"Selected element ID and linear editor elementId does not match");let i={...t.selectedLinearElement,isEditing:!t.selectedLinearElement.isEditing};return{appState:{...t,selectedLinearElement:i},captureUpdate:U.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0];if(!r)return null;let a=E(r.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return(0,tk.jsx)(Me,{type:"button",icon:Wte,title:a,"aria-label":a,onClick:()=>t(null)})}}),U4e=ee({name:"togglePolygon",category:Kt.elements,icon:aP,keywords:["loop"],label:(e,t,n)=>n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds}).some(r=>!Pt(r)||!r.polygon)?"labels.polygon.convertToPolygon":"labels.polygon.breakPolygon",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds});return a.length>0&&a.every(i=>Pt(i)&&i.points.length>=4)},perform(e,t,n,r){let a=r.scene.getSelectedElements(t);if(a.some(c=>!Pt(c)))return!1;let i=a,o=i.some(c=>!c.polygon),l=me(i);return{elements:e.map(c=>!l.has(c.id)||!Pt(c)?c:coe(c,{backgroundColor:o?c.backgroundColor:"transparent",...kb(c,o)})),appState:t,captureUpdate:U.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds});if(r.length===0||r.some(o=>!Pt(o)||!o.polygon||o.points.length<3))return null;let a=r.every(o=>Pt(o)&&o.polygon),i=E(a?"labels.polygon.breakPolygon":"labels.polygon.convertToPolygon");return(0,tk.jsx)(L_,{icon:aP,title:i,"aria-label":i,active:a,onClick:()=>t(null),style:{marginLeft:"auto"}})}}),vH=ee({name:"searchMenu",icon:su,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,n,r){if(t.openDialog)return!1;if(t.openSidebar?.name===kr.name&&t.openSidebar.tab===bl){let a=r.excalidrawContainerValue.container?.querySelector(`.${vt.SEARCH_MENU_INPUT_WRAPPER} input`);return a?.focus(),a?.select(),!1}return{appState:{...t,openSidebar:{name:kr.name,tab:bl},openDialog:null},captureUpdate:U.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.F}),doe=ee({name:"cropEditor",label:"helpDialog.cropStart",icon:SP,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,n,r){let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:a.id},captureUpdate:U.IMMEDIATELY}},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return!!(!t.croppingElementId&&a.length===1&&ft(a[0]))},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=E("helpDialog.cropStart");return(0,yH.jsx)(Me,{type:"button",icon:SP,title:r,"aria-label":r,onClick:()=>t(null)})}}),xH=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length===1&&he(n[0])},uoe=ee({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t).at(0)||null;if(he(a)){let i=pi(Pe(e),a.id).filter(o=>!(o.type==="text"&&o.containerId));return{elements:e,appState:{...t,selectedElementIds:i.reduce((o,l)=>(o[l.id]=!0,o),{})},captureUpdate:U.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:U.EVENTUALLY}},predicate:(e,t,n,r)=>xH(t,r)}),hoe=ee({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t).at(0)||null;return he(a)?{elements:$8(e,a),appState:{...t,selectedElementIds:{[a.id]:!0}},captureUpdate:U.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:U.EVENTUALLY}},predicate:(e,t,n,r)=>xH(t,r)}),J4e=ee({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:U.EVENTUALLY}),checked:e=>e.frameRendering.enabled}),e6e=ee({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:Zd,viewMode:!1,perform:(e,t,n,r)=>{let a=tt(t,{type:"frame"});return Xo(r.interactiveCanvas,{...t,activeTool:a}),{elements:e,appState:{...t,activeTool:tt(t,{type:"frame"})},captureUpdate:U.EVENTUALLY}},keyTest:e=>!e[D.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===D.F}),moe=ee({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=Re(e,t);return a.length>0&&!a.some(i=>he(i))},perform:(e,t,n,r)=>{let a=Re(e,t),i=r.scene.getNonDeletedElementsMap(),[o,l,c,s]=Qe(a,i),d=16,u=Rb({x:o-d,y:l-d,width:c-o+d*2,height:s-l+d*2});if(t.editingGroupId){let h=wt(a,t.editingGroupId);for(let m of h){let p=m.groupIds.indexOf(t.editingGroupId);Ar(m,i,{groupIds:m.groupIds.slice(0,p)})}}return{elements:qu([...r.scene.getElementsIncludingDeleted(),u],a,u,t),appState:{selectedElementIds:{[u.id]:!0}},captureUpdate:U.IMMEDIATELY}}}),gx=class extends uf{applyTo(e,t,n){let[r,a]=this.elements.applyTo(e,n.elements,{excludedProperties:new Set(["version","versionNonce"])}),[i,o]=this.appState.applyTo(t,r);return[r,i,a||o]}static calculate(e,t){return super.calculate(e,t)}static inverse(e){return super.inverse(e)}static applyLatestChanges(e,t,n,r){return super.applyLatestChanges(e,t,n,r)}},Kx=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},iU=class d1{constructor(t){this.store=t,L(this,"onHistoryChangedEmitter",new di),L(this,"undoStack",[]),L(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){if(t.isEmpty()||t instanceof gx)return;let n=gx.inverse(t);this.undoStack.push(n),n.elements.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new Kx(this.isUndoStackEmpty,this.isRedoStackEmpty))}undo(t,n){return this.perform(t,n,()=>d1.pop(this.undoStack),r=>d1.push(this.redoStack,r))}redo(t,n){return this.perform(t,n,()=>d1.pop(this.redoStack),r=>d1.push(this.undoStack,r))}perform(t,n,r,a){try{let i=r();if(i===null)return;let o=U.IMMEDIATELY,l=this.store.snapshot,c=t,s=n,d=!1;for(;i;){try{[c,s,d]=i.applyTo(c,s,l);let u=l.elements,h=l.maybeClone(o,c,s),m=oA.create(l,h),p=gx.applyLatestChanges(i,u,c);p.isEmpty()||(this.store.scheduleMicroAction({action:o,change:m,delta:p}),i=p),l=h}finally{a(i)}if(d)break;i=r()}return[c,s]}finally{this.onHistoryChangedEmitter.trigger(new Kx(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){let r=gx.inverse(n);return t.push(r)}},wH=(e,t)=>{let[n,r]=(0,j2.useState)(t);return(0,j2.useEffect)(()=>{let a=e.on(i=>{r(i)});return()=>{a()}},[e]),n},EH=(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:U.EVENTUALLY};let[a,i]=r,o=Ab(Array.from(a.values()));return{appState:i,elements:o,captureUpdate:U.NEVER}}return{captureUpdate:U.EVENTUALLY}},poe=e=>({name:"undo",label:"buttons.undo",icon:sP,trackEvent:{category:"history"},viewMode:!1,perform:(t,n,r,a)=>EH(a,n,()=>e.undo(me(t),n)),keyTest:t=>t[D.CTRL_OR_CMD]&&q0(t,D.Z)&&!t.shiftKey,PanelComponent:({appState:t,updateData:n,data:r,app:a})=>{let{isUndoStackEmpty:i}=wH(e.onHistoryChangedEmitter,new Kx(e.isUndoStackEmpty,e.isRedoStackEmpty)),o=cl()==="mobile";return(0,nk.jsx)(Me,{type:"button",icon:sP,"aria-label":E("buttons.undo"),onClick:n,size:r?.size||"medium",disabled:i,"data-testid":"button-undo",style:{...o?vl:{}}})}}),foe=e=>({name:"redo",label:"buttons.redo",icon:cP,trackEvent:{category:"history"},viewMode:!1,perform:(t,n,r,a)=>EH(a,n,()=>e.redo(me(t),n)),keyTest:t=>t[D.CTRL_OR_CMD]&&t.shiftKey&&q0(t,D.Z)||Z0&&t.ctrlKey&&!t.shiftKey&&q0(t,D.Y),PanelComponent:({appState:t,updateData:n,data:r,app:a})=>{let{isRedoStackEmpty:i}=wH(e.onHistoryChangedEmitter,new Kx(e.isUndoStackEmpty,e.isRedoStackEmpty)),o=cl()==="mobile";return(0,nk.jsx)(Me,{type:"button",icon:cP,"aria-label":E("buttons.redo"),onClick:n,size:r?.size||"medium",disabled:i,"data-testid":"button-redo",style:{...o?vl:{}}})}}),goe=ee({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=Re(e,t);return a.length===1&&oe(a[0])&&!a[0].autoResize},perform:(e,t,n,r)=>{let a=Re(e,t);return{appState:t,elements:e.map(i=>{if(i.id===a[0].id&&oe(i)){let o=kt(i.originalText,Mt(i),i.lineHeight);return pe(i,{autoResize:!0,width:o.width,height:o.height,text:i.originalText})}return i}),captureUpdate:U.IMMEDIATELY}}}),cC=(e,t,n,r,a,i)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,i))&&at(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${a.editorInterface.formFactor==="phone"?"mobile":"desktop"})`)}catch(o){console.error("error while logging action:",o)}},boe=class{constructor(e,t,n,r){L(this,"actions",{}),L(this,"updater"),L(this,"getAppState"),L(this,"getElementsIncludingDeleted"),L(this,"app"),L(this,"renderAction",(a,i)=>{let o=this.app.props.UIOptions.canvasActions;if(this.actions[a]&&"PanelComponent"in this.actions[a]&&(!(a in o)||o[a])){let l=this.actions[a],c=l.PanelComponent;c.displayName="PanelComponent";let s=this.getElementsIncludingDeleted(),d=this.getAppState(),u=h=>{cC(l,"ui",d,s,this.app,h),this.updater(l.perform(this.getElementsIncludingDeleted(),this.getAppState(),h,this.app))};return(0,SH.jsx)(c,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:u,appProps:this.app.props,app:this.app,data:i,renderAction:this.renderAction})}return null}),L(this,"isActionEnabled",a=>{let i=this.getElementsIncludingDeleted(),o=this.getAppState();return!a.predicate||a.predicate(i,o,this.app.props,this.app)}),this.updater=a=>{if(Ls(a))a.then(i=>e(i));else return e(a)},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((l,c)=>(c.keyPriority||0)-(l.keyPriority||0)).filter(l=>(l.name in t?t[l.name]:!0)&&l.keyTest&&l.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 a=this.getElementsIncludingDeleted(),i=this.getAppState();return cC(r,"keyboard",i,a,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(n[0].perform(a,i,null,this.app)),!0}executeAction(e,t="api",n=null){let r=this.getElementsIncludingDeleted(),a=this.getAppState();cC(e,t,a,r,this.app,n),this.updater(e.perform(r,a,n,this.app))}},voe=class{constructor(){L(this,"targets",new WeakMap),L(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}},oU=e=>{let t=Array.from(e.values());return{x:sU(t,n=>n.x)/t.length,y:sU(t,n=>n.y)/t.length}},lU=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),sU=(e,t)=>e.reduce((n,r)=>n+t(r),0),yoe=8,cU=99999,V2=e=>yoe/e,Ta=class{};L(Ta,"referenceSnapPoints",null),L(Ta,"visibleGaps",null),L(Ta,"setReferenceSnapPoints",e=>{Ta.referenceSnapPoints=e}),L(Ta,"getReferenceSnapPoints",()=>Ta.referenceSnapPoints),L(Ta,"setVisibleGaps",e=>{Ta.visibleGaps=e}),L(Ta,"getVisibleGaps",()=>Ta.visibleGaps),L(Ta,"destroy",()=>{Ta.referenceSnapPoints=null,Ta.visibleGaps=null});var ns=Ta,I1=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,Ic=({event:e,app:t,selectedElements:n})=>{if(e){let r=t.state.activeTool.type==="lasso"&&t.state.selectedElementsAreBeingDragged;return(t.state.activeTool.type!=="lasso"||r)&&(t.state.objectsSnapModeEnabled&&!e[D.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[D.CTRL_OR_CMD]&&!I1(t))}return n.length===1&&n[0].type==="arrow"?!1:t.state.objectsSnapModeEnabled},xoe=(e,t,n=.01)=>Math.abs(e-t)<=n,L1=(e,t,{omitCenter:n,boundingBoxCorners:r,dragOffset:a}={omitCenter:!1,boundingBoxCorners:!1})=>{let i=[];if(e.length===1){let o=e[0],[l,c,s,d,u,h]=Qn(o,t);a&&(l+=a.x,s+=a.x,u+=a.x,c+=a.y,d+=a.y,h+=a.y);let m=(s-l)/2,p=(d-c)/2;if((o.type==="diamond"||o.type==="ellipse")&&!r){let f=Ie(N(l,c+p),N(u,h),o.angle),x=Ie(N(l+m,c),N(u,h),o.angle),g=Ie(N(s,c+p),N(u,h),o.angle),v=Ie(N(l+m,d),N(u,h),o.angle),b=N(u,h);i=n?[f,x,g,v]:[f,x,g,v,b]}else{let f=Ie(N(l,c),N(u,h),o.angle),x=Ie(N(s,c),N(u,h),o.angle),g=Ie(N(l,d),N(u,h),o.angle),v=Ie(N(s,d),N(u,h),o.angle),b=N(u,h);i=n?[f,x,g,v]:[f,x,g,v,b]}}else if(e.length>1){let[o,l,c,s]=Mb(e,a??{x:0,y:0}),d=c-o,u=s-l,h=N(o,l),m=N(c,l),p=N(o,s),f=N(c,s),x=N(o+d/2,l+u/2);i=n?[h,m,p,f]:[h,m,p,f,x]}return i.map(o=>N($t(o[0]),$t(o[1])))},CH=(e,t,n,r)=>h3(e,t,n,r),woe=(e,t,n,r)=>{let a=CH(e,t,n,r),i=u3(a,r).filter(u=>!(u.length===1&&jt(u[0]))).map(u=>Qe(u).map(h=>$t(h))),o=i.sort((u,h)=>u[0]-h[0]),l=[],c=0;e:for(let u=0;u<o.length;u++){let h=o[u];for(let m=u+1;m<o.length;m++){if(++c>cU)break e;let p=o[m],[,f,x,g]=h,[v,b,,w]=p;x<v&&zp(ia(f,g),ia(b,w))&&l.push({startBounds:h,endBounds:p,startSide:[N(x,f),N(x,g)],endSide:[N(v,b),N(v,w)],length:v-x,overlap:Pp(ia(f,g),ia(b,w))})}}let s=i.sort((u,h)=>u[1]-h[1]),d=[];c=0;e:for(let u=0;u<s.length;u++){let h=s[u];for(let m=u+1;m<s.length;m++){if(++c>cU)break e;let p=s[m],[f,,x,g]=h,[v,b,w]=p;g<b&&zp(ia(f,x),ia(v,w))&&d.push({startBounds:h,endBounds:p,startSide:[N(f,g),N(x,g)],endSide:[N(v,b),N(w,b)],length:b-g,overlap:Pp(ia(f,x),ia(v,w))})}}return{horizontalGaps:l,verticalGaps:d}},dU=(e,t,n,r,a,i,o)=>{if(!Ic({app:n,event:r,selectedElements:e}))return[];if(e.length===0)return[];let l=ns.getVisibleGaps();if(l){let{horizontalGaps:c,verticalGaps:s}=l,[d,u,h,m]=Mb(e,t).map(x=>$t(x)),p=(d+h)/2,f=(u+m)/2;for(let x of c){if(!zp(ia(u,m),x.overlap))continue;let g=x.startSide[0][0]+x.length/2,v=$t(g-p);if(x.length>h-d&&Math.abs(v)<=o.x){Math.abs(v)<o.x&&(a.length=0),o.x=Math.abs(v);let T={type:"gap",direction:"center_horizontal",gap:x,offset:v};a.push(T);continue}let[,,b]=x.endBounds,w=d-b,S=$t(x.length-w);if(Math.abs(S)<=o.x){Math.abs(S)<o.x&&(a.length=0),o.x=Math.abs(S);let T={type:"gap",direction:"side_right",gap:x,offset:S};a.push(T);continue}let[_,,,]=x.startBounds,C=_-h,k=$t(C-x.length);if(Math.abs(k)<=o.x){Math.abs(k)<o.x&&(a.length=0),o.x=Math.abs(k);let T={type:"gap",direction:"side_left",gap:x,offset:k};a.push(T);continue}}for(let x of s){if(!zp(ia(d,h),x.overlap))continue;let g=x.startSide[0][1]+x.length/2,v=$t(g-f);if(x.length>m-u&&Math.abs(v)<=o.y){Math.abs(v)<o.y&&(i.length=0),o.y=Math.abs(v);let T={type:"gap",direction:"center_vertical",gap:x,offset:v};i.push(T);continue}let[,b,,]=x.startBounds,w=b-m,S=$t(w-x.length);if(Math.abs(S)<=o.y){Math.abs(S)<o.y&&(i.length=0),o.y=Math.abs(S);let T={type:"gap",direction:"side_top",gap:x,offset:S};i.push(T);continue}let[,,,_]=x.endBounds,C=$t(u-_),k=x.length-C;if(Math.abs(k)<=o.y){Math.abs(k)<o.y&&(i.length=0),o.y=Math.abs(k);let T={type:"gap",direction:"side_bottom",gap:x,offset:k};i.push(T);continue}}}},Eoe=(e,t,n,r)=>{let a=CH(e,t,n,r);return u3(a,r).filter(i=>!(i.length===1&&jt(i[0]))).flatMap(i=>L1(i,r))},Um=(e,t,n,r,a,i,o)=>{if(!Ic({app:n,event:r,selectedElements:e})||e.length===0&&t.length===0)return[];let l=ns.getReferenceSnapPoints();if(l)for(let c of t)for(let s of l){let d=s[0]-c[0],u=s[1]-c[1];Math.abs(d)<=o.x&&(Math.abs(d)<o.x&&(a.length=0),a.push({type:"point",points:[c,s],offset:d}),o.x=Math.abs(d)),Math.abs(u)<=o.y&&(Math.abs(u)<o.y&&(i.length=0),i.push({type:"point",points:[c,s],offset:u}),o.y=Math.abs(u))}},Soe=(e,t,n,r,a)=>{let i=n.state,o=Re(e,i);if(!Ic({app:n,event:r,selectedElements:o})||o.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=$t(t.x),t.y=$t(t.y);let l=[],c=[],s=V2(i.zoom.value),d={x:s,y:s},u=L1(o,a,{dragOffset:t});Um(o,u,n,r,l,c,d),dU(o,t,n,r,l,c,d);let h={x:l[0]?.offset??0,y:c[0]?.offset??0};d.x=0,d.y=0,l.length=0,c.length=0;let m={x:$t(t.x+h.x),y:$t(t.y+h.y)};Um(o,L1(o,a,{dragOffset:m}),n,r,l,c,d),dU(o,m,n,r,l,c,d);let p=rk(l,c),f=_oe(o,m,[...l,...c].filter(x=>x.type==="gap"));return{snapOffset:h,snapLines:[...p,...f]}},$t=e=>Math.round(e*10**6)/10**6,uU=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())},rk=(e,t)=>{let n={},r={};if(e.length>0){for(let a of e)if(a.type==="point"){let i=$t(a.points[0][0]);n[i]||(n[i]=[]),n[i].push(...a.points.map(o=>N($t(o[0]),$t(o[1]))))}}if(t.length>0){for(let a of t)if(a.type==="point"){let i=$t(a.points[0][1]);r[i]||(r[i]=[]),r[i].push(...a.points.map(o=>N($t(o[0]),$t(o[1]))))}}return Object.entries(n).map(([a,i])=>({type:"points",points:uU(i.map(o=>N(Number(a),o[1])).sort((o,l)=>o[1]-l[1]))})).concat(Object.entries(r).map(([a,i])=>({type:"points",points:uU(i.map(o=>N(o[0],Number(a))).sort((o,l)=>o[0]-l[0]))})))},Coe=e=>{let t=new Map;for(let n of e){let r=n.points.flat().map(a=>[$t(a)]).join(",");t.has(r)||t.set(r,n)}return Array.from(t.values())},_oe=(e,t,n)=>{let[r,a,i,o]=Mb(e,t),l=[];for(let c of n){let[s,d,u,h]=c.gap.startBounds,[m,p,f,x]=c.gap.endBounds,g=Pp(ia(a,o),c.gap.overlap),v=Pp(ia(r,i),c.gap.overlap);switch(c.direction){case"center_horizontal":{if(g){let b=(g[0]+g[1])/2;l.push({type:"gap",direction:"horizontal",points:[N(c.gap.startSide[0][0],b),N(r,b)]},{type:"gap",direction:"horizontal",points:[N(i,b),N(c.gap.endSide[0][0],b)]})}break}case"center_vertical":{if(v){let b=(v[0]+v[1])/2;l.push({type:"gap",direction:"vertical",points:[N(b,c.gap.startSide[0][1]),N(b,a)]},{type:"gap",direction:"vertical",points:[N(b,o),N(b,c.gap.endSide[0][1])]})}break}case"side_right":{if(g){let b=(g[0]+g[1])/2;l.push({type:"gap",direction:"horizontal",points:[N(u,b),N(m,b)]},{type:"gap",direction:"horizontal",points:[N(f,b),N(r,b)]})}break}case"side_left":{if(g){let b=(g[0]+g[1])/2;l.push({type:"gap",direction:"horizontal",points:[N(i,b),N(s,b)]},{type:"gap",direction:"horizontal",points:[N(u,b),N(m,b)]})}break}case"side_top":{if(v){let b=(v[0]+v[1])/2;l.push({type:"gap",direction:"vertical",points:[N(b,o),N(b,d)]},{type:"gap",direction:"vertical",points:[N(b,h),N(b,p)]})}break}case"side_bottom":{if(v){let b=(v[0]+v[1])/2;l.push({type:"gap",direction:"vertical",points:[N(b,h),N(b,p)]},{type:"gap",direction:"vertical",points:[N(b,x),N(b,a)]})}break}}}return Coe(l.map(c=>({...c,points:c.points.map(s=>N($t(s[0]),$t(s[1])))})))},hU=(e,t,n,r,a,i)=>{if(!Ic({event:r,selectedElements:e,app:n})||e.length===0||e.length===1&&!xoe(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[o,l,c,s]=Qe(t);i&&(i.includes("e")?c+=a.x:i.includes("w")&&(o+=a.x),i.includes("n")?l+=a.y:i.includes("s")&&(s+=a.y));let d=[];if(i)switch(i){case"e":{d.push(N(c,l),N(c,s));break}case"w":{d.push(N(o,l),N(o,s));break}case"n":{d.push(N(o,l),N(c,l));break}case"s":{d.push(N(o,s),N(c,s));break}case"ne":{d.push(N(c,l));break}case"nw":{d.push(N(o,l));break}case"se":{d.push(N(c,s));break}case"sw":{d.push(N(o,s));break}}let u=V2(n.state.zoom.value),h={x:u,y:u},m=[],p=[];Um(t,d,n,r,m,p,h);let f={x:m[0]?.offset??0,y:p[0]?.offset??0};h.x=0,h.y=0,m.length=0,p.length=0;let[x,g,v,b]=Qe(e).map(_=>$t(_)),w=[N(x,g),N(x,b),N(v,g),N(v,b)];Um(e,w,n,r,m,p,h);let S=rk(m,p);return{snapOffset:f,snapLines:S}},koe=(e,t,n,r,a,i)=>{if(!Ic({event:n,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let o=[N(r.x+a.x,r.y+a.y)],l=V2(t.state.zoom.value),c={x:l,y:l},s=[],d=[];Um([e],o,t,n,s,d,c);let u={x:s[0]?.offset??0,y:d[0]?.offset??0};c.x=0,c.y=0,s.length=0,d.length=0;let h=L1([e],i,{boundingBoxCorners:!0,omitCenter:!0});Um([e],h,t,n,s,d,c);let m=rk(s,d);return{snapOffset:u,snapLines:m}},Toe=(e,t,n,r,a)=>{if(!Ic({event:r,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let i=h3(e,[],t.state,a),o=V2(t.state.zoom.value),l={x:o,y:o},c=[],s=[];for(let d of i){let u=L1([d],a);for(let h of u){let m=h[0]-n.x;Math.abs(m)<=Math.abs(l.x)&&(Math.abs(m)<Math.abs(l.x)&&(s.length=0),s.push({type:"pointer",points:[h,N(h[0],n.y)],direction:"vertical"}),l.x=m);let p=h[1]-n.y;Math.abs(p)<=Math.abs(l.y)&&(Math.abs(p)<Math.abs(l.y)&&(c.length=0),c.push({type:"pointer",points:[h,N(n.x,h[1])],direction:"horizontal"}),l.y=p)}}return{originOffset:{x:s.length>0?s[0].points[0][0]-n.x:0,y:c.length>0?c[0].points[0][1]-n.y:0},snapLines:[...s,...c]}},Moe=e=>e===rn.rectangle||e===rn.ellipse||e===rn.diamond||e===rn.frame||e===rn.magicframe||e===rn.image||e===rn.text,mU=class{constructor(e){L(this,"scene"),L(this,"getRenderableElements",(()=>{let t=({elementsMap:r,zoom:a,offsetLeft:i,offsetTop:o,scrollX:l,scrollY:c,height:s,width:d})=>{let u=[];for(let h of r.values())df(h,d,s,{zoom:a,offsetLeft:i,offsetTop:o,scrollX:l,scrollY:c},r)&&u.push(h);return u},n=({elements:r,editingTextElement:a,newElementId:i})=>{let o=new Map;for(let l of r)i!==l.id&&(!a||a.type!=="text"||l.id!==a.id)&&o.set(l.id,l);return o};return i8(({zoom:r,offsetLeft:a,offsetTop:i,scrollX:o,scrollY:l,height:c,width:s,editingTextElement:d,newElementId:u,sceneNonce:h})=>{let m=this.scene.getNonDeletedElements(),p=n({elements:m,editingTextElement:d,newElementId:u}),f=t({elementsMap:p,zoom:r,offsetLeft:a,offsetTop:i,scrollX:o,scrollY:l,height:c,width:s});return{elementsMap:p,visibleElements:f}})})()),this.scene=e}destroy(){ZA.cancel(),this.getRenderableElements.clear()}},Aoe=5,Doe=(e,t,n)=>{let[r,a]=Qn(e,n),{x:i,y:o}=zn({sceneX:r+e.width,sceneY:a},t),l=i-t.offsetLeft+10,c=o-t.offsetTop;return{x:l,y:c}},pU=({children:e,element:t,elementsMap:n})=>{let r=$1();if(r.contextMenu||r.newElement||r.resizingElement||r.isRotating||r.openMenu||r.viewModeEnabled)return null;let{x:a,y:i}=Doe(t,r,n);return(0,_H.jsx)("div",{className:"excalidraw-canvas-buttons",style:{top:`${i}px`,left:`${a}px`,padding:Aoe},children:e})},$x=class{constructor(e,t,n){this.animationFrameHandler=e,this.app=t,this.options=n,L(this,"currentTrail"),L(this,"pastTrails",[]),L(this,"container"),L(this,"trailElement"),L(this,"trailAnimation"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(GE,"path"),this.options.animateTrail&&(this.trailAnimation=document.createElementNS(GE,"animate"),this.trailAnimation.setAttribute("attributeName","stroke-dashoffset"),this.trailElement.setAttribute("stroke-dasharray","7 7"),this.trailElement.setAttribute("stroke-dashoffset","10"),this.trailAnimation.setAttribute("from","0"),this.trailAnimation.setAttribute("to","-14"),this.trailAnimation.setAttribute("dur","0.3s"),this.trailElement.appendChild(this.trailAnimation))}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(){this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&this.container?.removeChild(this.trailElement)}startPath(e,t){this.currentTrail=new Zg(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())}getCurrentTrail(){return this.currentTrail}clearTrails(){this.pastTrails=[],this.currentTrail=void 0,this.update()}update(){this.start(),this.trailAnimation&&(this.trailAnimation.setAttribute("begin","indefinite"),this.trailAnimation.setAttribute("repeatCount","indefinite"))}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.trailAnimation?(this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this)),this.trailElement.setAttribute("stroke",(this.options.stroke??(()=>"black"))(this))):this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let n=e.getStrokeOutline(e.options.size/t.zoom.value).map(([a,i])=>{let o=zn({sceneX:a,sceneY:i},t);return[o.x,o.y]}),r=this.trailAnimation?n.slice(0,n.length/2):n;return o8(r,!0)}},Ioe=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,L(this,"localTrail"),L(this,"collabTrails",new Map),L(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new $x(e,t,{...this.getTrailOptions(),fill:()=>zE})}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(Zi(n),Zi(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 $x(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>t.pointer?.laserColor||_2(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))}}},en=e=>t=>{(0,ak.unstable_batchedUpdates)(e,t)},dC=e=>Yp(t=>{(0,ak.unstable_batchedUpdates)(e,t)}),Xx=(()=>{let e;try{let n=kH.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})(),Loe=(e,t,n,r,a,i)=>{let{zoom:o}=r,l=180*n/Math.PI,c=e*(o.value-1)/2,s=t*(o.value-1)/2;return e>a&&o.value!==1&&(c=a*(o.value-1)/2),t>i&&o.value!==1&&(s=i*(o.value-1)/2),`translate(${c}px, ${s}px) scale(${o.value}) rotate(${l}deg)`},Roe=({id:e,onChange:t,onSubmit:n,getViewportCoords:r,element:a,canvas:i,excalidrawContainer:o,app:l,autoSelect:c=!0})=>{let s=(R,P)=>{if(!P.style.fontFamily||!P.style.fontSize)return!1;let F=P.style.fontFamily.replace(/"/g,"");return qc({fontFamily:R.fontFamily})!==F||`${R.fontSize}px`!==P.style.fontSize},d=l.state.theme,u=()=>{d=l.state.theme;let R=l.state,P=l.scene.getElement(e);if(!P)return;let{textAlign:F,verticalAlign:q}=P,te=l.scene.getNonDeletedElementsMap();if(P&&oe(P)){let ge=P.x,be=P.y,fe=ui(P,l.scene.getNonDeletedElementsMap()),He=P.width,je=P.height,ke=P.width,ct=P.height;if(fe&&P.containerId){if(Oe(fe)){let Cs=ae.getBoundTextElementPosition(fe,P,te);ge=Cs.x,be=Cs.y}let Ou=s(P,h),Np;if(Ou?Np=Zp(fe.id,fe.height):(Np=x8[fe.id],Np||(Np=Zp(fe.id,fe.height))),ke=Jp(fe,P),ct=mb(fe,P),!Oe(fe)&&je>ct){let Cs=Wu(je,fe.type);l.scene.mutateElement(fe,{height:Cs}),mi(fe,l.scene);return}else if(!Oe(fe)&&fe.height>Np.height&&je<ct){let Cs=Wu(je,fe.type);l.scene.mutateElement(fe,{height:Cs}),mi(fe,l.scene)}else{let{x:Cs,y:NW}=zs(fe,P,te);ge=Cs,be=NW}}let[On,Zt]=r(ge,be);fe?He+=.5:(ke=(R.width-8-On)/R.zoom.value,He=Math.min(He,ke)),je*=1.05;let qt=Mt(P),gl=(R.height-Zt)/R.zoom.value;Object.assign(h.style,{font:qt,lineHeight:P.lineHeight,width:`${He}px`,height:`${je}px`,left:`${On}px`,top:`${Zt}px`,transform:Loe(He,je,A8(P,fe),R,ke,gl),textAlign:F,verticalAlign:q,color:R.theme===se.DARK?Do(P.strokeColor):P.strokeColor,opacity:P.opacity/100,maxHeight:`${gl}px`}),h.scrollTop=0,xl()&&(h.style.fontFamily=qc(P)),l.scene.mutateElement(P,{x:ge,y:be})}},h=document.createElement("textarea");h.dir="auto",h.tabIndex=0,h.dataset.type="wysiwyg",h.wrap="off",h.classList.add("excalidraw-wysiwyg");let m="pre",p="normal";(jt(a)||!a.autoResize)&&(m="pre-wrap",p="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:p,whiteSpace:m,overflowWrap:"break-word",boxSizing:"content-box"}),h.value=a.originalText,u(),t&&(h.onpaste=async R=>{let P=ure(R),F=null;if(P.has(_e.excalidrawClipboard)||P.has(_e.excalidraw)){R.preventDefault(),F=await Fx(R);try{let fe=await hF(F);if(fe.elements){let He=ef(fe.elements);if(He){let{selectionStart:je,selectionEnd:ke,value:ct}=h;h.value=ct.slice(0,je)+He+ct.slice(ke);let On=je+He.length;h.selectionStart=h.selectionEnd=On,h.dispatchEvent(new Event("input"))}}return}catch{console.warn("failed to parse excalidraw clipboard data")}}F=F||await Fx(R);let q=F.findByType(_e.text);if(!q)return;let te=qp(q.value);if(!te)return;let ge=ui(a,l.scene.getNonDeletedElementsMap()),be=Mt({fontSize:l.state.currentItemFontSize,fontFamily:l.state.currentItemFontFamily});if(ge){let fe=Le(ge,l.scene.getNonDeletedElementsMap()),He=Cl(`${h.value}${te}`,be,Jp(ge,fe)),je=T8(He,be);h.style.width=`${je}px`}},h.oninput=()=>{let R=qp(h.value);if(h.value!==R){let P=h.selectionStart;h.value=R,h.selectionStart=P,h.selectionEnd=P}t(h.value)}),h.onkeydown=R=>{if(!R.shiftKey&&IP.keyTest(R))R.preventDefault(),l.actionManager.executeAction(IP),u();else if(!R.shiftKey&&LP.keyTest(R))R.preventDefault(),l.actionManager.executeAction(LP),u();else if(!R.shiftKey&&RP.keyTest(R))R.preventDefault(),l.actionManager.executeAction(RP),u();else if(TP.keyTest(R))l.actionManager.executeAction(TP);else if(MP.keyTest(R))l.actionManager.executeAction(MP);else if(R.key===D.ESCAPE)R.preventDefault(),_=!0,C();else if(Hx.keyTest(R))R.preventDefault(),C(),l.actionManager.executeAction(Hx);else if(R.key===D.ENTER&&R[D.CTRL_OR_CMD]){if(R.preventDefault(),R.isComposing||R.keyCode===229)return;_=!0,C()}else if(R.key===D.TAB||R[D.CTRL_OR_CMD]&&(R.code===Ee.BRACKET_LEFT||R.code===Ee.BRACKET_RIGHT)){if(R.preventDefault(),R.isComposing)return;R.shiftKey||R.code===Ee.BRACKET_LEFT?b():v(),h.dispatchEvent(new Event("input"))}};let f=4,x=" ".repeat(f),g=new RegExp(`^ {1,${f}}`),v=()=>{let{selectionStart:R,selectionEnd:P}=h,F=w(),q=h.value;F.forEach(te=>{let ge=q.slice(0,te),be=q.slice(te);q=`${ge}${x}${be}`}),h.value=q,h.selectionStart=R+f,h.selectionEnd=P+f*F.length},b=()=>{let{selectionStart:R,selectionEnd:P}=h,F=w(),q=[],te=h.value;F.forEach(ge=>{let be=te.slice(ge,ge+f).match(g);if(be){let fe=te.slice(0,ge),He=te.slice(ge+be[0].length);te=`${fe}${He}`,q.push(ge)}}),h.value=te,q.length&&(R>q[q.length-1]?h.selectionStart=Math.max(R-f,q[q.length-1]):h.selectionStart=R,h.selectionEnd=Math.max(h.selectionStart,P-f*q.length))},w=()=>{let{selectionStart:R,selectionEnd:P,value:F}=h,q=F.slice(0,R).match(/[^\n]*$/)[0].length;return R=R-q,F.slice(R,P).split(`
|
|
61
|
-
`).reduce((te,ge,be,fe)=>te.concat(be?te[be-1]+fe[be-1].length+1:R),[]).reverse()},S=R=>{R.target instanceof HTMLCanvasElement&&(R.preventDefault(),R.stopPropagation())},_=!1,C=()=>{if(K)return;K=!0,k();let R=l.scene.getElement(a.id);if(!R)return;let P=ui(R,l.scene.getNonDeletedElementsMap());if(P){if(h.value.trim()){let F=Qp(P);!F||F!==a.id?l.scene.mutateElement(P,{boundElements:(P.boundElements||[]).concat({type:"text",id:a.id})}):Oe(P)&&_l(P)}else l.scene.mutateElement(P,{boundElements:P.boundElements?.filter(F=>!oe(F))});on(R,P,l.scene)}n({viaKeyboard:_,nextOriginalText:h.value})},k=()=>{h.onblur=null,h.oninput=null,h.onkeydown=null,Z&&Z.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("wheel",S,!0),window.removeEventListener("pointerdown",A),window.removeEventListener("pointerup",T),window.removeEventListener("blur",C),window.removeEventListener("pagehide",C),V(),O(),j(),h.remove()},T=R=>{window.removeEventListener("pointerup",T);let P=R?.target,F=P instanceof HTMLElement&&P.classList.contains("properties-trigger"),q=(P instanceof HTMLElement||P instanceof SVGElement)&&!!P.closest(".properties-content"),te=(P instanceof HTMLElement||P instanceof SVGElement)&&(!!P.closest(`.${vt.SHAPE_ACTIONS_MENU}`)||!!P.closest(".compact-shape-actions-island"));setTimeout(()=>{te||F||q||(h.onblur=C,h.focus())})},I=()=>{h.onblur=null,window.addEventListener("pointerup",T),window.addEventListener("blur",C)},A=R=>{let P=R?.target;if(R.button===Xi.WHEEL){P instanceof HTMLTextAreaElement&&(R.preventDefault(),l.handleCanvasPanUsingWheelOrSpaceDrag(R)),I();return}let F=P instanceof HTMLElement&&P.classList.contains("properties-trigger"),q=(P instanceof HTMLElement||P instanceof SVGElement)&&!!P.closest(".properties-content");(R.target instanceof HTMLElement||R.target instanceof SVGElement)&&(R.target.closest(`.${vt.SHAPE_ACTIONS_MENU}, .${vt.ZOOM_ACTIONS}`)||R.target.closest(".compact-shape-actions-island"))&&!sa(R.target)||F||q?I():R.target instanceof HTMLCanvasElement&&!xl()&&requestAnimationFrame(()=>{C()})},O=l.onChangeEmitter.on(R=>{l.state.theme!==d&&u()}),V=l.scene.onUpdate(()=>{u(),document.activeElement?.closest(".properties-content")||h.focus()}),j=l.onScrollChangeEmitter.on(()=>{u()}),K=!1;c&&h.select(),T();let Z=null;return i&&"ResizeObserver"in window?(Z=new window.ResizeObserver(()=>{u()}),Z.observe(i)):window.addEventListener("resize",u),h.onpointerdown=R=>R.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",A,{capture:!0})}),window.addEventListener("pagehide",C),o?.querySelector(".excalidraw-textEditorContainer").appendChild(h),C},kc=4,Zo=6,Noe="rgba(0,0,0,0.3)",Ooe=(e,t,n,r)=>{if(!e.size)return{horizontal:null,vertical:null};let[a,i,o,l]=Qe(e),c=t/r.zoom.value,s=n/r.zoom.value,d={top:parseInt(Kp("sat"))||0,bottom:parseInt(Kp("sab"))||0,left:parseInt(Kp("sal"))||0,right:parseInt(Kp("sar"))||0},u=y1().rtl,h=-r.scrollX+d.left,m=-r.scrollY+d.top,p=h+c-d.right,f=m+s-d.bottom,x=Math.min(a,h),g=Math.min(i,m),v=Math.max(o,p),b=Math.max(l,f),w=o-a,S=l-i,_=v-x,C=b-g,k=Math.max(kc*2,d.left+d.right)+Zo*2,T=t*(c/_)-k,I=Math.max(kc*2,d.top+d.bottom)+Zo*2,A=n*(s/C)-I,O=_>w?_*r.zoom.value/(T+k):t/(T+k),V=C>S?C*r.zoom.value/(A+I):n/(A+I);return{horizontal:h===x&&p===v?null:{x:Math.max(d.left,kc)+Zo+(h-x)/_*t,y:n-Zo-Math.max(kc,d.bottom),width:T,height:Zo,deltaMultiplier:O},vertical:m===g&&f===b?null:{x:u?Math.max(d.left,kc):t-Zo-Math.max(d.right,kc),y:Math.max(d.top,kc)+Zo+(m-g)/C*n,width:Zo,height:A,deltaMultiplier:V}}},fU=(e,t,n)=>{let[r,a]=[e.horizontal,e.vertical].map(i=>i!=null&&i.x<=t&&t<=i.x+i.width&&i.y<=n&&n<=i.y+i.height);return{isOverEither:r||a,isOverHorizontal:r,isOverVertical:a}},zoe=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())},Poe=e=>{let{lassoPath:t,elements:n,elementsMap:r,elementsSegments:a,intersectedElements:i,enclosedElements:o,simplifyDistance:l}=e,c=t;l&&(c=lx(t,l));let s=n.filter(u=>!u.locked);o.clear(),i.clear();let d=t.reduce((u,h)=>[Math.min(u[0],h[0]),Math.min(u[1],h[1]),Math.max(u[2],h[0]),Math.max(u[3],h[1])],[1/0,1/0,-1/0,-1/0]);for(let u of s){let h=Fs(u,r);Qu(d,h)&&!i.has(u.id)&&!o.has(u.id)&&(Uoe(c,u,a)?o.add(u.id):Boe(c,u,r)&&i.add(u.id))}return{selectedElementIds:[...i,...o]}},Uoe=(e,t,n)=>{let r=uM(e),a=n.get(t.id);return a?a.some(i=>i.some(o=>z0(o,r))):!1},Boe=(e,t,n)=>{let r=e.slice(1).map((i,o)=>Op(e[o],i)).concat([Op(e[e.length-1],e[0])]),a=Le(t,n);return r.some(i=>Ku(t,n,i,0,!0).length>0||!!a&&Ku({...a,...zs(t,a,n)},n,i,0,!0).length>0)},Foe=class extends $x{constructor(e,t){super(e,t,{animateTrail:!0,streamline:.4,sizeMapping:n=>{let r=Math.max(0,1-(performance.now()-n.pressure)/(1/0)),a=(5e3-Math.min(5e3,n.totalLength-n.currentIndex))/5e3;return Math.min(Zi(a),Zi(r))},fill:()=>"rgba(105,101,219,0.05)",stroke:()=>"rgba(105,101,219)"}),L(this,"intersectedElements",new Set),L(this,"enclosedElements",new Set),L(this,"elementsSegments",null),L(this,"canvasTranslate",null),L(this,"keepPreviousSelection",!1),L(this,"selectElementsFromIds",n=>{this.app.setState(r=>{let a=n.reduce((c,s)=>(c[s]=!0,c),{});if(this.keepPreviousSelection)for(let c of Object.keys(r.selectedElementIds))a[c]=!0;for(let[c]of Object.entries(a)){let s=this.app.scene.getNonDeletedElement(c);if(s&&oe(s)){let d=ui(s,this.app.scene.getNonDeletedElementsMap());d&&(a[d.id]=!0,delete a[s.id])}}for(let[c]of Object.entries(a)){let s=this.app.scene.getNonDeletedElement(c);if(s&&he(s)){let d=pi(this.app.scene.getNonDeletedElementsMap(),s.id);for(let u of d)delete a[u.id]}}let i=bn({editingGroupId:r.editingGroupId,selectedElementIds:a},this.app.scene.getNonDeletedElements(),r,this.app),o=[...Object.keys(i.selectedElementIds)],l=[...Object.keys(i.selectedGroupIds)];return{selectedElementIds:i.selectedElementIds,selectedGroupIds:i.selectedGroupIds,selectedLinearElement:o.length===1&&!l.length&&Te(this.app.scene.getNonDeletedElement(o[0]))?new ae(this.app.scene.getNonDeletedElement(o[0]),this.app.scene.getNonDeletedElementsMap()):null}})}),L(this,"addPointToPath",(n,r,a=!1)=>{super.addPointToPath(n,r),this.keepPreviousSelection=a,this.updateSelection()}),L(this,"updateSelection",()=>{let n=super.getCurrentTrail()?.originalPoints?.map(a=>N(a[0],a[1])),r={scrollX:this.app.state.scrollX,scrollY:this.app.state.scrollY,zoom:this.app.state.zoom.value};if(!this.elementsSegments||!Qt(r,this.canvasTranslate??{})){this.canvasTranslate=r,this.elementsSegments=new Map;let a=me(this.app.visibleElements);for(let i of this.app.visibleElements){let o=Tb(i,a);this.elementsSegments.set(i.id,o)}}if(n){let{selectedElementIds:a}=Poe({lassoPath:n,elements:this.app.visibleElements,elementsMap:this.app.scene.getNonDeletedElementsMap(),elementsSegments:this.elementsSegments,intersectedElements:this.intersectedElements,enclosedElements:this.enclosedElements,simplifyDistance:5/this.app.state.zoom.value});this.selectElementsFromIds(a)}})}startPath(e,t,n=!1){this.endPath(),super.startPath(e,t),this.intersectedElements.clear(),this.enclosedElements.clear(),this.keepPreviousSelection=n,this.keepPreviousSelection||this.app.setState({selectedElementIds:{},selectedGroupIds:{},selectedLinearElement:null})}endPath(){super.endPath(),super.clearTrails(),this.intersectedElements.clear(),this.enclosedElements.clear(),this.elementsSegments=null}},Hoe=class extends $x{constructor(e,t){super(e,t,{streamline:.2,size:5,keepHead:!0,sizeMapping:n=>{let r=Math.max(0,1-(performance.now()-n.pressure)/200),a=(10-Math.min(10,n.totalLength-n.currentIndex))/10;return Math.min(Zi(a),Zi(r))},fill:()=>t.state.theme===se.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"}),L(this,"elementsToErase",new Set),L(this,"groupsToErase",new Set)}startPath(e,t){this.endPath(),super.startPath(e,t),this.elementsToErase.clear()}addPointToPath(e,t,n=!1){return super.addPointToPath(e,t),this.updateElementsToBeErased(n)}updateElementsToBeErased(e){let t=super.getCurrentTrail()?.originalPoints?.map(i=>N(i[0],i[1]))||[];if(t.length<2)return[];let n=Op(t[t.length-1],t[t.length-2]),r=this.app.visibleElements.filter(i=>!i.locked),a=me(r);for(let i of r)if(e&&this.elementsToErase.has(i.id)){if(gU(n,i,a,this.app.state.zoom.value)){let o=i.groupIds.at(-1);if(this.groupsToErase.has(o)){let l=wt(this.app.scene.getNonDeletedElementsMap(),o);for(let c of l)this.elementsToErase.delete(c.id);this.groupsToErase.delete(o)}if(jt(i)&&this.elementsToErase.delete(i.containerId),gn(i)){let l=Qp(i);l&&this.elementsToErase.delete(l)}this.elementsToErase.delete(i.id)}}else if(!e&&!this.elementsToErase.has(i.id)&&gU(n,i,a,this.app.state.zoom.value)){let o=i.groupIds.at(-1);if(!this.groupsToErase.has(o)){let l=wt(this.app.scene.getNonDeletedElementsMap(),o);for(let c of l)this.elementsToErase.add(c.id);this.groupsToErase.add(o)}if(gn(i)){let l=Qp(i);l&&this.elementsToErase.add(l)}jt(i)&&this.elementsToErase.add(i.containerId),this.elementsToErase.add(i.id)}return Array.from(this.elementsToErase)}endPath(){super.endPath(),super.clearTrails(),this.elementsToErase.clear(),this.groupsToErase.clear()}},gU=(e,t,n,r)=>{let a=e[1],i=td(t)?15:t.strokeWidth/2,o=[Math.min(e[0][0],e[1][0])-i,Math.min(e[0][1],e[1][1])-i,Math.max(e[0][0],e[1][0])+i,Math.max(e[0][1],e[1][1])+i],l=Fs(t,n),c=[l[0]-i,l[1]-i,l[2]+i,l[3]+i];if(!Qu(o,c))return!1;if(I8(t)&&fb(a,t,n))return!0;if(td(t)){let d=nA(t),u=tA(t,d,n),h=Math.max(2.25,5/r);for(let p of u)if(RE(p,e)<=h)return!0;let m=dM(...d.map(([p,f])=>N(t.x+p,t.y+f)));return!!z0(e[0],m)}let s=Le(t,n);if(Oe(t)||Pt(t)&&!t.polygon){let d=Math.max(t.strokeWidth,t.strokeWidth*2/r),u=Tb(t,n);for(let h of u)if(RE(h,e)<=d)return!0;return!1}return Ku(t,n,e,0,!0).length>0||!!s&&Ku({...s,...zs(t,s,n)},n,e,0,!0).length>0},joe=44,Voe=22,Goe=66,Yoe=48,bx=14,Woe=304,Koe=320,TH=5.87,$oe=28,Xoe=4,Zoe=2,bU=10,qoe=10,Qoe=8,Lc=12,Zx=256,qx=10,vU=4,Qx=Lc*2,yU=Lc*2,Joe=100,ele=140,vx=.35,tle=Lc/2,Gd=20,uC=Lc*2,xU=Lc,tn={fillStyle:"hachure",fontFamily:Fu,fontSize:ks,opacity:100,roughness:1,strokeColor:_r.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:si.MIDDLE,locked:!1},ru=vM(mM),nle=e=>e.labels?.length??e.series[0]?.values.length??0,MH=(e,t)=>{if(!e)return!1;let n=nle(e);return n<2?!1:t==="radar"?n>=3:!0},wU=(e,t)=>{let n=t<=1?0:Math.min(Goe,(t-1)*Voe);return e+n},AH=(e,t)=>{if(e==="line"){let r=wU(Yoe,t);return{slotWidth:r,gap:bx,chartHeight:Koe,xLabelMaxWidth:r+bx*3+bU}}let n=wU(joe,t);return{slotWidth:n,gap:bx,chartHeight:Woe,xLabelMaxWidth:n+bx*3+bU}},G2=(e,t)=>{let n=(t.slotWidth+t.gap)*e.series[0].values.length+t.gap,r=t.chartHeight+t.gap*2;return{chartWidth:n,chartHeight:r}},rle=()=>{let e=Zx+yU*2,t=Zx+yU*2;return{chartWidth:e,chartHeight:t}},ale=(e,t,n)=>{let r=Math.abs(e-t);return Math.min(r,n-r)},ik=(e,t)=>{if(e<=0||ru.length===0)return[];let n=ru.length,r=(t%n+n)%n,a=[r],i=Math.min(e,n),o=new Set(Array.from({length:n},(l,c)=>c).filter(l=>l!==r));for(;a.length<i;){let l=-1,c=-1,s=-1;for(let d of o){let u=a.map(p=>ale(d,p,n)),h=Math.min(...u),m=u.reduce((p,f)=>p+f,0)/u.length;(h>c||h===c&&m>s)&&(l=d,c=h,s=m)}a.push(l),o.delete(l)}return Array.from({length:e},(l,c)=>ru[a[c%a.length]])},ok=e=>{if(ru.length===0)return 0;if(typeof e!="number"||!Number.isFinite(e))return Math.floor(Math.random()*ru.length);let t=e.toString(),n=0;for(let r=0;r<t.length;r++)n=n*31+t.charCodeAt(r)|0;return Math.abs(n)%ru.length},lk=e=>ru[e],ile=(e,t)=>{let n=e.flatMap(l=>l.values.map(c=>Math.max(0,c))),r=n.filter(l=>l>0),a=Math.max(1,...n),i=r.length>0?Math.min(...r):1,o=e.length===1&&i>0&&a/i>=Joe;return{renderSteps:!1,normalize:(l,c)=>{let s=Math.max(0,l);return o?Math.log10(s+1)/Math.log10(a+1):s/a}}},ole=e=>/\s/.test(e.trim()),sk=(e,t,n)=>ole(e)?Cl(e,t,n):e,lle=(e,t,n,r,a,i)=>{let o=Ot.Excalifont,l=li.sm,c=jr(o),s=Mt({fontFamily:o,fontSize:l}),d=Math.min(ele,a*(e.length>8?.56:.72)),u=Yu(s,c),h=e.map((f,x)=>{let g=t[x],v=Math.max(0,...f.trim().split(/\s+/).filter(Boolean).map(K=>kt(K,s,c).width)),b=Math.max(u,d,v),w=sk(f,s,b),S=kt(w,s,c),_=Math.cos(g),C=Math.sin(g),k=_>vx?"left":_<-vx?"right":"center",T=k==="center"?S.width/2:0,I=Math.abs(_)*T+Math.abs(C)*(S.height/2),A=Qx+I+tle,O=n+_*(a+A),V=r+C*(a+A),j=C>vx?Lc/3:C<-vx?-Lc/3:0;return mr({backgroundColor:i,...tn,text:w,originalText:f,x:O,y:V+j,fontFamily:o,fontSize:l,lineHeight:c,textAlign:k,verticalAlign:"middle"})}),m=Math.min(...h.map(f=>f.y)),p=Math.max(...h.map(f=>f.y+f.height));return{axisLabels:h,axisLabelTopY:m,axisLabelBottomY:p}},ck=(e,t,n,r,a,i)=>{if(e.length<=1)return[];let o=Ot["Lilita One"],l=li.lg,c=jr(o),s=Mt({fontFamily:o,fontSize:l}),d=e.map((w,S)=>{let _=w.title?.trim()||`Series ${S+1}`,C=sk(_,s,Zx),k=kt(C,s,c),T=Gd+xU+k.width;return{label:_,displayLabel:C,color:t[S],width:T,height:k.height}}),u=Math.max(Gd/2,...d.map(w=>w.height/2)),h=Math.max(a,r+u+Qx),m=uC,p=Gd*.6,f=d.reduce((w,S)=>w+S.width,0)+uC*Math.max(0,d.length-1),x=f+m*2,g=u*2+p*2,v=[];v.push(ua({...tn,backgroundColor:"transparent",type:"rectangle",fillStyle:"solid",strokeColor:_r.black,x:n-x/2,y:h-g/2,width:x,height:g,roughness:As.architect,roundness:{type:zt.PROPORTIONAL_RADIUS}}));let b=n-f/2;return d.forEach(w=>{v.push(ua({...tn,backgroundColor:w.color,type:"rectangle",x:b,y:h-Gd/2,width:Gd,height:Gd,fillStyle:"solid",strokeColor:w.color,roughness:As.architect,roundness:{type:zt.PROPORTIONAL_RADIUS}})),v.push(mr({...tn,text:w.displayLabel,originalText:w.label,autoResize:!1,x:b+Gd+xU,y:h,fontFamily:o,fontSize:l,lineHeight:c,textAlign:"left",verticalAlign:"middle"})),b+=w.width+uC}),v},sle=(e,t,n,r)=>{if(kt(e,n,r).width<=t)return e;let a=e.length;for(;a>1;){let i=`${e.slice(0,a)}...`;if(kt(i,n,r).width<=t)return i;a--}return e[0]?`${e[0]}...`:e},cle=(e,t,n,r)=>{if(kt(e,n,r).width<=t)return{wrapped:!1,text:e};let a=e.trim().split(/\s+/).filter(Boolean);return a.length>1&&!a.some(i=>kt(i,n,r).width>t)&&t>=Yu(n,r)?{wrapped:!0,text:Cl(e,n,t)}:{wrapped:!1,text:sle(e,t,n,r)}},DH=(e,t,n)=>{let r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n));return{width:e*r+t*a,height:e*a+t*r}},EU=e=>e.includes("..."),dle=(e,t,n,r,a)=>{let i=Math.max($oe,Math.ceil(Yu(r,a))),o=Math.max(i,Math.floor(t)),l=[];for(let m=o;m>=i;m-=4)l.push(m);l[l.length-1]!==i&&l.push(i);let c=m=>{let p=EU(m.text),f=m.text.replace(/\.\.\./g,"").replace(/\n/g,"").length,x=m.text.split(`
|
|
62
|
-
`).length;return{ellipsified:p,visibleChars:f,lineCount:x}},s=(m,p)=>{let f=c(m),x=c(p);return f.ellipsified!==x.ellipsified?!f.ellipsified:f.visibleChars!==x.visibleChars?f.visibleChars>x.visibleChars:f.lineCount!==x.lineCount?f.lineCount<x.lineCount:m.rotatedHeight<p.rotatedHeight},d=null,u=null,h=null;for(let m of l){let{wrapped:p,text:f}=cle(e,m,r,a),x=kt(f,r,a),g=DH(x.width,x.height,TH),v={originalText:e,text:f,metrics:x,rotatedWidth:g.width,rotatedHeight:g.height,wrapped:p},b=g.width-n;if(b<=0){(!d||s(v,d))&&(d=v);continue}(!u||b<u.overflow||b===u.overflow&&s(v,u.spec))&&(u={overflow:b,spec:v}),!EU(v.text)&&(!h||b<h.overflow||b===h.overflow&&s(v,h.spec))&&(h={overflow:b,spec:v})}return d||(h&&u&&h.overflow<=u.overflow+Qoe?h.spec:u.spec)},IH=e=>{if(e.type!=="text")return e.y+e.height;let t=DH(e.width,e.height,e.angle);return e.y+e.height/2+t.height/2},dk=(e,t,n,r,a)=>{let i=tn.fontFamily,o=li.sm,l=jr(i),c=Mt({fontFamily:i,fontSize:o}),s=Math.max(1,a.slotWidth+a.gap-Xoe*2+qoe),d=n;return e.labels?.map((u,h)=>{let m=dle(u,a.xLabelMaxWidth,s,c,l),p=t+h*(a.slotWidth+a.gap)+a.gap+a.slotWidth/2,f=d+Zoe+(m.rotatedHeight-m.metrics.height)/2;return mr({backgroundColor:r,...tn,text:m.text,originalText:m.wrapped?u:m.text,autoResize:!m.wrapped,x:p,y:f,angle:TH,fontSize:o,lineHeight:l,textAlign:"center",verticalAlign:"top"})})||[]},ule=(e,t,n,r,a,i=Math.max(...e.series[0].values))=>{let o=mr({backgroundColor:r,...tn,x:t-a.gap,y:n-a.gap,text:"0",textAlign:"right"}),l=mr({backgroundColor:r,...tn,x:t-a.gap,y:n-a.chartHeight-o.height/2,text:i.toLocaleString(),textAlign:"right"});return[o,l]},hle=(e,t,n,r,a)=>{let{chartWidth:i,chartHeight:o}=G2(e,a),l=Vr({backgroundColor:r,...tn,type:"line",x:t,y:n,width:i,points:[N(0,0),N(i,0)]}),c=Vr({backgroundColor:r,...tn,type:"line",x:t,y:n,height:o,points:[N(0,0),N(0,-o)]}),s=Vr({backgroundColor:r,...tn,type:"line",x:t,y:n-a.chartHeight-a.gap,strokeStyle:"dotted",width:i,opacity:qx,points:[N(0,0),N(i,0)]});return[l,c,s]},LH=(e,t,n,r,a,i=Math.max(...e.series[0].values),o)=>{let{chartWidth:l,chartHeight:c}=G2(e,a),s=e.title?mr({backgroundColor:r,...tn,text:e.title,x:t+l/2,y:n-a.chartHeight-a.gap*2-ks,roundness:null,textAlign:"center",fontSize:li.xl,fontFamily:Ot["Lilita One"]}):null,d=o?ua({backgroundColor:r,...tn,type:"rectangle",x:t,y:n-c,width:l,height:c,strokeColor:_r.black,fillStyle:"solid",opacity:6}):null;return[...d?[d]:[],...s?[s]:[],...dk(e,t,n,r,a),...ule(e,t,n,r,a,i),...hle(e,t,n,r,a)]},mle=(e,t,n,r)=>{let a=e.series,i=AH("bar",a.length),o=Math.max(1,...a.flatMap(w=>w.values.map(S=>Math.max(0,S)))),l=ok(r),c=lk(l),s=ik(a.length,l),d=a.length>1?Math.max(1,Math.floor(i.gap/(a.length+1))):0,u=a.length>1?Math.max(2,(i.slotWidth-d*(a.length-1))/a.length):i.slotWidth,h=a.length*u+d*(a.length-1),m=(i.slotWidth-h)/2,p=a[0].values.flatMap((w,S)=>a.map((_,C)=>{let k=Math.max(0,_.values[S]??0)/o*i.chartHeight,T=a.length>1?s[C]:c;return ua({backgroundColor:T,...tn,type:"rectangle",fillStyle:a.length>1?"solid":tn.fillStyle,strokeColor:a.length>1?T:tn.strokeColor,x:t+S*(i.slotWidth+i.gap)+i.gap+m+C*(u+d),y:n-k-i.gap,width:u,height:k})})),f=LH(e,t,n,c,i,o,qn()),x=dk(e,t,n,c,i),g=Math.max(n+i.gap/2,...x.map(w=>IH(w))),{chartWidth:v}=G2(e,i),b=ck(a,s,t+v/2,g,n+i.gap*5,c);return[...f,...p,...b]},ple=(e,t,n,r)=>{let a=e.series,i=AH("line",a.length),o=Math.max(1,...a.flatMap(v=>v.values)),l=ok(r),c=lk(l),s=ik(a.length,l),d=a.map((v,b)=>{let w=v.values.map((T,I)=>N(I*(i.slotWidth+i.gap),-(T/o)*i.chartHeight)),S=Math.max(...w.map(T=>T[0])),_=Math.max(...w.map(T=>T[1])),C=Math.min(...w.map(T=>T[0])),k=Math.min(...w.map(T=>T[1]));return Vr({backgroundColor:"transparent",...tn,type:"line",x:t+i.gap+i.slotWidth/2,y:n-i.gap,height:_-k,width:S-C,strokeColor:s[b],strokeWidth:2,points:w})}),u=a.flatMap((v,b)=>v.values.map((w,S)=>{let _=S*(i.slotWidth+i.gap)+i.gap/2,C=-(w/o)*i.chartHeight+i.gap/2;return ua({backgroundColor:s[b],...tn,fillStyle:"solid",strokeColor:s[b],strokeWidth:2,type:"ellipse",x:t+_+i.slotWidth/2,y:n+C-i.gap*2,width:i.gap,height:i.gap})})),h=a[0].values.map((v,b)=>Math.max(0,...a.map(w=>w.values[b]??0))).map((v,b)=>{let w=b*(i.slotWidth+i.gap)+i.gap/2,S=v/o*i.chartHeight+i.gap/2+i.gap;return Vr({backgroundColor:c,...tn,type:"line",x:t+w+i.slotWidth/2+i.gap/2,y:n-S,height:S,strokeStyle:"dotted",opacity:qx,points:[N(0,0),N(0,S)]})}),m=LH(e,t,n,c,i,o,qn()),p=dk(e,t,n,c,i),f=Math.max(n+i.gap/2,...p.map(v=>IH(v))),{chartWidth:x}=G2(e,i),g=ck(a,s,t+x/2,f,n+i.gap*5,c);return[...m,...d,...h,...u,...g]},$o=e=>{let t=/^([-+]?)[$\u20AC\u00A3\u00A5\u20A9]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},fle=(e,t)=>e.slice(1).every(n=>$o(n[t])!==null),gle=e=>{let t=e[0].length;if(t>2){let i=e[0].every(c=>$o(c)===null),o=i?e.slice(1):e;if(o.length<1)return{ok:!1,reason:"No data rows"};if(o.some(c=>c.slice(1).some(s=>$o(s)===null)))return{ok:!1,reason:"Value is not numeric"};if(t-1>o.length){let c=i?e[0].slice(1).map(d=>d.trim()):null,s=o.map(d=>({title:d[0]?.trim()||null,values:d.slice(1).map(u=>$o(u))}));return{ok:!0,data:{title:s.length===1?s[0].title:i&&e[0][0].trim()||null,labels:c,series:s}}}let l=e[0].slice(1).map((c,s)=>{let d=s+1,u=`Series ${d}`;return{title:i&&c.trim()||u,values:o.map(h=>$o(h[d]))}});return{ok:!0,data:{title:i&&e[0][0].trim()||null,labels:o.map(c=>c[0]),series:l}}}if(t===1){if(!fle(e,0))return{ok:!1,reason:"Value is not numeric"};let i=$o(e[0][0])===null,o=i?e[0][0]:null,l=(i?e.slice(1):e).map(c=>$o(c[0]));return l.length<2?{ok:!1,reason:"Less than two rows"}:{ok:!0,data:{title:o,labels:null,series:[{title:o,values:l}]}}}let n=$o(e[0][1])===null,r=n?e.slice(1):e;if(r.length<2)return{ok:!1,reason:"Less than 2 rows"};if(r.some(i=>$o(i[1])===null))return{ok:!1,reason:"Value is not numeric"};let a=n?e[0][1]:null;return{ok:!0,data:{title:a,labels:r.map(i=>i[0]),series:[{title:a,values:r.map(i=>$o(i[1]))}]}}},ble=e=>{let t=i=>e.replace(/\r\n?/g,`
|
|
63
|
-
`).split(`
|
|
64
|
-
`).filter(o=>o.trim().length>0).map(o=>o.split(i).map(l=>l.trim())),n=[" ",",",";"].map(i=>{let o=t(i),l=o[0]?.length??0,c=o.length>0&&o.every(s=>s.length===l);return{delimiter:i,parsed:o,numCols:l,isConsistent:c}}),r=(n.find(i=>i.isConsistent&&i.numCols>1)??n.find(i=>i.isConsistent)??n[0]).parsed;if(r.length===0)return{ok:!1,reason:"No values"};let a=r[0].length;return r.every(i=>i.length===a)?gle(r):{ok:!1,reason:"All rows don't have same number of columns"}},vle=(e,t,n,r)=>{if(!MH(e,"radar"))return null;let a=e.labels??e.series[0].values.map((K,Z)=>`Value ${Z+1}`),i=e.series,{normalize:o,renderSteps:l}=ile(i,a.length),c=ok(r),s=lk(c),d=ik(i.length,c),{chartWidth:u,chartHeight:h}=rle(),m=t+u/2,p=n-h/2,f=Zx/2,x=a.map((K,Z)=>-Math.PI/2+Math.PI*2*Z/a.length),{axisLabels:g,axisLabelTopY:v,axisLabelBottomY:b}=lle(a,x,m,p,f,s),w=Ot["Lilita One"],S=li.xl,_=jr(w),C=Mt({fontFamily:w,fontSize:S}),k=e.title?sk(e.title,C,u+Qx*2):null,T=k?kt(k,C,_):null,I=k?mr({backgroundColor:s,...tn,text:k,originalText:e.title??k,x:t+u/2,y:v-Qx-T.height/2,fontFamily:w,fontSize:S,lineHeight:_,textAlign:"center"}):null,A=l?Array.from({length:vU},(K,Z)=>{let R=(Z+1)/vU,P=f*R,F=x.map(q=>N(Math.cos(q)*P,Math.sin(q)*P));return F.push(N(F[0][0],F[0][1])),Vr({backgroundColor:"transparent",...tn,type:"line",x:m,y:p,width:P*2,height:P*2,strokeStyle:"solid",roughness:As.architect,opacity:qx,polygon:!0,points:F})}):[],O=x.map(K=>{let Z=Math.cos(K)*f,R=Math.sin(K)*f;return Vr({backgroundColor:"transparent",...tn,type:"line",x:m,y:p,width:Math.abs(Z),height:Math.abs(R),strokeStyle:"solid",roughness:As.architect,opacity:qx,points:[N(0,0),N(Z,R)]})}),V=i.map((K,Z)=>{let R=x.map((P,F)=>{let q=K.values[F]??0,te=o(q,F)*f;return N(Math.cos(P)*te,Math.sin(P)*te)});return R.push(N(R[0][0],R[0][1])),Vr({backgroundColor:"transparent",...tn,type:"line",x:m,y:p,width:f*2,height:f*2,strokeColor:d[Z],strokeWidth:2,polygon:!0,points:R})}),j=ck(i,d,m,b,n+Lc*5,s);return[...I?[I]:[],...g,...A,...O,...V,...j]},yle=(e,t,n,r,a)=>e==="line"?ple(t,n,r,a):e==="radar"?vle(t,n,r,a):mle(t,n,r,a),xle=()=>(0,zr.jsxs)("div",{"data-testid":"brave-measure-text-error",children:[(0,zr.jsx)("p",{children:(0,zr.jsx)(nl,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>(0,zr.jsx)("span",{style:{fontWeight:600},children:e})})}),(0,zr.jsx)("p",{children:(0,zr.jsx)(nl,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>(0,zr.jsx)("span",{style:{fontWeight:600},children:e})})}),(0,zr.jsx)("p",{children:(0,zr.jsx)(nl,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>(0,zr.jsx)("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),(0,zr.jsx)("p",{children:(0,zr.jsx)(nl,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>(0,zr.jsx)("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>(0,zr.jsxs)("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),wle=xle,Ele=({children:e,left:t,top:n,onCloseRequest:r,fitInViewport:a=!1,offsetLeft:i=0,offsetTop:o=0,viewportWidth:l=window.innerWidth,viewportHeight:c=window.innerHeight,className:s})=>{let d=(0,Rc.useRef)(null);(0,Rc.useEffect)(()=>{let h=d.current;if(!h)return;h.contains(document.activeElement)||h.focus();let m=p=>{if(p.key===D.TAB){let f=$p(h),{activeElement:x}=document,g=f.findIndex(v=>v===x);x===h?(p.shiftKey?f[f.length-1]?.focus():f[0].focus(),p.preventDefault(),p.stopImmediatePropagation()):g===0&&p.shiftKey?(f[f.length-1]?.focus(),p.preventDefault(),p.stopImmediatePropagation()):g===f.length-1&&!p.shiftKey&&(f[0]?.focus(),p.preventDefault(),p.stopImmediatePropagation())}};return h.addEventListener("keydown",m),()=>h.removeEventListener("keydown",m)},[]);let u=(0,Rc.useRef)(null);return(0,Rc.useLayoutEffect)(()=>{if(a&&d.current&&n!=null&&t!=null){let h=d.current,{width:m,height:p}=h.getBoundingClientRect();if(u.current?.top===n&&u.current?.left===t)return;u.current={top:n,left:t},m>=l?(h.style.width=`${l}px`,h.style.left="0px",h.style.overflowX="scroll"):t+m-i>l?h.style.left=`${l-m-10}px`:h.style.left=`${t}px`,p>=c?(h.style.height=`${c-20}px`,h.style.top="10px",h.style.overflowY="scroll"):n+p-o>c?h.style.top=`${c-p}px`:h.style.top=`${n}px`}},[n,t,a,l,c,i,o]),(0,Rc.useEffect)(()=>{if(r){let h=m=>{d.current?.contains(m.target)||(0,NH.unstable_batchedUpdates)(()=>r(m))};return document.addEventListener("pointerdown",h,!1),()=>document.removeEventListener("pointerdown",h,!1)}},[r]),(0,OH.jsx)("div",{className:H("popover",s),ref:d,tabIndex:-1,children:e})},jn="separator",Sle=RH.default.memo(({actionManager:e,items:t,top:n,left:r,onClose:a})=>{let i=$1(),o=nw(),l=t.reduce((c,s)=>(s&&(s===jn||!s.predicate||s.predicate(o,i,e.app.props,e.app))&&c.push(s),c),[]);return(0,as.jsx)(Ele,{onCloseRequest:()=>{a()},top:n,left:r,fitInViewport:!0,offsetLeft:i.offsetLeft,offsetTop:i.offsetTop,viewportWidth:i.width,viewportHeight:i.height,className:"context-menu-popover",children:(0,as.jsx)("ul",{className:"context-menu",onContextMenu:c=>c.preventDefault(),children:l.map((c,s)=>{if(c===jn)return!l[s-1]||l[s-1]===jn?null:(0,as.jsx)("hr",{className:"context-menu-item-separator"},s);let d=c.name,u="";return c.label&&(typeof c.label=="function"?u=E(c.label(o,i,e.app)):u=E(c.label)),(0,as.jsx)("li",{"data-testid":d,onClick:()=>{a(()=>{e.executeAction(c,"contextMenu")})},children:(0,as.jsxs)("button",{type:"button",className:H("context-menu-item",{dangerous:d==="deleteSelectedElements",checkmark:c.checked?.(i)}),children:[(0,as.jsx)("div",{className:"context-menu-item__label",children:u}),(0,as.jsx)("kbd",{className:"context-menu-item__shortcut",children:d?hn(d):""})]})},s)})})})}),Cle=({height:e,width:t,userToFollow:n,onDisconnect:r})=>(0,au.jsx)("div",{className:"follow-mode",style:{width:t,height:e},children:(0,au.jsxs)("div",{className:"follow-mode__badge",children:[(0,au.jsxs)("div",{className:"follow-mode__badge__label",children:["Following"," ",(0,au.jsx)("span",{className:"follow-mode__badge__username",title:n.username,children:n.username})]}),(0,au.jsx)("button",{type:"button",onClick:r,className:"follow-mode__disconnect-btn",children:Hm})]})}),_le=Cle,PH=({delay:e,theme:t})=>{let[n,r]=(0,Y2.useState)(!!e);return(0,Y2.useEffect)(()=>{if(!e)return;let a=setTimeout(()=>{r(!1)},e);return()=>clearTimeout(a)},[e]),n?null:(0,Am.jsxs)("div",{className:H("LoadingMessage",{"LoadingMessage--dark":t===se.DARK}),children:[(0,Am.jsx)("div",{children:(0,Am.jsx)(il,{})}),(0,Am.jsx)("div",{className:"LoadingMessage-text",children:E("labels.loadingScene")})]})},kle="medium",SU={CHECKED:b_,UNCHECKED:r2},Tle=e=>(0,R1.jsxs)("label",{className:H("ToolIcon ToolIcon__lock",`ToolIcon_size_${kle}`,{"is-mobile":e.isMobile}),title:`${e.title} \u2014 Q`,children:[(0,R1.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"}),(0,R1.jsx)("div",{className:"ToolIcon__icon",children:e.checked?SU.CHECKED:SU.UNCHECKED})]}),Mle=e=>(0,UH.jsx)(Me,{className:H("Shape",{fillable:!1,active:e.checked}),type:"radio",icon:C_,name:"editor-current-shape",checked:e.checked,title:`${e.title} \u2014 H`,keyBindingLabel:e.isMobile?void 0:D.H.toLocaleUpperCase(),"aria-label":`${e.title} \u2014 H`,"aria-keyshortcuts":D.H,"data-testid":"toolbar-hand",onChange:()=>e.onChange?.()}),hC=[{type:"rectangle",icon:v_,title:$e(E("toolBar.rectangle"))},{type:"diamond",icon:y_,title:$e(E("toolBar.diamond"))},{type:"ellipse",icon:x_,title:$e(E("toolBar.ellipse"))}],mC=[{type:"selection",icon:a2,title:$e(E("toolBar.selection"))},{type:"lasso",icon:h1,title:$e(E("toolBar.lasso"))}],pC=[{type:"arrow",icon:sB,title:$e(E("toolBar.arrow"))},{type:"line",icon:w_,title:$e(E("toolBar.line"))}],Ale=({app:e,onHandToolToggle:t,setAppState:n})=>{let r=e.state.activeTool,[a,i]=(0,Mc.useState)(!1),[o,l]=(0,Mc.useState)("rectangle"),[c,s]=(0,Mc.useState)("arrow");(0,Mc.useEffect)(()=>{(r.type==="rectangle"||r.type==="diamond"||r.type==="ellipse")&&l(r.type)},[r.type]),(0,Mc.useEffect)(()=>{(r.type==="arrow"||r.type==="line")&&s(r.type)},[r.type]);let d=r.type==="frame",u=r.type==="laser",h=r.type==="embeddable",{TTDDialogTriggerTunnel:m}=Br(),p=(A,O)=>{e.state.activeTool.type!==A&&at("toolbar",A,"ui"),A==="selection"?e.state.activeTool.type==="selection"||e.setActiveTool({type:"selection"}):e.setActiveTool({type:A})},[f,x]=(0,Mc.useState)(0),g=36,v=4,b=7,w=b*g+(b-1)*v,S=g+v,_=f>=w+1*S,C=f>=w+2*S,k=f>=w+3*S,T=["text","frame","embeddable","laser","magicframe"].filter(A=>!(_&&A==="text"||C&&A==="image"||k&&A==="frame")).includes(r.type),I=T?r.type==="text"?Em:r.type==="image"?wx:r.type==="frame"?Zd:r.type==="embeddable"?Px:r.type==="laser"?Rm:r.type==="magicframe"?Ux:NC:NC;return(0,Ct.jsxs)("div",{className:"mobile-toolbar",ref:A=>{A&&x(A.getBoundingClientRect().width)},children:[(0,Ct.jsx)(Mle,{checked:oh(e.state),onChange:t,title:E("toolBar.hand"),isMobile:!0}),(0,Ct.jsx)(Ix,{app:e,options:mC,activeTool:r,defaultOption:e.state.preferredSelectionTool.type,namePrefix:"selectionType",title:$e(E("toolBar.selection")),"data-testid":"toolbar-selection",onToolChange:A=>{(A==="selection"||A==="lasso")&&(e.setActiveTool({type:A}),n({preferredSelectionTool:{type:A,initialized:!0}}))},displayedOption:mC.find(A=>A.type===e.state.preferredSelectionTool.type)||mC[0]}),(0,Ct.jsx)(Me,{className:H({active:r.type==="freedraw"}),type:"radio",icon:H1,checked:r.type==="freedraw",name:"editor-current-shape",title:`${$e(E("toolBar.freedraw"))}`,"aria-label":$e(E("toolBar.freedraw")),"data-testid":"toolbar-freedraw",onChange:()=>p("freedraw")}),(0,Ct.jsx)(Me,{className:H({active:r.type==="eraser"}),type:"radio",icon:cB,checked:r.type==="eraser",name:"editor-current-shape",title:`${$e(E("toolBar.eraser"))}`,"aria-label":$e(E("toolBar.eraser")),"data-testid":"toolbar-eraser",onChange:()=>p("eraser")}),(0,Ct.jsx)(Ix,{app:e,options:hC,activeTool:r,defaultOption:o,namePrefix:"shapeType",title:$e(E(o==="rectangle"?"toolBar.rectangle":o==="diamond"?"toolBar.diamond":o==="ellipse"?"toolBar.ellipse":"toolBar.rectangle")),"data-testid":"toolbar-rectangle",onToolChange:A=>{(A==="rectangle"||A==="diamond"||A==="ellipse")&&(l(A),e.setActiveTool({type:A}))},displayedOption:hC.find(A=>A.type===o)||hC[0]}),(0,Ct.jsx)(Ix,{app:e,options:pC,activeTool:r,defaultOption:c,namePrefix:"linearElementType",title:$e(E(c==="arrow"?"toolBar.arrow":"toolBar.line")),"data-testid":"toolbar-arrow",fillable:!0,onToolChange:A=>{(A==="arrow"||A==="line")&&(s(A),e.setActiveTool({type:A}))},displayedOption:pC.find(A=>A.type===c)||pC[0]}),_&&(0,Ct.jsx)(Me,{className:H({active:r.type==="text"}),type:"radio",icon:Em,checked:r.type==="text",name:"editor-current-shape",title:`${$e(E("toolBar.text"))}`,"aria-label":$e(E("toolBar.text")),"data-testid":"toolbar-text",onChange:()=>p("text")}),C&&(0,Ct.jsx)(Me,{className:H({active:r.type==="image"}),type:"radio",icon:wx,checked:r.type==="image",name:"editor-current-shape",title:`${$e(E("toolBar.image"))}`,"aria-label":$e(E("toolBar.image")),"data-testid":"toolbar-image",onChange:()=>p("image")}),k&&(0,Ct.jsx)(Me,{className:H({active:d}),type:"radio",icon:Zd,checked:d,name:"editor-current-shape",title:`${$e(E("toolBar.frame"))}`,"aria-label":$e(E("toolBar.frame")),"data-testid":"toolbar-frame",onChange:()=>p("frame")}),(0,Ct.jsxs)(Ae,{open:a,children:[(0,Ct.jsx)(Ae.Trigger,{className:H("App-toolbar__extra-tools-trigger App-toolbar__extra-tools-trigger--mobile",{"App-toolbar__extra-tools-trigger--selected":T||a}),onToggle:()=>{i(!a),n({openMenu:null,openPopup:null})},title:E("toolBar.extraTools"),style:{width:g,height:g,display:"flex",alignItems:"center",justifyContent:"center"},children:I}),(0,Ct.jsxs)(Ae.Content,{onClickOutside:()=>i(!1),onSelect:()=>i(!1),className:"App-toolbar__extra-tools-dropdown",align:"start",children:[!_&&(0,Ct.jsx)(Ae.Item,{onSelect:()=>e.setActiveTool({type:"text"}),icon:Em,shortcut:D.T.toLocaleUpperCase(),"data-testid":"toolbar-text",selected:r.type==="text",children:E("toolBar.text")}),!C&&(0,Ct.jsx)(Ae.Item,{onSelect:()=>e.setActiveTool({type:"image"}),icon:wx,"data-testid":"toolbar-image",selected:r.type==="image",children:E("toolBar.image")}),!k&&(0,Ct.jsx)(Ae.Item,{onSelect:()=>e.setActiveTool({type:"frame"}),icon:Zd,shortcut:D.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:d,children:E("toolBar.frame")}),(0,Ct.jsx)(Ae.Item,{onSelect:()=>e.setActiveTool({type:"embeddable"}),icon:Px,"data-testid":"toolbar-embeddable",selected:h,children:E("toolBar.embeddable")}),(0,Ct.jsx)(Ae.Item,{onSelect:()=>e.setActiveTool({type:"laser"}),icon:Rm,"data-testid":"toolbar-laser",selected:u,shortcut:D.K.toLocaleUpperCase(),children:E("toolBar.laser")}),(0,Ct.jsx)("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),e.props.aiEnabled!==!1&&(0,Ct.jsx)(m.Out,{}),(0,Ct.jsx)(Ae.Item,{onSelect:()=>e.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:k_,"data-testid":"toolbar-embeddable",children:E("toolBar.mermaidToExcalidraw")}),e.props.aiEnabled!==!1&&e.plugins.diagramToCode&&(0,Ct.jsx)(Ct.Fragment,{children:(0,Ct.jsx)(Ae.Item,{onSelect:()=>e.onMagicframeToolSelect(),icon:Ux,"data-testid":"toolbar-magicframe",badge:(0,Ct.jsx)(Ae.Item.Badge,{children:"AI"}),children:E("toolBar.magicframe")})})]})]})]})},FH=({children:e,side:t,className:n})=>(0,BH.jsx)("div",{className:H("FixedSideContainer",`FixedSideContainer_side_${t}`,n),children:e}),Dle="medium",HH=e=>e.penDetected?(0,N1.jsxs)("label",{className:H("ToolIcon ToolIcon__penMode",`ToolIcon_size_${Dle}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,N1.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,N1.jsx)("div",{className:"ToolIcon__icon",children:vee})]}):null,Ile=({appState:e,elements:t,actionManager:n,setAppState:r,onHandToolToggle:a,renderTopLeftUI:i,renderTopRightUI:o,renderSidebars:l,renderWelcomeScreen:c,UIOptions:s,app:d,onPenModeToggle:u})=>{let{WelcomeScreenCenterTunnel:h,MainMenuTunnel:m,DefaultSidebarTriggerTunnel:p}=Br(),f=()=>{if(e.openDialog?.name==="elementLinkSelector")return null;let g=(0,dn.jsxs)("div",{className:"excalidraw-ui-top-right",children:[o?.(!0,e)??(!e.viewModeEnabled&&(0,dn.jsxs)(dn.Fragment,{children:[(0,dn.jsx)(HH,{checked:e.penMode,onChange:()=>u(null),title:E("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),(0,dn.jsx)(p.Out,{})]})),e.viewModeEnabled&&(0,dn.jsx)(Sie,{actionManager:n})]}),v=(0,dn.jsxs)("div",{className:"excalidraw-ui-top-left",children:[i?.(!0,e),(0,dn.jsx)(m.Out,{})]});return(0,dn.jsxs)("div",{className:"App-toolbar-content",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[v,g]})},x=()=>(0,dn.jsx)(Ale,{app:d,onHandToolToggle:a,setAppState:r});return(0,dn.jsxs)(dn.Fragment,{children:[l(),(0,dn.jsx)("div",{className:"App-welcome-screen",children:c&&(0,dn.jsx)(h.Out,{})}),!e.viewModeEnabled&&(0,dn.jsxs)("div",{className:"App-bottom-bar",style:{marginBottom:Zo+kc},children:[(0,dn.jsx)(vie,{appState:e,elementsMap:d.scene.getNonDeletedElementsMap(),renderAction:n.renderAction,app:d,setAppState:r}),(0,dn.jsxs)(Ja,{className:"App-toolbar",children:[!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&x(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&(0,dn.jsx)("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(g=>({...mf(t,g)}))},children:E("buttons.scrollBackToContent")})]})]}),(0,dn.jsx)(FH,{side:"top",className:"App-top-bar",children:f()})]})},Lle=e=>{switch(e){case"bar":return E("labels.chartType_bar");case"line":return E("labels.chartType_line");case"radar":return E("labels.chartType_radar");default:return e}},Rle=e=>{let t=(0,Gi.useRef)(null),[n,r]=(0,Gi.useState)(null),{theme:a}=pt();(0,Gi.useLayoutEffect)(()=>{if(!e.spreadsheet){r(null);return}let o=yle(e.chartType,e.spreadsheet,0,0,e.colorSeed);if(!o){r(null),t.current?.replaceChildren();return}r(o);let l,c=t.current;return(async()=>(l=await gf(o,{exportBackground:!1,viewBackgroundColor:"#fff",exportWithDarkMode:a==="dark"},null,{skipInliningFonts:!0}),l.querySelector(".style-fonts")?.remove(),c.replaceChildren(),c.appendChild(l)))(),()=>{c.replaceChildren()}},[e.spreadsheet,e.chartType,e.colorSeed,a]);let i=Lle(e.chartType);return(0,Qr.jsxs)("button",{type:"button",className:"ChartPreview","aria-label":i,onClick:()=>{n&&e.onClick(e.chartType,n)},children:[(0,Qr.jsx)("div",{className:"ChartPreview__canvas",ref:t}),(0,Qr.jsx)("div",{className:"ChartPreview__label",children:i})]})},Nle=e=>{let t=(0,Gi.useRef)(null),{theme:n}=pt();return(0,Gi.useLayoutEffect)(()=>{if(!e.rawText)return;let r=mr({text:e.rawText,x:0,y:0}),a=t.current;return(async()=>{let i=await gf([r],{exportBackground:!1,viewBackgroundColor:"#fff",exportWithDarkMode:n==="dark"},null,{skipInliningFonts:!0});i.querySelector(".style-fonts")?.remove(),a.replaceChildren(),a.appendChild(i)})(),()=>{a.replaceChildren()}},[e.rawText,n]),(0,Qr.jsxs)("button",{type:"button",className:"ChartPreview","aria-label":E("labels.chartType_plaintext"),onClick:()=>{e.onClick(e.rawText)},children:[(0,Qr.jsx)("div",{className:"ChartPreview__canvas",ref:t}),(0,Qr.jsx)("div",{className:"ChartPreview__label",children:E("labels.chartType_plaintext")})]})},Ole=({data:e,rawText:t,onClose:n})=>{let{onInsertElements:r,focusContainer:a}=Wi(),[i,o]=(0,Gi.useState)(Math.random()),l=Gi.default.useCallback(()=>{o(Math.random())},[]),c=Gi.default.useCallback(()=>{n&&n()},[n]),s=(u,h)=>{r(h),at("paste","chart",u),n(),a()},d=u=>{let h=mr({text:u,x:0,y:0});r([h]),at("paste","chart","plaintext"),n(),a()};return(0,Qr.jsx)(So,{size:"regular",onCloseRequest:c,title:(0,Qr.jsxs)("div",{className:"PasteChartDialog__title",children:[(0,Qr.jsx)("div",{className:"PasteChartDialog__titleText",children:E("labels.pasteCharts")}),(0,Qr.jsx)("div",{className:"PasteChartDialog__reshuffleBtn",onClick:l,role:"button",tabIndex:0,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l())},children:Ex})]}),className:"PasteChartDialog",autofocus:!1,children:(0,Qr.jsxs)("div",{className:"container",children:[["bar","line","radar"].map(u=>MH(e,u)?(0,Qr.jsx)(Rle,{chartType:u,spreadsheet:e,colorSeed:i,onClick:s},u):null),t&&(0,Qr.jsx)(Nle,{rawText:t,onClick:d})]})})},JC=({heading:e,children:t,...n})=>{let{id:r}=za(),a=(0,uu.jsx)("h2",{className:"visually-hidden",id:`${r}-${e}-title`,children:E(`headings.${e}`)});return(0,uu.jsx)("section",{...n,"aria-labelledby":`${r}-${e}-title`,children:typeof t=="function"?t(a):(0,uu.jsxs)(uu.Fragment,{children:[a,t]})})},zle=4,Ple=8,Ule=({shouldWrap:e,children:t,username:n})=>e?(0,or.jsx)(cu,{label:n||"Unknown user",children:t}):(0,or.jsx)(or.Fragment,{children:t}),fC=({actionManager:e,collaborator:t,socketId:n,withName:r=!1,shouldWrapWithTooltip:a=!1,isBeingFollowed:i})=>{let o={socketId:n,collaborator:t,withName:r,isBeingFollowed:i},l=e.renderAction("goToCollaborator",o);return(0,or.jsx)(Ule,{username:t.username,shouldWrap:a,children:l},n)},Ble=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],jH=$d.default.memo(({className:e,mobile:t,collaborators:n,userToFollow:r})=>{let a=Sn(),i=new Map;n.forEach((p,f)=>{let x=p.id||f;i.set(x,{...p,socketId:f})});let o=Array.from(i.values()).filter(p=>p.username?.trim()),[l,c]=$d.default.useState(""),s=o.filter(p=>p.username?.toLowerCase().includes(l)),d=$d.default.useRef(null);(0,$d.useLayoutEffect)(()=>{if(d.current){let p=x=>{let g=Math.max(1,Math.min(8,Math.floor(x/38)));h(g)};if(p(d.current.clientWidth),!F0)return;let f=new ResizeObserver(x=>{for(let g of x){let{width:v}=g.contentRect;p(v)}});return f.observe(d.current),()=>{f.disconnect()}}},[]);let[u,h]=$d.default.useState(zle),m=o.slice(0,u-1).map(p=>fC({actionManager:a,collaborator:p,socketId:p.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:p.socketId===r}));return t?(0,or.jsx)("div",{className:H("UserList UserList_mobile",e),children:o.map(p=>fC({actionManager:a,collaborator:p,socketId:p.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:p.socketId===r}))}):(0,or.jsx)("div",{className:"UserList__wrapper",ref:d,children:(0,or.jsxs)("div",{className:H("UserList",e),style:{"--max-avatars":u},children:[m,o.length>u-1&&(0,or.jsxs)(Ze.Root,{children:[(0,or.jsxs)(Ze.Trigger,{className:"UserList__more",children:["+",o.length-u+1]}),(0,or.jsx)(Ze.Content,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:(0,or.jsxs)(Ja,{padding:2,children:[o.length>=Ple&&(0,or.jsx)(YB,{placeholder:E("quickSearch.placeholder"),onChange:c}),(0,or.jsx)(KB,{className:"dropdown-menu UserList__collaborators",placeholder:E("userList.empty"),children:s.length>0?[(0,or.jsx)("div",{className:"hint",children:E("userList.hint.text")}),s.map(p=>fC({actionManager:a,collaborator:p,socketId:p.socketId,withName:!0,isBeingFollowed:p.socketId===r}))]:[]}),(0,or.jsx)(Ze.Arrow,{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,a]of e.collaborators){let i=t.collaborators.get(r);if(!i||r!==n.next().value||!Qt(a,i,Ble))return!1}return!0}),Fle=e=>(0,VH.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${E("helpDialog.title")} \u2014 ?`,"aria-label":E("helpDialog.title"),children:E_}),GH=({appState:e,actionManager:t,showExitZenModeBtn:n,renderWelcomeScreen:r})=>{let{FooterCenterTunnel:a,WelcomeScreenHelpHintTunnel:i}=Br();return(0,Ma.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,Ma.jsx)("div",{className:H("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:(0,Ma.jsx)(rl.Col,{gap:2,children:(0,Ma.jsxs)(JC,{heading:"canvasActions",children:[(0,Ma.jsx)(xie,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&(0,Ma.jsx)(wie,{renderAction:t.renderAction,className:H("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})})]})})}),(0,Ma.jsx)(a.Out,{}),(0,Ma.jsx)("div",{className:H("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:(0,Ma.jsxs)("div",{style:{position:"relative"},children:[r&&(0,Ma.jsx)(i.Out,{}),(0,Ma.jsx)(Fle,{onClick:()=>t.executeAction(Y_)})]})}),(0,Ma.jsx)(Eie,{actionManager:t,showExitZenModeBtn:n})]})},Hle=GH;GH.displayName="Footer";var KH=WH.default.createContext({}),$H=({children:e,className:t})=>{let n=En(),r=(0,YH.useContext)(KH),a=!!(n.canFitSidebar&&r.shouldRenderDockButton);return(0,iu.jsxs)("div",{className:H("sidebar__header",t),"data-testid":"sidebar-header",children:[e,(0,iu.jsxs)("div",{className:"sidebar__header__buttons",children:[a&&(0,iu.jsx)(cu,{label:E("labels.sidebarLock"),children:(0,iu.jsx)(hs,{onSelect:()=>r.onDock?.(!r.docked),selected:!!r.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":E("labels.sidebarLock"),children:mee})}),(0,iu.jsx)(hs,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:r.onCloseRequest,"aria-label":E("buttons.close"),children:Hm})]})]})};$H.displayName="SidebarHeader";var XH=({children:e,tab:t,onSelect:n,...r})=>(0,e_.jsx)(ar.Trigger,{value:t,asChild:!0,onSelect:n,children:(0,e_.jsx)("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...r,children:e})});XH.displayName="SidebarTabTrigger";var qH=({children:e,...t})=>(0,ZH.jsx)(ar.List,{className:"sidebar-triggers",...t,children:e});qH.displayName="SidebarTabTriggers";var QH=({name:e,tab:t,icon:n,title:r,children:a,onToggle:i,className:o,style:l})=>{let c=fn(),s=pt();return(0,ou.jsxs)("label",{title:r,className:"sidebar-trigger__label-element",children:[(0,ou.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:d=>{document.querySelector(".layer-ui__wrapper")?.classList.remove("animate");let u=d.target.checked;c({openSidebar:u?{name:e,tab:t}:null,openMenu:null,openPopup:null}),i?.(u)},checked:s.openSidebar?.name===e,"aria-label":r,"aria-keyshortcuts":"0"}),(0,ou.jsxs)("div",{className:H("sidebar-trigger",o),style:l,children:[n&&(0,ou.jsx)("div",{children:n}),a&&(0,ou.jsx)("div",{className:"sidebar-trigger__label",children:a})]})]})};QH.displayName="SidebarTrigger";var ej=({children:e,...t})=>{let n=pt(),r=fn();if(!n.openSidebar)return null;let{name:a}=n.openSidebar;return(0,JH.jsx)(ar.Root,{className:"sidebar-tabs-root",value:n.openSidebar.tab,onValueChange:i=>r(o=>({...o,openSidebar:{...o.openSidebar,name:a,tab:i}})),...t,children:e})};ej.displayName="SidebarTabs";var nj=({tab:e,children:t,...n})=>(0,tj.jsx)(ar.Content,{...n,value:e,"data-testid":e,children:t});nj.displayName="SidebarTab";var uk=Dt(!1),aj=(0,Rn.forwardRef)(({name:e,children:t,onDock:n,docked:r,className:a,...i},o)=>{qn()&&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 l=fn(),c=F1(uk);(0,Rn.useLayoutEffect)(()=>(c(!!r),()=>{c(!1)}),[c,r]);let s=(0,Rn.useRef)({});s.current.onCloseRequest=()=>{l({openSidebar:null})},s.current.onDock=m=>n?.(m),s.current=Vu(s.current,{docked:r,shouldRenderDockButton:!!n&&r!=null});let d=(0,Rn.useRef)(null);(0,Rn.useImperativeHandle)(o,()=>d.current);let u=En(),h=(0,Rn.useCallback)(()=>{document.querySelector(".Dialog")||l({openSidebar:null})},[l]);return N_(d,(0,Rn.useCallback)(m=>{m.target.closest(".sidebar-trigger")||(!r||!u.canFitSidebar)&&h()},[h,r,u.canFitSidebar])),(0,Rn.useEffect)(()=>{let m=p=>{p.key===D.ESCAPE&&(!r||!u.canFitSidebar)&&h()};return document.addEventListener(Q.KEYDOWN,m),()=>{document.removeEventListener(Q.KEYDOWN,m)}},[h,r,u.canFitSidebar]),(0,t_.jsx)(Ja,{...i,className:H(vt.SIDEBAR,{"sidebar--docked":r},a),ref:d,children:(0,t_.jsx)(KH.Provider,{value:s.current,children:t})})});aj.displayName="SidebarInner";var qo=Object.assign((0,Rn.forwardRef)((e,t)=>{let n=pt(),{onStateChange:r}=e,a=(0,Rn.useRef)(n.openSidebar);(0,Rn.useEffect)(()=>{(!n.openSidebar&&a?.current?.name===e.name||n.openSidebar?.name===e.name&&a?.current?.name!==e.name||a.current?.name===e.name)&&n.openSidebar!==a.current&&r?.(n.openSidebar?.name!==e.name?null:n.openSidebar),a.current=n.openSidebar},[n.openSidebar,r,e.name]);let[i,o]=(0,Rn.useState)(!1);return(0,Rn.useLayoutEffect)(()=>(o(!0),()=>o(!1)),[]),i&&n.openSidebar?.name===e.name?(0,rj.createElement)(aj,{...e,ref:t,key:e.name}):null}),{Header:$H,TabTriggers:qH,TabTrigger:XH,Tabs:ej,Tab:nj,Trigger:QH});qo.displayName="Sidebar";var W1=(e,t)=>{let n=Dt(0),r=a=>{let{tunnelsJotai:{useAtom:i}}=Br(),[,o]=i(n),l=(0,W2.useRef)({preferHost:!1,counter:0});return(0,W2.useLayoutEffect)(()=>{let c=l.current;return o(s=>{let d=s+1;return c.counter=d,d}),()=>{o(s=>{let d=s-1;return c.counter=d,d||(c.preferHost=!1),d})}},[o]),a.__fallback||(l.current.preferHost=!0),!l.current.counter&&a.__fallback&&l.current.preferHost||l.current.counter>1&&a.__fallback?null:(0,ij.jsx)(t,{...a})};return r.displayName=e,r},oj={};kE(oj,{ChangeCanvasBackground:()=>vj,ClearCanvas:()=>gj,CommandPalette:()=>mj,Export:()=>yj,Help:()=>fj,LiveCollaborationTrigger:()=>wj,LoadScene:()=>dj,Preferences:()=>sl,PreferencesToggleGridModeItem:()=>hk,PreferencesToggleZenModeItem:()=>mk,SaveAsImage:()=>hj,SaveToActiveFile:()=>uj,SearchMenu:()=>pj,Socials:()=>xj,ToggleTheme:()=>bj});var lj=Dt({active:!1});async function jle({title:e,description:t,actionLabel:n,color:r}){return new Promise(a=>{Qa.set(lj,{active:!0,onConfirm:()=>a(!0),onClose:()=>a(!1),onReject:()=>a(!1),title:e,description:t,actionLabel:n,color:r})})}var sj=function({onChange:e,value:t,choices:n,name:r}){return(0,O1.jsx)("div",{className:"RadioGroup",children:n.map(a=>(0,O1.jsxs)("div",{className:H("RadioGroup__choice",{active:a.value===t}),title:a.ariaLabel,children:[(0,O1.jsx)("input",{name:r,type:"radio",checked:a.value===t,onChange:()=>e(a.value),"aria-label":a.ariaLabel}),a.label]},String(a.value)))})},cj=({value:e,shortcut:t,onChange:n,choices:r,children:a,name:i})=>{let o=En();return(0,cs.jsxs)(cs.Fragment,{children:[(0,cs.jsxs)("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[(0,cs.jsx)("label",{className:"dropdown-menu-item__text",children:a}),(0,cs.jsx)(sj,{name:i,value:e,onChange:n,choices:r})]}),t&&o.formFactor!=="phone"&&(0,cs.jsx)("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};cj.displayName="DropdownMenuItemContentRadio";var Vle=cj,dj=()=>{let{t:e}=Lt(),t=Sn(),n=nw();return t.isActionEnabled(HC)?(0,Ce.jsx)(Yi,{icon:S_,onSelect:async()=>{(!n.length||await jle({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:(0,Ce.jsx)(nl,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:r=>(0,Ce.jsx)("strong",{children:r}),br:()=>(0,Ce.jsx)("br",{})})}))&&t.executeAction(HC)},"data-testid":"load-button",shortcut:hn("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};dj.displayName="LoadScene";var uj=()=>{let{t:e}=Lt(),t=Sn();return t.isActionEnabled(Hx)?(0,Ce.jsx)(Yi,{shortcut:hn("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(Hx),icon:_ee,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};uj.displayName="SaveToActiveFile";var hj=()=>{let e=fn(),{t}=Lt();return(0,Ce.jsx)(Yi,{icon:hB,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:hn("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};hj.displayName="SaveAsImage";var mj=e=>{let t=fn(),{t:n}=Lt();return(0,Ce.jsx)(Yi,{icon:OC,"data-testid":"command-palette-button",onSelect:()=>{at("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:hn("commandPalette"),"aria-label":n("commandPalette.title"),className:e?.className,children:n("commandPalette.title")})};mj.displayName="CommandPalette";var pj=e=>{let{t}=Lt(),n=Sn();return(0,Ce.jsx)(Yi,{icon:su,"data-testid":"search-menu-button",onSelect:()=>{n.executeAction(vH)},shortcut:hn("searchMenu"),"aria-label":t("search.title"),className:e?.className,children:t("search.title")})};pj.displayName="SearchMenu";var fj=()=>{let{t:e}=Lt(),t=Sn();return(0,Ce.jsx)(Yi,{"data-testid":"help-menu-item",icon:E_,onSelect:()=>t.executeAction(Y_),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};fj.displayName="Help";var gj=()=>{let{t:e}=Lt(),t=F1(H2);return Sn().isActionEnabled(f1)?(0,Ce.jsx)(Yi,{icon:us,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};gj.displayName="ClearCanvas";var bj=e=>{let{t}=Lt(),n=pt(),r=Sn(),a=hn("toggleTheme");return r.isActionEnabled(Bx)?e?.allowSystemTheme?(0,Ce.jsx)(Vle,{name:"theme",value:e.theme,onChange:i=>e.onSelect(i),choices:[{value:se.LIGHT,label:IC,ariaLabel:`${t("buttons.lightMode")} - ${a}`},{value:se.DARK,label:DC,ariaLabel:`${t("buttons.darkMode")} - ${a}`},{value:"system",label:Vte,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):(0,Ce.jsx)(Yi,{onSelect:i=>{if(i.preventDefault(),e?.onSelect)e.onSelect(n.theme===se.DARK?se.LIGHT:se.DARK);else return r.executeAction(Bx)},icon:n.theme===se.DARK?IC:DC,"data-testid":"toggle-dark-mode",shortcut:a,"aria-label":n.theme===se.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:n.theme===se.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};bj.displayName="ToggleTheme";var vj=()=>{let{t:e}=Lt(),t=pt(),n=Sn(),r=K1();return t.viewModeEnabled||!r.UIOptions.canvasActions.changeViewBackgroundColor?null:(0,Ce.jsxs)("div",{style:{marginTop:"0.75rem"},children:[(0,Ce.jsx)("div",{"data-testid":"canvas-background-label",style:{fontSize:"0.875rem",marginBottom:"0.25rem",marginLeft:"0.5rem"},children:e("labels.canvasBackground")}),(0,Ce.jsx)("div",{style:{padding:"0 0.625rem"},children:n.renderAction("changeViewBackgroundColor")})]})};vj.displayName="ChangeCanvasBackground";var yj=()=>{let{t:e}=Lt(),t=fn();return(0,Ce.jsx)(Yi,{icon:i2,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};yj.displayName="Export";var xj=()=>{let{t:e}=Lt();return(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)(Ax,{icon:dB,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),(0,Ce.jsx)(Ax,{icon:Cee,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),(0,Ce.jsx)(Ax,{icon:See,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};xj.displayName="Socials";var wj=({onSelect:e,isCollaborating:t})=>{let{t:n}=Lt();return(0,Ce.jsx)(Yi,{"data-testid":"collab-button",icon:fB,className:H({"active-collab":t}),onSelect:e,children:n("labels.liveCollaboration")})};wj.displayName="LiveCollaborationTrigger";var Ej=()=>{let{t:e}=Lt(),t=Wi(),n=pt();return(0,Ce.jsx)(fs,{checked:n.activeTool.locked,shortcut:hn("toolLock"),onSelect:r=>{t.toggleLock(),r.preventDefault()},children:e("labels.preferences_toolLock")})},Sj=()=>{let{t:e}=Lt(),t=Sn(),n=pt();return(0,Ce.jsx)(fs,{checked:n.objectsSnapModeEnabled,shortcut:hn("objectsSnapMode"),onSelect:r=>{t.executeAction(SF),r.preventDefault()},children:e("buttons.objectsSnapMode")})},Cj=()=>{let{t:e}=Lt(),t=Sn(),n=pt();return(0,Ce.jsx)(fs,{checked:n.bindingPreference==="enabled",onSelect:r=>{t.executeAction(CF),r.preventDefault()},children:e("labels.arrowBinding")})},_j=()=>{let{t:e}=Lt(),t=Sn(),n=pt();return(0,Ce.jsx)(fs,{checked:n.isMidpointSnappingEnabled,onSelect:r=>{t.executeAction(_F),r.preventDefault()},children:e("labels.midpointSnapping")})},hk=()=>{let{t:e}=Lt(),t=Sn(),n=pt();return(0,Ce.jsx)(fs,{checked:n.gridModeEnabled,shortcut:hn("gridMode"),onSelect:r=>{t.executeAction(VC),r.preventDefault()},children:e("labels.toggleGrid")})},mk=()=>{let{t:e}=Lt(),t=Sn(),n=pt();return(0,Ce.jsx)(fs,{checked:n.zenModeEnabled,shortcut:hn("zenMode"),onSelect:r=>{t.executeAction(jx),r.preventDefault()},children:e("buttons.zenMode")})},kj=()=>{let{t:e}=Lt(),t=Sn(),n=pt();return(0,Ce.jsx)(fs,{checked:n.viewModeEnabled,shortcut:hn("viewMode"),onSelect:r=>{t.executeAction(Wx),r.preventDefault()},children:e("labels.viewMode")})},Tj=()=>{let{t:e}=Lt(),t=Sn(),n=pt();return(0,Ce.jsx)(fs,{checked:n.stats.open,shortcut:hn("stats"),onSelect:r=>{t.executeAction(Vx),r.preventDefault()},children:e("stats.fullTitle")})},sl=({children:e,additionalItems:t})=>{let{t:n}=Lt();return(0,Ce.jsxs)(v1,{children:[(0,Ce.jsx)(v1.Trigger,{icon:tne,children:n("labels.preferences")}),(0,Ce.jsxs)(v1.Content,{className:"excalidraw-main-menu-preferences-submenu",children:[e||(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)(Ej,{}),(0,Ce.jsx)(Sj,{}),(0,Ce.jsx)(hk,{}),(0,Ce.jsx)(mk,{}),(0,Ce.jsx)(kj,{}),(0,Ce.jsx)(Tj,{}),(0,Ce.jsx)(Cj,{}),(0,Ce.jsx)(_j,{})]}),t]})]})};sl.ToggleToolLock=Ej;sl.ToggleSnapMode=Sj;sl.ToggleArrowBinding=Cj;sl.ToggleMidpointSnapping=_j;sl.ToggleGridMode=hk;sl.ToggleZenMode=mk;sl.ToggleViewMode=kj;sl.ToggleElementProperties=Tj;sl.displayName="Preferences";var Gle=Object.assign(W1("MainMenu",({children:e,onSelect:t})=>{let{MainMenuTunnel:n}=Br(),r=En(),a=pt(),i=fn();return(0,ss.jsx)(n.In,{children:(0,ss.jsxs)(Ae,{open:a.openMenu==="canvas",children:[(0,ss.jsx)(Ae.Trigger,{onToggle:()=>{i({openMenu:a.openMenu==="canvas"?null:"canvas",openPopup:null,openDialog:null})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:wee}),(0,ss.jsxs)(Ae.Content,{onClickOutside:()=>i({openMenu:null}),onSelect:Rs(t,()=>{i({openMenu:null})}),className:"main-menu",align:"start",children:[e,r.formFactor==="phone"&&a.collaborators.size>0&&(0,ss.jsxs)("fieldset",{className:"UserList-Wrapper",children:[(0,ss.jsx)("legend",{children:E("labels.collaborators")}),(0,ss.jsx)(jH,{mobile:!0,collaborators:a.collaborators,userToFollow:a.userToFollow?.socketId||null})]})]})]})})}),{Trigger:Ae.Trigger,Item:Ae.Item,ItemLink:Ae.ItemLink,ItemCustom:Ae.ItemCustom,Group:Ae.Group,Separator:Ae.Separator,Sub:v1,DefaultItems:oj}),ka=Gle,lu=(0,K2.forwardRef)(({children:e,icon:t,onClick:n,label:r,variant:a="filled",color:i="primary",size:o="medium",fullWidth:l,className:c,status:s,disabled:d},u)=>{let[h,m]=(0,K2.useState)(!1),p=async x=>{let g=n?.(x);if(Ls(g)){let v=window.setTimeout(()=>{m(!0)},50);try{await g}catch(b){if(b instanceof Pb)console.warn(b);else throw b}finally{clearTimeout(v),m(!1)}}},f=h?"loading":s;return i=f==="success"?"success":i,(0,Xd.jsx)("button",{className:H("ExcButton",`ExcButton--color-${i}`,`ExcButton--variant-${a}`,`ExcButton--size-${o}`,`ExcButton--status-${f}`,{"ExcButton--fullWidth":l},c),onClick:p,type:"button","aria-label":r,ref:u,disabled:d||f==="loading"||f==="success",children:(0,Xd.jsxs)("div",{className:"ExcButton__contents",children:[f==="loading"?(0,Xd.jsx)(il,{className:"ExcButton__statusIcon"}):f==="success"&&(0,Xd.jsx)("div",{className:"ExcButton__statusIcon",children:Ste}),t&&(0,Xd.jsx)("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),a!=="icon"&&(e??r)]})})}),pk=({title:e,children:t,actionLabel:n,onClick:r})=>(0,ds.jsxs)("div",{className:"OverwriteConfirm__Actions__Action",children:[(0,ds.jsx)("h4",{children:e}),(0,ds.jsx)("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),(0,ds.jsx)(lu,{variant:"outlined",color:"muted",label:n,size:"large",fullWidth:!0,onClick:r})]}),Yle=()=>{let{t:e}=Lt(),t=Sn(),n=fn();return(0,ds.jsx)(pk,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(pF,"ui",!0),n({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},Wle=()=>{let{t:e}=Lt(),t=Sn();return(0,ds.jsx)(pk,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(gF,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},CU=Object.assign(({children:e})=>(0,ds.jsx)("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:Yle,SaveToDisk:Wle}),gC=Object.assign(W1("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=Br(),[n,r]=Fe(lj);if(!n.active)return null;let a=()=>{n.onClose(),r(o=>({...o,active:!1}))},i=()=>{n.onConfirm(),r(o=>({...o,active:!1}))};return(0,Pi.jsx)(t.In,{children:(0,Pi.jsx)(So,{onCloseRequest:a,title:!1,size:916,children:(0,Pi.jsxs)("div",{className:"OverwriteConfirm",children:[(0,Pi.jsx)("h3",{children:n.title}),(0,Pi.jsxs)("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${n.color}`,children:[(0,Pi.jsx)("div",{className:"OverwriteConfirm__Description__icon",children:xB}),(0,Pi.jsx)("div",{children:n.description}),(0,Pi.jsx)("div",{className:"OverwriteConfirm__Description__spacer"}),(0,Pi.jsx)(lu,{color:n.color,size:"large",label:n.actionLabel,onClick:i})]}),(0,Pi.jsx)(CU,{children:e})]})})})}),{Actions:CU,Action:pk}),Kle=Dt(""),Aj=Dt(null),$le=350,Xle=()=>{let e=Wi(),t=fn(),n=(0,Ln.useRef)(null),[r,a]=Fe(Kle),i=r.trim(),[o,l]=(0,Ln.useState)(!1),[c,s]=(0,Ln.useState)({nonce:null,items:[]}),d=(0,Ln.useRef)(null),u=(0,Ln.useRef)(void 0),[h,m]=Fe(Aj),p=e.scene.getNonDeletedElementsMap();(0,Ln.useEffect)(()=>{o||(i!==d.current||e.scene.getSceneNonce()!==u.current)&&(d.current=null,TU(i,e,(b,w)=>{s({nonce:wl(),items:b}),d.current=i,u.current=e.scene.getSceneNonce(),t({searchMatches:b.length?{focusedId:null,matches:b.map(S=>({id:S.element.id,focus:!1,matchedLines:S.matchedLines}))}:null})}))},[o,i,p,e,t,m,u]);let f=()=>{c.items.length>0&&m(b=>b===null?0:(b+1)%c.items.length)},x=()=>{c.items.length>0&&m(b=>b===null?0:b-1<0?c.items.length-1:b-1)};(0,Ln.useEffect)(()=>{t(b=>b.searchMatches?{searchMatches:{focusedId:h!==null&&b.searchMatches?.matches[h]?.id||null,matches:b.searchMatches.matches.map((w,S)=>S===h?{...w,focus:!0}:{...w,focus:!1})}}:null)},[h,t]),(0,Ln.useEffect)(()=>{if(c.items.length>0&&h!==null){let b=c.items[h];if(b){let w=e.state.zoom.value,S=mr({text:b.searchQuery,x:b.element.x+(b.matchedLines[0]?.offsetX??0),y:b.element.y+(b.matchedLines[0]?.offsetY??0),width:b.matchedLines[0]?.width,height:b.matchedLines[0]?.height,fontSize:he(b.element)?yt.nameFontSize:b.element.fontSize,fontFamily:he(b.element)?Ot.Assistant:b.element.fontFamily}),_=14,C=S.fontSize,k=C*w<_;if(!Ju([S],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())||k){let T;k?C>=_?T={fitToContent:!0}:T={fitToViewport:!0,maxZoom:oi(_/C,1)}:T={fitToContent:!0},e.scrollToContent(S,{animate:!0,duration:300,...T,canvasOffsets:e.getEditorUIOffsets()})}}}},[h,c,e]),(0,Ln.useEffect)(()=>()=>{m(null),d.current=null,u.current=void 0,t({searchMatches:null}),l(!1)},[t,m]);let g=c2({goToNextItem:f,goToPreviousItem:x,searchMatches:c});(0,Ln.useEffect)(()=>{let b=w=>{if(w.key===D.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){w.preventDefault(),w.stopPropagation(),t({openSidebar:null});return}if(w[D.CTRL_OR_CMD]&&w.key===D.F){if(w.preventDefault(),w.stopPropagation(),e.state.openDialog)return;n.current?.matches(":focus")||(e.state.openDialog&&t({openDialog:null}),n.current?.focus(),n.current?.select())}w.target instanceof HTMLElement&&w.target.closest(".layer-ui__search")&&g.searchMatches.items.length&&(w.key===D.ENTER&&(w.stopPropagation(),g.goToNextItem()),w.key===D.ARROW_UP?(w.stopPropagation(),g.goToPreviousItem()):w.key===D.ARROW_DOWN&&(w.stopPropagation(),g.goToNextItem()))};return xt(window,Q.KEYDOWN,b,{capture:!0,passive:!1})},[t,g,e]);let v=`${c.items.length} ${c.items.length===1?E("search.singleResult"):E("search.multipleResults")}`;return(0,it.jsxs)("div",{className:"layer-ui__search",children:[(0,it.jsx)("div",{className:"layer-ui__search-header",children:(0,it.jsx)(N2,{className:vt.SEARCH_MENU_INPUT_WRAPPER,value:r,ref:n,placeholder:E("search.placeholder"),icon:su,onChange:b=>{a(b),l(!0);let w=b.trim();TU(w,e,(S,_)=>{s({nonce:wl(),items:S}),m(_),d.current=w,u.current=e.scene.getSceneNonce(),t({searchMatches:S.length?{focusedId:null,matches:S.map(C=>({id:C.element.id,focus:!1,matchedLines:C.matchedLines}))}:null}),l(!1)})},selectOnRender:!0})}),(0,it.jsxs)("div",{className:"layer-ui__search-count",children:[c.items.length>0&&(0,it.jsxs)(it.Fragment,{children:[h!==null&&h>-1?(0,it.jsxs)("div",{children:[h+1," / ",v]}):(0,it.jsx)("div",{children:v}),(0,it.jsxs)("div",{className:"result-nav",children:[(0,it.jsx)(hs,{onSelect:()=>{f()},className:"result-nav-btn",children:EB}),(0,it.jsx)(hs,{onSelect:()=>{x()},className:"result-nav-btn",children:$te})]})]}),c.items.length===0&&i&&d.current&&(0,it.jsx)("div",{style:{margin:"1rem auto"},children:E("search.noMatch")})]}),(0,it.jsx)(Qle,{matches:c,onItemClick:m,focusIndex:h,searchQuery:i})]})},_U=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(0,it.jsx)("div",{tabIndex:-1,className:H("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:n=>{e.highlighted&&n?.scrollIntoView({behavior:"auto",block:"nearest"})},children:(0,it.jsx)("div",{className:"preview-text",children:t.flatMap((n,r)=>(0,it.jsx)(Ln.Fragment,{children:r===2?(0,it.jsx)("b",{children:n}):n},r))})})},Zle=e=>{let t=(0,Ln.useMemo)(()=>e.matches.items.filter(r=>he(r.element)),[e.matches]),n=(0,Ln.useMemo)(()=>e.matches.items.filter(r=>oe(r.element)),[e.matches]);return(0,it.jsxs)("div",{children:[t.length>0&&(0,it.jsxs)("div",{className:"layer-ui__search-result-container",children:[(0,it.jsxs)("div",{className:"layer-ui__search-result-title",children:[(0,it.jsx)("div",{className:"title-icon",children:Zd}),(0,it.jsx)("div",{children:E("search.frames")})]}),t.map((r,a)=>(0,it.jsx)(_U,{searchQuery:e.searchQuery,preview:r.preview,highlighted:a===e.focusIndex,onClick:()=>e.onItemClick(a)},r.element.id+r.index)),n.length>0&&(0,it.jsx)("div",{className:"layer-ui__divider"})]}),n.length>0&&(0,it.jsxs)("div",{className:"layer-ui__search-result-container",children:[(0,it.jsxs)("div",{className:"layer-ui__search-result-title",children:[(0,it.jsx)("div",{className:"title-icon",children:Em}),(0,it.jsx)("div",{children:E("search.texts")})]}),n.map((r,a)=>(0,it.jsx)(_U,{searchQuery:e.searchQuery,preview:r.preview,highlighted:a+t.length===e.focusIndex,onClick:()=>e.onItemClick(a+t.length)},r.element.id+r.index))]})]})},qle=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,Qle=(0,Ln.memo)(Zle,qle),kU=(e,t,n)=>{let r=e.slice(0,t),a=r.split(/\s+/),i=r.endsWith(" "),o=a.length-2-1-(i?0:1),l=a.slice(o<=0?0:o).join(" ")+(i?" ":""),c=20;l=l.length>c?l.slice(-c):l;let s=e.slice(t+n.length),d=s.split(/\s+/),u=!s.startsWith(" "),h=u?6:5,m=(u?"":" ")+d.slice(0,h).join(" ");return{indexInSearchQuery:l.length,previewText:l+n+m,moreBefore:o>0,moreAfter:d.length>h}},Jle=(e,t)=>{let n=e.split(`
|
|
65
|
-
`),r=[],a=0;for(let i=0;i<n.length;i++){let o=n[i],l=n[i+1];if(l){let c=t.indexOf(l,a);if(c>o.length+a){let s=c-(o.length+a);for(;s>0;)o+=" ",s--}}r.push(o),a=a+o.length}return r.join(`
|
|
66
|
-
`)},ese=(e,t,n)=>{let r=Jle(e.text,e.originalText).split(`
|
|
67
|
-
`),a=[],i=0,o=0;for(let d of r){let u=i,h=u+d.length-1;a.push({line:d,startIndex:u,endIndex:h,lineNumber:o}),i=h+1,o++}let l=n,c=e.originalText.slice(n,n+t.length),s=[];for(let d of a){if(c==="")break;if(l>=d.startIndex&&l<=d.endIndex){let u=d.endIndex+1-l,h=d.line.slice(0,l-d.startIndex),m=c.slice(0,u);c=c.slice(u);let p=kt(h,Mt(e),e.lineHeight);if(h===""&&(p.width=0),e.textAlign!=="left"&&d.line.length>0){let b=kt(d.line,Mt(e),e.lineHeight),w=e.textAlign==="center"?(e.width-b.width)/2:e.width-b.width;p.width+=w}let{width:f,height:x}=kt(m,Mt(e),e.lineHeight),g=p.width,v=d.lineNumber*p.height;s.push({offsetX:g,offsetY:v,width:f,height:x,showOnCanvas:!0}),l+=u}}return s},tse=(e,t,n,r)=>{let a=e.name??f3(e),i=a.slice(n,n+t.length),o=a.slice(0,n),l=Mt({fontSize:yt.nameFontSize,fontFamily:Ot.Assistant}),c=jr(Ot.Assistant),s=kt(o,l,c);o===""&&(s.width=0);let d=kt(i,l,c),u=s.width,h=-s.height-yt.strokeWidth,m=d.width;return[{offsetX:u,offsetY:h,width:m,height:d.height,showOnCanvas:u+m<=e.width*r}]},nse=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),TU=(0,Mj.default)((e,t,n)=>{if(!e||e===""){n([],null);return}let r=t.scene.getNonDeletedElements(),a=r.filter(h=>oe(h)),i=r.filter(h=>he(h));a.sort((h,m)=>h.y-m.y),i.sort((h,m)=>h.y-m.y);let o=[],l=new RegExp(nse(e),"gi");for(let h of a){let m=null,p=h.originalText;for(;(m=l.exec(p))!==null;){let f=kU(p,m.index,e),x=ese(h,e,m.index);x.length>0&&o.push({element:h,searchQuery:e,preview:f,index:m.index,matchedLines:x})}}let c=[];for(let h of i){let m=null,p=h.name??f3(h);for(;(m=l.exec(p))!==null;){let f=kU(p,m.index,e),x=tse(h,e,m.index,t.state.zoom.value);x.length>0&&c.push({element:h,searchQuery:e,preview:f,index:m.index,matchedLines:x})}}let s=new Set(t.visibleElements.map(h=>h.id)),d=[...c,...o],u=d.findIndex(h=>s.has(h.element.id))??null;n(d,u)},$le),Ij=W1("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=Br();return(0,qr.jsx)(t.In,{children:(0,qr.jsx)(qo.Trigger,{...e,className:"default-sidebar-trigger",name:kr.name})})});Ij.displayName="DefaultSidebarTrigger";var Lj=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=Br();return(0,qr.jsx)(t.In,{children:e})};Lj.displayName="DefaultTabTriggers";var MU=Object.assign(W1("DefaultSidebar",({children:e,className:t,onDock:n,docked:r,...a})=>{let i=pt(),o=fn(),{DefaultSidebarTabTriggersTunnel:l}=Br(),c=i.openSidebar?.tab===bl;return(0,Dj.createElement)(qo,{...a,name:"default",key:"default",className:H("default-sidebar",t),docked:c||(r??i.defaultSidebarDockedPreference),onDock:c||n===!1||!n&&r!=null?void 0:Rs(n,s=>{o({defaultSidebarDockedPreference:s})})},(0,qr.jsxs)(qo.Tabs,{children:[(0,qr.jsx)(qo.Header,{children:(0,qr.jsxs)(qo.TabTriggers,{children:[(0,qr.jsx)(qo.TabTrigger,{tab:bl,children:su}),(0,qr.jsx)(qo.TabTrigger,{tab:jp,children:lB}),(0,qr.jsx)(l.Out,{})]})}),(0,qr.jsx)(qo.Tab,{tab:jp,children:(0,qr.jsx)(cie,{})}),(0,qr.jsx)(qo.Tab,{tab:bl,children:(0,qr.jsx)(Xle,{})}),e]}))}),{Trigger:Ij,TabTriggers:Lj}),rse=300,ase=({input:e,placeholder:t,onChange:n,onKeyboardSubmit:r,errorLine:a})=>{let i=(0,ms.useRef)(null),o=(0,ms.useRef)(r);o.current=r;let[l,c]=(0,ms.useState)({type:"loading"}),[s,d]=(0,ms.useState)(!1),{theme:u}=pt();if((0,ms.useEffect)(()=>{let h=!1,m=setTimeout(()=>{h||d(!0)},rse);return import("./chunks/CodeMirrorEditor-UCMRAMCV-MAKZFDBE.js").then(p=>{h||c({type:"ready",component:p.default})}).catch(()=>{h||c({type:"fallback"})}).finally(()=>{clearTimeout(m)}),()=>{h=!0,clearTimeout(m)}},[]),(0,ms.useEffect)(()=>{if(l.type!=="fallback"||!o.current)return;let h=i.current;if(h){let m=p=>{p[D.CTRL_OR_CMD]&&p.key===D.ENTER&&(p.preventDefault(),o.current?.())};return h.focus(),h.addEventListener(Q.KEYDOWN,m),()=>{h.removeEventListener(Q.KEYDOWN,m)}}},[l.type]),l.type==="ready"){let h=l.component;return(0,u1.jsx)(h,{value:e,onChange:n,onKeyboardSubmit:r,placeholder:t,theme:u,errorLine:a})}return l.type==="fallback"?(0,u1.jsx)("textarea",{className:"ttd-dialog-input",onChange:h=>n(h.target.value),value:e,placeholder:t,ref:i}):s?(0,u1.jsx)("div",{className:"ttd-dialog-input ttd-dialog-input--loading",children:(0,u1.jsx)(il,{})}):null},Rj=/(?:Parse|Lexical) error on line (\d+)[.:]/i,Nj=/Trying to inactivate an inactive participant \((.+)\)/i,ise=/^\s*-+\^\s*$/,X2=e=>Rj.test(e),Oj=e=>X2(e)||Nj.test(e),ose=e=>ise.test(e),zj=e=>{let t=e.match(Nj);return t?.[1]?t[1].trim():null},lse=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),sse=(e,t)=>{let n=zj(e);if(!n)return null;let r=new RegExp(`^\\s*deactivate\\s+${lse(n)}(?:\\s+%%.*)?\\s*$`),a=t.split(/\r?\n/);for(let i=a.length-1;i>=0;i--)if(r.test(a[i]))return i+1;return null},fk=(e,t)=>{let n=e.match(Rj);return n?Number.parseInt(n[1],10):t?sse(e,t):null},Sc=(e,t)=>(e.match(t)||[]).length,cse=(e,t)=>{if(!X2(e))return null;let n=fk(e,t),r=n?`Syntax error near line ${n}.`:"Syntax error in Mermaid diagram.",a=[];if(t){let i=Sc(t,/\[/g),o=Sc(t,/\]/g);i!==o&&a.push("Unbalanced square brackets in a node label.");let l=Sc(t,/\(/g),c=Sc(t,/\)/g);l!==c&&a.push("Unbalanced parentheses in a node shape.");let s=Sc(t,/\{/g),d=Sc(t,/\}/g);s!==d&&a.push("Unbalanced braces in a decision node.");let u=Sc(t,/^\s*subgraph\b/gm),h=Sc(t,/^\s*end\s*$/gm);u>h&&a.push("A block is missing an `end` statement.")}return(/got 'NODE_STRING'/.test(e)||/got 'PS'/.test(e))&&a.push("An extra character/token may appear after a node or label definition."),a.length===0&&(a.push("A node or edge line is malformed (missing/extra delimiters)."),a.push("A block (`subgraph`, `class`, etc.) may be incomplete.")),{summary:r,likelyCauses:[...new Set(a)]}},dse=e=>X2(e)?e.replace(/\n\s*Expecting[\s\S]*$/,"").trimEnd():e,Pj=({error:e,canvasRef:t,loaded:n,hideErrorDetails:r,sourceText:a,autoFixAvailable:i,onApplyAutoFix:o})=>{let l=e?r?E("chat.errors.mermaidParseError"):dse(e.message):null,c=e&&!r?cse(e.message,a):null,s=!!i&&!!o&&!r,d=l?.split(/\r?\n/)??[];return(0,ir.jsxs)("div",{className:`ttd-dialog-output-wrapper ${e?"ttd-dialog-output-wrapper--error":""}`,children:[e&&(0,ir.jsx)("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:(0,ir.jsxs)("div",{className:"ttd-dialog-output-error-content",children:[(0,ir.jsx)("div",{className:"ttd-dialog-output-error-icon",children:xB}),c&&(0,ir.jsxs)("div",{className:"ttd-dialog-output-error-summary",children:[(0,ir.jsx)("div",{className:"ttd-dialog-output-error-summary__headline",children:c.summary}),(0,ir.jsx)("div",{className:"ttd-dialog-output-error-summary__label",children:"Likely causes:"}),(0,ir.jsx)("ul",{className:"ttd-dialog-output-error-summary__causes",children:c.likelyCauses.map(u=>(0,ir.jsx)("li",{children:u},u))})]}),(0,ir.jsx)("div",{className:"ttd-dialog-output-error-message",children:d.map((u,h)=>(0,ir.jsxs)("span",{className:ose(u)?"ttd-dialog-output-error-message__caret":void 0,children:[u,h<d.length-1?`
|
|
68
|
-
`:""]},`error-line-${h}`))}),!r&&(0,ir.jsx)("div",{className:"ttd-dialog-output-error-autofix-slot",children:s?(0,ir.jsx)(hs,{className:"ttd-dialog-panel-button ttd-dialog-output-error-autofix",onSelect:o,children:E("mermaid.autoFixAvailable")}):null})]})},"error"),n?(0,ir.jsx)("div",{className:H("ttd-dialog-output-canvas-container",{invisible:!!e}),children:(0,ir.jsx)("div",{ref:t,className:"ttd-dialog-output-canvas-content"})},"canvas"):(0,ir.jsx)(il,{size:"2rem"})]})},Jx=({label:e,children:t,panelActions:n=[],onTextSubmitInProgess:r,renderTopRight:a,renderSubmitShortcut:i,className:o,panelActionJustifyContent:l="flex-start"})=>{let c=s=>{if(s?.variant==="link")return(0,La.jsxs)("button",{className:H("ttd-dialog-panel-action-link",s.className),onClick:s.action,disabled:s?.disabled||r,type:"button",children:[s.label,s.icon&&(0,La.jsx)("span",{className:"ttd-dialog-panel-action-link__icon",children:s.icon})]});if(s?.variant==="button")return(0,La.jsxs)(hs,{className:H("ttd-dialog-panel-button",s.className),onSelect:s.action?s.action:()=>{},disabled:s?.disabled||r,children:[(0,La.jsxs)("div",{className:H({invisible:r}),children:[s?.label,s?.icon&&(0,La.jsx)("span",{children:s.icon})]}),r&&(0,La.jsx)(il,{})]});if(s?.variant==="rateLimit")return(0,La.jsx)("div",{className:H("ttd-dialog-panel__rate-limit",s.className),children:s.label})};return(0,La.jsxs)("div",{className:H("ttd-dialog-panel",o),children:[(e||a)&&(0,La.jsxs)("div",{className:"ttd-dialog-panel__header",children:[typeof e=="string"?(0,La.jsx)("label",{children:e}):e,a?.()]}),t,(0,La.jsxs)("div",{className:H("ttd-dialog-panel-button-container",{invisible:!n.length}),style:{justifyContent:l},children:[n.filter(Boolean).map(s=>(0,La.jsx)(Uj.Fragment,{children:c(s)},s.label)),!r&&i?.()]})]})},use=({children:e})=>(0,Bj.jsx)("div",{className:"ttd-dialog-panels",children:e}),hse=()=>(0,z1.jsxs)("div",{className:"ttd-dialog-submit-shortcut",children:[(0,z1.jsx)("div",{className:"ttd-dialog-submit-shortcut__key",children:Y("CtrlOrCmd")}),(0,z1.jsx)("div",{className:"ttd-dialog-submit-shortcut__key",children:Y("Enter")})]}),mse=(e,t)=>{let n=fk(e,t);return n==null?null:n-1},AU=(e,t,n)=>{if(t<0||t>=e.length)return null;let r=n(e[t]);if(r===e[t])return null;let a=[...e];return a[t]=r,a.join(`
|
|
69
|
-
`)},pse=e=>{let t=e.match(/^(.*(?:\[[^\]]*]|\([^)]*\)|\{[^}]*}|"(?:[^"]*)"|'(?:[^']*)'))([A-Za-z]+)\s*$/);if(t)return t[1];let n=e.match(/^(.*(?:\[[^\]]*]|\([^)]*\)|\{[^}]*}|"(?:[^"]*)"|'(?:[^']*)'))([,;:])\s*$/);return n?n[1]:e},DU=e=>e.replace(/(\|[^|\n]+\|)\s*>\s*(?=[A-Za-z0-9_("[{'`])/g,"$1 "),Fj=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),fse=(e,t)=>{let n=new RegExp(`^\\s*deactivate\\s+${Fj(t)}(?:\\s+%%.*)?\\s*$`),r=e.split(/\r?\n/);for(let a=r.length-1;a>=0;a--)if(n.test(r[a]))return r.filter((i,o)=>o!==a).join(`
|
|
70
|
-
`);return null},gse=(e,t)=>{let n=new RegExp(`^\\s*deactivate\\s+${Fj(t)}(?:\\s+%%.*)?\\s*$`),r=e.split(/\r?\n/),a=!1,i=r.filter(o=>n.test(o)?(a=!0,!1):!0);return a?i.join(`
|
|
71
|
-
`):null},bse=e=>{let t=(e.match(/^\s*subgraph\b/gm)||[]).length,n=(e.match(/^\s*end\s*$/gm)||[]).length,r=t-n;if(r<=0)return null;let a=Array.from({length:r},()=>"end").join(`
|
|
72
|
-
`);return`${e.trimEnd()}
|
|
73
|
-
${a}`},vse=e=>e.replace(/[“”]/g,'"').replace(/[‘’]/g,"'"),IU=(e,t)=>{if(!Oj(t)||!e.trim())return[];let n=[],r=new Set,a=o=>{!o||o===e||r.has(o)||(r.add(o),n.push(o))},i=zj(t);if(i&&(a(fse(e,i)),a(gse(e,i))),X2(t)){let o=e.split(/\r?\n/),l=mse(t,e),c=l==null?[]:[l,l-1,l+1];for(let d of c)a(AU(o,d,u=>pse(u))),a(AU(o,d,u=>DU(u)));a(DU(e)),a(bse(e));let s=vse(e);a(s===e?null:s)}return n},Hj=({canvasRef:e,setError:t})=>{let n=e.current;if(!n)return;let r=n.parentElement;r&&(r.style.background="",t(null),n.replaceChildren())},gk=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:n,setError:r,data:a,theme:i})=>{let o=e.current,l=o?.parentElement;if(!o||!l)return{success:!1};if(!n)return Hj({canvasRef:e,setError:r}),{success:!1};let c;try{let s=await t.api;try{c=await s.parseMermaidToExcalidraw(n)}catch(m){let p=m;if(!n.includes('"'))return{success:!1,error:p};try{c=await s.parseMermaidToExcalidraw(n.replace(/"/g,"'"))}catch{return{success:!1,error:p}}}let{elements:d,files:u={}}=c;r(null),a.current={elements:ah(d,{regenerateIds:!0}),files:u};let h=await $_({elements:a.current.elements,files:a.current.files,exportPadding:Ms,maxWidthOrHeight:Math.max(l.offsetWidth,l.offsetHeight)*window.devicePixelRatio,appState:{exportWithDarkMode:i===se.DARK}});return l.style.background="var(--default-bg-color)",o.replaceChildren(h),{success:!0}}catch(s){return l.style.background="var(--default-bg-color)",n&&r(s),{success:!1,error:s}}},e2=e=>{Jd.set(Ds.MERMAID_TO_EXCALIDRAW,e)},n_=({app:e,data:t,text:n,shouldSaveMermaidDataToStorage:r})=>{let{elements:a,files:i}=t.current;a.length&&(e.addElementsFromPasteOrLibrary({elements:a,files:i,position:"center",fitToContent:!0}),e.setOpenDialog(null),r&&n&&e2(n))},yse=`flowchart TD
|
|
74
|
-
A[Christmas] -->|Get money| B(Go shopping)
|
|
75
|
-
B --> C{Let me think}
|
|
76
|
-
C -->|One| D[Laptop]
|
|
77
|
-
C -->|Two| E[iPhone]
|
|
78
|
-
C -->|Three| F[Car]`,LU=Qc(e2,300),xse=500,wse=4,Ese=30,Sse=e=>e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:"",Cse=({mermaidToExcalidrawLib:e,isActive:t})=>{let[n,r]=(0,ti.useState)(()=>Jd.get(Ds.MERMAID_TO_EXCALIDRAW)||yse),a=(0,ti.useDeferredValue)(n),[i,o]=(0,ti.useState)(null),[l,c]=(0,ti.useState)(null),s=i?.message?fk(i.message,a):null,d=(0,ti.useRef)(null),u=(0,ti.useRef)({elements:[],files:null}),h=Wi(),{theme:m}=pt();(0,ti.useEffect)(()=>{t&&((async()=>{try{if(!a.trim()){Hj({canvasRef:d,setError:o});return}let x=await gk({canvasRef:d,data:u,mermaidToExcalidrawLib:e,setError:o,mermaidDefinition:a,theme:m});if(!x.success){let g=x.error??new Error("Invalid mermaid definition");o(g)}}catch(x){qn()&&console.error("Failed to parse mermaid definition",x)}})(),LU(a))},[a,e,t,m]),(0,ti.useEffect)(()=>()=>{LU.flush()},[]),(0,ti.useEffect)(()=>{let x=i?.message??"",g=a;if(!(t&&Oj(x)&&g.trim()&&e.loaded)){c(null);return}let v=IU(g,x);if(!v.length){c(null);return}let b=!1,w=setTimeout(async()=>{try{let S=await e.api,_=new Set([g]),C=v.map(T=>({text:T,depth:1})),k=0;for(;C.length>0&&k<Ese;){let T=C.shift();if(!(!T||_.has(T.text))){_.add(T.text),k+=1;try{await S.parseMermaidToExcalidraw(T.text),b||c(T.text);return}catch(I){if(T.depth>=wse)continue;let A=Sse(I);if(!A)continue;let O=IU(T.text,A);for(let V of O)_.has(V)||C.push({text:V,depth:T.depth+1})}}}}catch{}b||c(null)},xse);return()=>{b=!0,clearTimeout(w)}},[a,i?.message,t,e]);let p=()=>{n_({app:h,data:u,text:n,shouldSaveMermaidDataToStorage:!0})},f=()=>{l&&r(l)};return(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)("div",{className:"ttd-dialog-desc",children:(0,yr.jsx)(nl,{i18nKey:"mermaid.description",flowchartLink:x=>(0,yr.jsx)("a",{href:"https://mermaid.js.org/syntax/flowchart.html",target:"_blank",rel:"noreferrer",children:x}),sequenceLink:x=>(0,yr.jsx)("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",target:"_blank",rel:"noreferrer",children:x}),classLink:x=>(0,yr.jsx)("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",target:"_blank",rel:"noreferrer",children:x}),erdLink:x=>(0,yr.jsx)("a",{href:"https://mermaid.js.org/syntax/entityRelationshipDiagram.html",target:"_blank",rel:"noreferrer",children:x})})}),(0,yr.jsxs)(use,{children:[(0,yr.jsx)(Jx,{children:(0,yr.jsx)(ase,{input:n,placeholder:E("mermaid.inputPlaceholder"),onChange:x=>r(x),errorLine:s,onKeyboardSubmit:()=>{p()}})}),(0,yr.jsx)(Jx,{panelActions:[{action:()=>{p()},label:E("mermaid.button"),icon:l2,variant:"button"}],renderSubmitShortcut:()=>(0,yr.jsx)(hse,{}),children:(0,yr.jsx)(Pj,{canvasRef:d,loaded:e.loaded,error:i,sourceText:n,autoFixAvailable:!!l,onApplyAutoFix:f})})]})]})},_se=Cse,Vj=()=>(0,Dm.jsxs)("div",{className:"chat-interface__welcome-screen__welcome-message",children:[(0,Dm.jsx)("h3",{children:E("chat.placeholder.title")}),(0,Dm.jsx)("p",{children:E("chat.placeholder.description")}),(0,Dm.jsx)("p",{children:E("chat.placeholder.hint")})]}),kse=({message:e,onMermaidTabClick:t,onAiRepairClick:n,onDeleteMessage:r,onInsertMessage:a,onRetry:i,rateLimitRemaining:o,isLastMessage:l,renderWarning:c,allowFixingParseError:s})=>{let[d,u]=(0,Z2.useState)(!1);(0,Z2.useEffect)(()=>{if(!e.error||!l)return;if(e.error&&!e.lastAttemptAt){u(!0);return}let m=Date.now()-e.lastAttemptAt,p=Math.max(0,5e3-m);if(p===0){u(!0);return}u(!1);let f=setTimeout(()=>{u(!0)},p);return()=>clearTimeout(f)},[e.error,e.lastAttemptAt,l]);let h=m=>m.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(e.type==="warning"){let m=c?.(e);return(0,Ye.jsx)("div",{className:"chat-message chat-message--system",children:(0,Ye.jsxs)("div",{className:"chat-message__content",children:[(0,Ye.jsxs)("div",{className:"chat-message__header",children:[(0,Ye.jsx)("span",{className:"chat-message__role",children:E("chat.role.system")}),(0,Ye.jsx)("span",{className:"chat-message__timestamp",children:h(e.timestamp)})]}),(0,Ye.jsx)("div",{className:"chat-message__body",children:(0,Ye.jsx)("div",{className:"chat-message__text",children:m||(e.warningType==="messageLimitExceeded"?(0,Ye.jsxs)(Ye.Fragment,{children:[E("chat.rateLimit.messageLimit"),(0,Ye.jsx)("div",{style:{marginTop:"10px"},children:(0,Ye.jsx)(lu,{onClick:()=>{window.open(`${_s.VITE_APP_PLUS_LP}/plus?utm_source=excalidraw&utm_medium=app&utm_content=ttdChatBanner#excalidraw-redirect`,"_blank","noopener")},children:E("chat.upsellBtnLabel")})})]}):E("chat.rateLimit.generalRateLimit"))})})]})})}return(0,Ye.jsxs)("div",{className:`chat-message chat-message--${e.type}`,children:[(0,Ye.jsxs)("div",{className:"chat-message__content",children:[(0,Ye.jsxs)("div",{className:"chat-message__header",children:[(0,Ye.jsx)("span",{className:"chat-message__role",children:e.type==="user"?E("chat.role.user"):E("chat.role.assistant")}),(0,Ye.jsx)("span",{className:"chat-message__timestamp",children:h(e.timestamp)})]}),(0,Ye.jsx)("div",{className:"chat-message__body",children:e.error?(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)("div",{className:"chat-message__error",children:e.content}),e.errorType!=="parse"&&(0,Ye.jsxs)("div",{className:"chat-message__error_message",children:["Error: ",e.error||E("chat.errors.generationFailed")]}),e.errorType==="parse"&&s&&(0,Ye.jsxs)("div",{className:"chat-message__error_message",children:[(0,Ye.jsx)("p",{children:E("chat.errors.invalidDiagram")}),(0,Ye.jsxs)("div",{className:"chat-message__error-actions",children:[t&&(0,Ye.jsx)("button",{className:"chat-message__error-link",onClick:()=>t(e),type:"button",children:E("chat.errors.fixInMermaid")}),n&&(0,Ye.jsx)("button",{className:"chat-message__error-link",onClick:()=>n(e),disabled:o===0,type:"button",children:E("chat.errors.aiRepair")})]})]})]}):(0,Ye.jsxs)("div",{className:"chat-message__text",children:[e.content,e.isGenerating&&(0,Ye.jsx)("span",{className:"chat-message__cursor",children:"\u258B"})]})})]}),e.type==="assistant"&&!e.isGenerating&&(0,Ye.jsxs)("div",{className:"chat-message__actions",children:[!e.error&&a&&(0,Ye.jsx)("button",{className:"chat-message__action",onClick:()=>a(e),type:"button","aria-label":E("chat.insert"),title:E("chat.insert"),children:kte}),t&&e.content&&(0,Ye.jsx)("button",{className:"chat-message__action",onClick:()=>t(e),type:"button","aria-label":E("chat.viewAsMermaid"),title:E("chat.viewAsMermaid"),children:bB}),r&&e.errorType!=="network"&&(0,Ye.jsx)("button",{className:"chat-message__action chat-message__action--danger",onClick:()=>r(e.id),type:"button","aria-label":E("chat.deleteMessage"),title:E("chat.deleteMessage"),children:us}),e.errorType==="network"&&i&&l&&(0,Ye.jsx)("button",{className:H("chat-message__action",{invisible:!d}),onClick:()=>i(e),type:"button","aria-label":E("chat.retry"),title:E("chat.retry"),children:_te})]})]})},Tse=({chatId:e,messages:t,currentPrompt:n,onPromptChange:r,onGenerate:a,isGenerating:i,rateLimits:o,onAbort:l,onMermaidTabClick:c,onAiRepairClick:s,onDeleteMessage:d,onInsertMessage:u,onRetry:h,renderWelcomeScreen:m,renderWarning:p})=>{let f=(0,hu.useRef)(null),x=(0,hu.useRef)(null);(0,hu.useLayoutEffect)(()=>{f.current?.scrollIntoView()},[t]),(0,hu.useEffect)(()=>{x.current&&x.current.focus()},[e]);let g=C=>{let k=C.target.value;r(k)},v=()=>{if(i&&l){l();return}let C=n.trim();C&&(a({prompt:C}),r(""))},b=C=>{C.key===D.ENTER&&!C.shiftKey&&(C.preventDefault(),i||v())},w=n.trim().length>3&&!i&&(o?.rateLimitRemaining??1)>0,S=i&&!!l,_=C=>{let k=C.target;k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,120)}px`};return(0,Aa.jsxs)("div",{className:"chat-interface",children:[(0,Aa.jsxs)("div",{className:"chat-interface__messages",children:[t.length===0?(0,Aa.jsx)("div",{className:"chat-interface__welcome-screen",children:m?m({rateLimits:o??null}):(0,Aa.jsx)(Vj,{})}):t.map((C,k)=>(0,Aa.jsx)(kse,{message:C,onMermaidTabClick:c,onAiRepairClick:s,onDeleteMessage:d,onInsertMessage:u,onRetry:h,rateLimitRemaining:o?.rateLimitRemaining,isLastMessage:k===t.length-1,renderWarning:p,allowFixingParseError:C.errorType==="parse"&&k===t.length-1},C.id)),(0,Aa.jsx)("div",{ref:f,id:"messages-end"})]}),(0,Aa.jsx)("div",{className:"chat-interface__input-container",children:(0,Aa.jsx)("div",{className:"chat-interface__input-outer",children:(0,Aa.jsxs)("div",{className:"chat-interface__input-wrapper",style:{borderColor:i?"var(--dialog-border-color)":void 0},children:[(0,Aa.jsx)("textarea",{ref:x,autoFocus:!0,className:"chat-interface__input",value:n,onChange:g,onKeyDown:b,placeholder:i?E("chat.generating"):o?.rateLimitRemaining===0?E("chat.rateLimit.messageLimitInputPlaceholder"):t.length>0?E("chat.inputPlaceholderWithMessages"):E("chat.inputPlaceholder",{shortcut:"Shift + Enter"}),disabled:o?.rateLimitRemaining===0,rows:1,cols:30,onInput:_}),(0,Aa.jsx)("button",{className:"chat-interface__send-button",onClick:v,disabled:!w&&!S,type:"button",children:(0,Aa.jsx)(G1,{size:"1.5em",icon:i?Nee:l2})})]})})})]})},Gj=Dt(null),Yj=Dt(!1),q2=Dt(null),qm=Dt({id:ca(),messages:[],currentPrompt:""}),wm=(e,t)=>{let{messages:n}=e,r=eb(n,o=>o.type==="assistant");if(r===-1)return e;let a=n[r],i=n.slice();return i[r]={...a,...t},{...e,messages:i}},Q2=e=>{let{messages:t}=e,n=eb(t,r=>r.type==="assistant");return t[n]},r_=(e,t)=>{let n=t.map(r=>({...r,id:ca(),timestamp:new Date}));return{...e,messages:[...e.messages,...n]}},Mse=e=>{let t=eb(e.messages??[],n=>n.type==="assistant");return t!==-1?{...e,messages:e.messages.filter((n,r)=>r!==t)}:e},Ase=e=>{let t=[];for(let n of e.messages)n.content&&(n.type==="user"||n.type==="assistant")&&t.push({role:n.type,content:n.content});return t},Wj=()=>{let[e,t]=Fe(qm);return{addUserMessage:n=>{t(r=>r_(r,[{type:"user",content:n}]))},addAssistantMessage:()=>{t(n=>r_(n,[{type:"assistant",content:"",isGenerating:!0}]))},setAssistantError:(n,r="other",a)=>{let i=a?JSON.stringify({name:a instanceof Error?a.name:"Error",message:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0}):void 0;t(o=>wm(o,{isGenerating:!1,error:n,errorType:r,errorDetails:i}))},chatHistory:e,setChatHistory:t,setLastRetryAttempt:()=>{t(n=>wm(n,{lastAttemptAt:Date.now()}))}}},Dse=e=>{let t=e.trim();return t.length<=50?t:`${t.substring(0,47)}...`},Ise=Dt([]),Lse=Dt(!1),Rse=Dt(!1),Kj=({persistenceAdapter:e})=>{let[t]=Fe(qm),[n,r]=Fe(Ise),[a,i]=Fe(Lse),[o,l]=Fe(Rse),c=(0,fo.useRef)(n);c.current=n;let s=t?.messages[t?.messages.length-1],d=(0,fo.useCallback)(async()=>{if(!(o||a)){i(!0);try{let f=await e.loadChats();r(f),l(!0)}catch(f){console.warn("Failed to load chats:",f),r([]),l(!0)}finally{i(!1)}}},[o,a,r,i,l,e]);(0,fo.useEffect)(()=>{d()},[]);let u=(0,fo.useCallback)(async()=>{if(t.messages.length===0)return;let f=t.messages.find(_=>_.type==="user");if(!f||typeof f.content!="string")return;let x=Dse(f.content),g=c.current,v=g.find(_=>_.id===t.id),b=!v||v.messages.length!==t.messages.length||v.messages.some((_,C)=>_.id!==t.messages[C]?.id||_.content!==t.messages[C]?.content),w={id:t.id,title:x,messages:t.messages.filter(_=>_.type==="user"||_.type==="assistant").map(_=>({..._,timestamp:_.timestamp instanceof Date?_.timestamp:new Date(_.timestamp)})),currentPrompt:t.currentPrompt,timestamp:b?Date.now():v?.timestamp??Date.now()},S=[...g.filter(_=>_.id!==t.id),w].sort((_,C)=>C.timestamp-_.timestamp).slice(0,10);r(S);try{await e.saveChats(S)}catch(_){console.warn("Failed to save chats:",_)}},[t,r,e]);(0,fo.useEffect)(()=>{s?.isGenerating||u()},[t.messages?.length,s?.id,s?.isGenerating]);let h=(0,fo.useCallback)(async f=>{let x=c.current.filter(g=>g.id!==f);r(x);try{await e.saveChats(x)}catch(g){console.warn("Failed to save after delete:",g)}return x},[r,e]),m=(0,fo.useCallback)(f=>f,[]),p=(0,fo.useCallback)(async()=>(await u(),ca()),[u]);return{savedChats:n,saveCurrentChat:u,deleteChat:h,restoreChat:m,createNewChatId:p}},Nse=e=>{let t=e.trim();if(!t)return!1;let n=(t.match(/\[/g)||[]).length,r=(t.match(/\]/g)||[]).length,a=(t.match(/\{/g)||[]).length,i=(t.match(/\}/g)||[]).length,o=(t.match(/\(/g)||[]).length,l=(t.match(/\)/g)||[]).length;if(n!==r||a!==i||o!==l)return!1;let c=t.split(`
|
|
79
|
-
`).pop()?.trim()||"";return![/-->$/,/--$/,/-\.$/,/==>$/,/==$/,/~~$/,/::$/,/:$/,/\|$/,/&$/].some(s=>s.test(c))},bC=300,Ose=3e3,zse=100,RU=100,Pse=({mermaidToExcalidrawLib:e,canvasRef:t})=>{let[n]=Fe(qm),[,r]=Fe(q2),[a,i]=Fe(Yj),o=(0,Gn.useRef)(!1),l=(0,Gn.useMemo)(()=>Q2(n),[n]),c=(0,Gn.useRef)(l);(0,Gn.useEffect)(()=>{c.current=l},[l]);let s=(0,Gn.useRef)({elements:[],files:null}),d=(0,Gn.useRef)(0),u=(0,Gn.useRef)(null),h=(0,Gn.useRef)(!1),m=(0,Gn.useRef)(bC),{theme:p}=pt(),f=(0,Gn.useCallback)(async v=>{if(!v.trim()||!e.loaded||o.current)return!1;o.current=!0;let b=performance.now(),w=await gk({canvasRef:t,data:s,mermaidToExcalidrawLib:e,setError:r,mermaidDefinition:v,theme:p});return performance.now()-b<zse?m.current=bC:m.current=Ose,o.current=!1,w.success},[t,e,r,p]),x=(0,Gn.useMemo)(()=>{let v=async b=>{let w=Date.now(),S=w-d.current,_=m.current;if(!Nse(b)){h.current||(d.current=Math.max(d.current,w-_+RU),h.current=!0),u.current=b;return}if(h.current=!1,S<_){u.current=b;return}u.current=null;let C=await f(b);d.current=Date.now(),C||(d.current=d.current-_+RU,h.current=!0)};return v.flush=async()=>{if(u.current){let b=u.current;u.current=null,await f(b),d.current=Date.now()}},v.cancel=()=>{u.current=null},v},[f]),g=(0,Gn.useCallback)(()=>{d.current=0,u.current=null,h.current=!1,m.current=bC},[]);return(0,Gn.useEffect)(()=>{l?.content&&l?.isGenerating?x(l.content):l?.isGenerating||(x.flush(),g(),l?.content&&x(l.content))},[g,x,l?.isGenerating,l?.content]),(0,Gn.useEffect)(()=>{let v=c.current;!v?.content||v.error||a&&f(v.content)},[n?.id,f,a]),(0,Gn.useEffect)(()=>{if(n.messages?.filter(v=>v.type==="assistant").length)a||i(!0);else{let v=t.current;if(v){let b=v.parentElement;b&&(b.style.background="",v.replaceChildren())}i(!1)}},[n.messages,i,t,a]),{data:s}},vC=3,yC=1e4,Use=({onTextSubmit:e})=>{let[,t]=Fe(q2),[n,r]=Fe(Gj),[a,i]=Fe(qm),{addUserMessage:o,addAssistantMessage:l,setAssistantError:c}=Wj(),s=(0,$j.useRef)(null),d=u=>u.length>yC||u.length<vC||n?.rateLimitRemaining===0?(u.length<vC&&t(new Error(E("chat.errors.promptTooShort",{min:vC}))),u.length>yC&&t(new Error(E("chat.errors.promptTooLong",{max:yC}))),!1):!0;return{onGenerate:async({prompt:u,isRepairFlow:h=!1})=>{if(!d(u))return;s.current&&s.current.abort(),t(null);let m=new AbortController;s.current=m,h?i(p=>wm(p,{isGenerating:!0,content:"",error:void 0,errorType:void 0,errorDetails:void 0})):(o(u),l());try{at("ai","generate","ttd");let p=[...Ase(a).slice(-3),{role:"user",content:u}],{generatedResponse:f,error:x,rateLimit:g,rateLimitRemaining:v}=await e({messages:p,onStreamCreated:()=>{h&&i(b=>wm(b,{content:"",error:"",isGenerating:!0}))},onChunk:b=>{i(w=>{let S=Q2(w);return wm(w,{content:S.content+b})})},signal:m.signal});if(i(b=>wm(b,{isGenerating:!1})),TE(g)&&TE(v)&&r({rateLimit:g,rateLimitRemaining:v}),(x?.status===429||v===0)&&i(b=>(x?.status===429&&(b=Mse(b)),b={...b,messages:b.messages.filter(w=>w.type!=="warning"||w.warningType==="rateLimitExceeded"||w.warningType==="messageLimitExceeded")},r_(b,[{type:"warning",warningType:v===0?"messageLimitExceeded":"rateLimitExceeded"}]))),x){if(x.name==="AbortError"||x.message==="Aborted"||m.signal.aborted)return;let b=new Error(x.message||E("chat.errors.requestFailed"));x.status!==429&&c(b.message,"network"),t(b);return}try{await p7(f??""),at("ai","mermaid parse success","ttd")}catch(b){at("ai","mermaid parse failed","ttd");let w=new Error(b.message||E("chat.errors.mermaidParseError"));c(w.message,"parse"),t(w)}}catch(p){let f=new Error(p.message||E("chat.errors.generationFailed"));c(f.message,"other"),t(f)}finally{s.current=null}},handleAbort:()=>{s.current&&s.current.abort()}}},Bse=({persistenceAdapter:e})=>{let t=F1(q2),[n,r]=Fe(qm),[a,i]=(0,Qo.useState)(!1),{restoreChat:o,deleteChat:l,createNewChatId:c}=Kj({persistenceAdapter:e}),s=(0,Qo.useCallback)(x=>{let g=x.messages.map(w=>({...w,timestamp:w.timestamp instanceof Date?w.timestamp:new Date(w.timestamp)})),v={id:x.id,messages:g,currentPrompt:""},b=Q2(v);t(b?.error?new Error(b?.error):null),r(v)},[t,r]),d=(0,Qo.useCallback)(async()=>{let x=await c();r({id:x,messages:[],currentPrompt:""}),t(null)},[c,r,t]),u=(0,Qo.useCallback)(x=>{let g=o(x);s(g),i(!1)},[o,s]),h=(0,Qo.useCallback)(async(x,g)=>{g.stopPropagation();let v=x===n.id,b=await l(x);if(v)if(b.length>0){let w=b[0];s(w)}else await d()},[n.id,l,s,d]),m=(0,Qo.useCallback)(async()=>{await d(),i(!1)},[d]),p=(0,Qo.useCallback)(()=>{i(x=>!x)},[]),f=(0,Qo.useCallback)(()=>{i(!1)},[]);return{isMenuOpen:a,onRestoreChat:u,handleDeleteChat:h,handleNewChat:m,handleMenuToggle:p,handleMenuClose:f}},Fse=({isOpen:e,onToggle:t,onClose:n,onNewChat:r,onRestoreChat:a,onDeleteChat:i,isNewChatBtnVisible:o,savedChats:l,activeSessionId:c,disabled:s})=>(0,Ia.jsxs)("div",{className:"ttd-chat-history-menu",children:[o&&(0,Ia.jsx)(lu,{onClick:r,disabled:s,children:E("chat.newChat")}),l.length>0&&(0,Ia.jsx)("div",{className:"ttd-dialog-panel__menu-wrapper",children:(0,Ia.jsxs)(Ae,{open:e,children:[(0,Ia.jsx)(Ae.Trigger,{onToggle:t,className:"ttd-dialog-menu-trigger",disabled:s,title:E("chat.menu"),"aria-label":E("chat.menu"),children:Lte}),(0,Ia.jsx)(Ae.Content,{onClickOutside:n,onSelect:n,children:(0,Ia.jsx)(Ia.Fragment,{children:l.map(d=>(0,Ia.jsxs)(Ae.ItemCustom,{className:H("ttd-chat-menu-item",{"ttd-chat-menu-item--active":d.id===c}),onClick:()=>{a(d)},children:[(0,Ia.jsx)("span",{className:"ttd-chat-menu-item__title",children:d.title}),(0,Ia.jsx)("button",{className:"ttd-chat-menu-item__delete",onClick:u=>i(d.id,u),title:E("chat.deleteChat"),"aria-label":E("chat.deleteChat"),type:"button",children:us})]},d.id))})})]})})]}),Hse=({chatId:e,messages:t,currentPrompt:n,onPromptChange:r,onGenerate:a,isGenerating:i,generatedResponse:o,isMenuOpen:l,onMenuToggle:c,onMenuClose:s,onNewChat:d,onRestoreChat:u,onDeleteChat:h,savedChats:m,activeSessionId:p,onAbort:f,onMermaidTabClick:x,onAiRepairClick:g,onDeleteMessage:v,onInsertMessage:b,onRetry:w,onViewAsMermaid:S,renderWelcomeScreen:_,renderWarning:C})=>{let[k]=Fe(Gj),T=(()=>{let A=[];return k&&A.push({label:E("chat.rateLimitRemaining",{count:k.rateLimitRemaining}),variant:"rateLimit",className:k.rateLimitRemaining<5?"ttd-dialog-panel__rate-limit--danger":""}),o&&A.push({action:S,label:E("chat.viewAsMermaid"),icon:(0,is.jsx)(G1,{icon:l2}),variant:"link"}),A})(),I=()=>T.length===2?"space-between":T.length===1&&T[0].variant==="rateLimit"?"flex-start":"flex-end";return(0,is.jsx)(Jx,{label:(0,is.jsxs)("div",{className:"ttd-dialog-panel__label-wrapper",children:[(0,is.jsx)("div",{className:"ttd-dialog-panel__label-group"}),(0,is.jsx)("div",{className:"ttd-dialog-panel__header-right",children:(0,is.jsx)(Fse,{isNewChatBtnVisible:!!t.length,isOpen:l,onToggle:c,onClose:s,onNewChat:d,onRestoreChat:u,onDeleteChat:h,savedChats:m,activeSessionId:p,disabled:i})})]}),className:"ttd-dialog-chat-panel",panelActionJustifyContent:I(),panelActions:T,children:(0,is.jsx)(Tse,{chatId:e,messages:t,currentPrompt:n,onPromptChange:r,onGenerate:a,isGenerating:i,generatedResponse:o,onAbort:f,onMermaidTabClick:x,onAiRepairClick:g,onDeleteMessage:v,onInsertMessage:b,onRetry:w,rateLimits:k,renderWelcomeScreen:_,renderWarning:C})})},jse=({canvasRef:e,error:t,loaded:n,onInsert:r,hideErrorDetails:a})=>{let i=[{action:r,label:E("chat.insert"),icon:l2,variant:"button"}];return(0,a_.jsx)(Jx,{panelActionJustifyContent:"flex-end",panelActions:i,className:"ttd-dialog-preview-panel",children:(0,a_.jsx)(Pj,{canvasRef:e,error:t,loaded:n,hideErrorDetails:a})})},Vse=({mermaidToExcalidrawLib:e,onTextSubmit:t,renderWelcomeScreen:n,renderWarning:r,persistenceAdapter:a})=>{let i=Wi(),o=fn(),l=(0,jj.useRef)(null),[c,s]=Fe(q2),[d,u]=Fe(qm),h=f_(Yj),{savedChats:m}=Kj({persistenceAdapter:a}),p=Q2(d),{setLastRetryAttempt:f}=Wj(),{data:x}=Pse({canvasRef:l,mermaidToExcalidrawLib:e}),{onGenerate:g,handleAbort:v}=Use({onTextSubmit:t}),{isMenuOpen:b,onRestoreChat:w,handleDeleteChat:S,handleNewChat:_,handleMenuToggle:C,handleMenuClose:k}=Bse({persistenceAdapter:a}),T=()=>{typeof p?.content=="string"&&(e2(p.content),o({openDialog:{name:"ttd",tab:"mermaid"}}))},I=R=>{let P=R.content||"";P&&(e2(P),o({openDialog:{name:"ttd",tab:"mermaid"}}))},A=async R=>{let P=R.content||"";if(!P.trim()||!e.loaded)return;let F={current:{elements:[],files:null}};(await gk({canvasRef:l,data:F,mermaidToExcalidrawLib:e,setError:s,mermaidDefinition:P,theme:i.state.theme})).success&&n_({app:i,data:F,text:P,shouldSaveMermaidDataToStorage:!0})},O=async R=>{let P=R.content||"",F=R.error||"";if(!P)return;let q=`Fix the error in this Mermaid diagram. The diagram is:
|
|
80
|
-
|
|
81
|
-
\`\`\`mermaid
|
|
82
|
-
${P}
|
|
83
|
-
\`\`\`
|
|
84
|
-
|
|
85
|
-
The exception/error is: ${F}
|
|
86
|
-
|
|
87
|
-
Please fix the Mermaid syntax and regenerate a valid diagram.`;await g({prompt:q,isRepairFlow:!0})},V=async R=>{let P=d.messages.findIndex(F=>F.id===R.id);if(P>0){let F=d.messages[P-1];F.type==="user"&&typeof F.content=="string"&&(f(),await g({prompt:F.content,isRepairFlow:!0}))}},j=()=>{n_({app:i,data:x})},K=R=>{let P=d.messages.findIndex(q=>q.id===R&&q.type==="assistant"),F=d.messages.slice(0,P-1);u({...d,messages:F})},Z=R=>{u(P=>({...P,currentPrompt:R}))};return(0,Bm.jsxs)("div",{className:`ttd-dialog-layout ${h?"ttd-dialog-layout--split":"ttd-dialog-layout--chat-only"}`,children:[(0,Bm.jsx)(Hse,{chatId:d.id,messages:d.messages,currentPrompt:d.currentPrompt,onPromptChange:Z,onGenerate:g,isGenerating:p?.isGenerating??!1,generatedResponse:p?.content,isMenuOpen:b,onMenuToggle:C,onMenuClose:k,onNewChat:_,onRestoreChat:w,onDeleteChat:S,savedChats:m,activeSessionId:d.id,onAbort:v,onMermaidTabClick:I,onAiRepairClick:O,onDeleteMessage:K,onInsertMessage:A,onRetry:V,onViewAsMermaid:T,renderWarning:r,renderWelcomeScreen:n}),h&&(0,Bm.jsx)(jse,{canvasRef:l,hideErrorDetails:p?.errorType==="parse",error:c,loaded:e.loaded,onInsert:j})]})},Gse=({mermaidToExcalidrawLib:e,onTextSubmit:t,renderWelcomeScreen:n,renderWarning:r,persistenceAdapter:a})=>(0,Bm.jsx)(Vse,{mermaidToExcalidrawLib:e,onTextSubmit:t,renderWelcomeScreen:n,renderWarning:r,persistenceAdapter:a}),Yse=Gse,Zj=e=>{let t=fn(),n=(0,i_.useRef)(null),r=(0,i_.useRef)(0);return(0,Xj.jsx)(ar.Root,{ref:n,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:a=>{if(!a)return;let i=n.current?.closest(".Modal__content");if(i){let o=i.offsetHeight||0;o>r.current&&(r.current=o,i.style.minHeight=`min(${r.current}px, 100%)`)}e.dialog==="ttd"&&rb(["text-to-diagram","mermaid"],a)&&t({openDialog:{name:e.dialog,tab:a}})},children:e.children})};Zj.displayName="TTDDialogTabs";var Wse=Zj,Qj=({children:e,...t})=>(0,qj.jsx)(ar.List,{className:"ttd-dialog-triggers",...t,children:e});Qj.displayName="TTDDialogTabTriggers";var l_=({children:e,tab:t,onSelect:n,...r})=>(0,o_.jsx)(ar.Trigger,{value:t,asChild:!0,onSelect:n,children:(0,o_.jsx)("button",{type:"button",className:"ttd-dialog-tab-trigger",...r,children:e})});l_.displayName="TTDDialogTabTrigger";var s_=({tab:e,children:t,...n})=>(0,Jj.jsx)(ar.Content,{...n,value:e,children:t});s_.displayName="TTDDialogTab";var eV=e=>{let t=pt();return t.openDialog?.name!=="ttd"?null:(0,Zr.jsx)(Kse,{...e,tab:t.openDialog.tab})};eV.WelcomeMessage=Vj;var Kse=W1("TTDDialogBase",({tab:e,...t})=>{let n=Wi(),[r,a]=(0,$2.useState)({loaded:!1,api:import("./chunks/excalidraw-mermaid-stub-NYXTOJ4H.js")});return(0,$2.useEffect)(()=>{(async()=>(await r.api,a(i=>({...i,loaded:!0}))))()},[r.api]),(0,Zr.jsx)(So,{className:"ttd-dialog",onCloseRequest:()=>{n.setOpenDialog(null)},size:1520,title:!1,...t,autofocus:!1,children:(0,Zr.jsxs)(Wse,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?(0,Zr.jsx)("p",{className:"dialog-mermaid-title",children:E("mermaid.title")}):(0,Zr.jsxs)(Qj,{children:[(0,Zr.jsx)(l_,{tab:"text-to-diagram",children:(0,Zr.jsxs)("div",{className:"ttd-dialog-tab-trigger__content",children:[E("labels.textToDiagram"),(0,Zr.jsx)("div",{className:"ttd-dialog-tab-trigger__badge",children:E("chat.aiBeta")})]})}),(0,Zr.jsx)(l_,{tab:"mermaid",children:E("mermaid.label")})]}),!("__fallback"in t)&&(0,Zr.jsx)(s_,{className:"ttd-dialog-content",tab:"text-to-diagram",children:(0,Zr.jsx)(Yse,{mermaidToExcalidrawLib:r,onTextSubmit:t.onTextSubmit,renderWelcomeScreen:t.renderWelcomeScreen,renderWarning:t.renderWarning,persistenceAdapter:t.persistenceAdapter})}),(0,Zr.jsx)(s_,{className:"ttd-dialog-content",tab:"mermaid",children:(0,Zr.jsx)(_se,{mermaidToExcalidrawLib:r,isActive:e==="mermaid"})})]})})}),$se=.01,c_=10,ps=(e,t)=>!(t==="angle"&&he(e)),Ur=(e,t)=>{let n=e+t/2;return n-n%t},t2=(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),P1=(e,t,n,r,a,i,o=!0)=>{if(Mr(n)&&(n.startBinding||n.endBinding)){if(Math.abs(e-n.x)<Uu&&Math.abs(t-n.y)<Uu)return;l3(n,"start",r),l3(n,"end",r)}let l=r.getNonDeletedElementsMap(),c=l.get(n.id);if(!c)return;let[s,d]=[n.x+n.width/2,n.y+n.height/2],[u,h]=Ie(N(n.x,n.y),N(s,d),n.angle),m=e-u,p=t-h,[f,x]=Ie(N(e,t),N(s+m,d+p),-n.angle);r.mutateElement(c,{x:f,y:x},{informMutation:o,isDragging:!1}),Us(c,r,a);let g=Le(n,i);if(g){let v=l.get(g.id);v&&r.mutateElement(v,{x:g.x+m,y:g.y+p},{informMutation:o,isDragging:!1})}if(he(n)){let v=pi(i,n.id);v.forEach(b=>{let w=l.get(b.id);if(!w)return;let[S,_]=[b.x+b.width/2,b.y+b.height/2],[C,k]=Ie(N(b.x,b.y),N(S,_),b.angle),T=Math.round(C+m),I=Math.round(k+p),[A,O]=Ie(N(T,I),N(S+m,_+p),-b.angle);r.mutateElement(w,{x:A,y:O},{informMutation:o,isDragging:!1}),Us(w,r,a,{simultaneouslyUpdated:v})})}},bk=(e,t)=>{let n=Ji(t).map(r=>wt(e,r).reduce((a,i)=>(a[i.id]=!0,a),{}));return e.filter(r=>!Bs(r)).forEach(r=>{n.push({[r.id]:!0})}),n},Xse=({label:e,icon:t,dragInputCallback:n,value:r,elements:a,editable:i=!0,shouldKeepAspectRatio:o,property:l,scene:c,appState:s,sensitivity:d=1,dragFinishedCallback:u})=>{let h=Wi(),m=fn(),p=(0,al.useRef)(null),f=(0,al.useRef)(null),[x,g]=(0,al.useState)(r.toString()),v=(0,al.useRef)(null);v.current||(v.current={originalAppState:qi(s),originalElements:a,lastUpdatedValue:x,updatePending:!1}),(0,al.useEffect)(()=>{let S=r.toString();g(S),v.current.lastUpdatedValue=S},[r]);let b=(S,_,C)=>{if(!v.current.updatePending)return!1;v.current.updatePending=!1;let k=Number(S);if(isNaN(k)){g(r.toString());return}let T=Number(k.toFixed(2)),I=Number(r);(isNaN(I)||Math.abs(T-I)>=$se)&&(v.current.lastUpdatedValue=S,n({accumulatedChange:0,instantChange:0,originalElements:_,originalElementsMap:h.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:o,shouldChangeByStepSize:!1,scene:c,nextValue:T,property:l,originalAppState:C,setInputValue:A=>g(String(A)),app:h,setAppState:m}),h.syncActionResult({captureUpdate:U.IMMEDIATELY}))},w=(0,al.useRef)({});return w.current.handleInputValue=b,(0,al.useEffect)(()=>{let S=p.current,_=w.current;return()=>{let C=S?.value;C&&_.handleInputValue?.(C,v.current.originalElements,v.current.originalAppState),window.removeEventListener(Q.POINTER_MOVE,_.onPointerMove,!1),window.removeEventListener(Q.POINTER_UP,_.onPointerUp,!1)}},[i]),i?(0,Im.jsxs)("div",{className:H("drag-input-container",!i&&"disabled"),"data-testid":e,children:[(0,Im.jsx)("div",{className:"drag-input-label",ref:f,onPointerDown:S=>{if(p.current&&i){document.body.classList.add("excalidraw-cursor-resize");let _=Number(p.current.value);isNaN(_)&&(_=0);let C=null,k=h.scene.getNonDeletedElements().reduce((K,Z)=>(K.set(Z.id,eo(Z)),K),new Map),T=a.map(K=>k.get(K.id)),I=qi(s),A=0,O=0,V=K=>{if(C&&k!==null&&T!==null){let Z=K.clientX-C.x;Z!==0&&(O+=Z,Math.abs(O)>=d&&(O=Math.sign(O)*Math.floor(Math.abs(O)/d),A+=O,n({accumulatedChange:A,instantChange:O,originalElements:T,originalElementsMap:k,shouldKeepAspectRatio:o,shouldChangeByStepSize:K.shiftKey,property:l,scene:c,originalAppState:I,setInputValue:R=>g(String(R)),app:h,setAppState:m}),O=0))}C={x:K.clientX,y:K.clientY}},j=()=>{window.removeEventListener(Q.POINTER_MOVE,V,!1),h.syncActionResult({captureUpdate:U.IMMEDIATELY}),u?.({app:h,setAppState:m,originalElements:T,originalAppState:I}),C=null,A=0,O=0,T=null,k=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener(Q.POINTER_UP,j,!1)};w.current.onPointerMove=V,w.current.onPointerUp=j,window.addEventListener(Q.POINTER_MOVE,V,!1),window.addEventListener(Q.POINTER_UP,j,!1)}},onPointerEnter:()=>{f.current&&(f.current.style.cursor="ew-resize")},children:t?(0,Im.jsx)(G1,{icon:t}):e}),(0,Im.jsx)("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:S=>{if(i){let _=S.target;_ instanceof HTMLInputElement&&S.key===D.ENTER&&(b(_.value,a,s),h.focusContainer())}},ref:p,value:x,onChange:S=>{v.current.updatePending=!0,g(S.target.value)},onFocus:S=>{S.target.select(),v.current.originalElements=a,v.current.originalAppState=qi(s)},onBlur:S=>{x?i&&b(S.target.value,v.current.originalElements,v.current.originalAppState):g(r.toString())},disabled:!i})]}):null},gs=Xse,Zse=15,qse=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:a,app:i})=>{let o=a.getNonDeletedElementsMap(),l=t[0];if(l&&!ze(l)){let c=o.get(l.id);if(!c)return;if(r!==void 0){let p=Ao(r);a.mutateElement(c,{angle:p}),Us(c,a,i.state);let f=Le(c,o);f&&!Oe(c)&&a.mutateElement(f,{angle:p});return}let s=Math.round(zu(l.angle)*100)/100,d=Math.round(e),u=(s+d)%360;n&&(u=Ur(u,Zse)),u=u<0?u+360:u;let h=Ao(u);a.mutateElement(c,{angle:h}),Us(c,a,i.state);let m=Le(c,o);m&&!Oe(c)&&a.mutateElement(m,{angle:h})}},Qse=({element:e,scene:t,appState:n,property:r})=>(0,nV.jsx)(gs,{label:"A",icon:yB,value:Math.round(zu(e.angle)%360*100)/100,elements:[e],dragInputCallback:qse,editable:ps(e,"angle"),scene:t,appState:n,property:r}),Jse=Qse,NU=5,ece=({property:e,scene:t,appState:n,setAppState:r})=>(0,rV.jsx)(gs,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:a,instantChange:i,shouldChangeByStepSize:o,setInputValue:l})=>{r(c=>{let s;return a?s=a:i&&(s=o?Ur(c.gridStep+NU*Math.sign(i),NU):c.gridStep+i),s?(s=GA(s),l(s),{gridStep:s}):(l(c.gridStep),null)})},scene:t,value:n.gridStep,property:e,appState:n}),tce=ece,OU=10,nce=e=>e.type==="image",rce=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldKeepAspectRatio:r,shouldChangeByStepSize:a,nextValue:i,property:o,originalAppState:l,instantChange:c,scene:s,app:d,setAppState:u})=>{let h=s.getNonDeletedElementsMap(),m=t[0],p=h.get(m.id);if(m&&p){let f=r||nce(m),x=m.width/m.height;if(l.croppingElementId===m.id){let g=h.get(m.id);if(!g||!ft(g)||!g.crop)return;let v=g.crop,b={...v},w=g.scale[0]===-1,S=g.scale[1]===-1,{width:_,height:C}=El(g),k=v.naturalWidth/_,T=v.naturalHeight/C,I=w?v.width+v.x:v.naturalWidth-v.x,A=S?v.height+v.y:v.naturalHeight-v.y,O=e3*k,V=e3*T;if(i!==void 0){if(o==="width"){let P=i*k,F=nn(P,O,I);b={...b,width:F,x:w?v.x+v.width-F:v.x}}else if(o==="height"){let P=i*T,F=nn(P,V,A);b={...b,height:F,y:S?v.y+v.height-F:v.y}}s.mutateElement(g,{crop:b,width:b.width/(v.naturalWidth/_),height:b.height/(v.naturalHeight/C)});return}let j=o==="width"?c:0,K=o==="height"?c:0,Z=nn(v.width+j,O,I),R=nn(v.height+K,O,A);b={...v,x:w?v.x+v.width-Z:v.x,y:S?v.y+v.height-R:v.y,width:Z,height:R},s.mutateElement(g,{crop:b,width:b.width/(v.naturalWidth/_),height:b.height/(v.naturalHeight/C)});return}if(i!==void 0){let g=Math.max(o==="width"?i:f?i*x:m.width,oa),v=Math.max(o==="height"?i:f?i/x:m.height,oa);if(rh(g,v,p,m,n,s,o==="width"?"e":"s",{shouldMaintainAspectRatio:f}),he(p)){let b=da(s.getElementsIncludingDeleted(),p,l,s.getNonDeletedElementsMap()),w=Io(s.getElementsIncludingDeleted(),b,p,d);s.replaceAllElements(w)}return}{let g=o==="width"?e:0,v=o==="height"?e:0,b=Math.max(0,m.width+g);o==="width"&&(a?b=Ur(b,OU):b=Math.round(b));let w=Math.max(0,m.height+v);if(o==="height"&&(a?w=Ur(w,OU):w=Math.round(w)),f&&(o==="width"?w=Math.round(b/x*100)/100:b=Math.round(w*x*100)/100),w=Math.max(oa,w),b=Math.max(oa,b),rh(b,w,p,m,n,s,o==="width"?"e":"s",{shouldMaintainAspectRatio:f}),he(p)){let S=da(s.getElementsIncludingDeleted(),p,l,s.getNonDeletedElementsMap());u({elementsToHighlight:S})}}}},ace=({setAppState:e,app:t,originalElements:n,originalAppState:r})=>{let a=t.scene.getNonDeletedElementsMap(),i=n?.[0],o=i&&a.get(i.id);if(o&&he(o)){let l=da(t.scene.getElementsIncludingDeleted(),o,r,t.scene.getNonDeletedElementsMap()),c=Io(t.scene.getElementsIncludingDeleted(),l,o,t);t.scene.replaceAllElements(c),e({elementsToHighlight:null})}},ice=({property:e,element:t,scene:n,appState:r})=>{let a=oi(e==="width"?t.width:t.height,2);if(r.croppingElementId&&r.croppingElementId===t.id&&ft(t)&&t.crop){let{width:i,height:o}=El(t);if(e==="width"){let l=i/t.crop.naturalWidth;a=oi(t.crop.width*l,2)}if(e==="height"){let l=o/t.crop.naturalHeight;a=oi(t.crop.height*l,2)}}return(0,aV.jsx)(gs,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:rce,value:a,editable:ps(t,e),scene:n,appState:r,property:e,dragFinishedCallback:ace})},zU=ice,PU=4,oce=4,lce=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:a})=>{let i=a.getNonDeletedElementsMap(),o=t[0];if(o){let l=i.get(o.id);if(!l||!oe(l))return;let c;if(r!==void 0)c=Math.max(Math.round(r),PU);else if(o.type==="text"){let s=Math.round(o.fontSize),d=Math.round(e);c=Math.max(s+d,PU),n&&(c=Ur(c,oce))}c&&(a.mutateElement(l,{fontSize:c}),on(l,a.getContainerElement(l),a))}},sce=({element:e,scene:t,appState:n,property:r})=>{let a=oe(e)?e:gn(e)?Le(e,t.getNonDeletedElementsMap()):null;return a?(0,iV.jsx)(gs,{label:"F",value:Math.round(a.fontSize*10)/10,elements:[a],dragInputCallback:lce,icon:o2,appState:n,scene:t,property:r}):null},cce=sce,dce=15,uce=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,property:a,scene:i})=>{let o=i.getNonDeletedElementsMap(),l=t.map(s=>o.get(s.id)).filter(s=>s&&!Bs(s)&&ps(s,a)),c=t.filter(s=>!Bs(s)&&ps(s,a));if(r!==void 0){let s=Ao(r);for(let d of l){if(!d)continue;i.mutateElement(d,{angle:s});let u=Le(d,o);u&&!Oe(d)&&i.mutateElement(u,{angle:s})}i.triggerUpdate();return}for(let s=0;s<l.length;s++){let d=l[s];if(!d)continue;let u=c[s],h=Math.round(zu(u.angle)*100)/100,m=Math.round(e),p=(h+m)%360;n&&(p=Ur(p,dce)),p=p<0?p+360:p;let f=Ao(p);i.mutateElement(d,{angle:f});let x=Le(d,o);x&&!Oe(d)&&i.mutateElement(x,{angle:f})}i.triggerUpdate()},hce=({elements:e,scene:t,appState:n,property:r})=>{let a=e.filter(c=>!Bs(c)&&ps(c,"angle")),i=a.map(c=>Math.round(zu(c.angle)%360*100)/100),o=new Set(i).size===1?i[0]:"Mixed",l=a.some(c=>ps(c,"angle"));return(0,oV.jsx)(gs,{label:"A",icon:yB,value:o,elements:e,dragInputCallback:uce,editable:l,appState:n,scene:t,property:r})},mce=hce,bm=10,pce=(e,t,n,r)=>{let a=r.x-e,i=r.y-t,o=r.width*n,l=r.height*n,c=e+a*n,s=t+i*n;return{width:o,height:l,x:c,y:s,...RA(r,o,l,!1),...oe(r)?{fontSize:r.fontSize*n}:{}}},fce=(e,t,n,r,a,i,o,l)=>{let c=l.getNonDeletedElementsMap(),s=pce(e,t,r,i);l.mutateElement(a,s);let d=Le(i,o);if(d){let u=d.fontSize*r;mi(a,l);let h=c.get(d.id);h&&oe(h)&&(l.mutateElement(h,{fontSize:u}),M8(a,l,n==="width"?"e":"s",!0))}},UU=(e,t,n,r,a,i,o,l,c,s)=>{i==="width"?t=Math.round(e/r*100)/100:e=Math.round(t*r*100)/100;let d=t/n;for(let u=0;u<l.length;u++){let h=l[u],m=o[u];fce(a[0],a[1],i,d,m,h,c,s)}},gce=({accumulatedChange:e,originalElements:t,originalElementsMap:n,originalAppState:r,shouldChangeByStepSize:a,nextValue:i,scene:o,property:l,setAppState:c,app:s})=>{let d=o.getNonDeletedElementsMap(),u=bk(t,r);if(i!==void 0){for(let f of u){let x=t2(f,d,n);if(x.length>1){let g=x.map(O=>O.latest),v=x.map(O=>O.original),[b,w,S,_]=Qe(v),C=S-b,k=_-w,T=C/k,I=Math.max(oa,l==="width"?Math.max(0,i):C),A=Math.max(oa,l==="height"?Math.max(0,i):k);UU(I,A,k,T,N(b,w),l,g,v,n,o)}else{let[g]=x,v=g?.latest,b=g?.original;if(v&&b&&ps(v,l)){let w=l==="width"?Math.max(0,i):v.width;l==="width"&&(a?w=Ur(w,bm):w=Math.round(w));let S=l==="height"?Math.max(0,i):v.height;if(l==="height"&&(a?S=Ur(S,bm):S=Math.round(S)),w=Math.max(oa,w),S=Math.max(oa,S),rh(w,S,v,b,n,o,l==="width"?"e":"s",{shouldInformMutation:!1}),he(v)){let _=da(o.getElementsIncludingDeleted(),v,r,o.getNonDeletedElementsMap()),C=Io(o.getElementsIncludingDeleted(),_,v,s);o.replaceAllElements(C)}}}}o.triggerUpdate();return}let h=l==="width"?e:0,m=l==="height"?e:0,p=[];for(let f of u){let x=t2(f,d,n);if(x.length>1){let g=x.map(O=>O.latest),v=x.map(O=>O.original),[b,w,S,_]=Qe(v),C=S-b,k=_-w,T=C/k,I=Math.max(0,C+h);l==="width"&&(a?I=Ur(I,bm):I=Math.round(I));let A=Math.max(0,k+m);l==="height"&&(a?A=Ur(A,bm):A=Math.round(A)),I=Math.max(oa,I),A=Math.max(oa,A),UU(I,A,k,T,N(b,w),l,g,v,n,o)}else{let[g]=x,v=g?.latest,b=g?.original;if(v&&b&&ps(v,l)){let w=Math.max(0,b.width+h);l==="width"&&(a?w=Ur(w,bm):w=Math.round(w));let S=Math.max(0,b.height+m);if(l==="height"&&(a?S=Ur(S,bm):S=Math.round(S)),w=Math.max(oa,w),S=Math.max(oa,S),rh(w,S,v,b,n,o,l==="width"?"e":"s",{shouldInformMutation:!1}),he(v)){let _=da(o.getElementsIncludingDeleted(),v,r,o.getNonDeletedElementsMap());p.push(..._)}}}}c({elementsToHighlight:p}),o.triggerUpdate()},bce=({setAppState:e,app:t,originalElements:n,originalAppState:r})=>{let a=t.scene.getNonDeletedElementsMap(),i=n?.[0],o=i&&a.get(i.id);if(o&&he(o)){let l=da(t.scene.getElementsIncludingDeleted(),o,r,t.scene.getNonDeletedElementsMap()),c=Io(t.scene.getElementsIncludingDeleted(),l,o,t);t.scene.replaceAllElements(c),e({elementsToHighlight:null})}},vce=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:a,appState:i})=>{let o=(0,lV.useMemo)(()=>r.map(s=>{let d=t2(s,n);if(d.length>1){let[h,m,p,f]=Qe(d.map(x=>x.latest));return Math.round((e==="width"?p-h:f-m)*100)/100}let[u]=d;return Math.round((e==="width"?u.latest.width:u.latest.height)*100)/100}),[n,r,e]),l=new Set(o).size===1?Math.round(o[0]*100)/100:"Mixed",c=o.length>0;return(0,sV.jsx)(gs,{label:e==="width"?"W":"H",elements:t,dragInputCallback:gce,value:l,editable:c,appState:i,property:e,scene:a,dragFinishedCallback:bce})},BU=vce,FU=4,yce=4,xce=(e,t)=>e.reduce((n,r)=>{if(!r||Bs(r))return n;if(oe(r))return n.push(r),n;if(gn(r)){let a=Le(r,t);if(a)return n.push(a),n}return n},[]),wce=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:a})=>{let i=a.getNonDeletedElementsMap(),o=t.map(c=>i.get(c.id)),l;if(r){l=Math.max(Math.round(r),FU);for(let c of o)a.mutateElement(c,{fontSize:l}),on(c,a.getContainerElement(c),a);a.triggerUpdate()}else{let c=t;for(let s=0;s<o.length;s++){let d=o[s],u=c[s],h=Math.round(u.fontSize),m=Math.round(e),p=Math.max(h+m,FU);n&&(p=Ur(p,yce)),a.mutateElement(d,{fontSize:p}),on(d,a.getContainerElement(d),a)}a.triggerUpdate()}},Ece=({elements:e,scene:t,appState:n,property:r,elementsMap:a})=>{let i=xce(e,a);if(!i.length)return null;let o=i.map(s=>Math.round(s.fontSize*10)/10),l=new Set(o).size===1?o[0]:"Mixed",c=o.length>0;return(0,cV.jsx)(gs,{label:"F",icon:o2,elements:i,dragInputCallback:wce,value:l,editable:c,scene:t,property:r,appState:n})},Sce=Ece,Cce=(e,t,n,r,a,i,o)=>{for(let l=0;l<r.length;l++){let c=r[l],[s,d]=[c.x+c.width/2,c.y+c.height/2],[u,h]=Ie(N(c.x,c.y),N(s,d),c.angle),m=e==="x"?Math.round(u+t):u,p=e==="y"?Math.round(h+n):h;P1(m,p,c,i,o,a,!1)}},_ce=(e,t,n,r,a,i)=>{let o=a.getNonDeletedElementsMap(),[l,c,,]=Qe(n),s=e-l,d=t-c;for(let u=0;u<n.length;u++){let h=n[u],m=o.get(h.id);if(m&&(!oe(m)||!m.containerId)){let[p,f]=[m.x+m.width/2,m.y+m.height/2],[x,g]=Ie(N(m.x,m.y),N(p,f),m.angle);P1(x+s,g+d,h,a,i,r,!1)}}},kce=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldChangeByStepSize:r,nextValue:a,property:i,scene:o,originalAppState:l,app:c})=>{let s=o.getNonDeletedElementsMap();if(a!==void 0){for(let u of bk(t,l)){let h=t2(u,s,n);if(h.length>1){let[m,p,,]=Qe(h.map(f=>f.latest));_ce(i==="x"?a:m,i==="y"?a:p,h.map(f=>f.original),n,o,c.state)}else{let m=h[0]?.original,p=h[0]?.latest;if(m&&p&&ps(p,i)){let[f,x]=[m.x+m.width/2,m.y+m.height/2],[g,v]=Ie(N(m.x,m.y),N(f,x),m.angle);P1(i==="x"?a:g,i==="y"?a:v,m,o,c.state,n,!1)}}}o.triggerUpdate();return}let d=r?Ur(e,c_):e;Cce(i,i==="x"?d:0,i==="y"?d:0,t,n,o,c.state),o.triggerUpdate()},Tce=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:a,appState:i})=>{let o=(0,dV.useMemo)(()=>r.map(c=>{let s=Object.keys(c).map(f=>n.get(f)).filter(f=>f!==void 0);if(s.length>1){let[f,x]=Qe(s);return Math.round((e==="x"?f:x)*100)/100}let[d]=s,[u,h]=[d.x+d.width/2,d.y+d.height/2],[m,p]=Ie(N(d.x,d.y),N(u,h),d.angle);return Math.round((e==="x"?m:p)*100)/100}),[r,n,e]),l=new Set(o).size===1?o[0]:"Mixed";return(0,uV.jsx)(gs,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:kce,value:l,property:e,scene:a,appState:i})},HU=Tce,Mce=({accumulatedChange:e,instantChange:t,originalElements:n,originalElementsMap:r,shouldChangeByStepSize:a,nextValue:i,property:o,scene:l,originalAppState:c,app:s})=>{let d=l.getNonDeletedElementsMap(),u=n[0],[h,m]=[u.x+u.width/2,u.y+u.height/2],[p,f]=Ie(N(u.x,u.y),N(h,m),u.angle);if(c.croppingElementId===u.id){let w=d.get(u.id);if(!w||!ft(w)||!w.crop)return;let S=w.crop,_=S,C=w.scale[0]===-1,k=w.scale[1]===-1,{width:T,height:I}=El(w);if(i!==void 0){if(o==="x"){let V=i*(S.naturalWidth/T);C?_={...S,x:nn(S.naturalWidth-V-S.width,0,S.naturalWidth-S.width)}:_={...S,x:nn(i*(S.naturalWidth/T),0,S.naturalWidth-S.width)}}o==="y"&&(_={...S,y:nn(i*(S.naturalHeight/I),0,S.naturalHeight-S.height)}),l.mutateElement(w,{crop:_});return}let A=(o==="x"?t:0)*(C?-1:1),O=(o==="y"?t:0)*(k?-1:1);_={...S,x:nn(S.x+A,0,S.naturalWidth-S.width),y:nn(S.y+O,0,S.naturalHeight-S.height)},l.mutateElement(w,{crop:_});return}if(i!==void 0){P1(o==="x"?i:p,o==="y"?i:f,u,l,s.state,r);return}let x=o==="x"?e:0,g=o==="y"?e:0,v=o==="x"?Math.round(a?Ur(u.x+x,c_):p+x):p,b=o==="y"?Math.round(a?Ur(u.y+g,c_):f+g):f;P1(v,b,u,l,s.state,r)},Ace=({property:e,element:t,elementsMap:n,scene:r,appState:a})=>{let[i,o]=Ie(N(t.x,t.y),N(t.x+t.width/2,t.y+t.height/2),t.angle),l=oi(e==="x"?i:o,2);if(a.croppingElementId===t.id&&ft(t)&&t.crop){let c=u8(t);c&&(l=oi(e==="x"?c.x:c.y,2))}return(0,hV.jsx)(gs,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:Mce,scene:r,value:l,property:e,appState:a})},jU=Ace,Dce=50,vk=e=>{let t=$1(),n=e.app.scene.getSceneNonce()||1,r=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),a=I1(e.app);return(0,le.jsx)(Ice,{...e,appState:t,sceneNonce:n,selectedElements:r,gridModeEnabled:a})},It=({children:e,columns:t=1,heading:n,style:r,...a})=>(0,le.jsx)("div",{className:H("exc-stats__row",{"exc-stats__row--heading":n}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...r},...a,children:e});It.displayName="StatsRow";var n2=({children:e,order:t,style:n,...r})=>(0,le.jsx)("div",{className:"exc-stats__rows",style:{order:t,...n},...r,children:e});n2.displayName="StatsRows";vk.StatsRow=It;vk.StatsRows=n2;var Ice=(0,yo.memo)(({app:e,onClose:t,renderCustomStats:n,selectedElements:r,appState:a,sceneNonce:i,gridModeEnabled:o})=>{let l=e.scene,c=l.getNonDeletedElements(),s=l.getNonDeletedElementsMap(),d=fn(),u=r.length===1?r[0]:null,h=r.length>1?r:null,m=a.croppingElementId&&ft(u),p=m?El(u):null,[f,x]=(0,yo.useState)({width:0,height:0}),g=(0,yo.useMemo)(()=>(0,tV.default)(w=>{let S=Qe(w);x({width:Math.round(S[2])-Math.round(S[0]),height:Math.round(S[3])-Math.round(S[1])})},Dce),[]);(0,yo.useEffect)(()=>{g(c)},[i,c,g]),(0,yo.useEffect)(()=>()=>g.cancel(),[g]);let v=(0,yo.useMemo)(()=>bk(r,a),[r,a]),b=(0,yo.useMemo)(()=>_b(r),[r]);return(0,le.jsx)("div",{className:"exc-stats",children:(0,le.jsxs)(Ja,{padding:3,children:[(0,le.jsxs)("div",{className:"title",children:[(0,le.jsx)("h2",{children:E("stats.title")}),(0,le.jsx)("div",{className:"close",onClick:t,children:Hm})]}),(0,le.jsxs)(FC,{label:(0,le.jsx)("h3",{children:E("stats.generalStats")}),open:!!(a.stats.panels&Vp.generalStats),openTrigger:()=>d(w=>({stats:{open:!0,panels:w.stats.panels^Vp.generalStats}})),children:[(0,le.jsxs)(n2,{children:[(0,le.jsx)(It,{heading:!0,children:E("stats.scene")}),(0,le.jsxs)(It,{columns:2,children:[(0,le.jsx)("div",{children:E("stats.shapes")}),(0,le.jsx)("div",{children:c.length})]}),(0,le.jsxs)(It,{columns:2,children:[(0,le.jsx)("div",{children:E("stats.width")}),(0,le.jsx)("div",{children:f.width})]}),(0,le.jsxs)(It,{columns:2,children:[(0,le.jsx)("div",{children:E("stats.height")}),(0,le.jsx)("div",{children:f.height})]}),o&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(It,{heading:!0,children:"Canvas"}),(0,le.jsx)(It,{children:(0,le.jsx)(tce,{property:"gridStep",scene:l,appState:a,setAppState:d})})]})]}),n?.(c,a)]}),!b&&r.length>0&&(0,le.jsx)("div",{id:"elementStats",style:{marginTop:12},children:(0,le.jsx)(FC,{label:(0,le.jsx)("h3",{children:E("stats.elementProperties")}),open:!!(a.stats.panels&Vp.elementProperties),openTrigger:()=>d(w=>({stats:{open:!0,panels:w.stats.panels^Vp.elementProperties}})),children:(0,le.jsxs)(n2,{children:[u&&(0,le.jsxs)(le.Fragment,{children:[m&&(0,le.jsx)(It,{heading:!0,children:E("labels.unCroppedDimension")}),a.croppingElementId&&ft(u)&&p&&(0,le.jsxs)(It,{columns:2,children:[(0,le.jsx)("div",{children:E("stats.width")}),(0,le.jsx)("div",{children:oi(p.width,2)})]}),a.croppingElementId&&ft(u)&&p&&(0,le.jsxs)(It,{columns:2,children:[(0,le.jsx)("div",{children:E("stats.height")}),(0,le.jsx)("div",{children:oi(p.height,2)})]}),(0,le.jsx)(It,{heading:!0,"data-testid":"stats-element-type",style:{margin:"0.3125rem 0"},children:a.croppingElementId?E("labels.imageCropping"):E(`element.${u.type}`)}),(0,le.jsx)(It,{children:(0,le.jsx)(jU,{element:u,property:"x",elementsMap:s,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(jU,{element:u,property:"y",elementsMap:s,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(zU,{property:"width",element:u,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(zU,{property:"height",element:u,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(Jse,{property:"angle",element:u,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(cce,{property:"fontSize",element:u,scene:l,appState:a})})]}),h&&(0,le.jsxs)(le.Fragment,{children:[xb(h)&&(0,le.jsx)(It,{heading:!0,children:E("element.group")}),(0,le.jsxs)(It,{columns:2,style:{margin:"0.3125rem 0"},children:[(0,le.jsx)("div",{children:E("stats.shapes")}),(0,le.jsx)("div",{children:r.length})]}),(0,le.jsx)(It,{children:(0,le.jsx)(HU,{property:"x",elements:h,elementsMap:s,atomicUnits:v,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(HU,{property:"y",elements:h,elementsMap:s,atomicUnits:v,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(BU,{property:"width",elements:h,elementsMap:s,atomicUnits:v,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(BU,{property:"height",elements:h,elementsMap:s,atomicUnits:v,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(mce,{property:"angle",elements:h,scene:l,appState:a})}),(0,le.jsx)(It,{children:(0,le.jsx)(Sce,{property:"fontSize",elements:h,scene:l,appState:a,elementsMap:s})})]})]})})})]})})},(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),Lce=({sourceElementId:e,onClose:t,appState:n,scene:r,generateLinkForSelection:a=Db})=>{let i=r.getNonDeletedElementsMap(),o=i.get(e)?.link??null,[l,c]=(0,Nc.useState)(o),[s,d]=(0,Nc.useState)(!1);(0,Nc.useEffect)(()=>{let h=Re(i,n),m=o;if(h.length>0&&a){let p=Ib(h,n);p&&(m=Qi(a(p.id,p.type)))}c(m)},[i,n,n.selectedElementIds,o,a]);let u=(0,Nc.useCallback)(()=>{if(l&&l!==i.get(e)?.link){let h=i.get(e);h&&r.mutateElement(h,{link:l})}if(!l&&s&&e){let h=i.get(e);h&&r.mutateElement(h,{link:null})}t?.()},[e,l,i,s,r,t]);return(0,Nc.useEffect)(()=>{let h=m=>{n.openDialog?.name==="elementLinkSelector"&&m.key===D.ENTER&&u(),n.openDialog?.name==="elementLinkSelector"&&m.key===D.ESCAPE&&t?.()};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[n,t,u]),(0,Bi.jsxs)("div",{className:"ElementLinkDialog",children:[(0,Bi.jsxs)("div",{className:"ElementLinkDialog__header",children:[(0,Bi.jsx)("h2",{children:E("elementLink.title")}),(0,Bi.jsx)("p",{children:E("elementLink.desc")})]}),(0,Bi.jsxs)("div",{className:"ElementLinkDialog__input",children:[(0,Bi.jsx)(N2,{value:l??"",onChange:h=>{s||d(!0),c(h)},onKeyDown:h=>{h.key===D.ENTER&&u()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),o&&l&&(0,Bi.jsx)(Me,{type:"button",title:E("buttons.remove"),"aria-label":E("buttons.remove"),label:E("buttons.remove"),onClick:()=>{c(null),d(!0)},className:"ElementLinkDialog__remove",icon:us})]}),(0,Bi.jsxs)("div",{className:"ElementLinkDialog__actions",children:[(0,Bi.jsx)(zm,{label:E("buttons.cancel"),onClick:()=>{t?.()},style:{marginRight:10}}),(0,Bi.jsx)(zm,{label:E("buttons.confirm"),onClick:u,actionType:"primary"})]})]})},Rce=Lce,Nce=({children:e,onClose:t})=>{let[n,r]=(0,J2.useState)(!!e),{container:a}=za(),i=J2.default.useCallback(()=>{r(!1),t&&t(),a?.focus()},[t,a]);return(0,Lm.jsx)(Lm.Fragment,{children:n&&(0,Lm.jsx)(So,{size:"small",onCloseRequest:i,title:E("errorDialog.title"),children:(0,Lm.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},Oce=()=>(0,X.jsxs)("div",{className:"HelpDialog__header",children:[(0,X.jsxs)("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener",children:[(0,X.jsx)("div",{className:"HelpDialog__link-icon",children:lP}),E("helpDialog.documentation")]}),(0,X.jsxs)("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener",children:[(0,X.jsx)("div",{className:"HelpDialog__link-icon",children:lP}),E("helpDialog.blog")]}),(0,X.jsxs)("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[(0,X.jsx)("div",{className:"HelpDialog__link-icon",children:dB}),E("helpDialog.github")]}),(0,X.jsxs)("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[(0,X.jsx)("div",{className:"HelpDialog__link-icon",children:Gte}),"YouTube"]})]}),zce=e=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("h3",{children:e.title}),(0,X.jsx)("div",{className:"HelpDialog__islands-container",children:e.children})]}),xC=e=>(0,X.jsxs)("div",{className:`HelpDialog__island ${e.className}`,children:[(0,X.jsx)("h4",{className:"HelpDialog__island-title",children:e.caption}),(0,X.jsx)("div",{className:"HelpDialog__island-content",children:e.children})]});function*Pce(e,t){let n=!0;for(let r of e)n||(yield t),n=!1,yield r}var Uce=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),re=({label:e,shortcuts:t,isOr:n=!0})=>{let r=t.map(a=>(a.endsWith("++")?[...a.slice(0,-2).split("+"),"+"]:a.split("+")).map(i=>(0,X.jsx)(Bce,{children:Uce(i)},i)));return(0,X.jsxs)("div",{className:"HelpDialog__shortcut",children:[(0,X.jsx)("div",{children:e}),(0,X.jsx)("div",{className:"HelpDialog__key-container",children:[...Pce(r,n?E("helpDialog.or"):null)]})]})},Bce=e=>(0,X.jsx)("kbd",{className:"HelpDialog__key",...e}),Fce=({onClose:e})=>{let t=mV.default.useCallback(()=>{e&&e()},[e]);return(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(So,{onCloseRequest:t,title:E("helpDialog.title"),className:"HelpDialog",children:[(0,X.jsx)(Oce,{}),(0,X.jsxs)(zce,{title:E("helpDialog.shortcuts"),children:[(0,X.jsxs)(xC,{className:"HelpDialog__island--tools",caption:E("helpDialog.tools"),children:[(0,X.jsx)(re,{label:E("toolBar.hand"),shortcuts:[D.H]}),(0,X.jsx)(re,{label:E("toolBar.selection"),shortcuts:[D.V,D[1]]}),(0,X.jsx)(re,{label:E("toolBar.rectangle"),shortcuts:[D.R,D[2]]}),(0,X.jsx)(re,{label:E("toolBar.diamond"),shortcuts:[D.D,D[3]]}),(0,X.jsx)(re,{label:E("toolBar.ellipse"),shortcuts:[D.O,D[4]]}),(0,X.jsx)(re,{label:E("toolBar.arrow"),shortcuts:[D.A,D[5]]}),(0,X.jsx)(re,{label:E("toolBar.line"),shortcuts:[D.L,D[6]]}),(0,X.jsx)(re,{label:E("toolBar.freedraw"),shortcuts:[D.P,D[7]]}),(0,X.jsx)(re,{label:E("toolBar.text"),shortcuts:[D.T,D[8]]}),(0,X.jsx)(re,{label:E("toolBar.image"),shortcuts:[D[9]]}),(0,X.jsx)(re,{label:E("toolBar.eraser"),shortcuts:[D.E,D[0]]}),(0,X.jsx)(re,{label:E("toolBar.frame"),shortcuts:[D.F]}),(0,X.jsx)(re,{label:E("toolBar.laser"),shortcuts:[D.K]}),(0,X.jsx)(re,{label:E("labels.eyeDropper"),shortcuts:[D.I,"Shift+S","Shift+G"]}),(0,X.jsx)(re,{label:E("helpDialog.editLineArrowPoints"),shortcuts:[Y("CtrlOrCmd+Enter")]}),(0,X.jsx)(re,{label:E("helpDialog.editText"),shortcuts:[Y("Enter")]}),(0,X.jsx)(re,{label:E("helpDialog.textNewLine"),shortcuts:[Y("Enter"),Y("Shift+Enter")]}),(0,X.jsx)(re,{label:E("helpDialog.textFinish"),shortcuts:[Y("Esc"),Y("CtrlOrCmd+Enter")]}),(0,X.jsx)(re,{label:E("helpDialog.curvedArrow"),shortcuts:["A",E("helpDialog.click"),E("helpDialog.click"),E("helpDialog.click")],isOr:!1}),(0,X.jsx)(re,{label:E("helpDialog.curvedLine"),shortcuts:["L",E("helpDialog.click"),E("helpDialog.click"),E("helpDialog.click")],isOr:!1}),(0,X.jsx)(re,{label:E("helpDialog.cropStart"),shortcuts:[E("helpDialog.doubleClick"),Y("Enter")],isOr:!0}),(0,X.jsx)(re,{label:E("helpDialog.cropFinish"),shortcuts:[Y("Enter"),Y("Escape")],isOr:!0}),(0,X.jsx)(re,{label:E("toolBar.lock"),shortcuts:[D.Q]}),(0,X.jsx)(re,{label:E("helpDialog.preventBinding"),shortcuts:[Y("CtrlOrCmd")]}),(0,X.jsx)(re,{label:E("toolBar.link"),shortcuts:[Y("CtrlOrCmd+K")]}),(0,X.jsx)(re,{label:E("toolBar.convertElementType"),shortcuts:["Tab","Shift+Tab"],isOr:!0})]}),(0,X.jsxs)(xC,{className:"HelpDialog__island--view",caption:E("helpDialog.view"),children:[(0,X.jsx)(re,{label:E("buttons.zoomIn"),shortcuts:[Y("CtrlOrCmd++")]}),(0,X.jsx)(re,{label:E("buttons.zoomOut"),shortcuts:[Y("CtrlOrCmd+-")]}),(0,X.jsx)(re,{label:E("buttons.resetZoom"),shortcuts:[Y("CtrlOrCmd+0")]}),(0,X.jsx)(re,{label:E("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,X.jsx)(re,{label:E("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,X.jsx)(re,{label:E("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),(0,X.jsx)(re,{label:E("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),(0,X.jsx)(re,{label:E("buttons.zenMode"),shortcuts:[Y("Alt+Z")]}),(0,X.jsx)(re,{label:E("buttons.objectsSnapMode"),shortcuts:[Y("Alt+S")]}),(0,X.jsx)(re,{label:E("labels.toggleGrid"),shortcuts:[Y("CtrlOrCmd+'")]}),(0,X.jsx)(re,{label:E("labels.viewMode"),shortcuts:[Y("Alt+R")]}),(0,X.jsx)(re,{label:E("labels.toggleTheme"),shortcuts:[Y("Alt+Shift+D")]}),(0,X.jsx)(re,{label:E("stats.fullTitle"),shortcuts:[Y("Alt+/")]}),(0,X.jsx)(re,{label:E("search.title"),shortcuts:[hn("searchMenu")]}),(0,X.jsx)(re,{label:E("commandPalette.title"),shortcuts:yl?[hn("commandPalette")]:[hn("commandPalette"),hn("commandPalette",1)]})]}),(0,X.jsxs)(xC,{className:"HelpDialog__island--editor",caption:E("helpDialog.editor"),children:[(0,X.jsx)(re,{label:E("helpDialog.createFlowchart"),shortcuts:[Y("CtrlOrCmd+Arrow Key")],isOr:!0}),(0,X.jsx)(re,{label:E("helpDialog.navigateFlowchart"),shortcuts:[Y("Alt+Arrow Key")],isOr:!0}),(0,X.jsx)(re,{label:E("labels.moveCanvas"),shortcuts:[Y(`Space+${E("helpDialog.drag")}`),Y(`Wheel+${E("helpDialog.drag")}`)],isOr:!0}),(0,X.jsx)(re,{label:E("buttons.clearReset"),shortcuts:[Y("CtrlOrCmd+Delete")]}),(0,X.jsx)(re,{label:E("labels.delete"),shortcuts:[Y("Delete")]}),(0,X.jsx)(re,{label:E("labels.cut"),shortcuts:[Y("CtrlOrCmd+X")]}),(0,X.jsx)(re,{label:E("labels.copy"),shortcuts:[Y("CtrlOrCmd+C")]}),(0,X.jsx)(re,{label:E("labels.paste"),shortcuts:[Y("CtrlOrCmd+V")]}),(0,X.jsx)(re,{label:E("labels.pasteAsPlaintext"),shortcuts:[Y("CtrlOrCmd+Shift+V")]}),(0,X.jsx)(re,{label:E("labels.selectAll"),shortcuts:[Y("CtrlOrCmd+A")]}),(0,X.jsx)(re,{label:E("labels.multiSelect"),shortcuts:[Y(`Shift+${E("helpDialog.click")}`)]}),(0,X.jsx)(re,{label:E("helpDialog.deepSelect"),shortcuts:[Y(`CtrlOrCmd+${E("helpDialog.click")}`)]}),(0,X.jsx)(re,{label:E("helpDialog.deepBoxSelect"),shortcuts:[Y(`CtrlOrCmd+${E("helpDialog.drag")}`)]}),(G_||yl)&&(0,X.jsx)(re,{label:E("labels.copyAsPng"),shortcuts:[Y("Shift+Alt+C")]}),(0,X.jsx)(re,{label:E("labels.copyStyles"),shortcuts:[Y("CtrlOrCmd+Alt+C")]}),(0,X.jsx)(re,{label:E("labels.pasteStyles"),shortcuts:[Y("CtrlOrCmd+Alt+V")]}),(0,X.jsx)(re,{label:E("labels.sendToBack"),shortcuts:[Y(la?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,X.jsx)(re,{label:E("labels.bringToFront"),shortcuts:[Y(la?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,X.jsx)(re,{label:E("labels.sendBackward"),shortcuts:[Y("CtrlOrCmd+[")]}),(0,X.jsx)(re,{label:E("labels.bringForward"),shortcuts:[Y("CtrlOrCmd+]")]}),(0,X.jsx)(re,{label:E("labels.alignTop"),shortcuts:[Y("CtrlOrCmd+Shift+Up")]}),(0,X.jsx)(re,{label:E("labels.alignBottom"),shortcuts:[Y("CtrlOrCmd+Shift+Down")]}),(0,X.jsx)(re,{label:E("labels.alignLeft"),shortcuts:[Y("CtrlOrCmd+Shift+Left")]}),(0,X.jsx)(re,{label:E("labels.alignRight"),shortcuts:[Y("CtrlOrCmd+Shift+Right")]}),(0,X.jsx)(re,{label:E("labels.duplicateSelection"),shortcuts:[Y("CtrlOrCmd+D"),Y(`Alt+${E("helpDialog.drag")}`)]}),(0,X.jsx)(re,{label:E("helpDialog.toggleElementLock"),shortcuts:[Y("CtrlOrCmd+Shift+L")]}),(0,X.jsx)(re,{label:E("buttons.undo"),shortcuts:[Y("CtrlOrCmd+Z")]}),(0,X.jsx)(re,{label:E("buttons.redo"),shortcuts:Z0?[Y("CtrlOrCmd+Y"),Y("CtrlOrCmd+Shift+Z")]:[Y("CtrlOrCmd+Shift+Z")]}),(0,X.jsx)(re,{label:E("labels.group"),shortcuts:[Y("CtrlOrCmd+G")]}),(0,X.jsx)(re,{label:E("labels.ungroup"),shortcuts:[Y("CtrlOrCmd+Shift+G")]}),(0,X.jsx)(re,{label:E("labels.flipHorizontal"),shortcuts:[Y("Shift+H")]}),(0,X.jsx)(re,{label:E("labels.flipVertical"),shortcuts:[Y("Shift+V")]}),(0,X.jsx)(re,{label:E("labels.showStroke"),shortcuts:[Y("S")]}),(0,X.jsx)(re,{label:E("labels.showBackground"),shortcuts:[Y("G")]}),(0,X.jsx)(re,{label:E("labels.showFonts"),shortcuts:[Y("Shift+F")]}),(0,X.jsx)(re,{label:E("labels.decreaseFontSize"),shortcuts:[Y("CtrlOrCmd+Shift+<")]}),(0,X.jsx)(re,{label:E("labels.increaseFontSize"),shortcuts:[Y("CtrlOrCmd+Shift+>")]})]})]})]})})},rt=e=>Array.isArray(e)?`<kbd>${e.map(Y).join(" + ")}</kbd>`:`<kbd>${Y(e)}</kbd>`,Hce=({appState:e,isMobile:t,editorInterface:n,app:r})=>{let{activeTool:a,isResizing:i,isRotating:o,lastPointerDownWith:l}=e,c=e.multiElement!==null;if(e.openSidebar?.name===kr.name&&e.openSidebar.tab===bl&&e.searchMatches?.matches.length)return E("hints.dismissSearch",{shortcut:rt("Escape")});if(e.openSidebar&&!n.canFitSidebar)return null;if(to(e))return E("hints.eraserRevert",{shortcut:rt("Alt")});let s=r.scene.getSelectedElements(e);if(e.selectedLinearElement?.isDragging&&s[0]?.type==="arrow")return E("hints.arrowBindModifiers",{shortcut_1:rt("Ctrl"),shortcut_2:rt("Alt")});if(a.type==="arrow"||a.type==="line")return c?E("hints.linearElementMulti",{shortcut_1:rt("Escape"),shortcut_2:rt("Enter")}):a.type==="arrow"?E("hints.arrowTool",{shortcut:rt("A")}):E("hints.linearElement");if(a.type==="freedraw")return E("hints.freeDraw");if(a.type==="text")return E("hints.text");if(a.type==="embeddable")return E("hints.embeddable");if(i&&l==="mouse"&&s.length===1){let d=s[0];return Te(d)&&d.points.length===2?E("hints.lockAngle",{shortcut:rt("Shift")}):ft(d)?E("hints.resizeImage",{shortcut_1:rt("Shift"),shortcut_2:rt("Alt")}):E("hints.resize",{shortcut_1:rt("Shift"),shortcut_2:rt("Alt")})}if(o&&l==="mouse")return E("hints.rotate",{shortcut:rt("Shift")});if(s.length===1&&oe(s[0]))return E("hints.text_selected",{shortcut:rt("Enter")});if(e.editingTextElement)return E("hints.text_editing",{shortcut_1:rt("Escape"),shortcut_2:rt(["CtrlOrCmd","Enter"])});if(e.croppingElementId)return E("hints.leaveCropEditor",{shortcut_1:rt("Enter"),shortcut_2:rt("Escape")});if(s.length===1&&ft(s[0]))return E("hints.enterCropEditor",{shortcut:rt("Enter")});if(a.type==="selection"){if(e.selectionElement&&!s.length&&!e.editingTextElement&&!e.selectedLinearElement?.isEditing)return E("hints.deepBoxSelect",{shortcut:rt("CtrlOrCmd")});if(I1(r)&&e.selectedElementsAreBeingDragged)return E("hints.disableSnapping",{shortcut:rt("CtrlOrCmd")});if(!s.length&&!t)return E("hints.canvasPanning",{shortcut_1:rt(E("keys.mmb")),shortcut_2:rt("Space")});if(s.length===1){if(Te(s[0]))return e.selectedLinearElement?.isEditing?e.selectedLinearElement.selectedPointsIndices?E("hints.lineEditor_pointSelected",{shortcut_1:rt("Delete"),shortcut_2:rt(["CtrlOrCmd","D"])}):E("hints.lineEditor_nothingSelected",{shortcut_1:rt("Shift"),shortcut_2:rt("Alt")}):Pt(s[0])?E("hints.lineEditor_line_info",{shortcut:rt("Enter")}):E("hints.lineEditor_info",{shortcut_1:rt("CtrlOrCmd"),shortcut_2:rt(["CtrlOrCmd","Enter"])});if(!e.newElement&&!e.selectedElementsAreBeingDragged&&Sl(s[0])){let d=E("hints.bindTextToElement",{shortcut:rt("Enter")}),u=E("hints.createFlowchart",{shortcut:rt(["CtrlOrCmd","\u2191\u2193"])});return cb(s[0])?xA(s[0],r.scene.getNonDeletedElementsMap())?[d,u]:[d,u]:d}}}return null},jce=({appState:e,isMobile:t,editorInterface:n,app:r})=>{let a=Hce({appState:e,isMobile:t,editorInterface:n,app:r});if(!a)return null;let i=(Array.isArray(a)?a.map(o=>o.replace(/\. ?$/,"")).join(", "):a).split(/(<kbd>[^<]+<\/kbd>)/g).map((o,l)=>{if(l%2===1){let c=o[0]==="<"&&o.match(/^<kbd>([^<]+)<\/kbd>$/);return(0,Rx.jsx)("kbd",{children:c?c[1]:o},l)}return o});return(0,Rx.jsx)("div",{className:"HintViewer",children:(0,Rx.jsx)("span",{children:i})})},Vce=2e3,Gce=()=>{let[e,t]=(0,Qm.useState)(null),n=(0,Qm.useRef)(0),r=()=>{clearTimeout(n.current),t("success"),n.current=window.setTimeout(()=>{t(null)},Vce)},a=(0,Qm.useCallback)(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:a,onCopy:r}},yx=({title:e,name:t,checked:n,onChange:r,disabled:a=!1})=>(0,d_.jsx)("div",{className:H("Switch",{toggled:n,disabled:a}),children:(0,d_.jsx)("input",{name:t,id:t,title:e,type:"checkbox",checked:n,disabled:a,onChange:()=>r(!n),onKeyDown:i=>{i.key===" "&&r(!n)}})}),Yce=()=>(0,We.jsxs)("div",{children:[(0,We.jsx)("h3",{children:E("canvasError.cannotShowPreview")}),(0,We.jsx)("p",{children:(0,We.jsx)("span",{children:E("canvasError.canvasTooBig")})}),(0,We.jsxs)("em",{children:["(",E("canvasError.canvasTooBigTip"),")"]})]}),Wce=({appStateSnapshot:e,elementsSnapshot:t,files:n,actionManager:r,onExportImage:a,name:i,exportWithDarkMode:o})=>{let l=vn(t,e),[c,s]=(0,Ra.useState)(i),[d,u]=(0,Ra.useState)(l),[h,m]=(0,Ra.useState)(e.exportBackground),[p,f]=(0,Ra.useState)(e.exportEmbedScene),[x,g]=(0,Ra.useState)(e.exportScale),v=(0,Ra.useRef)(null),b=(0,Ra.useRef)(0),[w,S]=(0,Ra.useState)(null),{onCopy:_,copyStatus:C,resetCopyStatus:k}=Gce();(0,Ra.useEffect)(()=>{k()},[c,h,o,x,p,k]);let{exportedElements:T,exportingFrame:I}=S2(t,e,d);return(0,Ra.useEffect)(()=>{let A=v.current;if(!A)return;let O=A.offsetWidth,V=A.offsetHeight;if(!O)return;let j=++b.current,K=()=>j!==b.current;return $_({elements:T,appState:{...e,name:c,exportBackground:h,exportWithDarkMode:o,exportScale:x,exportEmbedScene:p},files:n,exportPadding:Ms,maxWidthOrHeight:Math.max(O,V),exportingFrame:I}).then(async Z=>{if(!K()){try{await bf(Z)}catch(R){throw R.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(E("canvasError.canvasTooBig")):R}K()||(S(null),A.replaceChildren(Z))}}).catch(Z=>{K()||(console.error(Z),S(Z))}),()=>{b.current+=1}},[e,n,T,I,c,h,o,x,p]),(0,We.jsxs)("div",{className:"ImageExportModal",children:[(0,We.jsx)("h3",{children:E("imageExportDialog.header")}),(0,We.jsxs)("div",{className:"ImageExportModal__preview",children:[(0,We.jsx)("div",{className:"ImageExportModal__preview__canvas",ref:v,children:w&&(0,We.jsx)(Yce,{})}),(0,We.jsx)("div",{className:"ImageExportModal__preview__filename",children:!zb&&(0,We.jsx)("input",{type:"text",className:"TextInput",value:c,style:{width:"30ch"},onChange:A=>{s(A.target.value),r.executeAction(fre,"ui",A.target.value)}})})]}),(0,We.jsxs)("div",{className:"ImageExportModal__settings",children:[(0,We.jsx)("h3",{children:E("imageExportDialog.header")}),l&&(0,We.jsx)(Jg,{label:E("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:(0,We.jsx)(yx,{name:"exportOnlySelected",checked:d,onChange:A=>{u(A)}})}),(0,We.jsx)(Jg,{label:E("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:(0,We.jsx)(yx,{name:"exportBackgroundSwitch",checked:h,onChange:A=>{m(A),r.executeAction(bre,"ui",A)}})}),(0,We.jsx)(Jg,{label:E("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:(0,We.jsx)(yx,{name:"exportDarkModeSwitch",checked:o,onChange:A=>{r.executeAction(yre,"ui",A)}})}),(0,We.jsx)(Jg,{label:E("imageExportDialog.label.embedScene"),tooltip:E("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:(0,We.jsx)(yx,{name:"exportEmbedSwitch",checked:p,onChange:A=>{f(A),r.executeAction(pF,"ui",A)}})}),(0,We.jsx)(Jg,{label:E("imageExportDialog.label.scale"),name:"exportScale",children:(0,We.jsx)(sj,{name:"exportScale",value:x,onChange:A=>{g(A),r.executeAction(gre,"ui",A)},choices:G0.map(A=>({value:A,label:`${A}\xD7`}))})}),(0,We.jsxs)("div",{className:"ImageExportModal__settings__buttons",children:[(0,We.jsx)(lu,{className:"ImageExportModal__settings__buttons__button",label:E("imageExportDialog.title.exportToPng"),onClick:()=>a(V0.png,T,{exportingFrame:I}),icon:EP,children:E("imageExportDialog.button.exportToPng")}),(0,We.jsx)(lu,{className:"ImageExportModal__settings__buttons__button",label:E("imageExportDialog.title.exportToSvg"),onClick:()=>a(V0.svg,T,{exportingFrame:I}),icon:EP,children:E("imageExportDialog.button.exportToSvg")}),(G_||yl)&&(0,We.jsx)(lu,{className:"ImageExportModal__settings__buttons__button",label:E("imageExportDialog.title.copyPngToClipboard"),status:C,onClick:async()=>{await a(V0.clipboard,T,{exportingFrame:I}),_()},icon:__,children:E("imageExportDialog.button.copyPngToClipboard")})]})]})]})},Jg=({label:e,children:t,tooltip:n,name:r})=>(0,We.jsxs)("div",{className:"ImageExportModal__settings__setting",title:e,children:[(0,We.jsxs)("label",{htmlFor:r,className:"ImageExportModal__settings__setting__label",children:[e,n&&(0,We.jsx)(cu,{label:n,long:!0,children:Ete})]}),(0,We.jsx)("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),Kce=({elements:e,appState:t,files:n,actionManager:r,onExportImage:a,onCloseRequest:i,name:o})=>{let[{appStateSnapshot:l,elementsSnapshot:c}]=(0,Ra.useState)(()=>({appStateSnapshot:qi(t),elementsSnapshot:qi(e)}));return(0,We.jsx)(So,{onCloseRequest:i,size:"wide",title:!1,children:(0,We.jsx)(Wce,{elementsSnapshot:c,appStateSnapshot:l,files:n,actionManager:r,onExportImage:a,name:o,exportWithDarkMode:t.exportWithDarkMode})})},wC={primary:{base:"var(--color-primary)",darker:"var(--color-primary-darker)",darkest:"var(--color-primary-darkest)"},lime:{base:"#74b816",darker:"#66a80f",darkest:"#5c940d"},pink:{base:"#d6336c",darker:"#c2255c",darkest:"#a61e4d"}},VU=({children:e,color:t})=>(0,fV.jsx)("div",{className:"Card",style:{"--card-color":wC[t].base,"--card-color-darker":wC[t].darker,"--card-color-darkest":wC[t].darkest},children:e}),$ce=({elements:e,appState:t,setAppState:n,files:r,actionManager:a,exportOpts:i,canvas:o,onCloseRequest:l})=>{let{onExportToBackend:c}=i;return(0,Vn.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,Vn.jsxs)("div",{className:"ExportDialog-cards",children:[i.saveFileToDisk&&(0,Vn.jsxs)(VU,{color:"lime",children:[(0,Vn.jsx)("div",{className:"Card-icon",children:Mee}),(0,Vn.jsx)("h2",{children:E("exportDialog.disk_title")}),(0,Vn.jsxs)("div",{className:"Card-details",children:[E("exportDialog.disk_details"),!zb&&a.renderAction("changeProjectName")]}),(0,Vn.jsx)(Me,{className:"Card-button",type:"button",title:E("exportDialog.disk_button"),"aria-label":E("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{a.executeAction(gF,"ui")}})]}),c&&(0,Vn.jsxs)(VU,{color:"pink",children:[(0,Vn.jsx)("div",{className:"Card-icon",children:LC}),(0,Vn.jsx)("h2",{children:E("exportDialog.link_title")}),(0,Vn.jsx)("div",{className:"Card-details",children:E("exportDialog.link_details")}),(0,Vn.jsx)(Me,{className:"Card-button",type:"button",title:E("exportDialog.link_button"),"aria-label":E("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{at("export","link",`ui (${a8()})`),await c(e,t,r),l()}catch(s){n({errorMessage:s.message})}}})]}),i.renderCustomUI&&i.renderCustomUI(e,t,r,o)]})})},Xce=({elements:e,appState:t,files:n,actionManager:r,exportOpts:a,canvas:i,setAppState:o})=>{let l=pV.default.useCallback(()=>{o({openDialog:null})},[o]);return(0,Vn.jsx)(Vn.Fragment,{children:t.openDialog?.name==="jsonExport"&&(0,Vn.jsx)(So,{onCloseRequest:l,title:E("buttons.export"),children:(0,Vn.jsx)($ce,{elements:e,appState:t,setAppState:o,files:n,actionManager:r,onCloseRequest:l,exportOpts:a,canvas:i})})})},Zce="small",qce=e=>(0,U1.jsxs)("label",{className:H("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${Zce}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,U1.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"}),(0,U1.jsx)("div",{className:"ToolIcon__icon",children:Rm})]}),Qce=({UIOptions:e})=>(0,ne.jsxs)(ka,{__fallback:!0,children:[(0,ne.jsx)(ka.DefaultItems.LoadScene,{}),(0,ne.jsx)(ka.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&(0,ne.jsx)(ka.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&(0,ne.jsx)(ka.DefaultItems.SaveAsImage,{}),(0,ne.jsx)(ka.DefaultItems.SearchMenu,{}),(0,ne.jsx)(ka.DefaultItems.Help,{}),(0,ne.jsx)(ka.DefaultItems.ClearCanvas,{}),(0,ne.jsx)(ka.Separator,{}),(0,ne.jsx)(ka.Group,{title:"Excalidraw links",children:(0,ne.jsx)(ka.DefaultItems.Socials,{})}),(0,ne.jsx)(ka.Separator,{}),(0,ne.jsx)(ka.DefaultItems.ToggleTheme,{}),(0,ne.jsx)(ka.DefaultItems.ChangeCanvasBackground,{})]}),Jce=()=>(0,ne.jsxs)(gC,{__fallback:!0,children:[(0,ne.jsx)(gC.Actions.SaveToDisk,{}),(0,ne.jsx)(gC.Actions.ExportToImage,{})]}),ede=({actionManager:e,appState:t,files:n,setAppState:r,elements:a,canvas:i,onLockToggle:o,onHandToolToggle:l,onPenModeToggle:c,showExitZenModeBtn:s,renderTopLeftUI:d,renderTopRightUI:u,renderCustomStats:h,UIOptions:m,onExportImage:p,renderWelcomeScreen:f,children:x,app:g,isCollaborating:v,generateLinkForSelection:b})=>{let w=En(),S=cl()==="compact",_=pie(),C=S?{menuTopGap:4,toolbarColGap:4,toolbarRowGap:1,toolbarInnerRowGap:.5,islandPadding:1,collabMarginLeft:8}:{menuTopGap:6,toolbarColGap:4,toolbarRowGap:1,toolbarInnerRowGap:1,islandPadding:1,collabMarginLeft:8},k=_.tunnelsJotai.Provider,[T,I]=Fe(d2),A=()=>m.canvasActions.export?(0,ne.jsx)(Xce,{elements:a,appState:t,files:n,actionManager:e,exportOpts:m.canvasActions.export,canvas:i,setAppState:r}):null,O=()=>!m.canvasActions.saveAsImage||t.openDialog?.name!=="imageExport"?null:(0,ne.jsx)(Kce,{elements:a,appState:t,files:n,actionManager:e,onExportImage:p,onCloseRequest:()=>r({openDialog:null}),name:g.getName()}),V=()=>(0,ne.jsxs)("div",{style:{position:"relative"},children:[(0,ne.jsx)(_.MainMenuTunnel.Out,{}),f&&(0,ne.jsx)(_.WelcomeScreenMenuHintTunnel.Out,{})]}),j=()=>{let F=S;return(0,ne.jsx)(JC,{heading:"selectedShapeActions",className:H("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:F?(0,ne.jsx)(Ja,{className:H("compact-shape-actions-island"),padding:0,style:{maxHeight:`${t.height-166}px`},children:(0,ne.jsx)(bie,{appState:t,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:g,setAppState:r})}):(0,ne.jsx)(Ja,{className:vt.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:(0,ne.jsx)(fie,{appState:t,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:g})})})},K=()=>{let F=BA(t,a),q=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector";return(0,ne.jsx)(FH,{side:"top",children:(0,ne.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,ne.jsxs)(rl.Col,{gap:C.menuTopGap,className:H("App-menu_top__left"),children:[V(),(0,ne.jsx)("div",{className:H("selected-shape-actions-container",{"selected-shape-actions-container--compact":S}),children:F&&j()})]}),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&(0,ne.jsx)(JC,{heading:"shapes",className:"shapes-section",children:te=>(0,ne.jsxs)("div",{style:{position:"relative"},children:[f&&(0,ne.jsx)(_.WelcomeScreenToolbarHintTunnel.Out,{}),(0,ne.jsx)(rl.Col,{gap:C.toolbarColGap,align:"start",children:(0,ne.jsxs)(rl.Row,{gap:C.toolbarRowGap,className:H("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[(0,ne.jsxs)(Ja,{padding:C.islandPadding,className:H("App-toolbar",{"zen-mode":t.zenModeEnabled,"App-toolbar--compact":S}),children:[(0,ne.jsx)(jce,{appState:t,isMobile:w.formFactor==="phone",editorInterface:w,app:g}),te,(0,ne.jsxs)(rl.Row,{gap:C.toolbarInnerRowGap,children:[(0,ne.jsx)(HH,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>c(null),title:E("toolBar.penMode"),penDetected:t.penDetected}),(0,ne.jsx)(Tle,{checked:t.activeTool.locked,onChange:o,title:E("toolBar.lock")}),(0,ne.jsx)("div",{className:"App-toolbar__divider"}),(0,ne.jsx)(yie,{setAppState:r,activeTool:t.activeTool,UIOptions:m,app:g})]})]}),v&&(0,ne.jsx)(Ja,{style:{marginLeft:C.collabMarginLeft,alignSelf:"center",height:"fit-content"},children:(0,ne.jsx)(qce,{title:E("toolBar.laser"),checked:t.activeTool.type===rn.laser,onChange:()=>g.setActiveTool({type:rn.laser}),isMobile:!0})})]})})]})}),(0,ne.jsxs)("div",{className:H("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled,"layer-ui__wrapper__top-right--compact":S}),children:[t.collaborators.size>0&&(0,ne.jsx)(jH,{collaborators:t.collaborators,userToFollow:t.userToFollow?.socketId||null}),u?.(w.formFactor==="phone",t),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&(!R||t.openSidebar?.name!==kr.name)&&(0,ne.jsx)(_.DefaultSidebarTriggerTunnel.Out,{}),q&&(0,ne.jsx)(vk,{app:g,onClose:()=>{e.executeAction(Vx)},renderCustomStats:h})]})]})})},Z=()=>(0,ne.jsx)(MU,{__fallback:!0,onDock:F=>{at("sidebar",`toggleDock (${F?"dock":"undock"})`,`(${w.formFactor==="phone"?"mobile":"desktop"})`)}}),R=f_(uk),P=(0,ne.jsxs)(ne.Fragment,{children:[x,(0,ne.jsx)(Qce,{UIOptions:m}),(0,ne.jsx)(MU.Trigger,{__fallback:!0,icon:Qte,title:$e(E("toolBar.library")),onToggle:F=>{F&&at("sidebar",`${kr.name} (open)`,`button (${w.formFactor==="phone"?"mobile":"desktop"})`)},tab:kr.defaultTab}),(0,ne.jsx)(Jce,{}),t.openDialog?.name==="ttd"&&(0,ne.jsx)(eV,{__fallback:!0}),t.isLoading&&(0,ne.jsx)(PH,{delay:250}),t.errorMessage&&(0,ne.jsx)(Nce,{onClose:()=>r({errorMessage:null}),children:t.errorMessage}),T&&w.formFactor!=="phone"&&(0,ne.jsx)(une,{colorPickerType:T.colorPickerType,onCancel:()=>{I(null)},onChange:(F,q,te,{altKey:ge})=>{if(!(F!=="elementBackground"&&F!=="elementStroke"))if(te.length){for(let be of te)Ar(be,me(a),{[ge&&T.swapPreviewOnAlt?F==="elementBackground"?"strokeColor":"backgroundColor":F==="elementBackground"?"backgroundColor":"strokeColor"]:q}),Ro.delete(be);g.scene.triggerUpdate()}else r(F==="elementBackground"?{currentItemBackgroundColor:q}:{currentItemStrokeColor:q})},onSelect:(F,q)=>{I(te=>te?.keepOpenOnAlt&&q.altKey?te:null),T?.onSelect?.(F,q)}}),t.openDialog?.name==="help"&&(0,ne.jsx)(Fce,{onClose:()=>{r({openDialog:null})}}),(0,ne.jsx)(Cie,{}),t.openDialog?.name==="elementLinkSelector"&&(0,ne.jsx)(Rce,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{r({openDialog:null})},scene:g.scene,appState:t,generateLinkForSelection:b}),(0,ne.jsx)(_.OverwriteConfirmDialogTunnel.Out,{}),O(),A(),t.openDialog?.name==="charts"&&(0,ne.jsx)(Ole,{data:t.openDialog.data,rawText:t.openDialog.rawText,onClose:()=>r({openDialog:null})}),w.formFactor==="phone"&&(0,ne.jsx)(Ile,{app:g,appState:t,elements:a,actionManager:e,renderJSONExportDialog:A,renderImageExportDialog:O,setAppState:r,onHandToolToggle:l,onPenModeToggle:c,renderTopLeftUI:d,renderTopRightUI:u,renderSidebars:Z,renderWelcomeScreen:f,UIOptions:m}),w.formFactor!=="phone"&&(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)("div",{className:"layer-ui__wrapper",style:t.openSidebar&&R&&w.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[f&&(0,ne.jsx)(_.WelcomeScreenCenterTunnel.Out,{}),K(),(0,ne.jsx)(Hle,{appState:t,actionManager:e,showExitZenModeBtn:s,renderWelcomeScreen:f}),(t.toast||t.scrolledOutside)&&(0,ne.jsxs)("div",{className:"floating-status-stack",children:[t.toast&&(0,ne.jsx)(dF,{message:t.toast.message,onClose:()=>r({toast:null}),duration:t.toast.duration,closable:t.toast.closable}),!t.toast&&t.scrolledOutside&&(0,ne.jsx)("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(F=>({...mf(a,F)}))},children:E("buttons.scrollBackToContent")})]})]}),Z()]})]});return(0,ne.jsx)(RB.Provider,{value:t,children:(0,ne.jsx)(k,{children:(0,ne.jsx)(oH.Provider,{value:_,children:P})})})},GU=e=>{let{startBoundElement:t,cursorButton:n,scrollX:r,scrollY:a,...i}=e;return i},tde=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:n,appState:r,...a}=e,{canvas:i,appState:o,...l}=t;return Qt(GU(r),GU(o),{selectedElementIds:Qt,selectedGroupIds:Qt})&&Qt(a,l)},nde=zH.default.memo(ede,tde),rde="small",EC=e=>(0,B1.jsxs)("label",{className:H("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${rde}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,B1.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,B1.jsx)("div",{className:"ToolIcon__icon",children:e.icon})]}),ade=({trails:e})=>{let t=(0,ew.useRef)(null);return(0,ew.useEffect)(()=>{if(t.current)for(let n of e)n.start(t.current);return()=>{for(let n of e)n.stop()}},e),(0,u_.jsx)("div",{className:"SVGLayer",children:(0,u_.jsx)("svg",{ref:t})})},ide="#ff6b6b",ode="#ff0000",YU=1,WU=2,lde=(e,t)=>{if(!t.snapLines.length)return;let n=t.theme===se.LIGHT||t.zenModeEnabled?ide:ode,r=(t.zenModeEnabled?YU*1.5:YU)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let a of t.snapLines)a.type==="pointer"?(e.lineWidth=r,e.strokeStyle=n,cde(a,e,t)):a.type==="gap"?(e.lineWidth=r,e.strokeStyle=n,dde(a.points[0],a.points[1],a.direction,t,e)):a.type==="points"&&(e.lineWidth=r,e.strokeStyle=n,sde(a,e,t));e.restore()},sde=(e,t,n)=>{if(!n.zenModeEnabled){let r=e.points[0],a=e.points[e.points.length-1];Oi(r,a,t)}for(let r of e.points)gV(r,n,t)},cde=(e,t,n)=>{gV(e.points[0],n,t),n.zenModeEnabled||Oi(e.points[0],e.points[1],t)},gV=([e,t],n,r)=>{r.save();let a=(n.zenModeEnabled?WU*1.5:WU)/n.zoom.value;r.beginPath(),r.moveTo(e-a,t-a),r.lineTo(e+a,t+a),r.moveTo(e+a,t-a),r.lineTo(e-a,t+a),r.stroke(),r.restore()},Oi=(e,t,n)=>{n.beginPath(),n.lineTo(e[0],e[1]),n.lineTo(t[0],t[1]),n.stroke()},dde=(e,t,n,r,a)=>{let i=8/r.zoom.value,o=i/2,l=i/4;if(n==="horizontal"){let c=[(e[0]+t[0])/2,e[1]];r.zenModeEnabled||Oi(N(e[0],e[1]-i),N(e[0],e[1]+i),a),Oi(N(c[0]-l,c[1]-o),N(c[0]-l,c[1]+o),a),Oi(N(c[0]+l,c[1]-o),N(c[0]+l,c[1]+o),a),r.zenModeEnabled||(Oi(N(t[0],t[1]-i),N(t[0],t[1]+i),a),Oi(e,t,a))}else{let c=[e[0],(e[1]+t[1])/2];r.zenModeEnabled||Oi(N(e[0]-i,e[1]),N(e[0]+i,e[1]),a),Oi(N(c[0]-o,c[1]-l),N(c[0]+o,c[1]-l),a),Oi(N(c[0]-o,c[1]+l),N(c[0]+o,c[1]+l),a),r.zenModeEnabled||(Oi(N(t[0]-i,t[1]),N(t[0]+i,t[1]),a),Oi(e,t,a))}},ude=(e,t)=>{ut(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:n}=t.selectedLinearElement;ut(n,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),yk(n,e,t),e.restore()},hde=(e,t,n)=>{let{elementId:r,hoverPointIndex:a}=t.selectedLinearElement;if(t.selectedLinearElement?.isEditing&&t.selectedLinearElement?.selectedPointsIndices?.includes(a)||t.selectedLinearElement?.isDragging)return;let i=ae.getElement(r,n);if(!i)return;let o=ae.getPointAtIndexGlobalCoordinates(i,a,n);e.save(),e.translate(t.scrollX,t.scrollY),yk(o,e,t),e.restore()},yk=(e,t,n)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",pf(t,e[0],e[1],ae.POINT_HANDLE_SIZE/n.zoom.value,!1)},mde=(e,t,n)=>{e.save(),e.translate(t.scrollX,t.scrollY),yk(n,e,t),e.restore()},SC=(e,t,n,r,a,i,o)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",a?e.fillStyle="rgba(134, 131, 226, 0.9)":i&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),pf(e,n[0],n[1],(o?r*(t.selectedLinearElement?.isEditing?1.5:2):r)/t.zoom.value,!i,!o||a)},pde=(e,t,n,r,a)=>{let i=t.element.frameId&&n.get(t.element.frameId);switch(i&&he(i)&&(e.translate(i.x,i.y),e.beginPath(),yt.radius&&e.roundRect?e.roundRect(-1,-1,i.width+1,i.height+1,yt.radius/r.zoom.value):e.rect(-1,-1,i.width+1,i.height+1),e.clip(),e.translate(-i.x,-i.y)),t.element.type){case"magicframe":case"frame":e.save(),e.translate(t.element.x,t.element.y),e.lineWidth=yt.strokeWidth/r.zoom.value,e.strokeStyle=r.theme===se.DARK?"rgba(3, 93, 161, 1)":"rgba(106, 189, 252, 1)",yt.radius&&e.roundRect?(e.beginPath(),e.roundRect(0,0,t.element.width,t.element.height,yt.radius/r.zoom.value),e.stroke(),e.closePath()):e.strokeRect(0,0,t.element.width,t.element.height),e.restore();break;default:e.save();let o=od(t.element,n);switch(e.translate(o[0],o[1]),e.rotate(t.element.angle),e.translate(-o[0],-o[1]),e.translate(t.element.x,t.element.y),e.lineWidth=nn(1.75,t.element.strokeWidth,4)/Math.max(.25,r.zoom.value),e.strokeStyle=r.theme===se.DARK?"rgba(3, 93, 161, 1)":"rgba(106, 189, 252, 1)",t.element.type){case"ellipse":e.beginPath(),e.ellipse(t.element.width/2,t.element.height/2,t.element.width/2,t.element.height/2,0,0,2*Math.PI),e.closePath(),e.stroke();break;case"diamond":{let[l,c]=db(t.element);l.forEach(s=>{e.beginPath(),e.moveTo(s[0][0]-t.element.x,s[0][1]-t.element.y),e.lineTo(s[1][0]-t.element.x,s[1][1]-t.element.y),e.stroke()}),c.forEach(s=>{let[d,u,h,m]=s;e.beginPath(),e.moveTo(d[0]-t.element.x,d[1]-t.element.y),e.bezierCurveTo(u[0]-t.element.x,u[1]-t.element.y,h[0]-t.element.x,h[1]-t.element.y,m[0]-t.element.x,m[1]-t.element.y),e.stroke()})}break;default:{let[l,c]=r3(t.element);l.forEach(s=>{e.beginPath(),e.moveTo(s[0][0]-t.element.x,s[0][1]-t.element.y),e.lineTo(s[1][0]-t.element.x,s[1][1]-t.element.y),e.stroke()}),c.forEach(s=>{let[d,u,h,m]=s;e.beginPath(),e.moveTo(d[0]-t.element.x,d[1]-t.element.y),e.bezierCurveTo(u[0]-t.element.x,u[1]-t.element.y,h[0]-t.element.x,h[1]-t.element.y,m[0]-t.element.x,m[1]-t.element.y),e.stroke()})}break}e.restore();break}if(r.isMidpointSnappingEnabled&&(he(t.element)||nd(t.element))){let o=r.selectedLinearElement,l=o?.elementId&&ae.getElement(o?.elementId,n),c=a&&Ps({point:a,element:t.element,elementsMap:n,threshold:0,overrideShouldTestInside:!0}),s=l&&ze(l)||r.activeTool.type==="arrow"&&r.currentItemArrowType==="elbow";if(!c||s){e.save();let d=od(t.element,n),u;if(t.element.type==="diamond"){let f=od(t.element,n);u=v8(t.element).map(x=>{let g=LE(x,.5),v=Ie(g,f,t.element.angle);return N(v[0],v[1])})}else u=[{x:t.element.width,y:t.element.height/2},{x:t.element.width/2,y:t.element.height},{x:0,y:t.element.height/2},{x:t.element.width/2,y:0}].map(f=>{let x=N(f.x+t.element.x,f.y+t.element.y),g=Ie(x,d,t.element.angle);return N(g[0],g[1])});let h=a&&u.reduce((f,x,g)=>{let v=Cr(x,a);return g===-1||v<f.distance?{idx:g,distance:v}:f},{idx:-1,distance:1/0}),m=4/r.zoom.value,p=$u(r.zoom)+t.element.strokeWidth/2;u.forEach((f,x)=>{let g=(!c||s)&&h?.idx===x&&h.distance<=p,v=!g&&(s||x===h?.idx&&h.distance<=p*2);g?(e.fillStyle=r.theme===se.DARK?"rgba(3, 93, 161, 1)":"rgba(106, 189, 252, 1)",e.beginPath(),e.arc(f[0],f[1],m,0,2*Math.PI),e.fill()):v&&(e.fillStyle=r.theme===se.DARK?"rgba(0, 0, 0, 0.8)":"rgba(65, 65, 65, 0.5)",e.beginPath(),e.arc(f[0],f[1],m,0,2*Math.PI),e.fill())}),e.restore()}}},fde=(e,t,n,r,a,i,o)=>{let l=e.state.bindMode==="orbit"&&e.bindModeHandler!==null,c=Is-(o?.runtime??(l?0:Is)),s=nn(1/Is*c,1e-4,1),d=n.strokeWidth/2,u=n.frameId&&r.get(n.frameId);switch(u&&he(u)&&(t.translate(u.x,u.y),t.beginPath(),yt.radius&&t.roundRect?t.roundRect(-1,-1,u.width+1,u.height+1,yt.radius/a.zoom.value):t.rect(-1,-1,u.width+1,u.height+1),t.clip(),t.translate(-u.x,-u.y)),n.type){case"magicframe":case"frame":t.save(),t.translate(n.x,n.y),t.lineWidth=yt.strokeWidth/a.zoom.value,t.strokeStyle=a.theme===se.DARK?`rgba(3, 93, 161, ${s})`:`rgba(106, 189, 252, ${s})`,yt.radius&&t.roundRect?(t.beginPath(),t.roundRect(0,0,n.width,n.height,yt.radius/a.zoom.value),t.stroke(),t.closePath()):t.strokeRect(0,0,n.width,n.height),t.restore();break;default:t.save();let m=od(n,r),p=m[0]+a.scrollX,f=m[1]+a.scrollY;switch(t.translate(p,f),t.rotate(n.angle),t.translate(-p,-f),t.translate(n.x+a.scrollX-d,n.y+a.scrollY-d),t.lineWidth=nn(2.5,n.strokeWidth*1.75,4)/Math.max(.25,a.zoom.value),t.strokeStyle=a.theme===se.DARK?`rgba(3, 93, 161, ${s/2})`:`rgba(106, 189, 252, ${s/2})`,n.type){case"ellipse":t.beginPath(),t.ellipse((n.width+d*2)/2,(n.height+d*2)/2,(n.width+d*2)/2,(n.height+d*2)/2,0,0,2*Math.PI),t.closePath(),t.stroke();break;case"diamond":{let[x,g]=db(n,d);x.forEach(v=>{t.beginPath(),t.moveTo(v[0][0]-n.x+d,v[0][1]-n.y+d),t.lineTo(v[1][0]-n.x+d,v[1][1]-n.y+d),t.stroke()}),g.forEach(v=>{let[b,w,S,_]=v;t.beginPath(),t.moveTo(b[0]-n.x+d,b[1]-n.y+d),t.bezierCurveTo(w[0]-n.x+d,w[1]-n.y+d,S[0]-n.x+d,S[1]-n.y+d,_[0]-n.x+d,_[1]-n.y+d),t.stroke()})}break;default:{let[x,g]=r3(n,d);x.forEach(v=>{t.beginPath(),t.moveTo(v[0][0]-n.x+d,v[0][1]-n.y+d),t.lineTo(v[1][0]-n.x+d,v[1][1]-n.y+d),t.stroke()}),g.forEach(v=>{let[b,w,S,_]=v;t.beginPath(),t.moveTo(b[0]-n.x+d,b[1]-n.y+d),t.bezierCurveTo(w[0]-n.x+d,w[1]-n.y+d,S[0]-n.x+d,S[1]-n.y+d,_[0]-n.x+d,_[1]-n.y+d),t.stroke()})}break}t.restore();break}if(!l||(o?.runtime??0)>Is)return;let h=.5*(Math.min(n.width,n.height)/2);if(!he(n)){t.save(),t.translate(n.x+a.scrollX,n.y+a.scrollY);let m=1/Is*c;if(t.strokeStyle="rgba(0, 0, 0, 0.2)",t.lineWidth=1/a.zoom.value,t.setLineDash([4/a.zoom.value,4/a.zoom.value]),t.lineDashOffset=-m*10/a.zoom.value,t.beginPath(),t.ellipse(n.width/2,n.height/2,h,h,0,0,2*Math.PI),t.stroke(),t.fillStyle="rgba(0, 0, 0, 0.04)",t.beginPath(),t.ellipse(n.width/2,n.height/2,h*(1-s),h*(1-s),0,0,2*Math.PI),t.fill(),t.restore(),a.isMidpointSnappingEnabled){t.save(),t.translate(n.x+a.scrollX,n.y+a.scrollY);let p=5/a.zoom.value,f=5/a.zoom.value,x=p+f,g;if(n.type==="diamond"){let[,v]=db(n),b=od(n,r);g=v.map(w=>{let S=LE(w,.5),_=Ie(S,b,n.angle);return{x:_[0]-n.x,y:_[1]-n.y}})}else{let v=od(n,r);g=[{x:n.width/2,y:0},{x:n.width,y:n.height/2},{x:n.width/2,y:n.height},{x:0,y:n.height/2}].map(b=>{let w=N(b.x+n.x,b.y+n.y),S=Ie(w,v,n.angle);return{x:S[0]-n.x,y:S[1]-n.y}})}g.forEach(v=>{t.clearRect(v.x-x,v.y-x,x*2,x*2)}),t.fillStyle=a.theme===se.DARK?`rgba(3, 93, 161, ${s})`:`rgba(106, 189, 252, ${s})`,g.forEach(v=>{t.beginPath(),t.arc(v.x,v.y,p,0,2*Math.PI),t.fill()}),t.restore()}}return{runtime:(o?.runtime??0)+i}},gde=(e,t,n,r,a,i,o)=>{if(n===null)return;if(ci("COMPLEX_BINDINGS"))return fde(e,t,n.element,r,a,i,o);t.save(),t.translate(a.scrollX,a.scrollY);let l=e.lastPointerMoveCoords?N(e.lastPointerMoveCoords.x,e.lastPointerMoveCoords.y):null;pde(t,n,r,a,l),t.restore()},bV=(e,t,n)=>{let{angle:r,x1:a,y1:i,x2:o,y2:l,selectionColors:c,cx:s,cy:d,dashed:u,activeEmbeddable:h}=n,m=o-a,p=l-i,f=(n.padding??j0*2)/t.zoom.value,x=8/t.zoom.value,g=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(h?4:1)/t.zoom.value;let v=c.length;for(let b=0;b<v;++b)e.strokeStyle=c[b],u&&e.setLineDash([x,g+(x+g)*(v-1)]),e.lineDashOffset=(x+g)*b,ff(e,a-f,i-f,m+f*2,p+f*2,s,d,r);e.restore()},bde=(e,t,n,r)=>{let[a,i,o,l]=Qn(n,r),c=o-a,s=l-i;e.strokeStyle="rgb(0,118,255)",e.lineWidth=yt.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),ff(e,a,i,c,s,a+c/2,i+s/2,n.angle,!1,yt.radius/t.zoom.value),e.restore()},KU=(e,t,n,r)=>{let{colors:a=["rgb(0,118,255)"],dashed:i=!1}=r||{},o=n.filter(d=>d.groupIds.length===0),l=n.filter(d=>d.groupIds.length>0),c=d=>{let[u,h,m,p]=Qe(d);return{angle:0,x1:u,x2:m,y1:h,y2:p,selectionColors:a,dashed:i,cx:u+(m-u)/2,cy:h+(p-h)/2,activeEmbeddable:!1}},s=d=>{let u=wt(n,d);return c(u)};Object.entries(ad(l,t)).filter(([d,u])=>u).map(([d,u])=>d).map(d=>s(d)).concat(o.map(d=>c([d]))).forEach(d=>bV(e,t,d))},CC=(e,t,n,r)=>{if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let a=ae.getPointsGlobalCoordinates(n,r),{POINT_HANDLE_SIZE:i}=ae,o=t.selectedLinearElement?.isEditing?i:i/2,l=ze(n),c=Pt(n);if(a.forEach((s,d)=>{if(l&&d!==0&&d!==a.length-1)return;let u=d>0&&(d!==a.length-1||!c||!n.polygon)&&cM(s,d===a.length-1?a[0]:a[d-1],2/t.zoom.value),h=!!t.selectedLinearElement?.isEditing&&!!t.selectedLinearElement?.selectedPointsIndices?.includes(d);c&&n.polygon&&!h&&d===n.points.length-1&&t.selectedLinearElement?.isEditing&&t.selectedLinearElement?.selectedPointsIndices?.includes(0)&&(h=!0),SC(e,t,s,o,h,!1,u)}),ze(n)){let s=n.fixedSegments?.map(d=>d.index)||[];a.slice(0,-1).forEach((d,u)=>{ae.isSegmentTooShort(n,a[u+1],a[u],u,t.zoom)||SC(e,t,N((d[0]+a[u+1][0])/2,(d[1]+a[u+1][1])/2),i/2,!1,!s.includes(u+1),!1)})}else ae.getEditorMidPoints(n,r,t).filter((s,d,u)=>s!==null&&!(ze(n)&&(d===0||d===u.length-1))).forEach(s=>{(t.selectedLinearElement?.isEditing||a.length===2)&&SC(e,t,s,i/2,!1,!0,!1)});e.restore()},vde=(e,t,n,r)=>{e.save(),e.translate(t.scrollX,t.scrollY),e.strokeStyle="rgba(134, 131, 226, 0.6)",e.lineWidth=1/t.zoom.value,e.setLineDash([4/t.zoom.value,4/t.zoom.value]),e.beginPath(),e.moveTo(n[0],n[1]),e.lineTo(r[0],r[1]),e.stroke(),e.restore()},yde=(e,t,n,r,a)=>{e.save(),e.translate(t.scrollX,t.scrollY),e.strokeStyle="rgba(134, 131, 226, 0.6)",e.lineWidth=1/t.zoom.value,e.setLineDash([]),e.fillStyle=a?"rgba(134, 131, 226, 0.9)":"rgba(255, 255, 255, 0.9)",pf(e,n[0],n[1],r/t.zoom.value,!0,!0),e.restore()},$U=({arrow:e,appState:t,type:n,context:r,elementsMap:a})=>{let i=n==="start"?e.startBinding:e.endBinding,o=i?.elementId&&a.get(i.elementId);if(!o||!nd(o)||o.isDeleted)return;let l=d3(i.fixedPoint,o,a);if(!_A(l,e,o,a,t,n))return;let c=t.selectedLinearElement,s=!!c?.isDragging,d=n==="start"?0:e.points.length-1,u=!!c?.selectedPointsIndices?.includes(d);if(c?.hoveredFocusPointBinding===n&&!c.draggedFocusPointBinding&&mde(r,t,l),!(u&&s)){let h=d3(i.fixedPoint,o,a),m=c?.hoveredFocusPointBinding===n,p=ae.getPointAtIndexGlobalCoordinates(e,d,a);vde(r,t,p,h),yde(r,t,h,N8/1.5,m)}},XU=(e,t,n,r,a)=>{Object.keys(r).forEach(i=>{let o=r[i];if(o!==void 0){let[l,c,s,d]=o;e.save(),e.lineWidth=1/n.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),i==="rotation"?pf(e,l+s/2,c+d/2,s/2,!0):e.roundRect?(e.beginPath(),e.roundRect(l,c,s,d,2/n.zoom.value),e.fill(),e.stroke()):ff(e,l,c,s,d,l+s/2,c+d/2,a,!0),e.restore()}})},xde=(e,t,n,r,a)=>{let[i,o,,,l,c]=Qn(r,a),s=3,d=20,u=s/n.zoom.value,h=u/2,m=l-i+u,p=c-o+u,f=Math.min(d/n.zoom.value,m),x=Math.min(d/n.zoom.value,p);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=u,[[[-m,-p],[0,h],[f,h],[h,0],[h,x]],[[m-h,-p],[h,h],[-f+h,h],[0,0],[0,x]],[[-m,p],[0,-h],[f,-h],[h,0],[h,-x]],[[m-h,p],[h,-h],[-f+h,-h],[0,0],[0,-x]]].forEach(g=>{let[[v,b],[w,S],[_,C],[k,T],[I,A]]=g;e.save(),e.translate(l,c),e.rotate(r.angle),e.beginPath(),e.moveTo(v+w,b+S),e.lineTo(v+_,b+C),e.stroke(),e.beginPath(),e.moveTo(v+k,b+T),e.lineTo(v+I,b+A),e.stroke(),e.restore()}),e.restore()},wde=(e,t,n,r)=>{t.save();let a=j0*2/n.zoom.value,i=e.width+a*2,o=e.height+a*2,l=e.x+i/2,c=e.y+o/2,s=-(i/2+a),d=-(o/2+a);t.translate(l+n.scrollX,c+n.scrollY),t.rotate(e.angle),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(s,d,i,o),t.restore()},Ede=({app:e,canvas:t,elementsMap:n,visibleElements:r,selectedElements:a,allElementsMap:i,scale:o,appState:l,renderConfig:c,editorInterface:s,animationState:d,deltaTime:u})=>{if(t===null)return{atLeastOneVisibleElement:!1,elementsMap:n};let[h,m]=O3(t,o),p=d,f=z3({canvas:t,scale:o,normalizedWidth:h,normalizedHeight:m});f.save(),f.scale(l.zoom.value,l.zoom.value);let x;if(r.forEach(S=>{l.selectedLinearElement?.isEditing&&l.selectedLinearElement.elementId===S.id&&S&&(x=S)}),x&&CC(f,l,x,n),l.selectionElement&&!l.isCropping)try{J8(l.selectionElement,f,l,c.selectionColor)}catch(S){console.error(S)}if(l.editingTextElement&&oe(l.editingTextElement)){let S=i.get(l.editingTextElement.id);S&&!S.autoResize&&wde(S,f,l,c.selectionColor)}if(l.isBindingEnabled&&l.suggestedBinding?p={...d,bindingHighlight:gde(e,f,l.suggestedBinding,i,l,u,d?.bindingHighlight)}:p={...d,bindingHighlight:void 0},l.frameToHighlight&&bde(f,l,l.frameToHighlight,n),l.elementsToHighlight&&KU(f,l,l.elementsToHighlight),l.activeLockedId){let S=i.get(l.activeLockedId),_=S?[S]:wt(i,l.activeLockedId);KU(f,l,_,{colors:["#ced4da"],dashed:!0})}let g=a.some(S=>he(S));a.length===1&&l.selectedLinearElement?.isEditing&&l.selectedLinearElement.elementId===a[0].id&&CC(f,l,a[0],n);let v=l.selectedLinearElement,b=v&&ae.getElement(v.elementId,i);if(b&&(l.selectedLinearElement.isDragging||(v.segmentMidPointHoveredCoords?ude(f,l):(ze(b)?v.hoverPointIndex===0||v.hoverPointIndex===b.points.length-1:v.hoverPointIndex>=0)&&hde(f,l,n)),Oe(b)&&($U({arrow:b,elementsMap:i,appState:l,context:f,type:"start"}),$U({arrow:b,elementsMap:i,appState:l,context:f,type:"end"}))),!l.multiElement&&!l.newElement&&!l.selectedLinearElement?.isEditing){let S=Ob(a,l,s),_=a.length===1&&Te(a[0]);_&&l.selectedLinearElement?.elementId===a[0].id&&!a[0].locked&&CC(f,l,a[0],n);let C=c.selectionColor||"#000";if(S){let k=me(a),T=[];for(let A of n.values()){let O=[],V=c.remoteSelectedElementIds.get(A.id);if(_&&ze(A)&&(A.startBinding||A.endBinding)||(k.has(A.id)&&!yb(l,A)&&O.push(C),V&&O.push(...V.map(j=>_2(j,l.collaborators.get(j))))),O.length){let[j,K,Z,R,P,F]=Qn(A,n,!0);T.push({angle:A.angle,x1:j,y1:K,x2:Z,y2:R,selectionColors:A.locked?["#ced4da"]:O,dashed:!!V||A.locked,cx:P,cy:F,activeEmbeddable:l.activeEmbeddable?.element===A&&l.activeEmbeddable.state==="active",padding:A.id===l.croppingElementId||ft(A)?0:void 0})}}let I=A=>{let O=wt(n,A),[V,j,K,Z]=Qe(O);T.push({angle:0,x1:V,x2:K,y1:j,y2:Z,selectionColors:O.some(R=>R.locked)?["#ced4da"]:["#000"],dashed:!0,cx:V+(K-V)/2,cy:j+(Z-j)/2,activeEmbeddable:!1})};for(let A of Ji(l))I(A);l.editingGroupId&&I(l.editingGroupId),T.forEach(A=>bV(f,l,A))}if(f.save(),f.translate(l.scrollX,l.scrollY),a.length===1){f.fillStyle="#fff";let k=UA(a[0],l.zoom,n,"mouse",Nb(s));if(!l.viewModeEnabled&&S&&!oe(l.editingTextElement)&&!l.croppingElementId&&XU(f,c,l,k,a[0].angle),l.croppingElementId&&!l.isCropping){let T=n.get(l.croppingElementId);T&&ft(T)&&xde(f,c,l,T,n)}}else if(a.length>1&&!l.isRotating&&!a.some(k=>k.locked)){let k=j0*2/l.zoom.value;f.fillStyle="#fff";let[T,I,A,O]=Qe(a,n),V=f.getLineDash();f.setLineDash([2/l.zoom.value]);let j=f.lineWidth;f.lineWidth=1/l.zoom.value,f.strokeStyle=C,ff(f,T-k,I-k,A-T+k*2,O-I+k*2,(T+A)/2,(I+O)/2,0),f.lineWidth=j,f.setLineDash(V);let K=PA([T,I,A,O,(T+A)/2,(I+O)/2],0,l.zoom,"mouse",g?{...Nb(s),rotation:!0}:Nb(s));a.some(Z=>!Z.locked)&&XU(f,c,l,K,0)}f.restore()}l.searchMatches?.matches.forEach(({id:S,focus:_,matchedLines:C})=>{let k=n.get(S);if(k){let[T,I,,,A,O]=Qn(k,n,!0);f.save(),l.theme===se.LIGHT?_?f.fillStyle="rgba(255, 124, 0, 0.4)":f.fillStyle="rgba(255, 226, 0, 0.4)":_?f.fillStyle="rgba(229, 82, 0, 0.4)":f.fillStyle="rgba(99, 52, 0, 0.4)";let V=he(k)?l.zoom.value:1;f.translate(l.scrollX,l.scrollY),f.translate(A,O),f.rotate(k.angle),C.forEach(j=>{(j.showOnCanvas||_)&&f.fillRect(T+j.offsetX/V-A,I+j.offsetY/V-O,j.width/V,j.height/V)}),f.restore()}}),lde(f,l),f.restore(),Tre({context:f,renderConfig:c,appState:l,normalizedWidth:h,normalizedHeight:m});let w;return c.renderScrollbars&&(w=Ooe(n,h,m,l),f.save(),f.fillStyle=Noe,f.strokeStyle="rgba(255,255,255,0.8)",[w.horizontal,w.vertical].forEach(S=>{S&&vF(f,S.x,S.y,S.width,S.height,Zo/2)}),f.restore()),{scrollBars:w,atLeastOneVisibleElement:r.length>0,elementsMap:n,animationState:p}},Sde=e=>{let t=Ede(e);return e.callback(t),t},h_=class Xr{static start(t,n){let r=n({deltaTime:0,state:void 0});r&&(Xr.animations.set(t,{animation:n,lastTime:0,state:r}),Xr.isRunning||(Xr.isRunning=!0,Xx()?requestAnimationFrame(Xr.tick):setTimeout(Xr.tick,0)))}static tick(){if(Xr.animations.size>0){for(let[t,n]of Xr.animations){let r=performance.now(),a=n.lastTime===0?0:r-n.lastTime,i=n.animation({deltaTime:a,state:n.state});if(i)n.lastTime=r,n.state=i;else if(Xr.animations.delete(t),Xr.animations.size===0){Xr.isRunning=!1;return}}Xx()?requestAnimationFrame(Xr.tick):setTimeout(Xr.tick,0)}}static running(t){return Xr.animations.has(t)}static cancel(t){Xr.animations.delete(t)}};L(h_,"isRunning",!1),L(h_,"animations",new Map);var ZU=h_,qU="animateInteractiveScene",Cde=e=>{let t=(0,mu.useRef)(!1),n=(0,mu.useRef)(null);return(0,mu.useEffect)(()=>{if(!t.current){t.current=!0;return}let r=new Map,a=new Map,i=new Map,o=new Map,l=new Map;e.appState.collaborators.forEach((s,d)=>{if(s.selectedElementIds)for(let u of Object.keys(s.selectedElementIds))i.has(u)||i.set(u,[]),i.get(u).push(d);!s.pointer||s.pointer.renderCursor===!1||(s.username&&o.set(d,s.username),s.userState&&l.set(d,s.userState),a.set(d,zn({sceneX:s.pointer.x,sceneY:s.pointer.y},e.appState)),r.set(d,s.button))});let c=e.containerRef?.current&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";n.current={app:e.app,canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:a,remotePointerButton:r,remoteSelectedElementIds:i,remotePointerUsernames:o,remotePointerUserStates:l,selectionColor:c,renderScrollbars:e.renderScrollbars,lastViewportPosition:e.app.lastViewportPosition},editorInterface:e.editorInterface,callback:e.renderInteractiveSceneCallback,animationState:{bindingHighlight:void 0},deltaTime:0},ZU.running(qU)||ZU.start(qU,({deltaTime:s,state:d})=>{let u=Sde({...n.current,deltaTime:s,animationState:d}).animationState;if(u){for(let h in u)if(u[h]!==void 0)return u}})}),(0,vV.jsx)("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled&&e.appState.activeTool.type!=="laser"?Ve.GRAB:Ve.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:E("labels.drawingCanvas")})},QU=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,activeTool:e.activeTool,openDialog:e.openDialog,editingGroupId:e.editingGroupId,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,newElement:e.newElement,isBindingEnabled:e.isBindingEnabled,isMidpointSnappingEnabled:e.isMidpointSnappingEnabled,suggestedBinding:e.suggestedBinding,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,activeLockedId:e.activeLockedId,hoveredElementIds:e.hoveredElementIds,frameRendering:e.frameRendering,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,exportScale:e.exportScale,currentItemArrowType:e.currentItemArrowType}),_de=(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||e.renderScrollbars!==t.renderScrollbars?!1:Qt(QU(e.appState),QU(t.appState)),kde=mu.default.memo(Cde,_de),Tde=e=>{let t=(0,Oc.useRef)(null),n=(0,Oc.useRef)(!1);return(0,Oc.useEffect)(()=>{e.canvas.style.width=`${e.appState.width}px`,e.canvas.style.height=`${e.appState.height}px`,e.canvas.width=e.appState.width*e.scale,e.canvas.height=e.appState.height*e.scale},[e.appState.height,e.appState.width,e.canvas,e.scale]),(0,Oc.useEffect)(()=>{let r=t.current;if(!r)return;let a=e.canvas;n.current||(n.current=!0,r.replaceChildren(a),a.classList.add("excalidraw__canvas","static")),qA({canvas:a,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},Xx())}),(0,yV.jsx)("div",{className:"excalidraw__canvas-wrapper",ref:t})},JU=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,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,suggestedBinding:e.suggestedBinding}),Mde=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:Qt(JU(e.appState),JU(t.appState))&&Qt(e.renderConfig,t.renderConfig),Ade=Oc.default.memo(Tde,Mde),xV=({canvas:e,rc:t,newElement:n,elementsMap:r,allElementsMap:a,scale:i,appState:o,renderConfig:l})=>{if(e){let[c,s]=O3(e,i),d=z3({canvas:e,scale:i,normalizedWidth:c,normalizedHeight:s});if(d.save(),d.scale(o.zoom.value,o.zoom.value),n&&n.type!=="selection"){if(No(n))return;if((n.frameId||o.frameToHighlight?.id)&&o.frameRendering.enabled&&o.frameRendering.clip){let u=X8(n,r,o);u&&Z8(n,u,o,r)&&XA(u,d,l,o)}eA(n,r,a,t,d,l,o)}else d.clearRect(0,0,c,s);d.restore()}},Dde=Yp(e=>{xV(e)}),Ide=(e,t)=>{if(t){Dde(e);return}xV(e)},Lde=e=>{let t=(0,tw.useRef)(null);return(0,tw.useEffect)(()=>{t.current&&Ide({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},Xx())}),(0,wV.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})},Rde=Lde,Nde=class{constructor(e){this.getState=e,L(this,"listeners",[]),L(this,"onStateChange",(t,n,r)=>{let{predicate:a,getValue:i,callback:o,once:l,matchesImmediately:c}=this.normalize(t,n,r);return o?c&&(queueMicrotask(()=>{let s=this.getState();o(i(s),s)}),l)?()=>{}:this.subscribe({predicate:a,getValue:i,callback:o,once:l}):c?Promise.resolve(i(this.getState())):new Promise(s=>{this.subscribe({predicate:a,getValue:i,callback:d=>s(d),once:!0})})})}isStateChangePredicateOptions(e){return typeof e=="object"&&!Array.isArray(e)&&"predicate"in e}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}normalize(e,t,n){let r,a,i=t,o=n?.once??!1,l=!1;if(this.isStateChangePredicateOptions(e)){let{predicate:c,callback:s,once:d}=e;r=c,a=u=>u,i=s?(u,h)=>s(h):void 0,o=d??!1,l=c(this.getState())}else if(typeof e=="function"){let c=e;r=(s,d)=>c(s)!==c(d),a=s=>c(s)}else if(Array.isArray(e)){let c=e;r=(s,d)=>c.some(u=>s[u]!==d[u]),a=s=>s}else{let c=e;r=(s,d)=>s[c]!==d[c],a=s=>s[c]}return{predicate:r,getValue:a,callback:i,once:o,matchesImmediately:l}}flush(e){if(!this.listeners.length)return;let t=this.getState(),n=[];for(let r of this.listeners)r.predicate(t,e)?(r.callback(r.getValue(t),t),r.once||n.push(r)):n.push(r);this.listeners=n}clear(){this.listeners=[]}},Ode=({app:e,activeLockedId:t})=>{let n=e.scene.getElement(t),r=n?[n]:wt(e.scene.getNonDeletedElementsMap(),t);if(r.length===0)return null;let[a,i]=Qe(r),{x:o,y:l}=zn({sceneX:a,sceneY:i},e.state);return(0,SV.jsx)("div",{className:"UnlockPopup",style:{bottom:`${e.state.height+12-l+e.state.offsetTop}px`,left:`${o-e.state.offsetLeft}px`},onClick:()=>{(0,EV.flushSync)(()=>{let c=ad(r,e.state);e.setState({selectedElementIds:r.reduce((s,d)=>({...s,[d.id]:!0}),{}),selectedGroupIds:c,activeLockedId:null})}),e.actionManager.executeAction(DF)},title:E("labels.elementLock.unlock"),children:pee})},zde=Ode,CV=mn.default.createContext(null),_V=mn.default.createContext(null),m_={formFactor:"desktop",desktopUIMode:"full",userAgent:$E(typeof navigator<"u"?navigator.userAgent:""),isTouchScreen:!1,canFitSidebar:!1,isLandscape:!0},xk=mn.default.createContext(m_);xk.displayName="EditorInterfaceContext";var Pde={"editor:mount":{cardinality:"once",replay:"last"},"editor:initialize":{cardinality:"once",replay:"last"},"editor:unmount":{cardinality:"once",replay:"last"}},wk=mn.default.createContext({container:null,id:null});wk.displayName="ExcalidrawContainerContext";var Ek=mn.default.createContext([]);Ek.displayName="ExcalidrawElementsContext";var Sk=mn.default.createContext({...ih(),width:0,height:0,offsetLeft:0,offsetTop:0});Sk.displayName="ExcalidrawAppStateContext";var Ck=mn.default.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});Ck.displayName="ExcalidrawSetAppStateContext";var _k=mn.default.createContext(null);_k.displayName="ExcalidrawActionManagerContext";var kV=mn.default.createContext(null);kV.displayName="ExcalidrawAPIContext";var TV=mn.default.createContext(null);TV.displayName="ExcalidrawAPISetContext";var Wi=()=>(0,mn.useContext)(CV),K1=()=>(0,mn.useContext)(_V),En=()=>(0,mn.useContext)(xk),cl=()=>Xc(En()),za=()=>(0,mn.useContext)(wk),nw=()=>(0,mn.useContext)(Ek),$1=()=>(0,mn.useContext)(Sk),fn=()=>(0,mn.useContext)(Ck),Sn=()=>(0,mn.useContext)(_k);var e1=!1,_C=0,t1=null,Cc=!1,n1=!1,kC=!1,r1={horizontal:null,vertical:null},_c=0,a1=!1,TC=new Map,MC=!1,eB=0,tB=!1,i1=null,Je={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},Ude=class MV extends mn.default.Component{constructor(t){super(t),L(this,"canvas"),L(this,"interactiveCanvas",null),L(this,"sessionExportThemeOverride"),L(this,"rc"),L(this,"unmounted",!1),L(this,"actionManager"),L(this,"editorInterface",m_),L(this,"stylesPanelMode",Xc(m_)),L(this,"excalidrawContainerRef",mn.default.createRef()),L(this,"scene"),L(this,"fonts"),L(this,"renderer"),L(this,"visibleElements"),L(this,"resizeObserver"),L(this,"library"),L(this,"libraryItemsFromStorage"),L(this,"id"),L(this,"store"),L(this,"history"),L(this,"excalidrawContainerValue"),L(this,"files",{}),L(this,"imageCache",new Map),L(this,"iFrameRefs",new Map),L(this,"embedsValidationStatus",new Map),L(this,"initializedEmbeds",new Set),L(this,"elementsPendingErasure",new Set),L(this,"_initialized",!1),L(this,"editorLifecycleEvents",new s8(Pde)),L(this,"onEvent",this.editorLifecycleEvents.on.bind(this.editorLifecycleEvents)),L(this,"appStateObserver",new Nde(()=>this.state)),L(this,"onStateChange",this.appStateObserver.onStateChange),L(this,"flowChartCreator",new yA),L(this,"flowChartNavigator",new vA),L(this,"bindModeHandler",null),L(this,"hitLinkElement"),L(this,"lastPointerDownEvent",null),L(this,"lastPointerUpEvent",null),L(this,"lastPointerMoveEvent",null),L(this,"lastPointerMoveCoords",null),L(this,"previousPointerMoveCoords",null),L(this,"lastViewportPosition",{x:0,y:0}),L(this,"animationFrameHandler",new voe),L(this,"laserTrails",new Ioe(this.animationFrameHandler,this)),L(this,"eraserTrail",new Hoe(this.animationFrameHandler,this)),L(this,"lassoTrail",new Foe(this.animationFrameHandler,this)),L(this,"onChangeEmitter",new di),L(this,"onPointerDownEmitter",new di),L(this,"onPointerUpEmitter",new di),L(this,"onUserFollowEmitter",new di),L(this,"onScrollChangeEmitter",new di),L(this,"missingPointerEventCleanupEmitter",new di),L(this,"onRemoveEventListenersEmitter",new di),L(this,"api"),L(this,"updateEditorAtom",(s,...d)=>{let u=Qa.set(s,...d);return this.triggerRender(),u}),L(this,"previousHoveredBindableElement",null),L(this,"getEffectiveGridSize",()=>I1(this)?this.state.gridSize:null),L(this,"handleIframeLikeElementHover",({hitElement:s,scenePointer:d,moveEvent:u})=>s&&ob(s)&&(this.state.viewModeEnabled||this.state.activeTool.type==="laser"||this.isIframeLikeElementCenter(s,u,d.x,d.y))?(ht(this.interactiveCanvas,Ve.POINTER),this.setState({activeEmbeddable:{element:s,state:"hover"}}),!0):(this.state.activeEmbeddable?.state==="hover"&&this.setState({activeEmbeddable:null}),!1)),L(this,"updateEmbedValidationStatus",(s,d)=>{this.embedsValidationStatus.set(s.id,d),Ro.delete(s)}),L(this,"updateEmbeddables",()=>{let s=new Set,d=!1;this.scene.getNonDeletedElements().filter(u=>{if(Tr(u)){if(s.add(u.id),!this.embedsValidationStatus.has(u.id)){d=!0;let h=nh(u.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(u,h)}}else ed(u)&&s.add(u.id);return!1}),d&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((u,h)=>{s.has(h)||this.iFrameRefs.delete(h)})}),L(this,"getFrameNameDOMId",s=>`${this.id}-frame-name-${s.id}`),L(this,"frameNameBoundsCache",{get:s=>{let d=this.frameNameBoundsCache._cache.get(s.id);if(!d||d.zoom!==this.state.zoom.value||d.versionNonce!==s.versionNonce){let u=document.getElementById(this.getFrameNameDOMId(s));if(u){let h=u.getBoundingClientRect(),m=dt({clientX:h.x,clientY:h.y},this.state),p=dt({clientX:h.right,clientY:h.bottom},this.state);return d={x:m.x,y:m.y,width:p.x-m.x,height:p.y-m.y,angle:0,zoom:this.state.zoom.value,versionNonce:s.versionNonce},this.frameNameBoundsCache._cache.set(s.id,d),d}return null}return d},_cache:new Map}),L(this,"resetEditingFrame",s=>{s&&this.scene.mutateElement(s,{name:s.name?.trim()||null}),this.setState({editingFrame:null})}),L(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let s=this.state.theme===se.DARK,d=this.scene.getNonDeletedFramesLikes(),u=d.length>0&&this.state.searchMatches?.focusedId&&he(this.scene.getElement(this.state.searchMatches.focusedId))?this.state.searchMatches.matches.find(h=>h.focus):null;return d.map(h=>{if(!df(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:m,y:p}=zn({sceneX:h.x,sceneY:h.y},this.state),f=6,x,g=q8(h);if(h.id===this.state.editingFrame){let v=g;x=(0,Ne.jsx)("input",{autoFocus:!0,value:v,onChange:b=>{this.scene.mutateElement(h,{name:b.target.value})},onFocus:b=>b.target.select(),onBlur:()=>this.resetEditingFrame(h),onKeyDown:b=>{(b.key===D.ESCAPE||b.key===D.ENTER)&&this.resetEditingFrame(h)},style:{background:s?Do(this.state.viewBackgroundColor):this.state.viewBackgroundColor,zIndex:2,border:"none",display:"block",padding:`${f}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:`${yt.nameFontSize}px`,transform:`translate(-${f}px, ${f}px)`,color:s?yt.nameColorDarkTheme:yt.nameColorLightTheme,overflow:"hidden",maxWidth:`${document.body.clientWidth-m-f}px`},size:v.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else x=g;return(0,Ne.jsx)("div",{id:this.getFrameNameDOMId(h),className:vt.FRAME_NAME,style:{position:"absolute",bottom:`${this.state.height+yt.nameOffsetY-p+this.state.offsetTop}px`,left:`${m-this.state.offsetLeft}px`,zIndex:2,fontSize:yt.nameFontSize,color:s?yt.nameColorDarkTheme:yt.nameColorLightTheme,lineHeight:yt.nameLineHeight,width:"max-content",maxWidth:u?.id===h.id&&u?.focus?"none":`${h.width*this.state.zoom.value}px`,overflow:h.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:Ve.MOVE,pointerEvents:this.state.viewModeEnabled?$c.disabled:$c.enabled},onPointerDown:v=>this.handleCanvasPointerDown(v),onWheel:v=>this.handleWheel(v),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:h.id})},children:x},h.id)})}),L(this,"focusContainer",()=>{this.excalidrawContainerRef.current?.focus()}),L(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),L(this,"getSceneElementsMapIncludingDeleted",()=>this.scene.getElementsMapIncludingDeleted()),L(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),L(this,"onInsertElements",s=>{this.addElementsFromPasteOrLibrary({elements:s,position:"center",files:null})}),L(this,"onExportImage",async(s,d,u)=>{at("export",s,"ui");let h=await C2(s,d,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:u.exportingFrame}).catch(J0).catch(m=>{console.error(m),this.setState({errorMessage:m.message})});this.state.exportEmbedScene&&h&&B3(h)&&this.setState({fileHandle:h})}),L(this,"magicGenerations",new Map),L(this,"updateMagicGeneration",({frameElement:s,data:d})=>{d.status==="pending"?this.scene.mutateElement(s,{customData:{generationData:void 0}},{informMutation:!1,isDragging:!1}):this.scene.mutateElement(s,{customData:{generationData:d}},{informMutation:!1,isDragging:!1}),this.magicGenerations.set(s.id,d),this.triggerRender()}),L(this,"plugins",{}),L(this,"onMagicframeToolSelect",()=>{let s=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(s.length===0)this.setActiveTool({type:rn.magicframe}),at("ai","tool-select (empty-selection)","d2c");else{let d=s.length===1&&lb(s[0])&&s[0];if(!d&&s.some(h=>he(h)||h.frameId)){this.setActiveTool({type:rn.magicframe});return}at("ai","tool-select (existing selection)","d2c");let u;if(d)u=d;else{let[h,m,p,f]=Qe(s),x=50;u=x3({...yt,x:h-x,y:m-x,width:p-h+x*2,height:f-m+x*2,opacity:100,locked:!1}),this.scene.insertElement(u);for(let g of s)this.scene.mutateElement(g,{frameId:u.id});this.setState({selectedElementIds:{[u.id]:!0}})}this.onMagicFrameGenerate(u,"upstream")}}),L(this,"openEyeDropper",({type:s})=>{this.updateEditorAtom(d2,{swapPreviewOnAlt:!0,colorPickerType:s==="stroke"?"elementStroke":"elementBackground",onSelect:(d,u)=>{let h=s==="background"&&u.altKey||s==="stroke"&&!u.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?h?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:d},captureUpdate:U.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:d},captureUpdate:U.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(m=>this.state.selectedElementIds[m.id]?pe(m,{[h?"strokeColor":"backgroundColor"]:d}):m),captureUpdate:U.IMMEDIATELY})},keepOpenOnAlt:!1})}),L(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.state.selectedLinearElement?.isEditing&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isEditing:!1}})})}),L(this,"syncActionResult",en(s=>{if(this.unmounted||s===!1)return;this.store.scheduleAction(s.captureUpdate);let d=!1,u=null;if(s.elements&&(this.scene.replaceAllElements(s.elements),d=!0),s.files&&(this.addMissingFiles(s.files,s.replaceFiles),this.addNewImagesToImageCache()),s.appState||u||this.state.contextMenu){let h=s?.appState?.viewModeEnabled||!1,m=s?.appState?.zenModeEnabled||!1,p=s?.appState?.theme||this.props.theme||se.LIGHT,f=s?.appState?.name??this.state.name,x=s?.appState?.errorMessage??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(h=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(m=this.props.zenModeEnabled),u=s.appState?.editingTextElement||null,s.elements&&u&&s.elements.forEach(g=>{u?.id===g.id&&u!==g&&D3(g)&&oe(g)&&(u=g)}),u?.isDeleted&&(u=null),this.setState(g=>{let v=s.appState||{};return{...g,...v,contextMenu:null,editingTextElement:u,viewModeEnabled:h,zenModeEnabled:m,theme:p,name:f,errorMessage:x}}),d=!0}d||this.scene.triggerUpdate()})),L(this,"onBlur",en(()=>{Cc=!1,this.setState({isBindingEnabled:this.state.bindingPreference==="enabled"})})),L(this,"onUnload",()=>{this.onBlur()}),L(this,"disableEvent",s=>{s.preventDefault()}),L(this,"resetHistory",()=>{this.history.clear()}),L(this,"resetStore",()=>{this.store.clear()}),L(this,"resetScene",en(s=>{this.scene.replaceAllElements([]),this.setState(d=>({...ih(),isLoading:s?.resetLoadingState?!1:d.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),L(this,"initializeScene",async()=>{"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async m=>{if(!m.files.length)return;let p=m.files[0],f=await p.getFile();this.loadFileToCanvas(new File([f],f.name||"",{type:f.type}),p)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let s=null;try{typeof this.props.initialData=="function"?s=await this.props.initialData()||null:s=await this.props.initialData||null,s?.libraryItems&&this.library.updateLibrary({libraryItems:s.libraryItems,merge:!0}).catch(m=>{console.error(m)})}catch(m){console.error(m),s={appState:{errorMessage:m.message||"Encountered an error during importing or restoring scene data"}}}let d=cd(s?.elements,null,{repairBindings:!0,deleteInvisibleElements:!0}),u=sh(s?.appState,null),h=u.activeTool;u.preferredSelectionTool.initialized||(u.preferredSelectionTool={type:this.editorInterface.formFactor==="phone"?"lasso":"selection",initialized:!0}),u={...u,theme:this.props.theme||u.theme,openSidebar:u?.openSidebar||this.state.openSidebar,activeTool:h.type==="image"||h.type==="lasso"||h.type==="selection"?{...h,type:u.preferredSelectionTool.type}:u.activeTool,isLoading:!1,toast:this.state.toast},s?.scrollToContent&&(u={...u,...mf(d,{...u,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({elements:d,appState:u,files:s?.files,captureUpdate:U.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(m=>{this.fonts.onLoaded(m)}),ld(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),L(this,"getFormFactor",(s,d)=>this.props.UIOptions.getFormFactor?.(s,d)??KE(s,d)),L(this,"refreshEditorInterface",()=>{let s=this.excalidrawContainerRef.current;if(!s)return;let{width:d,height:u}=s.getBoundingClientRect(),h=YM(),m=$E(typeof navigator<"u"?navigator.userAgent:""),p=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:HM,f=Vu(this.editorInterface,{desktopUIMode:h??this.editorInterface.desktopUIMode,formFactor:this.getFormFactor(d,u),userAgent:m,canFitSidebar:d>p,isLandscape:d>u});this.editorInterface=f,this.reconcileStylesPanelMode(f)}),L(this,"reconcileStylesPanelMode",s=>{let d=Xc(s);if(d===this.stylesPanelMode)return;let u=this.stylesPanelMode;this.stylesPanelMode=d,u!=="full"&&d==="full"&&this.setState(h=>({preferredSelectionTool:{type:"selection",initialized:!0}}))}),L(this,"setDesktopUIMode",s=>{let d=WM(s);this.editorInterface=Vu(this.editorInterface,{desktopUIMode:d}),this.reconcileStylesPanelMode(this.editorInterface)}),L(this,"onResize",en(()=>{this.scene.getElementsIncludingDeleted().forEach(s=>Ro.delete(s)),this.refreshEditorInterface(),this.updateDOMRect(),this.setState({})})),L(this,"onFullscreenChange",()=>{!document.fullscreenElement&&this.state.activeEmbeddable?.state==="active"&&this.setState({activeEmbeddable:null})}),L(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:s,scrollBars:d,elementsMap:u})=>{d&&(r1=d);let h=this.state.editingTextElement?!1:!s&&u.size>0;this.state.scrolledOutside!==h&&this.setState({scrolledOutside:h}),this.scheduleImageRefresh()}),L(this,"onScroll",Qc(()=>{let{offsetTop:s,offsetLeft:d}=this.getCanvasOffsets();this.setState(u=>u.offsetLeft===d&&u.offsetTop===s?null:{offsetTop:s,offsetLeft:d})},IM)),L(this,"onCut",en(s=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||sa(s.target)||(this.actionManager.executeAction(UP,"keyboard",s),s.preventDefault(),s.stopPropagation())})),L(this,"onCopy",en(s=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||sa(s.target)||(this.actionManager.executeAction(Tx,"keyboard",s),s.preventDefault(),s.stopPropagation())})),L(this,"onTouchStart",s=>{if(VM&&s.preventDefault(),!e1){e1=!0,s.touches.length===1&&(t1={x:s.touches[0].clientX,y:s.touches[0].clientY}),clearTimeout(_C),_C=window.setTimeout(MV.resetTapTwice,AM);return}if(e1&&s.touches.length===1&&t1){let d=s.touches[0];Cr(N(d.clientX,d.clientY),N(t1.x,t1.y))<=UM&&(this.lassoTrail.endPath(),this.deselectElements(),this.handleCanvasDoubleClick({clientX:d.clientX,clientY:d.clientY})),e1=!1,clearTimeout(_C)}s.touches.length===2&&this.setState({selectedElementIds:nt({},this.state),activeEmbeddable:null})}),L(this,"onTouchEnd",s=>{this.resetContextMenuTimer(),s.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:nt(this.state.previousSelectedElementIds,this.state)}):Je.pointers.clear()}),L(this,"pasteFromClipboard",en(async s=>{let d=!!MC,u=document.activeElement,h=this.excalidrawContainerRef.current?.contains(u);if(s&&!h)return;let m=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(s&&(!(m instanceof HTMLCanvasElement)||sa(u)))return;let p=await Fx(s),f=p.getFiles(),x=await hF(p,d);if(this.props.onPaste)try{if(await this.props.onPaste(x,s)===!1)return}catch(g){console.error(g)}await this.insertClipboardContent(x,f,d),this.setActiveTool({type:this.state.preferredSelectionTool.type},!0),s?.preventDefault()})),L(this,"addElementsFromPasteOrLibrary",s=>{let d=cd(s.elements,null,{deleteInvisibleElements:!0}),[u,h,m,p]=Qe(d),f=Jc(u,m)/2,x=Jc(h,p)/2,g=typeof s.position=="object"?s.position.clientX:s.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,v=typeof s.position=="object"?s.position.clientY:s.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x:b,y:w}=dt({clientX:g,clientY:v},this.state),S=b-f,_=w-x,[C,k]=hr(S,_,this.getEffectiveGridSize()),{duplicatedElements:T}=Hs({type:"everything",elements:d.map(j=>pe(j,{x:j.x+C-u,y:j.y+k-h})),randomizeSeed:!s.retainSeed}),I=this.scene.getElementsIncludingDeleted(),A=[...I,...T];A=this.props.onDuplicate?.(A,I)||A,Oo(A,me(T));let O=this.getTopLayerFrameAtSceneCoords({x:b,y:w});if(O){let j=K8(T,O);qu(A,j,O,this.state)}this.scene.replaceAllElements(A),T.forEach(j=>{if(oe(j)&&jt(j)){let K=ui(j,this.scene.getElementsMapIncludingDeleted());on(j,K,this.scene)}}),jM&&lh.loadElementsFonts(T).then(j=>{this.fonts.onLoaded(j)}),s.files&&this.addMissingFiles(s.files);let V=F8(T);this.store.scheduleCapture(),this.setState({...this.state,openSidebar:this.state.openSidebar&&this.editorInterface.canFitSidebar&&Qa.get(uk)?this.state.openSidebar:null,...bn({editingGroupId:null,selectedElementIds:V.reduce((j,K)=>(jt(K)||(j[K.id]=!0),j),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{s.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:this.state.preferredSelectionTool.type},!0),s.fitToContent&&this.scrollToContent(T,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),L(this,"setAppState",(s,d)=>{this.setState(s,d)}),L(this,"removePointer",s=>{_c&&this.resetContextMenuTimer(),Je.pointers.delete(s.pointerId)}),L(this,"toggleLock",(s="ui")=>{this.state.activeTool.locked||at("toolbar","toggleLock",`${s} (${this.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),this.setState(d=>({activeTool:{...d.activeTool,...tt(this.state,d.activeTool.locked?{type:this.state.preferredSelectionTool.type}:d.activeTool),locked:!d.activeTool.locked}}))}),L(this,"updateFrameRendering",s=>{this.setState(d=>{let u=typeof s=="function"?s(d.frameRendering):s;return{frameRendering:{enabled:u?.enabled??d.frameRendering.enabled,clip:u?.clip??d.frameRendering.clip,name:u?.name??d.frameRendering.name,outline:u?.outline??d.frameRendering.outline}}})}),L(this,"togglePenMode",s=>{this.setState(d=>({penMode:s??!d.penMode,penDetected:!0}))}),L(this,"onHandToolToggle",()=>{this.actionManager.executeAction(Xne)}),L(this,"zoomCanvas",s=>{this.setState({...Yd({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:Ml(s)},this.state)})}),L(this,"cancelInProgressAnimation",null),L(this,"scrollToContent",(s=this.scene.getNonDeletedElements(),d)=>{if(typeof s=="string"){let f;if(ld(s)?f=hA(s):f=s,f){let x=this.scene.getElementsFromId(f);x?.length?this.scrollToContent(x,{fitToContent:d?.fitToContent??!0,animate:d?.animate??!0}):ld(s)&&this.setState({toast:{message:E("elementLink.notFound"),duration:3e3,closable:!0}})}return}this.cancelInProgressAnimation?.();let u=Array.isArray(s)?s:[s],h=this.state.zoom,m=this.state.scrollX,p=this.state.scrollY;if(d?.fitToContent||d?.fitToViewport){let{appState:f}=E2({canvasOffsets:d.canvasOffsets,targetElements:u,appState:this.state,fitToViewport:!!d?.fitToViewport,viewportZoomFactor:d?.viewportZoomFactor,minZoom:d?.minZoom,maxZoom:d?.maxZoom});h=f.zoom,m=f.scrollX,p=f.scrollY}else{let f=mf(u,this.state);m=f.scrollX,p=f.scrollY}if(d?.animate){let f=this.state.scrollX,x=this.state.scrollY,g=this.state.zoom.value,v=ZM({fromValues:{scrollX:f,scrollY:x,zoom:g},toValues:{scrollX:m,scrollY:p,zoom:h.value},interpolateValue:(b,w,S,_)=>{if(_==="zoom")return b*Math.pow(w/b,Zi(S))},onStep:({scrollX:b,scrollY:w,zoom:S})=>{this.setState({scrollX:b,scrollY:w,zoom:{value:S}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:d?.duration??500});this.cancelInProgressAnimation=()=>{v(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:m,scrollY:p,zoom:h})}),L(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),L(this,"translateCanvas",s=>{this.cancelInProgressAnimation?.(),this.maybeUnfollowRemoteUser(),this.setState(s)}),L(this,"setToast",s=>{this.setState({toast:s})}),L(this,"restoreFileFromShare",async()=>{try{let s=await caches.open("web-share-target"),d=await s.match("shared-file");if(d){let u=await d.blob(),h=new File([u],u.name||"",{type:u.type});this.loadFileToCanvas(h,null),await s.delete("shared-file"),window.history.replaceState(null,NE,window.location.pathname)}}catch(s){this.setState({errorMessage:s.message})}}),L(this,"addFiles",en(s=>{let{addedFiles:d}=this.addMissingFiles(s);this.clearImageShapeCache(d),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),L(this,"addMissingFiles",(s,d=!1)=>{let u=d?{}:{...this.files},h={},m=Array.isArray(s)?s:Object.values(s);for(let p of m)if(!u[p.id]&&(h[p.id]=p,u[p.id]=p,p.mimeType===_e.svg))try{let f=s7(S3(c7(p.dataURL)),_e.svg);p.dataURL!==f&&(p.version=(p.version??1)+1,p.dataURL=f)}catch(f){console.error(f)}return this.files=u,{addedFiles:h}}),L(this,"updateScene",en(s=>{let{elements:d,appState:u,collaborators:h,captureUpdate:m}=s;if(m){let p=d||void 0,f=u?lA({...this.store.snapshot.appState,...u}):void 0;this.store.scheduleMicroAction({action:m,elements:p,appState:f})}u&&this.setState(u),d&&this.scene.replaceAllElements(d),h&&this.setState({collaborators:h})})),L(this,"applyDeltas",(s,d)=>{let u=uf.squash(...s),h={...this.state},m=new Map(this.scene.getElementsMapIncludingDeleted());return uf.applyTo(u,m,h,d)}),L(this,"mutateElement",(s,d,u=!0)=>this.scene.mutateElement(s,d,{informMutation:u,isDragging:!1})),L(this,"triggerRender",s=>{s===!0?this.scene.triggerUpdate():this.setState({})}),L(this,"toggleSidebar",({name:s,tab:d,force:u})=>{let h;u===void 0?h=this.state.openSidebar?.name===s&&this.state.openSidebar?.tab===d?null:s:h=u?s:null;let m=h?{name:h}:null;return m&&d&&(m.tab=d),this.setState({openSidebar:m}),!!h}),L(this,"updateCurrentCursorPosition",en(s=>{this.lastViewportPosition.x=s.clientX,this.lastViewportPosition.y=s.clientY})),L(this,"getEditorUIOffsets",()=>{let s=this.excalidrawContainerRef?.current?.querySelector(".App-toolbar")?.getBoundingClientRect()?.bottom??0,d=this.excalidrawContainerRef?.current?.querySelector(".sidebar")?.getBoundingClientRect(),u=this.excalidrawContainerRef?.current?.querySelector(".App-menu__left")?.getBoundingClientRect(),h=16;return y1().rtl?{top:s+h,right:Math.max(this.state.width-(u?.left??this.state.width),0)+h,bottom:h,left:Math.max(d?.right??0,0)+h}:{top:s+h,right:Math.max(this.state.width-(d?.left??this.state.width)+h,0),bottom:h,left:Math.max(u?.right??0,0)+h}}),L(this,"onKeyDown",en(s=>{if("Proxy"in window&&(!s.shiftKey&&/^[A-Z]$/.test(s.key)||s.shiftKey&&/^[a-z]$/.test(s.key))&&(s=new Proxy(s,{get(p,f){let x=p[f];return typeof x=="function"?x.bind(p):f==="key"?s.shiftKey?p.key.toUpperCase():p.key.toLowerCase():x}})),!qE(s.target)){if((s.key===D.ESCAPE||s.key===D.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let p=Re(this.scene.getNonDeletedElementsMap(),this.state);if(p.length===1&&ft(p[0])&&s.key===D.ENTER){this.startImageCropping(p[0]);return}if(s.key===D.ESCAPE)this.updateEditorAtom(rs,null);else if(s.key===D.TAB&&(document.activeElement===this.excalidrawContainerRef?.current||document.activeElement?.classList.contains(vt.CONVERT_ELEMENT_TYPE_POPUP))){s.preventDefault();let x=k2(p);Qa.get(rs)?.type==="panel"&&LF(this,{conversionType:x,direction:s.shiftKey?"left":"right"})&&this.store.scheduleCapture(),x&&this.updateEditorAtom(rs,{type:"panel"})}if(s.key===D.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let f=Zc(s.key);if(s[D.CTRL_OR_CMD]&&f&&!s.shiftKey){s.preventDefault();let x=Re(this.scene.getNonDeletedElementsMap(),this.state);x.length===1&&cb(x[0])&&this.flowChartCreator.createNodes(x[0],this.state,E3(s.key),this.scene),this.flowChartCreator.pendingNodes?.length&&!Ju(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(s.altKey){let x=Re(this.scene.getNonDeletedElementsMap(),this.state);if(x.length===1&&f){s.preventDefault();let g=this.flowChartNavigator.exploreByDirection(x[0],this.scene.getNonDeletedElementsMap(),E3(s.key));if(g){this.setState(b=>({selectedElementIds:nt({[g]:!0},b)}));let v=this.scene.getNonDeletedElementsMap().get(g);v&&!Ju([v],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(v,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(s[D.CTRL_OR_CMD]&&s.key===D.P&&!s.shiftKey&&!s.altKey){this.setToast({message:E("commandPalette.shortcutHint",{shortcut:hn("commandPalette")})}),s.preventDefault();return}if(s[D.CTRL_OR_CMD]&&s.key.toLowerCase()===D.V&&(MC=s.shiftKey,clearTimeout(eB),eB=window.setTimeout(()=>{MC=!1},100)),s[D.CTRL_OR_CMD]&&sa(s.target)&&(s.code===Ee.MINUS||s.code===Ee.EQUAL)){s.preventDefault();return}if(sa(s.target)&&s.key!==D.ESCAPE||Zc(s.key)&&qE(s.target))return;if(s.key===D.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(s.key.toLowerCase()===D.E&&s.shiftKey&&s[D.CTRL_OR_CMD]){s.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(s.key===D.PAGE_UP||s.key===D.PAGE_DOWN){let p=(s.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;s.key===D.PAGE_DOWN&&(p=-p),s.shiftKey?this.translateCanvas(f=>({scrollX:f.scrollX+p})):this.translateCanvas(f=>({scrollY:f.scrollY+p}))}if(this.state.openDialog?.name==="elementLinkSelector"||(s.key===D.ALT&&(ci("COMPLEX_BINDINGS")?this.handleSkipBindMode():hf({app:this,event:s})),this.actionManager.handleKeyDown(s)))return;let d=this.props.viewModeEnabled===!0;if(!d&&this.state.viewModeEnabled&&s.key===D.ESCAPE){this.setActiveTool({type:"selection"});return}if(!d&&!s.ctrlKey&&!s.altKey&&!s.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let p=hie(s.key,this);if(this.state.viewModeEnabled&&!QE(p,["laser","hand"]))return;if(p){this.state.activeTool.type!==p&&at("toolbar",p,`keyboard (${this.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),p==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(f=>({currentItemArrowType:f.currentItemArrowType===an.sharp?an.round:f.currentItemArrowType===an.round?an.elbow:an.sharp})),p==="lasso"&&this.state.activeTool.type==="laser"?this.setActiveTool({type:this.state.preferredSelectionTool.type}):this.setActiveTool({type:p}),s.stopPropagation();return}else if(s.key===D.Q){this.toggleLock("keyboard"),s.stopPropagation();return}}if(this.state.viewModeEnabled)return;if(s[D.CTRL_OR_CMD]&&!s.repeat&&(ci("COMPLEX_BINDINGS")&&this.resetDelayedBindMode(),(0,$r.flushSync)(()=>{this.setState({isBindingEnabled:this.state.bindingPreference!=="enabled"})}),hf({app:this,event:s})),Zc(s.key)){let p=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),f=new Set;p.filter(b=>Mr(b)).filter(b=>{let w=b.startBinding&&!p.some(_=>_.id===b.startBinding?.elementId),S=b.endBinding&&!p.some(_=>_.id===b.endBinding?.elementId);return w||S}).forEach(b=>f.add(b.id)),p=p.filter(b=>!f.has(b.id));let x=this.getEffectiveGridSize()&&(s.shiftKey?OE:this.getEffectiveGridSize())||(s.shiftKey?EM:OE),g=0,v=0;s.key===D.ARROW_LEFT?g=-x:s.key===D.ARROW_RIGHT?g=x:s.key===D.ARROW_UP?v=-x:s.key===D.ARROW_DOWN&&(v=x),p.forEach(b=>{this.scene.mutateElement(b,{x:b.x+g,y:b.y+v},{informMutation:!1,isDragging:!1}),mi(b,this.scene,{simultaneouslyUpdated:p})}),this.scene.triggerUpdate(),s.preventDefault()}else if(s.key===D.ENTER){let p=this.scene.getSelectedElements(this.state);if(p.length===1){let f=p[0];if(s[D.CTRL_OR_CMD]||Pt(f))Te(f)&&(!this.state.selectedLinearElement?.isEditing||this.state.selectedLinearElement.elementId!==f.id)&&(this.store.scheduleCapture(),ze(f)||this.actionManager.executeAction(fx));else if(oe(f)||D8(f)){let x;oe(f)||(x=f);let g=hb(f,this.state,this.scene.getNonDeletedElementsMap()),v=g.x,b=g.y;this.startTextEditing({sceneX:v,sceneY:b,container:x}),s.preventDefault();return}else he(f)&&this.setState({editingFrame:f.id})}}if(s.key===D.SPACE&&Je.pointers.size===0&&(Cc=!0,ht(this.interactiveCanvas,Ve.GRAB),s.preventDefault()),(s.key===D.G||s.key===D.S)&&!s.altKey&&!s[D.CTRL_OR_CMD]){let p=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!p.length)return;s.key===D.G&&(kl(this.state.activeTool.type)||p.some(f=>kl(f.type)))&&(this.setState({openPopup:"elementBackground"}),s.stopPropagation()),s.key===D.S&&(this.setState({openPopup:"elementStroke"}),s.stopPropagation())}if(!s[D.CTRL_OR_CMD]&&s.shiftKey&&s.key.toLowerCase()===D.F){let p=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!p.length)return;(this.state.activeTool.type==="text"||p.find(f=>oe(f)||Le(f,this.scene.getNonDeletedElementsMap())))&&(s.preventDefault(),this.setState({openPopup:"fontFamily"}))}s[D.CTRL_OR_CMD]&&(s.key===D.BACKSPACE||s.key===D.DELETE)&&this.updateEditorAtom(H2,"clearCanvas");let u=s.key.toLocaleLowerCase(),h=u===D.S&&s.shiftKey&&!s[D.CTRL_OR_CMD],m=s.key===D.I||u===D.G&&s.shiftKey;(h||m)&&this.openEyeDropper({type:h?"stroke":"background"})})),L(this,"onKeyUp",en(s=>{if(s.key===D.SPACE&&(this.state.viewModeEnabled&&this.state.activeTool.type!=="laser"||this.state.openDialog?.name==="elementLinkSelector"?ht(this.interactiveCanvas,Ve.GRAB):Wp(this.state.activeTool.type)?mo(this.interactiveCanvas):(Xo(this.interactiveCanvas,this.state),this.setState({selectedElementIds:nt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),Cc=!1),s.key===D.ALT&&hf({app:this,event:s}),(s.key===D.ALT&&this.state.bindMode==="skip"||!s[D.CTRL_OR_CMD]&&!Xu(this.state))&&(this.setState({bindMode:"orbit"}),this.lastPointerMoveEvent&&ci("COMPLEX_BINDINGS"))){let d=dt({clientX:this.lastPointerMoveEvent.clientX,clientY:this.lastPointerMoveEvent.clientY},this.state),u=hi(N(d.x,d.y),this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap());if(this.state.selectedLinearElement){let h=ae.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());Mr(h)&&this.handleDelayedBindModeChange(h,u)}}if(!s[D.CTRL_OR_CMD]){let d=this.state.bindingPreference==="enabled";this.state.isBindingEnabled!==d&&(0,$r.flushSync)(()=>{this.setState({isBindingEnabled:d})}),hf({app:this,event:s})}if(Zc(s.key)){tf(this.scene.getSelectedElements(this.state).filter(Oe),this.scene,this.state);let d=this.scene.getNonDeletedElementsMap();this.scene.getSelectedElements(this.state).filter(sb).forEach(u=>{u.startBinding&&this.scene.mutateElement(u,{startBinding:{...u.startBinding,...c3(u,d.get(u.startBinding.elementId),"start",d)}}),u.endBinding&&this.scene.mutateElement(u,{endBinding:{...u.endBinding,...c3(u,d.get(u.endBinding.elementId),"end",d)}})}),this.setState({suggestedBinding:null})}if(s.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:U.IMMEDIATELY})),!s[D.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.pendingNodes?.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let d=this.flowChartCreator.pendingNodes?.[0];d&&(this.setState(u=>({selectedElementIds:nt({[d.id]:!0},u)})),Ju([d],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(d,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:U.IMMEDIATELY})}})),L(this,"isToolSupported",s=>this.props.UIOptions.tools?.[s]!==!1),L(this,"setActiveTool",(s,d=!1)=>{if(!this.isToolSupported(s.type)){console.warn(`"${s.type}" tool is disabled via "UIOptions.canvasActions.tools.${s.type}"`);return}let u=tt(this.state,s);u.type==="hand"?ht(this.interactiveCanvas,Ve.GRAB):Cc||Xo(this.interactiveCanvas,{...this.state,activeTool:u}),KM(document.activeElement)&&this.focusContainer(),h8(u.type)||this.setState({suggestedBinding:null}),u.type==="image"&&this.onImageToolbarButtonClick(),this.setState(h=>{let m={snapLines:h.snapLines.length?[]:h.snapLines,originSnapOffset:null,activeEmbeddable:null,selectedLinearElement:Wp(u.type)?h.selectedLinearElement:null};return u.type==="freedraw"&&this.store.scheduleCapture(),u.type==="lasso"?{...h,...m,activeTool:u,...d?{}:{selectedElementIds:nt({},h),selectedGroupIds:nt({},h),editingGroupId:null,multiElement:null}}:u.type!=="selection"?{...h,...m,activeTool:u,selectedElementIds:nt({},h),selectedGroupIds:nt({},h),editingGroupId:null,multiElement:null}:{...h,...m,activeTool:u}})}),L(this,"setOpenDialog",s=>{this.setState({openDialog:s})}),L(this,"setCursor",s=>{ht(this.interactiveCanvas,s)}),L(this,"resetCursor",()=>{mo(this.interactiveCanvas)}),L(this,"isTouchScreenMultiTouchGesture",()=>Je.pointers.size>=2),L(this,"getName",()=>this.state.name||this.props.name||`${E("labels.untitled")}-${ZE()}`),L(this,"onGestureStart",en(s=>{s.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:nt({},this.state),activeEmbeddable:null}),Je.initialScale=this.state.zoom.value})),L(this,"onGestureChange",en(s=>{if(s.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let d=Je.initialScale;d&&this.setState(u=>({...Yd({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Ml(d*s.scale)},u)}))})),L(this,"onGestureEnd",en(s=>{s.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:nt(this.state.previousSelectedElementIds,this.state)}),Je.initialScale=null})),L(this,"startTextEditing",({sceneX:s,sceneY:d,insertAtParentCenter:u=!0,container:h,autoEdit:m=!0})=>{let p=!1,f=u&&this.getTextWysiwygSnappedToCenterPosition(s,d,this.state,h);h&&f&&(Le(h,this.scene.getNonDeletedElementsMap())||(p=!0));let x=null,g=this.scene.getSelectedElements(this.state);g.length===1?oe(g[0])?x=g[0]:h?x=Le(g[0],this.scene.getNonDeletedElementsMap()):x=this.getTextElementAtPosition(s,d):x=this.getTextElementAtPosition(s,d);let v=x?.fontFamily||this.state.currentItemFontFamily,b=x?.lineHeight||jr(v),w=this.state.currentItemFontSize;if(!x&&p&&h&&!Oe(h)){let C=Yu(Mt({fontSize:w,fontFamily:v}),b),k=k8(w,b),T=Math.max(h.height,k),I=Math.max(h.width,C);this.scene.mutateElement(h,{height:T,width:I}),s=h.x+I/2,d=h.y+T/2,f&&(f=this.getTextWysiwygSnappedToCenterPosition(s,d,this.state,h))}let S=this.getTopLayerFrameAtSceneCoords({x:s,y:d}),_=x||mr({x:f?f.elementCenterX:s,y:f?f.elementCenterY:d,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:w,fontFamily:v,textAlign:f?"center":this.state.currentItemTextAlign,verticalAlign:f?si.MIDDLE:PE,containerId:p?h?.id:void 0,groupIds:h?.groupIds??[],lineHeight:b,angle:h?Oe(h)?0:h.angle:0,frameId:S?S.id:null});if(!x&&p&&h&&this.scene.mutateElement(h,{boundElements:(h.boundElements||[]).concat({type:"text",id:_.id})}),this.setState({editingTextElement:_}),!x)if(h&&p){let C=this.scene.getElementIndex(h.id);this.scene.insertElementAtIndex(_,C+1)}else this.scene.insertElement(_);m||x||h?this.handleTextWysiwyg(_,{isExistingElement:!!x}):this.setState({newElement:_,multiElement:null})}),L(this,"startImageCropping",s=>{this.store.scheduleCapture(),this.setState({croppingElementId:s.id})}),L(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.scheduleCapture(),this.setState({croppingElementId:null}))}),L(this,"handleCanvasDoubleClick",s=>{if(this.state.multiElement||this.state.activeTool.type!==this.state.preferredSelectionTool.type)return;let d=this.scene.getSelectedElements(this.state),{x:u,y:h}=dt(s,this.state);if(d.length===1&&Te(d[0])){let m=d[0];if((s[D.CTRL_OR_CMD]&&sb(m)||Pt(m))&&(!this.state.selectedLinearElement?.isEditing||this.state.selectedLinearElement.elementId!==m.id)){this.actionManager.executeAction(fx);return}else if(this.state.selectedLinearElement&&ze(d[0])){let p=ae.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:u,y:h},this.state,this.scene.getNonDeletedElementsMap()),f=p?ae.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,p,this.scene.getNonDeletedElementsMap()):-1;if(f&&f>-1){this.store.scheduleCapture(),ae.deleteFixedSegment(d[0],this.scene,f);let x=ae.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:u,y:h},this.state,this.scene.getNonDeletedElementsMap()),g=x?ae.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,x,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,initialState:{...this.state.selectedLinearElement.initialState,segmentMidpoint:{index:g,value:p,added:!1}},segmentMidPointHoveredCoords:x}});return}}else if(this.state.selectedLinearElement?.isEditing&&this.state.selectedLinearElement.elementId===m.id&&Pt(m))return}if(d.length===1&&ft(d[0])){this.startImageCropping(d[0]);return}if(mo(this.interactiveCanvas),Ji(this.state).length>0){let m=this.getElementAtPosition(u,h),p=m&&P8(m,this.state.selectedGroupIds);if(p){this.store.scheduleCapture(),this.setState(f=>({...f,...bn({editingGroupId:p,selectedElementIds:{[m.id]:!0}},this.scene.getNonDeletedElements(),f,this)}));return}}if(mo(this.interactiveCanvas),!s[D.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let m=this.getElementAtPosition(u,h);if(ob(m)){this.setState({activeEmbeddable:{element:m,state:"active"}});return}if(!this.state.selectedLinearElement?.isEditing){let p=this.getTextBindableContainerAtPosition(u,h);if(p&&(gn(p)||!Hr(p.backgroundColor)||Ps({point:N(u,h),element:p,elementsMap:this.scene.getNonDeletedElementsMap(),threshold:this.getElementHitThreshold(p)}))){let f=hb(p,this.state,this.scene.getNonDeletedElementsMap());u=f.x,h=f.y}this.startTextEditing({sceneX:u,sceneY:h,insertAtParentCenter:!s.altKey,container:p})}}}),L(this,"getElementLinkAtPosition",(s,d)=>{if(d&&d.locked)return;let u=this.scene.getNonDeletedElements(),h=-1;for(let m=u.length-1;m>=0;m--){let p=u[m];if(d&&p.id===d.id&&(h=m),p.link&&m>=h&&Ub(p,this.scene.getNonDeletedElementsMap(),this.state,N(s.x,s.y),this.editorInterface.formFactor==="phone"))return p}}),L(this,"handleElementLinkClick",s=>{let d=Cr(N(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),N(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||d>Uu)return;let u=dt(this.lastPointerDownEvent,this.state),h=this.scene.getNonDeletedElementsMap(),m=Ub(this.hitLinkElement,h,this.state,N(u.x,u.y),this.editorInterface.formFactor==="phone"),p=dt(this.lastPointerUpEvent,this.state),f=Ub(this.hitLinkElement,h,this.state,N(p.x,p.y),this.editorInterface.formFactor==="phone");if(m&&f){VP();let x=this.hitLinkElement.link;if(x){x=Qi(x);let g;if(this.props.onLinkOpen&&(g=tb(Q.EXCALIDRAW_LINK,s.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:x},g)),!g?.defaultPrevented){let v=ib(x)?"_self":"_blank",b=window.open(void 0,v);b&&(b.opener=null,b.location=x)}}}}),L(this,"getTopLayerFrameAtSceneCoords",s=>{let d=this.scene.getNonDeletedElementsMap(),u=this.scene.getNonDeletedFramesLikes().filter(h=>!h.locked&&m3(s,h,d));return u.length?u[u.length-1]:null}),L(this,"handleCanvasPointerMove",s=>{this.savePointer(s.clientX,s.clientY,this.state.cursorButton),this.lastPointerMoveEvent=s.nativeEvent;let d=dt(s,this.state),{x:u,y:h}=d;this.lastPointerMoveCoords={x:u,y:h},Je.pointers.has(s.pointerId)&&Je.pointers.set(s.pointerId,{x:s.clientX,y:s.clientY});let m=Je.initialScale;if(Je.pointers.size===2&&Je.lastCenter&&m&&Je.initialDistance){let S=oU(Je.pointers),_=S.x-Je.lastCenter.x,C=S.y-Je.lastCenter.y;Je.lastCenter=S;let k=lU(Array.from(Je.pointers.values())),T=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:k/Je.initialDistance,I=T?Ml(m*T):this.state.zoom.value;this.setState(A=>{let O=Yd({viewportX:S.x,viewportY:S.y,nextZoom:I},A);return this.translateCanvas({zoom:O.zoom,scrollX:O.scrollX+2*(_/I),scrollY:O.scrollY+2*(C/I),shouldCacheIgnoreZoom:!0}),null}),this.resetShouldCacheIgnoreZoomDebounced()}else Je.lastCenter=Je.initialDistance=Je.initialScale=null;if(Cc||n1||kC||oh(this.state))return;let p=fU(r1,s.clientX-this.state.offsetLeft,s.clientY-this.state.offsetTop).isOverEither;if(!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(p?mo(this.interactiveCanvas):Xo(this.interactiveCanvas,this.state)),!this.state.newElement&&Moe(this.state.activeTool.type)){let{originOffset:S,snapLines:_}=Toe(this.scene.getNonDeletedElements(),this,{x:u,y:h},s,this.scene.getNonDeletedElementsMap());this.setState(C=>{let k=Gu(C.snapLines,_),T=C.originSnapOffset?Gu(C.originSnapOffset,S):S;return C.snapLines===k&&C.originSnapOffset===T?null:{snapLines:k,originSnapOffset:T}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(S=>S.snapLines.length?{snapLines:[]}:null);if(this.state.selectedLinearElement?.isEditing&&!this.state.selectedLinearElement.isDragging){let S=this.state.newElement?null:ae.handlePointerMoveInEditMode(s,u,h,this);S&&S!==this.state.selectedLinearElement&&(0,$r.flushSync)(()=>{this.setState({selectedLinearElement:S})})}if(m8(this.state.activeTool.type)){let{newElement:S}=this.state;if(!S&&Xu(this.state)){let _=N(u,h),C=this.scene.getNonDeletedElementsMap(),k=hi(_,this.scene.getNonDeletedElements(),C,$u(this.state.zoom));k?this.setState({suggestedBinding:{element:k,midPoint:ub(_,k,C,this.state.zoom)}}):this.state.suggestedBinding&&this.setState({suggestedBinding:null})}}if(this.state.multiElement&&this.state.selectedLinearElement){let{multiElement:S,selectedLinearElement:_}=this.state,{x:C,y:k,points:T}=S,I=T[T.length-1],{lastCommittedPoint:A}=_;if(Xo(this.interactiveCanvas,this.state),I===A)Oe(this.state.newElement)&&Xu(this.state)&&hi(N(u,h),this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),$u(this.state.zoom))?(this.actionManager.executeAction(qa,"ui",{event:s.nativeEvent,sceneCoords:{x:u,y:h}}),this.setState({suggestedBinding:null,startBoundElement:null}),this.state.activeTool.locked||(mo(this.interactiveCanvas),this.setState(O=>({newElement:null,activeTool:tt(this.state,{type:this.state.preferredSelectionTool.type}),selectedElementIds:nt({...O.selectedElementIds,[S.id]:!0},O),selectedLinearElement:new ae(S,this.scene.getNonDeletedElementsMap())})))):Cr(N(u-C,h-k),I)>=Bu?(this.scene.mutateElement(S,{points:[...T,N(u-C,h-k)]},{informMutation:!1,isDragging:!1}),ut(this.state.selectedLinearElement?.initialState,"initialState must be set"),this.setState({selectedLinearElement:{...this.state.selectedLinearElement,lastCommittedPoint:T[T.length-1],selectedPointsIndices:[S.points.length-1],initialState:{...this.state.selectedLinearElement.initialState,lastClickedPoint:S.points.length-1}}})):ht(this.interactiveCanvas,Ve.POINTER);else if(T.length>2&&A&&Cr(N(u-C,h-k),A)<Bu)ht(this.interactiveCanvas,Ve.POINTER),this.scene.mutateElement(S,{points:T.slice(0,-1)},{informMutation:!1,isDragging:!1}),this.setState({selectedLinearElement:{..._,selectedPointsIndices:_.selectedPointsIndices?.includes(S.points.length)?[..._.selectedPointsIndices.filter(O=>O!==S.points.length&&O!==S.points.length-1),S.points.length-1]:_.selectedPointsIndices,lastCommittedPoint:S.points[S.points.length-1],initialState:{..._.initialState,lastClickedPoint:S.points.length-1}}});else{Xp(T,this.state.zoom.value)&&ht(this.interactiveCanvas,Ve.POINTER);let O=this.scene.getNonDeletedElementsMap();if(sb(S)){let j=hi(N(u,h),this.scene.getNonDeletedElements(),O);ci("COMPLEX_BINDINGS")&&this.handleDelayedBindModeChange(S,j)}ut(this.state.selectedLinearElement,"Expected selectedLinearElement to be set to operate on a linear element");let V=ae.handlePointerMove(s.nativeEvent,this,u,h,this.state.selectedLinearElement);V&&this.setState(V)}return}if(this.state.activeTool.type==="arrow"){let S=hi(N(u,h),this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),$u(this.state.zoom)),_=N(u,h),C=this.scene.getNonDeletedElementsMap();S&&!fb(_,S,C)&&this.setState({suggestedBinding:{element:S,midPoint:ub(_,S,C,this.state.zoom)}})}let f=!!s.buttons,x=this.state.activeTool.type==="laser";if(f||!x&&this.state.activeTool.type!=="selection"&&this.state.activeTool.type!=="lasso"&&this.state.activeTool.type!=="text"&&this.state.activeTool.type!=="eraser")return;let g=this.scene.getNonDeletedElements(),v=this.scene.getSelectedElements(this.state);if(v.length===1&&!p&&!this.state.selectedLinearElement?.isEditing){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,u,h),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&this.state.openDialog?.name!=="elementLinkSelector"&&!(v.length===1&&ze(v[0]))&&!(Te(v[0])&&(this.editorInterface.userAgent.isMobileDevice||v[0].points.length===2))){let S=_3(g,this.state,u,h,this.state.zoom,s.pointerType,this.scene.getNonDeletedElementsMap(),this.editorInterface);if(S&&S.transformHandleType){ht(this.interactiveCanvas,T3(S));return}}}else if(v.length>1&&!p&&this.state.openDialog?.name!=="elementLinkSelector"){let S=k3(Qe(v),u,h,this.state.zoom,s.pointerType,this.editorInterface);if(S){ht(this.interactiveCanvas,T3({transformHandleType:S}));return}}if(to(this.state))return;let b=this.getElementAtPosition(u,h,{preferSelected:!0,includeLockedElements:!0}),w=null;if(b&&b.locked?w=null:w=b,this.handleIframeLikeElementHover({hitElement:w,scenePointer:d,moveEvent:s})||(this.hitLinkElement=this.getElementLinkAtPosition(d,b)),this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id])ht(this.interactiveCanvas,Ve.POINTER),Fre(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap());else{if(VP(),x)return;w&&(w.link||Tr(w))&&this.state.selectedElementIds[w.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?ht(this.interactiveCanvas,oe(w)?Ve.TEXT:Ve.CROSSHAIR):this.state.viewModeEnabled?ht(this.interactiveCanvas,Ve.GRAB):this.state.openDialog?.name==="elementLinkSelector"?ht(this.interactiveCanvas,Ve.AUTO):p?ht(this.interactiveCanvas,Ve.AUTO):s[D.CTRL_OR_CMD]?ht(this.interactiveCanvas,Ve.AUTO):(w||this.isHittingCommonBoundingBoxOfSelectedElements(d,v))&&!w?.locked&&(!w||!ze(w)||!(w.startBinding||w.endBinding))&&(this.state.activeTool.type!=="lasso"||v.length>0)&&ht(this.interactiveCanvas,Ve.MOVE),this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,u,h)}this.state.openDialog?.name==="elementLinkSelector"&&w?this.setState(S=>({hoveredElementIds:Gu(S.hoveredElementIds,bn({editingGroupId:S.editingGroupId,selectedElementIds:{[w.id]:!0}},this.scene.getNonDeletedElements(),S,this).selectedElementIds)})):this.state.openDialog?.name==="elementLinkSelector"&&!w&&this.setState(S=>({hoveredElementIds:Gu(S.hoveredElementIds,{})}))}),L(this,"handleEraser",(s,d)=>{let u=this.eraserTrail.addPointToPath(d.x,d.y,s.altKey);this.elementsPendingErasure=new Set(u),this.triggerRender()}),L(this,"handleTouchMove",s=>{a1=!0}),L(this,"handleCanvasPointerDown",s=>{if(!s.ctrlKey){let w=this.state.bindingPreference==="enabled";this.state.isBindingEnabled!==w&&this.setState({isBindingEnabled:w})}let d=dt(s,this.state),{x:u,y:h}=d;this.lastPointerMoveCoords={x:u,y:h};let m=s.target;if(m.setPointerCapture&&m.setPointerCapture(s.pointerId),this.maybeCleanupAfterMissingPointerUp(s.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(w=>({searchMatches:w.searchMatches&&{focusedId:null,matches:w.searchMatches.matches.map(S=>({...S,focus:!1}))}})),this.updateEditorAtom(Aj,null)),Qa.get(rs)&&this.updateEditorAtom(rs,null),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.state.openPopup&&this.setState({openPopup:null}),this.updateGestureOnPointerDown(s),s.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let w=this.state.newElement;this.updateScene({...w.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(S=>S.id!==w.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBinding:null,selectedElementIds:nt(Object.keys(this.state.selectedElementIds).filter(S=>S!==w.id).reduce((S,_)=>(S[_]=this.state.selectedElementIds[_],S),{}),this.state)},captureUpdate:this.state.openDialog?.name==="elementLinkSelector"?U.EVENTUALLY:U.NEVER});return}let p=document.getSelection();if(p?.anchorNode&&p.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(s),!this.state.penDetected&&s.pointerType==="pen"&&this.setState(w=>({penMode:!0,penDetected:!0})),!this.editorInterface.isTouchScreen&&["pen","touch"].includes(s.pointerType)&&(this.editorInterface=Vu(this.editorInterface,{isTouchScreen:!0})),n1||(this.lastPointerDownEvent=s,this.handleCanvasPanUsingWheelOrSpaceDrag(s)))return;if(this.setState({lastPointerDownWith:s.pointerType,cursorButton:"down"}),this.savePointer(s.clientX,s.clientY,"down"),s.button===Xi.ERASER&&this.state.activeTool.type!==rn.eraser){this.setState({activeTool:tt(this.state,{type:rn.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(s);let w=()=>{S(),_?.(),to(this.state)&&this.setState({activeTool:tt(this.state,{...this.state.activeTool.lastActiveTool||{type:rn.selection},lastActiveToolBeforeEraser:null})})},S=xt(window,Q.POINTER_UP,w,{once:!0}),_;requestAnimationFrame(()=>{_=this.missingPointerEventCleanupEmitter.once(w)})});return}if(s.button!==Xi.MAIN&&s.button!==Xi.TOUCH&&s.button!==Xi.ERASER||Je.pointers.size>1)return;let f=this.initialPointerDownState(s);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(s,f)||(this.clearSelectionIfNotUsingSelection(),this.handleSelectionOnPointerDown(s,f))||!(!this.state.penMode||s.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="lasso"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="lasso"){let w=f.hit.element&&this.isASelectedElement(f.hit.element);!f.hit.hasHitCommonBoundingBoxOfSelectedElements&&!f.resize.handleType&&!w&&(this.lassoTrail.startPath(f.origin.x,f.origin.y,s.shiftKey),f.drag.blockDragging=this.editorInterface.formFactor==="desktop"),this.editorInterface.formFactor!=="desktop"&&f.hit.element&&!w&&(this.setState(S=>{let _={...S.selectedElementIds,[f.hit.element.id]:!0},C=[];Object.keys(S.selectedElementIds).forEach(T=>{let I=this.scene.getElement(T);I&&C.push(I)});let k=f.hit.element;if(he(k))pi(C,k.id).forEach(T=>{delete _[T.id]});else if(k.frameId)_[k.frameId]&&delete _[k.id];else{let T=k.groupIds,I=new Set(T.flatMap(A=>wt(this.scene.getNonDeletedElements(),A)).filter(A=>he(A)).map(A=>A.id));I.size>0&&C.forEach(A=>{A.frameId&&I.has(A.frameId)&&(delete _[A.id],A.groupIds.flatMap(O=>wt(this.scene.getNonDeletedElements(),O)).forEach(O=>{delete _[O.id]}))})}return{...bn({editingGroupId:S.editingGroupId,selectedElementIds:_},this.scene.getNonDeletedElements(),S,this),showHyperlinkPopup:k.link||Tr(k)?"info":!1}}),f.hit.wasAddedToSelection=!0)}else this.state.activeTool.type==="text"?this.handleTextOnPointerDown(s,f):this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line"?this.handleLinearElementOnPointerDown(s,this.state.activeTool.type,f):this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(s,this.state.activeTool.type,f):this.state.activeTool.type==="custom"?Xo(this.interactiveCanvas,this.state):this.state.activeTool.type===rn.frame||this.state.activeTool.type===rn.magicframe?this.createFrameElementOnPointerDown(f,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(f.lastCoords.x,f.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.state.activeTool.type!=="image"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,f);this.props?.onPointerDown?.(this.state.activeTool,f),this.onPointerDownEmitter.trigger(this.state.activeTool,f,s),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(f.lastCoords.x,f.lastCoords.y);let x=this.onPointerMoveFromPointerDownHandler(f),g=this.onPointerUpFromPointerDownHandler(f),v=this.onKeyDownFromPointerDownHandler(f),b=this.onKeyUpFromPointerDownHandler(f);this.missingPointerEventCleanupEmitter.once(w=>g(w||s.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener(Q.POINTER_MOVE,x),window.addEventListener(Q.POINTER_UP,g),window.addEventListener(Q.KEYDOWN,v),window.addEventListener(Q.KEYUP,b),f.eventListeners.onMove=x,f.eventListeners.onUp=g,f.eventListeners.onKeyUp=b,f.eventListeners.onKeyDown=v)}),L(this,"handleCanvasPointerUp",s=>{if(ci("COMPLEX_BINDINGS")&&this.resetDelayedBindMode(),this.removePointer(s),this.lastPointerUpEvent=s,!s.ctrlKey){let m=this.state.bindingPreference==="enabled";this.state.isBindingEnabled!==m&&this.setState({isBindingEnabled:m})}let d=dt({clientX:s.clientX,clientY:s.clientY},this.state),{x:u,y:h}=d;if(this.lastPointerMoveCoords={x:u,y:h},!this.handleIframeLikeCenterClick()){if(this.editorInterface.isTouchScreen){let m=this.getElementAtPosition(d.x,d.y,{includeLockedElements:!0});this.hitLinkElement=this.getElementLinkAtPosition(d,m)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?this.handleElementLinkClick(s):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}}),L(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",s=>{s.pointerType==="touch"&&(a1=!1,_c?a1=!0:_c=window.setTimeout(()=>{_c=0,a1||this.handleCanvasContextMenu(s)},DM))}),L(this,"resetContextMenuTimer",()=>{clearTimeout(_c),_c=0,a1=!1}),L(this,"maybeCleanupAfterMissingPointerUp",s=>{i1?.(),this.missingPointerEventCleanupEmitter.trigger(s).clear()}),L(this,"handleCanvasPanUsingWheelOrSpaceDrag",s=>{if(!(Je.pointers.size<=1&&(s.button===Xi.WHEEL||s.button===Xi.MAIN&&Cc||oh(this.state)||this.state.viewModeEnabled&&this.state.activeTool.type!=="laser")))return!1;n1=!0,this.focusContainer(),this.state.editingTextElement||s.preventDefault();let d=!1,u=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);ht(this.interactiveCanvas,Ve.GRABBING);let{clientX:h,clientY:m}=s,p=dC(x=>{let g=h-x.clientX,v=m-x.clientY;if(h=x.clientX,m=x.clientY,u&&!d&&(Math.abs(g)>1||Math.abs(v)>1)){d=!0;let b=S=>{document.body.removeEventListener(Q.PASTE,b),S.stopPropagation()},w=()=>{setTimeout(()=>{document.body.removeEventListener(Q.PASTE,b),window.removeEventListener(Q.POINTER_UP,w)},100)};document.body.addEventListener(Q.PASTE,b),window.addEventListener(Q.POINTER_UP,w)}this.translateCanvas({scrollX:this.state.scrollX-g/this.state.zoom.value,scrollY:this.state.scrollY-v/this.state.zoom.value})}),f=en(i1=()=>{i1=null,n1=!1,Cc||(this.state.viewModeEnabled&&this.state.activeTool.type!=="laser"?ht(this.interactiveCanvas,Ve.GRAB):Xo(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(s.clientX,s.clientY,"up"),window.removeEventListener(Q.POINTER_MOVE,p),window.removeEventListener(Q.POINTER_UP,f),window.removeEventListener(Q.BLUR,f),p.flush()});return window.addEventListener(Q.BLUR,f),window.addEventListener(Q.POINTER_MOVE,p,{passive:!0}),window.addEventListener(Q.POINTER_UP,f),!0}),L(this,"clearSelectionIfNotUsingSelection",()=>{Wp(this.state.activeTool.type)||this.setState({selectedElementIds:nt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),L(this,"handleSelectionOnPointerDown",(s,d)=>{if(Wp(this.state.activeTool.type)){let u=this.scene.getNonDeletedElements(),h=this.scene.getNonDeletedElementsMap(),m=this.scene.getSelectedElements(this.state);if(m.length===1&&!this.state.selectedLinearElement?.isEditing&&!ze(m[0])&&!(Te(m[0])&&(this.editorInterface.userAgent.isMobileDevice||m[0].points.length===2))&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let p=_3(u,this.state,d.origin.x,d.origin.y,this.state.zoom,s.pointerType,this.scene.getNonDeletedElementsMap(),this.editorInterface);p!=null&&(p.transformHandleType==="rotation"?(this.setState({resizingElement:p.element}),d.resize.handleType=p.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:p.element}),d.resize.handleType=p.transformHandleType))}else m.length>1&&(d.resize.handleType=k3(Qe(m),d.origin.x,d.origin.y,this.state.zoom,s.pointerType,this.editorInterface));if(d.resize.handleType)d.resize.isResizing=!0,d.resize.offset=Q0(NA(d.resize.handleType,m,h,d.origin.x,d.origin.y)),m.length===1&&Te(m[0])&&m[0].points.length===2&&(d.resize.arrowDirection=OA(d.resize.handleType,m[0]));else{if(this.state.selectedLinearElement){let b=this.state.selectedLinearElement,w=ae.handlePointerDown(s,this,this.store,d.origin,b,this.scene);if(w.hitElement&&(d.hit.element=w.hitElement),w.linearElementEditor&&this.setState({selectedLinearElement:w.linearElementEditor}),w.didAddPoint)return!0;let S=this.scene.getNonDeletedElementsMap(),_=ae.getElement(b.elementId,S);if(_&&Mr(_)){let{hitFocusPoint:C,pointerOffset:k}=TA(_,d,S,this.state);if(C)return this.setState({selectedLinearElement:{...b,hoveredFocusPointBinding:C,draggedFocusPointBinding:C,pointerOffset:k}}),!1}}let p=this.getElementsAtPosition(d.origin.x,d.origin.y,{includeLockedElements:!0}),f=p.filter(b=>!b.locked),x=this.getElementAtPosition(d.origin.x,d.origin.y,{allHitElements:p});if((!x||x.id!==this.state.activeLockedId)&&this.setState({activeLockedId:null}),x&&x.locked&&!f.some(b=>this.state.selectedElementIds[b.id])?d.hit.element=null:d.hit.element=d.hit.element??this.getElementAtPosition(d.origin.x,d.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(d.origin,x),this.hitLinkElement)return!0;if(this.state.croppingElementId&&d.hit.element?.id!==this.state.croppingElementId&&this.finishImageCropping(),d.hit.element&&this.getElementLinkAtPosition({x:d.origin.x,y:d.origin.y},d.hit.element))return!1;d.hit.allHitElements=f;let g=d.hit.element,v=d.hit.allHitElements.some(b=>this.isASelectedElement(b));if((g===null||!v)&&!s.shiftKey&&!d.hit.hasHitCommonBoundingBoxOfSelectedElements&&(!this.state.selectedLinearElement?.isEditing||g&&g?.id!==this.state.selectedLinearElement?.elementId)&&this.clearSelection(g),this.state.selectedLinearElement?.isEditing)this.setState(b=>({selectedLinearElement:b.selectedLinearElement?{...b.selectedLinearElement,isEditing:!!g&&g.id===this.state.selectedLinearElement?.elementId}:null,selectedElementIds:b.selectedLinearElement?nt({[b.selectedLinearElement.elementId]:!0},this.state):nt({},b)}));else if(g!=null){if(s[D.CTRL_OR_CMD])return s.altKey?(this.state.openDialog?.name==="elementLinkSelector"&&this.setOpenDialog(null),this.lassoTrail.startPath(d.origin.x,d.origin.y,s.shiftKey),this.setActiveTool({type:"lasso",fromSelection:!0}),!1):(this.state.selectedElementIds[g.id]||(d.hit.wasAddedToSelection=!0),this.setState(b=>({...z8(b,g),previousSelectedElementIds:this.state.selectedElementIds})),!1);this.state.selectedElementIds[g.id]||(this.state.editingGroupId&&!Zu(g,this.state.editingGroupId)&&this.setState({selectedElementIds:nt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!v&&!d.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(b=>{let w={...b.selectedElementIds,[g.id]:!0},S=[];if(Object.keys(b.selectedElementIds).forEach(_=>{let C=this.scene.getElement(_);C&&S.push(C)}),he(g))pi(S,g.id).forEach(_=>{delete w[_.id]});else if(g.frameId)w[g.frameId]&&delete w[g.id];else{let _=g.groupIds,C=new Set(_.flatMap(k=>wt(this.scene.getNonDeletedElements(),k)).filter(k=>he(k)).map(k=>k.id));C.size>0&&S.forEach(k=>{k.frameId&&C.has(k.frameId)&&(delete w[k.id],k.groupIds.flatMap(T=>wt(this.scene.getNonDeletedElements(),T)).forEach(T=>{delete w[T.id]}))})}return b.openDialog?.name==="elementLinkSelector"&&(g.groupIds.some(_=>b.selectedGroupIds[_])||(w={[g.id]:!0})),{...bn({editingGroupId:b.editingGroupId,selectedElementIds:w},this.scene.getNonDeletedElements(),b,this),showHyperlinkPopup:g.link||Tr(g)?"info":!1}}),d.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),L(this,"handleTextOnPointerDown",(s,d)=>{if(this.state.editingTextElement)return;let u=d.origin.x,h=d.origin.y,m=this.getElementAtPosition(u,h,{includeBoundTextElement:!0}),p=this.getTextBindableContainerAtPosition(u,h);gn(m)&&(p=m,u=m.x+m.width/2,h=m.y+m.height/2),this.startTextEditing({sceneX:u,sceneY:h,insertAtParentCenter:!s.altKey,container:p,autoEdit:!1}),mo(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:tt(this.state,{type:this.state.preferredSelectionTool.type})})}),L(this,"handleFreeDrawElementOnPointerDown",(s,d,u)=>{let[h,m]=hr(u.origin.x,u.origin.y,null),p=this.getTopLayerFrameAtSceneCoords({x:h,y:m}),f=s.pressure===.5,x=fA({type:d,x:h,y:m,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:f,locked:!1,frameId:p?p.id:null,points:[N(0,0)],pressures:f?[]:[s.pressure]});this.scene.insertElement(x),this.setState(v=>{let b={...v.selectedElementIds};return delete b[x.id],{selectedElementIds:nt(b,v)}});let g=hi(N(u.origin.x,u.origin.y),this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap());this.setState({newElement:x,startBoundElement:g,suggestedBinding:null})}),L(this,"insertIframeElement",({sceneX:s,sceneY:d,width:u,height:h})=>{let[m,p]=hr(s,d,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),f=mA({type:"iframe",x:m,y:p,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:u,height:h});return this.scene.insertElement(f),f}),L(this,"insertEmbeddableElement",({sceneX:s,sceneY:d,link:u})=>{let[h,m]=hr(s,d,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),p=sd(u);if(!p)return;p.error instanceof URIError&&this.setToast({message:E("toast.unrecognizedLinkFormat"),closable:!0});let f=y3({type:"embeddable",x:h,y:m,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:p.intrinsicSize.w,height:p.intrinsicSize.h,link:u});return this.scene.insertElement(f),f}),L(this,"newImagePlaceholder",({sceneX:s,sceneY:d,addToFrameUnderCursor:u=!0})=>{let[h,m]=hr(s,d,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),p=u?this.getTopLayerFrameAtSceneCoords({x:h,y:m}):null,f=100/this.state.zoom.value;return gA({type:"image",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:p?p.id:null,x:h-f/2,y:m-f/2,width:f,height:f})}),L(this,"handleLinearElementOnPointerDown",(s,d,u)=>{if(s.ctrlKey&&(0,$r.flushSync)(()=>{this.setState({isBindingEnabled:this.state.bindingPreference!=="enabled"})}),this.state.multiElement){let{multiElement:h,selectedLinearElement:m}=this.state;if(ut(m,"selectedLinearElement is expected to be set"),h.type==="line"&&Xp(h.points,this.state.zoom.value)){(0,$r.flushSync)(()=>{this.setState({selectedLinearElement:{...m,lastCommittedPoint:h.points[h.points.length-1],initialState:{...m.initialState,lastClickedPoint:-1}}})}),this.actionManager.executeAction(qa);return}if(ze(h)&&h.points.length>1){this.actionManager.executeAction(qa,"ui",{event:s.nativeEvent,sceneCoords:{x:u.origin.x,y:u.origin.y}});return}let{x:p,y:f}=h,{lastCommittedPoint:x}=m,g=Xu(this.state)&&hi(N(this.lastPointerMoveCoords?.x??p+h.points[h.points.length-1][0],this.lastPointerMoveCoords?.y??f+h.points[h.points.length-1][1]),this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap());if(Mr(h)&&g||h.points.length>1&&x&&Cr(N(u.origin.x-p,u.origin.y-f),x)<Bu){this.actionManager.executeAction(qa,"ui",{event:s.nativeEvent,sceneCoords:{x:u.origin.x,y:u.origin.y}});return}this.setState(v=>({selectedElementIds:nt({...v.selectedElementIds,[h.id]:!0},v)})),ht(this.interactiveCanvas,Ve.POINTER)}else{let[h,m]=hr(u.origin.x,u.origin.y,s[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),p=this.getTopLayerFrameAtSceneCoords({x:h,y:m}),{currentItemStartArrowhead:f,currentItemEndArrowhead:x}=this.state,[g,v]=d==="arrow"?[f,x]:[null,null],b=d==="arrow"?th({type:d,x:h,y:m,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===an.round?{type:zt.PROPORTIONAL_RADIUS}:null,startArrowhead:g,endArrowhead:v,locked:!1,frameId:p?p.id:null,elbowed:this.state.currentItemArrowType===an.elbow,fixedSegments:this.state.currentItemArrowType===an.elbow?[]:null}):Vr({type:d,x:h,y:m,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:zt.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:p?p.id:null}),w=N(u.origin.x,u.origin.y),S=this.scene.getNonDeletedElementsMap(),_=Xu(this.state)?hi(w,this.scene.getNonDeletedElements(),S):null;this.scene.mutateElement(b,{points:[N(0,0),N(0,0)]}),this.scene.insertElement(b),Mr(b)&&bb(b,new Map([[0,{point:N(0,0),isDragging:!1}]]),w[0],w[1],this.scene,this.state,{newArrow:!0,altKey:s.altKey,initialBinding:!0,angleLocked:Gp(s.nativeEvent)}),(0,$r.flushSync)(()=>{this.setState(C=>{let k=null,T=C.selectedElementIds;if(Te(b)){k=new ae(b,this.scene.getNonDeletedElementsMap());let I=b.points.length-1;k={...k,selectedPointsIndices:[I],initialState:{...k.initialState,arrowStartIsInside:s.altKey,lastClickedPoint:I,origin:N(u.origin.x,u.origin.y)}}}return T=this.state.activeTool.locked?C.selectedElementIds:nt({[b.id]:!0},C),{...C,bindMode:"orbit",newElement:b,startBoundElement:_,suggestedBinding:_&&Mr(b)?{element:_,midPoint:ub(w,_,S,this.state.zoom)}:null,selectedElementIds:T,selectedLinearElement:k}})}),Mr(b)&&ci("COMPLEX_BINDINGS")&&this.handleDelayedBindModeChange(b,_)}}),L(this,"createGenericElementOnPointerDown",(s,d)=>{let[u,h]=hr(d.origin.x,d.origin.y,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=this.getTopLayerFrameAtSceneCoords({x:u,y:h}),p={x:u,y: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,roundness:this.getCurrentItemRoundness(s),locked:!1,frameId:m?m.id:null},f;s==="embeddable"?f=y3({type:"embeddable",...p}):f=ua({type:s,...p}),f.type==="selection"?this.setState({selectionElement:f}):(this.scene.insertElement(f),this.setState({multiElement:null,newElement:f}))}),L(this,"createFrameElementOnPointerDown",(s,d)=>{let[u,h]=hr(s.origin.x,s.origin.y,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m={x:u,y:h,opacity:this.state.currentItemOpacity,locked:!1,...yt},p=d===rn.magicframe?x3(m):Rb(m);this.scene.insertElement(p),this.setState({multiElement:null,newElement:p})}),L(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),L(this,"eraseElements",()=>{let s=!1;this.elementsPendingErasure.forEach(u=>{let h=this.scene.getElement(u);if(Mr(h)){if(h.startBinding){let m=this.scene.getElement(h.startBinding.elementId);Ar(m,this.scene.getElementsMapIncludingDeleted(),{boundElements:m.boundElements.filter(p=>p.id!==h.id)})}if(h.endBinding){let m=this.scene.getElement(h.endBinding.elementId);Ar(m,this.scene.getElementsMapIncludingDeleted(),{boundElements:m.boundElements.filter(p=>p.id!==h.id)})}}else nd(h)&&h.boundElements?.forEach(m=>{if(m.type==="arrow"){let p=this.scene.getElement(m.id);p?.startBinding?.elementId===h.id&&Ar(p,this.scene.getElementsMapIncludingDeleted(),{startBinding:null}),p?.endBinding?.elementId===h.id&&Ar(p,this.scene.getElementsMapIncludingDeleted(),{endBinding:null})}})});let d=this.scene.getElementsIncludingDeleted().map(u=>this.elementsPendingErasure.has(u.id)||u.frameId&&this.elementsPendingErasure.has(u.frameId)||jt(u)&&this.elementsPendingErasure.has(u.containerId)?(s=!0,pe(u,{isDeleted:!0})):u);this.elementsPendingErasure=new Set,s&&(this.store.scheduleCapture(),this.scene.replaceAllElements(d))}),L(this,"initializeImage",async(s,d)=>{if(!F3(d))throw new Error(E("errors.unsupportedFileType"));let u=d.type;if(ht(this.interactiveCanvas,"wait"),u===_e.svg)try{d=j3(S3(await d.text()),d.name)}catch(p){throw console.warn(p),new Error(E("errors.svgImageInsertError"))}let h=await(this.props.generateIdForFile?.(d)||o7(d));if(!h)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(E("errors.imageInsertError"));if(!this.files[h]?.dataURL){try{d=await H3(d,{maxWidthOrHeight:RM})}catch(p){console.error("Error trying to resizing image file on insertion",p)}if(d.size>VE)throw new Error(E("errors.fileTooBig",{maxSize:`${Math.trunc(VE/1024/1024)}MB`}))}let m=this.files[h]?.dataURL||await l7(d);return new Promise(async(p,f)=>{try{let x=this.getLatestInitializedImageElement(s,h);if(this.addMissingFiles([{mimeType:u,id:h,dataURL:m,created:Date.now(),lastRetrieved:Date.now()}]),!this.imageCache.get(h)){this.addNewImagesToImageCache();let{erroredFiles:v}=await this.updateImageCache([x]);if(v.size)throw new Error("Image cache update resulted with an error.")}let g=await this.imageCache.get(h)?.image;if(g&&this.state.newElement?.id!==x.id){x=this.getLatestInitializedImageElement(s,h);let v=this.getImageNaturalDimensions(x,g);Object.assign(x,v)}p(x)}catch(x){console.error(x),f(new Error(E("errors.imageInsertError")))}})}),L(this,"getLatestInitializedImageElement",(s,d)=>{let u=this.scene.getElement(s.id)??s;return pe(u,{fileId:d})}),L(this,"onImageToolbarButtonClick",async()=>{try{let s=this.state.width/2+this.state.offsetLeft,d=this.state.height/2+this.state.offsetTop,{x:u,y:h}=dt({clientX:s,clientY:d},this.state),m=await L3({description:"Image",extensions:Object.keys(Hp),multiple:!0});this.insertImages(m,u,h)}catch(s){s.name!=="AbortError"?console.error(s):console.warn(s),this.setState({newElement:null,activeTool:tt(this.state,{type:this.state.preferredSelectionTool.type})},()=>{this.actionManager.executeAction(qa)})}}),L(this,"getImageNaturalDimensions",(s,d)=>{let u=Math.max(this.state.height-120,160),h=Math.min(u,Math.floor(this.state.height*.5)/this.state.zoom.value),m=Math.min(d.naturalHeight,h),p=m*(d.naturalWidth/d.naturalHeight),f=s.x+s.width/2-p/2,x=s.y+s.height/2-m/2;return{x:f,y:x,width:p,height:m,crop:null}}),L(this,"updateImageCache",async(s,d=this.files)=>{let{updatedFiles:u,erroredFiles:h}=await DA({imageCache:this.imageCache,fileIds:s.map(m=>m.fileId),files:d});return h.size&&(this.store.scheduleAction(U.NEVER),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(m=>Ns(m)&&h.has(m.fileId)?pe(m,{status:"error"}):m))),{updatedFiles:u,erroredFiles:h}}),L(this,"addNewImagesToImageCache",async(s=IA(this.scene.getNonDeletedElements()),d=this.files)=>{let u=s.filter(h=>!h.isDeleted&&!this.imageCache.has(h.fileId));if(u.length){let{updatedFiles:h}=await this.updateImageCache(u,d);if(h.size)for(let m of u)h.has(m.fileId)&&Ro.delete(m);h.size&&this.scene.triggerUpdate()}}),L(this,"scheduleImageRefresh",(0,nB.default)(()=>{this.addNewImagesToImageCache()},MM)),L(this,"handleInteractiveCanvasRef",s=>{s!==null?(this.interactiveCanvas=s,this.interactiveCanvas.addEventListener(Q.TOUCH_START,this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener(Q.TOUCH_END,this.onTouchEnd)):(this.interactiveCanvas?.removeEventListener(Q.TOUCH_START,this.onTouchStart),this.interactiveCanvas?.removeEventListener(Q.TOUCH_END,this.onTouchEnd))}),L(this,"insertImages",async(s,d,u)=>{let h=50/this.state.zoom.value,m=C3(s.map(()=>this.newImagePlaceholder({sceneX:d,sceneY:u})),d,u,h);m.forEach(b=>this.scene.insertElement(b));let p=await Promise.all(m.map(async(b,w)=>{try{return await this.initializeImage(b,await Bb(s[w]))}catch(S){return this.setState({errorMessage:S.message||E("errors.imageInsertError")}),pe(b,{isDeleted:!0})}})),f=me(p),x=C3(p.filter(b=>!b.isDeleted),d,u,h),g=me(x),v=this.scene.getElementsIncludingDeleted().map(b=>g.get(b.id)??f.get(b.id)??b);this.updateScene({appState:{selectedElementIds:nt(Object.fromEntries(x.map(b=>[b.id,!0])),this.state)},elements:v,captureUpdate:U.IMMEDIATELY}),this.setState({},()=>{this.actionManager.executeAction(qa)})}),L(this,"handleAppOnDrop",async s=>{let{x:d,y:u}=dt(s,this.state),h=await Fx(s),m=h.getFiles();if(m.length===1){let{file:v,fileHandle:b}=m[0];if(v&&(v.type===_e.png||v.type===_e.svg))try{let w=await r7(v,this.state,this.scene.getElementsIncludingDeleted(),b);this.syncActionResult({...w,appState:{...w.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:U.IMMEDIATELY});return}catch(w){if(w.name!=="EncodingError")throw new Error(E("alerts.couldNotLoadInvalidFile"))}}let p=m.map(v=>v.file).filter(v=>F3(v));if(p.length>0&&this.isToolSupported("image"))return this.insertImages(p,d,u);let f=h.getData(_e.excalidrawlibIds),x=h.getData(_e.excalidrawlib);if(f||x){try{let v=null;if(f){let{itemIds:b}=JSON.parse(f);v=(await this.library.getLatestLibrary()).filter(w=>b.includes(w.id))}else x&&(v=a7(x));v?.length&&(v=v.map(b=>({...b,elements:Hs({type:"everything",elements:b.elements,randomizeSeed:!0}).duplicatedElements})),this.addElementsFromPasteOrLibrary({elements:Z_(v),position:s,files:null}))}catch(v){this.setState({errorMessage:v.message})}return}if(m.length>0){let{file:v,fileHandle:b}=m[0];v&&await this.loadFileToCanvas(v,b)}let g=h.findByType(_e.text);if(g){let v=g.value;if(v&&nh(v,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(v)||sd(v)?.type==="video")){let b=this.insertEmbeddableElement({sceneX:d,sceneY:u,link:Qi(v)});b&&(this.store.scheduleCapture(),this.setState({selectedElementIds:{[b.id]:!0}}))}}}),L(this,"loadFileToCanvas",async(s,d)=>{s=await Bb(s);try{let u=this.scene.getElementsIncludingDeleted(),h;try{h=await n7(s,this.state,u,d)}catch(m){let p=m instanceof jA;if(p&&m.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:E("errors.imageToolNotSupported")});return}let f=E(p?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:f})}if(!h)return;h.type===_e.excalidraw?(eh(u.concat(h.data.elements)),this.store.scheduleMicroAction({action:U.NEVER,elements:u,appState:void 0}),this.setState({isLoading:!0}),this.syncActionResult({...h.data,appState:{...h.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:U.IMMEDIATELY})):h.type===_e.excalidrawlib&&await this.library.updateLibrary({libraryItems:s,merge:!0,openLibraryMenu:!0}).catch(m=>{console.error(m),this.setState({errorMessage:E("errors.importLibraryError")})})}catch(u){this.setState({isLoading:!1,errorMessage:u.message})}}),L(this,"handleCanvasContextMenu",s=>{if(s.preventDefault(),("pointerType"in s.nativeEvent&&s.nativeEvent.pointerType==="touch"||"pointerType"in s.nativeEvent&&s.nativeEvent.pointerType==="pen"&&s.button!==Xi.SECONDARY)&&this.state.activeTool.type!==this.state.preferredSelectionTool.type)return;let{x:d,y:u}=dt(s,this.state),h=this.getElementAtPosition(d,u,{preferSelected:!0,includeLockedElements:!0}),m=this.scene.getSelectedElements(this.state),p=this.isHittingCommonBoundingBoxOfSelectedElements({x:d,y:u},m),f=h||p?"element":"canvas",x=this.excalidrawContainerRef.current,{top:g,left:v}=x.getBoundingClientRect(),b=s.clientX-v,w=s.clientY-g;at("contextMenu","openContextMenu",f),this.setState({...h&&!this.state.selectedElementIds[h.id]?{...this.state,...bn({editingGroupId:this.state.editingGroupId,selectedElementIds:{[h.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:Te(h)?new ae(h,this.scene.getNonDeletedElementsMap()):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:w,left:b,items:this.getContextMenuItems(f)}})})}),L(this,"maybeDragNewGenericElement",(s,d,u=!0)=>{let h=this.state.selectionElement,m=s.lastCoords;if(h&&s.boxSelection.hasOccurred&&this.state.activeTool.type!=="eraser"){v3({newElement:h,elementType:this.state.activeTool.type,originX:s.origin.x,originY:s.origin.y,x:m.x,y:m.y,width:Jc(s.origin.x,m.x),height:Jc(s.origin.y,m.y),shouldMaintainAspectRatio:ju(d),shouldResizeFromCenter:!1,scene:this.scene,zoom:this.state.zoom.value,informMutation:!1});return}let p=this.state.newElement;if(!p)return;let[f,x]=hr(m.x,m.y,d[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=Ns(p)&&this.imageCache.get(p.fileId)?.image,v=g&&!(g instanceof Promise)?g.width/g.height:null;this.maybeCacheReferenceSnapPoints(d,[p]);let{snapOffset:b,snapLines:w}=koe(p,this,d,{x:s.originInGrid.x+(this.state.originSnapOffset?.x??0),y:s.originInGrid.y+(this.state.originSnapOffset?.y??0)},{x:f-s.originInGrid.x,y:x-s.originInGrid.y},this.scene.getNonDeletedElementsMap());f+=b.x,x+=b.y,this.setState({snapLines:w}),Mr(p)||v3({newElement:p,elementType:this.state.activeTool.type,originX:s.originInGrid.x,originY:s.originInGrid.y,x:f,y:x,width:Jc(s.originInGrid.x,f),height:Jc(s.originInGrid.y,x),shouldMaintainAspectRatio:ft(p)?!ju(d):ju(d),shouldResizeFromCenter:XE(d),zoom:this.state.zoom.value,scene:this.scene,widthAspectRatio:v,originOffset:this.state.originSnapOffset,informMutation:u}),this.setState({newElement:p}),(this.state.activeTool.type===rn.frame||this.state.activeTool.type===rn.magicframe)&&this.setState({elementsToHighlight:da(this.scene.getNonDeletedElements(),p,this.state,this.scene.getNonDeletedElementsMap())})}),L(this,"maybeHandleCrop",(s,d)=>{if(!this.state.croppingElementId)return!1;let u=s.resize.handleType,h=s.lastCoords,[m,p]=hr(h.x-s.resize.offset.x,h.y-s.resize.offset.y,d[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),f=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(u&&f&&ft(f)){let x=s.originalElements.get(f.id),g=Ns(f)&&this.imageCache.get(f.fileId)?.image;if(x&&ft(x)&&g&&!(g instanceof Promise)){let[v,b]=hr(h.x,h.y,d[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w={x:v-s.originInGrid.x,y:b-s.originInGrid.y};this.maybeCacheReferenceSnapPoints(d,[f]);let{snapOffset:S,snapLines:_}=hU([f],[x],this,d,w,u);this.scene.mutateElement(f,d8(f,this.scene.getNonDeletedElementsMap(),u,g.naturalWidth,g.naturalHeight,m+S.x,p+S.y,d.shiftKey?x.width/x.height:void 0)),mi(f,this.scene),this.setState({isCropping:u&&u!=="rotation",snapLines:_})}return!0}return!1}),L(this,"maybeHandleResize",(s,d)=>{let u=this.scene.getSelectedElements(this.state),h=u.filter(v=>he(v)),m=s.resize.handleType;if(h.length>0&&m==="rotation"||u.length===1&&ze(u[0])||this.state.croppingElementId)return!1;this.setState({isResizing:m&&m!=="rotation",isRotating:m==="rotation",activeEmbeddable:null});let p=s.lastCoords,[f,x]=hr(p.x-s.resize.offset.x,p.y-s.resize.offset.y,d[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=new Map;if(h.forEach(v=>{pi(this.scene.getNonDeletedElements(),v.id).forEach(b=>{g.set(v.id+b.id,{x:b.x-v.x,y:b.y-v.y})})}),!this.state.selectedElementsAreBeingDragged){let[v,b]=hr(p.x,p.y,d[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w={x:v-s.originInGrid.x,y:b-s.originInGrid.y},S=[...s.originalElements.values()];this.maybeCacheReferenceSnapPoints(d,u);let{snapOffset:_,snapLines:C}=hU(u,Re(S,this.state),this,d,w,m);f+=_.x,x+=_.y,this.setState({snapLines:C})}if(LA(s.originalElements,m,u,this.scene,Gp(d),XE(d),u.some(v=>ft(v))?!ju(d):ju(d),f,x,s.resize.center.x,s.resize.center.y)){let v=new Set;return h.forEach(b=>{da(this.scene.getNonDeletedElements(),b,this.state,this.scene.getNonDeletedElementsMap()).forEach(w=>v.add(w))}),this.setState({elementsToHighlight:[...v]}),!0}return!1}),L(this,"getContextMenuItems",s=>{let d=[];if(d.push(FP,BP),s==="canvas")return this.state.viewModeEnabled?[...d,VC,jx,Wx,Vx]:[PP,jn,FP,BP,HP,jn,sne,Vre,jn,VC,SF,CF,_F,jx,Wx,Vx];if(d.push(HP),this.state.viewModeEnabled)return[Tx,...d];let u=this.editorInterface.formFactor==="desktop"?[jn,ane,ine,one,lne]:[];return[jn,UP,Tx,PP,jn,uoe,hoe,moe,jn,doe,jn,...d,jn,xre,wre,jn,Sre,goe,Lre,Rre,zre,Cre,jn,Mre,...u,jn,Are,Dre,jn,fx,jn,AF,OF,jn,cne,DF,jn,kB]}),L(this,"handleWheel",en(s=>{if(!(s.target instanceof HTMLCanvasElement||s.target instanceof HTMLTextAreaElement||s.target instanceof HTMLIFrameElement||s.target instanceof HTMLElement&&s.target.classList.contains(vt.FRAME_NAME))){s[D.CTRL_OR_CMD]&&s.preventDefault();return}if(s.preventDefault(),n1)return;let{deltaX:d,deltaY:u}=s;if(s.metaKey||s.ctrlKey){let h=Math.sign(u),m=Hu*100,p=Math.abs(u),f=u;p>m&&(f=m*h);let x=this.state.zoom.value-f/100;x+=Math.log10(Math.max(1,this.state.zoom.value))*-h*Math.min(1,p/20),this.translateCanvas(g=>({...Yd({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Ml(x)},g),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(s.shiftKey){this.translateCanvas(({zoom:h,scrollX:m})=>({scrollX:m-(u||d)/h.value}));return}this.translateCanvas(({zoom:h,scrollX:m,scrollY:p})=>({scrollX:m-d/h.value,scrollY:p-u/h.value}))})),L(this,"savePointer",(s,d,u)=>{if(!s||!d)return;let{x:h,y:m}=dt({clientX:s,clientY:d},this.state);isNaN(h)||isNaN(m);let p={x:h,y:m,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};this.props.onPointerUpdate?.({pointer:p,button:u,pointersMap:Je.pointers})}),L(this,"resetShouldCacheIgnoreZoomDebounced",Qc(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),L(this,"updateDOMRect",s=>{if(this.excalidrawContainerRef?.current){let d=this.excalidrawContainerRef.current,{width:u,height:h,left:m,top:p}=d.getBoundingClientRect(),{width:f,height:x,offsetTop:g,offsetLeft:v}=this.state;if(u===f&&h===x&&m===v&&p===g){s&&s();return}this.setState({width:u,height:h,offsetLeft:m,offsetTop:p},()=>{s&&s()})}}),L(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})}),L(this,"watchState",()=>{});let n=ih(),{viewModeEnabled:r=!1,zenModeEnabled:a=!1,gridModeEnabled:i=!1,objectsSnapModeEnabled:o=!1,theme:l=n.theme,name:c=`${E("labels.untitled")}-${ZE()}`}=t;this.state={...n,theme:l,exportWithDarkMode:l===se.DARK,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:r,zenModeEnabled:a,objectsSnapModeEnabled:o,gridModeEnabled:i??n.gridModeEnabled,name:c,width:window.innerWidth,height:window.innerHeight},this.refreshEditorInterface(),this.stylesPanelMode=Xc(this.editorInterface),this.id=c8(),this.library=new yae(this),this.actionManager=new boe(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new b3,this.canvas=document.createElement("canvas"),this.rc=HA.canvas(this.canvas),this.renderer=new mU(this.scene),this.visibleElements=[],this.store=new iA(this),this.history=new iU(this.store),this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new lh(this.scene),this.history=new iU(this.store),this.actionManager.registerAll(zC),this.actionManager.registerAction(poe(this.history)),this.actionManager.registerAction(foe(this.history)),this.api=this.createExcalidrawAPI()}createExcalidrawAPI(){return{isDestroyed:!1,updateScene:this.updateScene,applyDeltas:this.applyDeltas,mutateElement:this.mutateElement,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,getSceneElementsMapIncludingDeleted:this.getSceneElementsMapIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:t=>{this.actionManager.registerAction(t)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,getEditorInterface:()=>this.editorInterface,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:t=>this.onChangeEmitter.on(t),onIncrement:t=>this.store.onStoreIncrementEmitter.on(t),onPointerDown:t=>this.onPointerDownEmitter.on(t),onPointerUp:t=>this.onPointerUpEmitter.on(t),onScrollChange:t=>this.onScrollChangeEmitter.on(t),onUserFollow:t=>this.onUserFollowEmitter.on(t),onStateChange:this.onStateChange,onEvent:this.onEvent}}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,a=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!a)break;for(let i of a)i.contentWindow===t.source&&(r=i.contentWindow);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,a=n.info.playerState;Object.values(Bp).includes(a)&&TC.set(r,a)}break}}handleSkipBindMode(){if(this.state.selectedLinearElement?.initialState&&!this.state.selectedLinearElement.initialState.arrowStartIsInside){ut(this.lastPointerMoveCoords,"Missing last pointer move coords when changing bind skip mode for arrow start");let t=this.scene.getNonDeletedElementsMap(),n=hi(N(this.lastPointerMoveCoords.x,this.lastPointerMoveCoords.y),this.scene.getNonDeletedElements(),t),r=ae.getElement(this.state.selectedLinearElement.elementId,t);r?.startBinding&&n?.id===r.startBinding.elementId&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,initialState:{...this.state.selectedLinearElement.initialState,arrowStartIsInside:!0}}})}if(this.state.bindMode==="orbit"&&(this.bindModeHandler&&(clearTimeout(this.bindModeHandler),this.bindModeHandler=null),(0,$r.flushSync)(()=>{this.setState({bindMode:"skip"})}),this.lastPointerMoveCoords&&this.state.selectedLinearElement?.selectedPointsIndices&&this.state.selectedLinearElement?.selectedPointsIndices.length)){let{x:t,y:n}=this.lastPointerMoveCoords,r=this.lastPointerMoveEvent??this.lastPointerDownEvent?.nativeEvent;ut(r,"Last event must exist");let a=t-this.state.selectedLinearElement.pointerOffset.x,i=n-this.state.selectedLinearElement.pointerOffset.y,o=this.state.multiElement?ae.handlePointerMove(r,this,a,i,this.state.selectedLinearElement):ae.handlePointDragging(r,this,a,i,this.state.selectedLinearElement);o&&this.setState(o)}}resetDelayedBindMode(){this.bindModeHandler&&(clearTimeout(this.bindModeHandler),this.bindModeHandler=null),this.state.bindMode!=="orbit"&&setTimeout(()=>this.setState({bindMode:"orbit"}))}handleDelayedBindModeChange(t,n){if(t.isDeleted||ze(t))return;let r=()=>{if(this.bindModeHandler=null,ut(this.lastPointerMoveCoords,"Expected lastPointerMoveCoords to be set"),!this.state.multiElement){if(!this.state.selectedLinearElement||!this.state.selectedLinearElement.selectedPointsIndices||!this.state.selectedLinearElement.selectedPointsIndices.length)return;let m=this.state.selectedLinearElement.selectedPointsIndices.includes(0),p=this.state.selectedLinearElement.selectedPointsIndices.includes(t.points.length-1);if(!m&&!p||m&&p)return}let{x:d,y:u}=this.lastPointerMoveCoords,h=hi(N(d,u),this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap());if(h&&this.state.bindMode!=="skip"){ut(this.state.selectedLinearElement?.elementId===t.id,"The selectedLinearElement is expected to not change while a bind mode timeout is ticking");let m=this.state.selectedLinearElement.initialState.arrowStartIsInside||t.startBinding?.elementId===h.id;(0,$r.flushSync)(()=>{ut(this.state.selectedLinearElement,"this.state.selectedLinearElement must exist"),this.setState({bindMode:"inside",selectedLinearElement:{...this.state.selectedLinearElement,initialState:{...this.state.selectedLinearElement.initialState,arrowStartIsInside:m}}})});let p=this.lastPointerMoveEvent??this.lastPointerDownEvent?.nativeEvent;ut(p,"Last event must exist");let f=d-this.state.selectedLinearElement.pointerOffset.x,x=u-this.state.selectedLinearElement.pointerOffset.y,g=this.state.multiElement?ae.handlePointerMove(p,this,f,x,this.state.selectedLinearElement):ae.handlePointDragging(p,this,f,x,this.state.selectedLinearElement);g&&this.setState(g)}},a=!1;if(this.state.selectedLinearElement?.selectedPointsIndices){let d=this.scene.getNonDeletedElementsMap(),u=this.state.selectedLinearElement.selectedPointsIndices.includes(0),h=this.state.selectedLinearElement.selectedPointsIndices.includes(t.points.length-1),m=u?n:t.startBinding&&d.get(t.startBinding.elementId),p=h?n:t.endBinding&&d.get(t.endBinding.elementId),f=m&&Fs(m,d),x=p&&Fs(p,d);a=!!(f&&x&&m.id!==p.id&&Qu(f,x))}let i=this.state.selectedLinearElement?.selectedPointsIndices?.includes(0),o=this.state.selectedLinearElement?.selectedPointsIndices?.includes(t.points.length-1),l=i?"startBinding":o?"endBinding":null,c=i?"endBinding":o?"startBinding":null,s=c&&t[c]?.mode==="inside"&&t[c]?.elementId===n?.id||l&&t[l]?.mode==="inside"&&n?.id===t[l]?.elementId;l&&c&&t[l]?.mode==="inside"&&n?.id!==t[l]?.elementId&&t[c]?.elementId!==t[l]?.elementId&&this.scene.mutateElement(t,{[l]:{...t[l],mode:"orbit"}},{informMutation:!1,isDragging:!0}),!n||this.previousHoveredBindableElement&&n.id!==this.previousHoveredBindableElement.id?(this.bindModeHandler&&(clearTimeout(this.bindModeHandler),this.bindModeHandler=null),this.state.bindMode==="inside"&&(0,$r.flushSync)(()=>{this.setState({bindMode:"orbit"})}),this.previousHoveredBindableElement=null):!this.bindModeHandler&&(!this.state.newElement||!t.startBinding||a)&&!s&&(this.bindModeHandler=setTimeout(r,Is)),this.previousHoveredBindableElement=n}cacheEmbeddableRef(t,n){n&&this.iFrameRefs.set(t.id,n)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleIframeLikeCenterClick(){if(!this.lastPointerDownEvent||!this.lastPointerUpEvent||this.lastPointerDownEvent.button!==Xi.MAIN||Cc||!QE(this.state.activeTool.type,["laser","selection","lasso"]))return!1;let t=N(dt({clientX:this.lastPointerDownEvent.clientX,clientY:this.lastPointerDownEvent.clientY},this.state)),n=N(dt({clientX:this.lastPointerUpEvent.clientX,clientY:this.lastPointerUpEvent.clientY},this.state));if(Cr(t,n)>Uu)return!1;let r=this.getElementAtPosition(t[0],t[1]);if(!(r&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<=300&&Je.pointers.size<2&&ob(r)&&(this.state.viewModeEnabled||this.state.activeTool.type==="laser"||this.isIframeLikeElementCenter(r,this.lastPointerUpEvent,n[0],n[1]))))return!1;let a=r;if(this.state.activeEmbeddable?.element===a&&this.state.activeEmbeddable?.state==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:a,state:"active"},selectedElementIds:{[a.id]:!0},newElement:null,selectionElement:null})},100),ed(a)))return!0;let i=this.getHTMLIFrameElement(a);if(!i?.contentWindow)return!0;if(i.src.includes("youtube")){let o=TC.get(a.id);switch(o||(TC.set(a.id,Bp.UNSTARTED),i.contentWindow.postMessage(JSON.stringify({event:"listening",id:a.id}),"*")),o){case Bp.PLAYING:case Bp.BUFFERING:i.contentWindow?.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:i.contentWindow?.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}return i.src.includes("player.vimeo.com")&&i.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*"),!0}isIframeLikeElementCenter(t,n,r,a){return t&&!n.altKey&&!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&(this.state.activeEmbeddable?.element!==t||this.state.activeEmbeddable?.state==="hover"||!this.state.activeEmbeddable)&&r>=t.x+t.width/3&&r<=t.x+2*t.width/3&&a>=t.y+t.height/3&&a<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,n=this.state.width,r=this.state.height,a=this.scene.getNonDeletedElements().filter(i=>Tr(i)&&this.embedsValidationStatus.get(i.id)===!0||ed(i));return(0,Ne.jsx)(Ne.Fragment,{children:a.map(i=>{let{x:o,y:l}=zn({sceneX:i.x,sceneY:i.y},this.state),c=df(i,n,r,this.state,this.scene.getNonDeletedElementsMap()),s=this.initializedEmbeds.has(i.id);if(c&&!s&&this.initializedEmbeds.add(i.id),!(c||s))return null;let d;if(ed(i)){d=null;let m=(i.customData?.generationData??this.magicGenerations.get(i.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(m.status==="done"){let p=m.html;d={intrinsicSize:{w:i.width,h:i.height},type:"document",srcdoc:()=>p}}else if(m.status==="pending")d={intrinsicSize:{w:i.width,h:i.height},type:"document",srcdoc:()=>w3(`
|
|
88
|
-
<style>
|
|
89
|
-
html, body {
|
|
90
|
-
width: 100%;
|
|
91
|
-
height: 100%;
|
|
92
|
-
color: ${this.state.theme===se.DARK?"white":"black"};
|
|
93
|
-
}
|
|
94
|
-
body {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: center;
|
|
98
|
-
flex-direction: column;
|
|
99
|
-
gap: 1rem;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.Spinner {
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
margin-left: auto;
|
|
107
|
-
margin-right: auto;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.Spinner svg {
|
|
111
|
-
animation: rotate 1.6s linear infinite;
|
|
112
|
-
transform-origin: center center;
|
|
113
|
-
width: 40px;
|
|
114
|
-
height: 40px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.Spinner circle {
|
|
118
|
-
stroke: currentColor;
|
|
119
|
-
animation: dash 1.6s linear 0s infinite;
|
|
120
|
-
stroke-linecap: round;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@keyframes rotate {
|
|
124
|
-
100% {
|
|
125
|
-
transform: rotate(360deg);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@keyframes dash {
|
|
130
|
-
0% {
|
|
131
|
-
stroke-dasharray: 1, 300;
|
|
132
|
-
stroke-dashoffset: 0;
|
|
133
|
-
}
|
|
134
|
-
50% {
|
|
135
|
-
stroke-dasharray: 150, 300;
|
|
136
|
-
stroke-dashoffset: -200;
|
|
137
|
-
}
|
|
138
|
-
100% {
|
|
139
|
-
stroke-dasharray: 1, 300;
|
|
140
|
-
stroke-dashoffset: -280;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
</style>
|
|
144
|
-
<div class="Spinner">
|
|
145
|
-
<svg
|
|
146
|
-
viewBox="0 0 100 100"
|
|
147
|
-
>
|
|
148
|
-
<circle
|
|
149
|
-
cx="50"
|
|
150
|
-
cy="50"
|
|
151
|
-
r="46"
|
|
152
|
-
stroke-width="8"
|
|
153
|
-
fill="none"
|
|
154
|
-
stroke-miter-limit="10"
|
|
155
|
-
/>
|
|
156
|
-
</svg>
|
|
157
|
-
</div>
|
|
158
|
-
<div>Generating...</div>
|
|
159
|
-
`)};else{let p;m.code==="ERR_GENERATION_INTERRUPTED"?p="Generation was interrupted...":p=m.message||"Generation failed",d={intrinsicSize:{w:i.width,h:i.height},type:"document",srcdoc:()=>w3(`
|
|
160
|
-
<style>
|
|
161
|
-
html, body {
|
|
162
|
-
height: 100%;
|
|
163
|
-
}
|
|
164
|
-
body {
|
|
165
|
-
display: flex;
|
|
166
|
-
flex-direction: column;
|
|
167
|
-
align-items: center;
|
|
168
|
-
justify-content: center;
|
|
169
|
-
color: ${_r.red[3]};
|
|
170
|
-
}
|
|
171
|
-
h1, h3 {
|
|
172
|
-
margin-top: 0;
|
|
173
|
-
margin-bottom: 0.5rem;
|
|
174
|
-
}
|
|
175
|
-
</style>
|
|
176
|
-
<h1>Error!</h1>
|
|
177
|
-
<h3>${p}</h3>
|
|
178
|
-
`)}}}else d=sd(JE(i.link||""));let u=this.state.activeEmbeddable?.element===i&&this.state.activeEmbeddable?.state==="active",h=this.state.activeEmbeddable?.element===i&&this.state.activeEmbeddable?.state==="hover";return(0,Ne.jsx)("div",{className:H("excalidraw__embeddable-container",{"is-hovered":h}),style:{transform:c?`translate(${o-this.state.offsetLeft}px, ${l-this.state.offsetTop}px) scale(${t})`:"none",display:c?"block":"none",opacity:Q8(i,id(i,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,this.state.openDialog?.name==="elementLinkSelector"?PM:1),"--embeddable-radius":`${y8(Math.min(i.width,i.height),i)}px`},children:(0,Ne.jsxs)("div",{className:"excalidraw__embeddable-container__inner",style:{width:c?`${i.width}px`:0,height:c?`${i.height}px`:0,transform:c?`rotate(${i.angle}rad)`:"none",pointerEvents:u?$c.enabled:$c.disabled},children:[h&&(0,Ne.jsx)("div",{className:"excalidraw__embeddable-hint",children:E("buttons.embeddableInteractionButton")}),(0,Ne.jsx)("div",{className:"excalidraw__embeddable__outer",style:{padding:`${i.strokeWidth}px`},children:(Tr(i)?this.props.renderEmbeddable?.(i,this.state):null)??(0,Ne.jsx)("iframe",{ref:m=>this.cacheEmbeddableRef(i,m),className:"excalidraw__embeddable",srcDoc:d?.type==="document"?d.srcdoc(this.state.theme):void 0,src:d?.type!=="document"?d?.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:`${d?.sandbox?.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},i.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:n,renderTopLeftUI:r,renderCustomStats:a}=this.props,i=this.scene.getSceneNonce(),{elementsMap:o,visibleElements:l}=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:this.state.newElement?.id});this.visibleElements=l;let c=this.scene.getNonDeletedElementsMap(),s="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],u=Qa.get(rs)?.type==="panel";return(0,Ne.jsx)("div",{translate:"no",className:H("excalidraw excalidraw-container notranslate",{"excalidraw--view-mode":this.state.viewModeEnabled||this.state.openDialog?.name==="elementLinkSelector","excalidraw--mobile":this.editorInterface.formFactor==="phone"}),style:{"--ui-pointerEvents":s?$c.disabled:$c.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:(0,Ne.jsx)(kV.Provider,{value:this.api,children:(0,Ne.jsx)(CV.Provider,{value:this,children:(0,Ne.jsx)(_V.Provider,{value:this.props,children:(0,Ne.jsx)(wk.Provider,{value:this.excalidrawContainerValue,children:(0,Ne.jsx)(xk.Provider,{value:this.editorInterface,children:(0,Ne.jsx)(Ck.Provider,{value:this.setAppState,children:(0,Ne.jsx)(Sk.Provider,{value:this.state,children:(0,Ne.jsxs)(Ek.Provider,{value:this.scene.getNonDeletedElements(),children:[(0,Ne.jsxs)(_k.Provider,{value:this.actionManager,children:[(0,Ne.jsx)(nde,{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:y1().code,renderTopLeftUI:r,renderTopRightUI:n,renderCustomStats:a,showExitZenModeBtn:typeof this.props?.zenModeEnabled>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type===this.state.preferredSelectionTool.type&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),(0,Ne.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,Ne.jsx)("div",{className:"excalidraw-contextMenuContainer"}),(0,Ne.jsx)("div",{className:"excalidraw-eye-dropper-container"}),(0,Ne.jsx)(ade,{trails:[this.laserTrails,this.lassoTrail,this.eraserTrail]}),t.length===1&&this.state.openDialog?.name!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&(0,Ne.jsx)(Bre,{element:d,scene:this.scene,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},d.id),this.props.aiEnabled!==!1&&t.length===1&&lb(d)&&(0,Ne.jsx)(pU,{element:d,elementsMap:o,children:(0,Ne.jsx)(EC,{title:E("labels.convertToCode"),icon:Ux,checked:!1,onChange:()=>this.onMagicFrameGenerate(d,"button")})}),t.length===1&&ed(d)&&d.customData?.generationData?.status==="done"&&(0,Ne.jsxs)(pU,{element:d,elementsMap:o,children:[(0,Ne.jsx)(EC,{title:E("labels.copySource"),icon:__,checked:!1,onChange:()=>this.onIframeSrcCopy(d)}),(0,Ne.jsx)(EC,{title:"Enter fullscreen",icon:Tte,checked:!1,onChange:()=>{let h=this.getHTMLIFrameElement(d);if(h)try{h.requestFullscreen(),this.setState({activeEmbeddable:{element:d,state:"active"},selectedElementIds:{[d.id]:!0},newElement:null,selectionElement:null})}catch(m){console.warn(m),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.contextMenu&&(0,Ne.jsx)(Sle,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:h=>{this.setState({contextMenu:null},()=>{this.focusContainer(),h?.()})}}),(0,Ne.jsx)(Ade,{canvas:this.canvas,rc:this.rc,elementsMap:o,allElementsMap:c,visibleElements:l,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:I1(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes,theme:this.state.theme}}),this.state.newElement&&(0,Ne.jsx)(Rde,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:o,allElementsMap:c,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null,theme:this.state.theme}}),(0,Ne.jsx)(kde,{app:this,containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:o,visibleElements:l,allElementsMap:c,selectedElements:t,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderScrollbars:this.props.renderScrollbars===!0,editorInterface:this.editorInterface,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&&(0,Ne.jsx)(_le,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames(),this.state.activeLockedId&&(0,Ne.jsx)(zde,{app:this,activeLockedId:this.state.activeLockedId}),u&&(0,Ne.jsx)(tae,{app:this})]}),this.renderEmbeddables()]})})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,n){let r=this.plugins.diagramToCode?.generate;if(!r){this.setState({errorMessage:"No diagram to code plugin found"});return}let a=Cb(this.scene.getNonDeletedElements(),t).filter(o=>!lb(o));if(!a.length){n==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),at("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let i=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(i){this.updateMagicGeneration({frameElement:i,data:{status:"pending"}}),this.setState({selectedElementIds:{[i.id]:!0}}),at("ai","generate (start)","d2c");try{let{html:o}=await r({frame:t,children:a});if(at("ai","generate (success)","d2c"),!o.trim()){this.updateMagicGeneration({frameElement:i,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let l=o.includes("<!DOCTYPE html>")&&o.includes("</html>")?o.slice(o.indexOf("<!DOCTYPE html>"),o.indexOf("</html>")+7):o;this.updateMagicGeneration({frameElement:i,data:{status:"done",html:l}})}catch(o){at("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:i,data:{status:"error",code:"ERR_OAI",message:o.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){t.customData?.generationData?.status==="done"&&(Y1(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=>{Ns(r)&&n[r.fileId]&&(this.imageCache.delete(r.fileId),Ro.delete(r))})}async componentDidMount(){if(this.unmounted=!1,this.api=this.createExcalidrawAPI(),this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,xl()||qn()){let n=this.setState.bind(this);Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...r)=>this.setState(...r)},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.onDurableIncrementEmitter.on(n=>{this.history.record(n.delta)}),this.props.onIncrement&&this.store.onStoreIncrementEmitter.on(n=>{this.props.onIncrement?.(n)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),F0&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorInterface(),this.updateDOMRect()}),this.resizeObserver?.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),GM()&&!C8()&&this.setState({errorMessage:(0,Ne.jsx)(wle,{})});let t={excalidrawAPI:this.api,container:this.excalidrawContainerRef.current};this.editorLifecycleEvents.emit("editor:mount",t),this.props.onMount?.(t),this.props.onExcalidrawAPI?.(this.api)}componentWillUnmount(){this.api={...this.api,isDestroyed:!0};for(let t of Object.keys(this.api))(t.startsWith("get")||t==="onStateChange"||t==="onEvent")&&typeof this.api[t]=="function"&&(this.api[t]=()=>{throw new Error("ExcalidrawAPI is no longer usable after the editor has been unmounted and will return invalid/empty data. You should check for `ExcalidrawAPI.isDestroyed` before calling get* methods on subscribing to state/event changes.")});this.editorLifecycleEvents.emit("editor:unmount"),this.props.onUnmount?.(),this.props.onExcalidrawAPI?.(null),window.launchQueue?.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new b3,this.fonts=new lh(this.scene),this.renderer=new mU(this.scene),this.files={},this.imageCache.clear(),this.resizeObserver?.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),this.store.onDurableIncrementEmitter.clear(),this.appStateObserver.clear(),this.editorLifecycleEvents.clear(),Ro.destroy(),ns.destroy(),clearTimeout(_c),vn.clearCache(),bn.clearCache(),_c=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(xt(document,Q.KEYDOWN,this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(xt(this.excalidrawContainerRef.current,Q.WHEEL,this.handleWheel,{passive:!1}),xt(window,Q.MESSAGE,this.onWindowMessage,!1),xt(document,Q.POINTER_UP,this.removePointer,{passive:!1}),xt(document,Q.COPY,this.onCopy,{passive:!1}),xt(document,Q.KEYUP,this.onKeyUp,{passive:!0}),xt(document,Q.POINTER_MOVE,this.updateCurrentCursorPosition,{passive:!1}),xt(document.fonts,"loadingdone",t=>{let n=t.fontfaces;this.fonts.onLoaded(n)},{passive:!1}),xt(document,Q.GESTURE_START,this.onGestureStart,!1),xt(document,Q.GESTURE_CHANGE,this.onGestureChange,!1),xt(document,Q.GESTURE_END,this.onGestureEnd,!1),xt(window,Q.FOCUS,()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(xt(document,Q.FULLSCREENCHANGE,this.onFullscreenChange,{passive:!1}),xt(document,Q.PASTE,this.pasteFromClipboard,{passive:!1}),xt(document,Q.CUT,this.onCut,{passive:!1}),xt(window,Q.RESIZE,this.onResize,!1),xt(window,Q.UNLOAD,this.onUnload,!1),xt(window,Q.BLUR,this.onBlur,!1),xt(this.excalidrawContainerRef.current,Q.WHEEL,this.handleWheel,{passive:!1}),xt(this.excalidrawContainerRef.current,Q.DRAG_OVER,this.disableEvent,!1),xt(this.excalidrawContainerRef.current,Q.DROP,this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(xt(JM(this.excalidrawContainerRef.current),Q.SCROLL,this.onScroll,{passive:!1})))}componentDidUpdate(t,n){!this._initialized&&!this.state.isLoading&&(this._initialized=!0,this.editorLifecycleEvents.emit("editor:initialize",this.api),this.props.onInitialize?.(this.api)),this.appStateObserver.flush(n),this.updateEmbeddables();let r=this.scene.getElementsIncludingDeleted(),a=this.scene.getElementsMapIncludingDeleted(),i=(this.sessionExportThemeOverride??this.state.theme)===se.DARK;this.state.exportWithDarkMode!==i&&this.setState({exportWithDarkMode:i}),!this.state.showWelcomeScreen&&!r.length&&this.setState({showWelcomeScreen:!0}),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)&&(this.props?.onScrollChange?.(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&&to(this.state)&&this.setState({activeTool:tt(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&n.theme!==this.state.theme&&lF(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(),to(n)&&!to(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()),(n.openDialog?.name==="elementLinkSelector"||this.state.openDialog?.name==="elementLinkSelector")&&n.openDialog?.name!==this.state.openDialog?.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}),this.excalidrawContainerRef.current?.classList.toggle("theme--dark",this.state.theme===se.DARK),this.state.selectedLinearElement?.isEditing&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&setTimeout(()=>{this.state.selectedLinearElement?.isEditing&&this.actionManager.executeAction(qa)}),this.state.editingTextElement?.isDeleted&&this.setState({editingTextElement:null}),this.store.commit(a,this.state),this.state.isLoading||(this.props.onChange?.(r,this.state,this.files),this.onChangeEmitter.trigger(r,this.state,this.files))}static resetTapTwice(){e1=!1,t1=null}async insertClipboardContent(t,n,r){let{x:a,y:i}=dt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state);if(t.errorMessage){this.setState({errorMessage:t.errorMessage});return}if(n.length===0&&!r&&t.mixedContent){await this.addElementsFromMixedContentPaste(t.mixedContent,{isPlainPaste:r,sceneX:a,sceneY:i});return}if(!r&&t.text){let s=ble(t.text);if(s.ok){this.setState({openDialog:{name:"charts",data:s.data,rawText:t.text}});return}}let o=n.map(s=>s.file);if(o.length===0&&t.text&&!r){let s=t.text.trim();s.startsWith("<svg")&&s.endsWith("</svg>")&&o.push(j3(s))}if(o.length>0){this.isToolSupported("image")?await this.insertImages(o,a,i):this.setState({errorMessage:E("errors.imageToolNotSupported")});return}if(t.elements){let s=t.programmaticAPI?ah(t.elements):t.elements;this.addElementsFromPasteOrLibrary({elements:s,files:t.files||null,position:this.editorInterface.formFactor==="desktop"?"cursor":"center",retainSeed:r});return}if(!t.text)return;if(!r&&zoe(t.text)){let s=await import("./chunks/excalidraw-mermaid-stub-NYXTOJ4H.js");try{let{elements:d,files:u={}}=await s.parseMermaidToExcalidraw(t.text),h=ah(d,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:h,files:u,position:this.editorInterface.formFactor==="desktop"?"cursor":"center"});return}catch(d){console.warn(`parsing pasted text as mermaid definition failed: ${d.message}`)}}let l=l8(t.text).split(/\n+/).map(s=>s.trim()).filter(Boolean),c=l.map(s=>bA(s)).filter(s=>nh(s,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(s)||sd(s)?.type==="video"));if(!r&&c.length>0&&c.length===l.length){let s=[];for(let d of c){let u=s[s.length-1],h=this.insertEmbeddableElement({sceneX:u?u.x+u.width+20:a,sceneY:i,link:Qi(d)});h&&s.push(h)}s.length&&(this.store.scheduleCapture(),this.setState({selectedElementIds:Object.fromEntries(s.map(d=>[d.id,!0]))}));return}this.addTextFromPaste(t.text,r)}async addElementsFromMixedContentPaste(t,{isPlainPaste:n,sceneX:r,sceneY:a}){if(!n&&t.some(i=>i.type==="imageUrl")&&this.isToolSupported("image")){let i=t.filter(s=>s.type==="imageUrl").map(s=>s.value),o=await Promise.all(i.map(async s=>{try{return{file:await d7(s)}}catch(d){let u=d.message;return d.cause==="FETCH_ERROR"?u=E("errors.failedToFetchImage"):d.cause==="UNSUPPORTED"&&(u=E("errors.unsupportedFileType")),{errorMessage:u}}})),l=o.filter(s=>!!s.file).map(s=>s.file);await this.insertImages(l,r,a);let c=o.find(s=>!!s.errorMessage);c&&c.errorMessage&&this.setState({errorMessage:c.errorMessage})}else{let i=t.filter(o=>o.type==="text");i.length&&this.addTextFromPaste(i.map(o=>o.value).join(`
|
|
179
|
-
|
|
180
|
-
`),n)}}addTextFromPaste(t,n=!1){let{x:r,y:a}=dt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),i={x:r,y:a,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:H0,verticalAlign:PE,locked:!1},o=Mt({fontSize:i.fontSize,fontFamily:i.fontFamily}),l=jr(i.fontFamily),[c,,s]=g3(this.state),d=Math.max(Math.min((s-c)*.5,800),200),u=10,h=a,m=n?[t]:t.split(`
|
|
181
|
-
`),p=m.reduce((f,x,g)=>{let v=qp(x).trim();if(v.length){let b=this.getTopLayerFrameAtSceneCoords({x:r,y:h}),w=kt(v,o,l),S=w.width>d,_=S?Cl(v,o,d):v;w=S?kt(_,o,l):w;let C=r-w.width/2,k=h-w.height/2,T=mr({...i,x:C,y:k,text:_,originalText:v,lineHeight:l,autoResize:!S,frameId:b?b.id:null});f.push(T),h+=T.height+u}else m[g-1]?.trim()&&(h+=_8(i.fontSize,l)+u);return f},[]);p.length!==0&&(this.scene.insertElements(p),this.store.scheduleCapture(),this.setState({selectedElementIds:nt(Object.fromEntries(p.map(f=>[f.id,!0])),this.state)}),!n&&p.length>1&&tB===!1&&this.editorInterface.formFactor!=="phone"&&(this.setToast({message:E("toast.pasteAsSingleElement",{shortcut:Y("CtrlOrCmd+Shift+V")}),duration:5e3}),tB=!0))}handleTextWysiwyg(t,{isExistingElement:n=!1}){let r=this.scene.getElementsMapIncludingDeleted(),a=(i,o)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(l=>l.id===t.id&&oe(l)?pe(l,{originalText:i,isDeleted:o??l.isDeleted,...pA(l,ui(l,r),r,i)}):l)])};Roe({id:t.id,canvas:this.canvas,getViewportCoords:(i,o)=>{let{x:l,y:c}=zn({sceneX:i,sceneY:o},this.state);return[l-this.state.offsetLeft,c-this.state.offsetTop]},onChange:en(i=>{a(i,!1),D3(t)&&mi(t,this.scene)}),onSubmit:en(({viaKeyboard:i,nextOriginalText:o})=>{let l=!o.trim();if(a(o,l),!l&&i){let c=t.containerId?t.containerId:t.id;(0,$r.flushSync)(()=>{this.setState(s=>({selectedElementIds:nt({...s.selectedElementIds,[c]:!0},s)}))})}l&&vb(this.scene.getNonDeletedElements(),[t]),(!l||n)&&this.store.scheduleCapture(),(0,$r.flushSync)(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&Xo(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.editorInterface.isTouchScreen}),this.deselectElements(),a(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:nt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,n){let r=this.getElementAtPosition(t,n,{includeBoundTextElement:!0});return r&&oe(r)&&!r.isDeleted?r:null}getElementAtPosition(t,n,r){let a=[];if(r&&"allHitElements"in r?a=r?.allHitElements||[]:a=this.getElementsAtPosition(t,n,{includeBoundTextElement:r?.includeBoundTextElement,includeLockedElements:r?.includeLockedElements}),a.length>1){if(r?.preferSelected){for(let o=a.length-1;o>-1;o--)if(this.state.selectedElementIds[a[o].id])return a[o]}let i=a[a.length-1];return Ps({point:N(t,n),element:i,threshold:this.getElementHitThreshold(i)/2,elementsMap:this.scene.getNonDeletedElementsMap(),frameNameBound:he(i)?this.frameNameBoundsCache.get(i):null})?i:a[a.length-2]}return a.length===1?a[0]:null}getElementsAtPosition(t,n,r){let a=[],i=this.scene.getNonDeletedElementsMap();return(r?.includeBoundTextElement&&r?.includeLockedElements?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(o=>(r?.includeLockedElements||!o.locked)&&(r?.includeBoundTextElement||!(oe(o)&&o.containerId)))).filter(o=>this.hitElement(t,n,o)).filter(o=>{let l=id(o,i);return l&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?m3({x:t,y:n},l,i):!0}).filter(o=>ed(o)?(a.push(o),!1):!0).concat(a)}getElementHitThreshold(t){return Math.max(t.strokeWidth/2+.1,.85*(UE/this.state.zoom.value))}hitElement(t,n,r,a=!0){return a&&this.state.selectedElementIds[r.id]&&Ob([r],this.state,this.editorInterface)&&pb(N(t,n),r,this.scene.getNonDeletedElementsMap(),this.getElementHitThreshold(r))||R8(N(t,n),r,this.scene.getNonDeletedElementsMap())?!0:Ps({point:N(t,n),element:r,threshold:this.getElementHitThreshold(r),elementsMap:this.scene.getNonDeletedElementsMap(),frameNameBound:he(r)?this.frameNameBoundsCache.get(r):null})}getTextBindableContainerAtPosition(t,n){let r=this.scene.getNonDeletedElements(),a=this.scene.getSelectedElements(this.state);if(a.length===1)return Sl(a[0],!1)?a[0]:null;let i=null;for(let o=r.length-1;o>=0;--o){if(r[o].isDeleted)continue;let[l,c,s,d]=Qn(r[o],this.scene.getNonDeletedElementsMap());if(Oe(r[o])&&Ps({point:N(t,n),element:r[o],elementsMap:this.scene.getNonDeletedElementsMap(),threshold:this.getElementHitThreshold(r[o])})){i=r[o];break}else if(l<t&&t<s&&c<n&&n<d){i=r[o];break}}return Sl(i,!1)?i:null}handleHoverSelectedLinearElement(t,n,r){let a=this.scene.getNonDeletedElementsMap(),i=ae.getElement(t.elementId,a);if(i)if(this.state.selectedLinearElement){let o=-1,l=null;Ps({point:N(n,r),element:i,elementsMap:a,threshold:this.getElementHitThreshold(i)})?(o=ae.getPointIndexUnderCursor(i,a,this.state.zoom,n,r),l=ae.getSegmentMidpointHitCoords(t,{x:n,y:r},this.state,this.scene.getNonDeletedElementsMap()),(ze(i)?o===0||o===i.points.length-1:o>=0)||l?ht(this.interactiveCanvas,Ve.POINTER):this.hitElement(n,r,i)&&(!ze(i)||!(i.startBinding||i.endBinding))&&(this.state.activeTool.type!=="lasso"||Object.keys(this.state.selectedElementIds).length>0)&&ht(this.interactiveCanvas,Ve.MOVE)):this.hitElement(n,r,i)&&(!ze(i)||!(i.startBinding||i.endBinding))&&(this.state.activeTool.type!=="lasso"||Object.keys(this.state.selectedElementIds).length>0)&&ht(this.interactiveCanvas,Ve.MOVE),this.state.selectedLinearElement.hoverPointIndex!==o&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:o}}),ae.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,l)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:l}});let c=null,s=i;(s.startBinding||s.endBinding)&&(c=AA(i,n,r,this.scene,this.state)),this.state.selectedLinearElement.hoveredFocusPointBinding!==c&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!1,hoveredFocusPointBinding:c}}),c&&ht(this.interactiveCanvas,Ve.POINTER)}else ht(this.interactiveCanvas,Ve.AUTO)}updateGestureOnPointerDown(t){Je.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),Je.pointers.size===2&&(Je.lastCenter=oU(Je.pointers),Je.initialScale=this.state.zoom.value,Je.initialDistance=lU(Array.from(Je.pointers.values())))}initialPointerDownState(t){let n=dt(t,this.state),r=this.scene.getSelectedElements(this.state),[a,i,o,l]=Qe(r),c=r.findIndex(ze)===0;return{origin:n,withCmdOrCtrl:t[D.CTRL_OR_CMD],originInGrid:Q0(hr(n.x,n.y,t[D.CTRL_OR_CMD]||c?null:this.getEffectiveGridSize())),scrollbars:fU(r1,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...n},originalElements:this.scene.getNonDeletedElements().reduce((s,d)=>(s.set(d.id,eo(d)),s),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(o+a)/2,y:(l+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(n,r)},drag:{hasOccurred:!1,offset:null,origin:{...n},blockDragging:!1},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,n){if(!(n.scrollbars.isOverEither&&!this.state.multiElement))return!1;kC=!0,n.lastCoords.x=t.clientX,n.lastCoords.y=t.clientY;let r=dC(i=>{i.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(i,n)}),a=en(()=>{i1=null,kC=!1,Xo(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener(Q.POINTER_MOVE,r),window.removeEventListener(Q.POINTER_UP,a),r.flush()});return i1=a,window.addEventListener(Q.POINTER_MOVE,r),window.addEventListener(Q.POINTER_UP,a),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,n){if(n.length<2)return!1;let r=Math.max(UE/this.state.zoom.value,1),[a,i,o,l]=Qe(n);return t.x>a-r&&t.x<o+r&&t.y>i-r&&t.y<l+r}getCurrentItemRoundness(t){return this.state.currentItemRoundness==="round"?{type:Os(t)?zt.ADAPTIVE_RADIUS:zt.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(t,n,r=!1){Ic({event:t,app:this,selectedElements:n})&&(r||!ns.getReferenceSnapPoints())&&ns.setReferenceSnapPoints(Eoe(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(t,n,r=!1){Ic({event:t,app:this,selectedElements:n})&&(r||!ns.getVisibleGaps())&&ns.setVisibleGaps(woe(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(t){return en(n=>{this.maybeHandleResize(t,n)||this.maybeDragNewGenericElement(t,n)})}onKeyUpFromPointerDownHandler(t){return en(n=>{n.key===D.ALT&&n.preventDefault(),!this.maybeHandleResize(t,n)&&this.maybeDragNewGenericElement(t,n)})}onPointerMoveFromPointerDownHandler(t){return dC(n=>{if(this.state.openDialog?.name==="elementLinkSelector")return;let r=dt(n,this.state);if(this.state.activeLockedId&&this.setState({activeLockedId:null}),this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.initialState.segmentMidpoint.index){let[d,u]=hr(r.x,r.y,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),h=this.state.selectedLinearElement.initialState.segmentMidpoint.index;if(h<0){let p=ae.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:d,y:u},this.state,this.scene.getNonDeletedElementsMap());h=p?ae.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,p,this.scene.getNonDeletedElementsMap()):-1}let m=ae.moveFixedSegment(this.state.selectedLinearElement,h,d,u,this.scene);this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0,segmentMidPointHoveredCoords:m.segmentMidPointHoveredCoords,initialState:m.initialState}});return}let a=this.previousPointerMoveCoords??t.origin;if(this.previousPointerMoveCoords=r,t.drag.offset===null&&(t.drag.offset=Q0(uA(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(n.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(n,t))return;if(to(this.state)){this.handleEraser(n,r);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(r.x,r.y);let[i,o]=hr(r.x,r.y,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize());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 l=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let d=this.state.selectedLinearElement;if(d.draggedFocusPointBinding){kA(d,l,r,this.scene,this.state,this.getEffectiveGridSize(),n.altKey),this.setState({selectedLinearElement:{...d,isDragging:!1,selectedPointsIndices:[],initialState:{...d.initialState,lastClickedPoint:-1}}});return}if(ae.shouldAddMidpoint(this.state.selectedLinearElement,r,this.state,l)){let u=ae.addMidpoint(this.state.selectedLinearElement,r,this,!n[D.CTRL_OR_CMD],this.scene);if(!u)return;(0,$r.flushSync)(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,initialState:u.pointerDownState,selectedPointsIndices:u.selectedPointsIndices,segmentMidPointHoveredCoords:null}})});return}else{if(d.initialState.segmentMidpoint.value!==null&&!d.initialState.segmentMidpoint.added)return;if(d.initialState.lastClickedPoint>-1){let u=ae.getElement(d.elementId,l);if(u?.isDeleted)return;if(Mr(u)){let m=hi(N(r.x,r.y),this.scene.getNonDeletedElements(),l);ci("COMPLEX_BINDINGS")&&this.handleDelayedBindModeChange(u,m)}if(n.altKey&&!this.state.selectedLinearElement?.initialState?.arrowStartIsInside&&ci("COMPLEX_BINDINGS")&&this.handleSkipBindMode(),d.initialState.lastClickedPoint===-1)return;let h=ae.handlePointDragging(n,this,r.x,r.y,d);if(h){t.lastCoords.x=r.x,t.lastCoords.y=r.y,t.drag.hasOccurred=!0,(h.suggestedBinding!==this.state.suggestedBinding||!Qt(h.selectedLinearElement?.selectedPointsIndices??[],this.state.selectedLinearElement?.selectedPointsIndices??[])||h.selectedLinearElement?.hoverPointIndex!==this.state.selectedLinearElement?.hoverPointIndex||h.selectedLinearElement?.customLineAngle!==this.state.selectedLinearElement?.customLineAngle||this.state.selectedLinearElement.isDragging!==h.selectedLinearElement?.isDragging||this.state.selectedLinearElement?.initialState?.altFocusPoint!==h.selectedLinearElement?.initialState?.altFocusPoint)&&this.setState(h);return}}}}let c=t.hit.allHitElements.some(d=>this.isASelectedElement(d)),s=this.state.selectedLinearElement?.isEditing&&n.shiftKey&&this.state.selectedLinearElement.elementId===t.hit.element?.id;if((c||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!s&&!t.drag.blockDragging){let d=this.scene.getSelectedElements(this.state);if(d.length>0&&d.every(p=>p.locked))return;let u=d.find(p=>he(p)),h=this.getTopLayerFrameAtSceneCoords(r),m=h&&!u?h:null;if(this.state.frameToHighlight!==m&&(0,$r.flushSync)(()=>{this.setState({frameToHighlight:m})}),t.drag.hasOccurred=!0,this.state.activeTool.type==="lasso"&&this.lassoTrail.hasCurrentTrail&&!(this.editorInterface.formFactor!=="desktop"&&t.hit.element)&&!this.state.activeTool.fromSelection)return;if(this.state.activeTool.type==="lasso"&&d.length>0&&t.drag.hasOccurred&&!this.state.activeTool.fromSelection&&this.lassoTrail.endPath(),d.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&this.state.activeEmbeddable?.state!=="active"){let p={x:r.x-t.drag.origin.x,y:r.y-t.drag.origin.y},f=[...t.originalElements.values()],x=n.shiftKey;if(x){let b=Math.abs(p.x),w=Math.abs(p.y),S=x&&b<w,_=x&&b>w;S&&(p.x=0),_&&(p.y=0)}if(this.state.croppingElementId){let b=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(b&&ft(b)&&b.crop!==null&&t.hit.element===b){let w=b.crop,S=Ns(b)&&this.imageCache.get(b.fileId)?.image;if(S&&!(S instanceof Promise)){let _=El(b),C=ME(r.x-a.x,r.y-a.y);C[0]*=S.naturalWidth/_.width,C[1]*=S.naturalHeight/_.height;let[k,T,I,A,O,V]=Qn(b,l),j=Pu(Ie(N(k,T),N(O,V),b.angle)),K=Pu(Ie(N(I,T),N(O,V),b.angle)),Z=Pu(Ie(N(k,A),N(O,V),b.angle)),R=IE(DE(K,j)),P=IE(DE(Z,j)),F=ME(AE(C,R),AE(C,P)),q={...w,x:nn(w.x-F[0]*Math.sign(b.scale[0]),0,S.naturalWidth-w.width),y:nn(w.y-F[1]*Math.sign(b.scale[1]),0,S.naturalHeight-w.height)};this.scene.mutateElement(b,{crop:q});return}}}this.maybeCacheVisibleGaps(n,d),this.maybeCacheReferenceSnapPoints(n,d);let{snapOffset:g,snapLines:v}=Soe(f,p,this,n,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:v}),this.state.editingFrame||dA(t,d,p,this.scene,g,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),n.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let b=this.scene.getElementsIncludingDeleted(),w=t.hit.element,S=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});w&&t.hit.wasAddedToSelection&&!S.find(j=>j.id===w.id)&&S.push(w);let _=new Map(S.map(j=>[j.id,j])),{duplicatedElements:C,duplicateElementsMap:k,elementsWithDuplicates:T,origIdToDuplicateId:I}=Hs({type:"in-place",elements:b,appState:this.state,randomizeSeed:!0,idsOfElementsToDuplicate:_,overrides:({duplicateElement:j,origElement:K})=>({frameId:j.frameId??K.frameId,seed:wl()})});C.forEach(j=>{t.originalElements.set(j.id,eo(j))});let A=T.map(j=>{if(_.has(j.id)){let K=t.originalElements.get(j.id);if(K)return pe(j,{x:K.x,y:K.y})}return j}),O=this.props.onDuplicate?.(A,b),V=Oo(O||A,me(C));(0,$r.flushSync)(()=>{if(t.hit.element){let j=I.get(t.hit.element.id),K=j&&k.get(j);t.hit.element=K||null}t.hit.allHitElements=t.hit.allHitElements.reduce((j,K)=>{let Z=I.get(K.id),R=Z&&k.get(Z);return R&&j.push(R),j},[]),t.drag.origin=dt(n,this.state),this.setState(j=>({...Eb(C,this.scene.getNonDeletedElements(),j)})),this.scene.replaceAllElements(V),S.forEach(j=>{nd(j)&&j.boundElements?.some(K=>K.type==="arrow")&&mi(j,this.scene)}),this.maybeCacheVisibleGaps(n,S,!0),this.maybeCacheReferenceSnapPoints(n,S,!0)})}return}}if(this.state.selectionElement){if(t.lastCoords.x=r.x,t.lastCoords.y=r.y,n.altKey){this.setActiveTool({type:"lasso",fromSelection:!0},n.shiftKey),this.lassoTrail.startPath(t.origin.x,t.origin.y,n.shiftKey),this.setAppState({selectionElement:null});return}this.maybeDragNewGenericElement(t,n)}else if(this.state.activeTool.type==="lasso")!n.altKey&&this.state.activeTool.fromSelection?(this.setActiveTool({type:"selection"}),this.createGenericElementOnPointerDown("selection",t),t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeDragNewGenericElement(t,n),this.lassoTrail.endPath()):this.lassoTrail.addPointToPath(r.x,r.y,n.shiftKey);else{let d=this.state.newElement;if(!d)return;if(d.type==="freedraw"){let u=d.points,h=r.x-d.x,m=r.y-d.y,p=u.length>0&&u[u.length-1];if(!(p&&p[0]===h&&p[1]===m)){let f=d.simulatePressure?d.pressures:[...d.pressures,n.pressure];this.scene.mutateElement(d,{points:[...u,N(h,m)],pressures:f},{informMutation:!1,isDragging:!1}),this.setState({newElement:d})}}else if(Te(d)&&!d.isDeleted){t.drag.hasOccurred=!0;let u=d.points;ut(u.length>1,"Do not create linear elements with less than 2 points");let h=this.state.selectedLinearElement;h||(h=new ae(d,this.scene.getNonDeletedElementsMap()),h={...h,selectedPointsIndices:[1],initialState:{...h.initialState,lastClickedPoint:1}}),this.setState({newElement:d,...ae.handlePointDragging(n,this,i,o,h)})}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 d=this.scene.getNonDeletedElements();if(this.state.selectedLinearElement?.isEditing)ae.handleBoxSelection(n,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let u=!0;!n.shiftKey&&vn(d,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(m=>bn({...m,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),m,this)):u=!1);let h=this.state.selectionElement?H8(d,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(m=>{let p={...u&&m.selectedElementIds,...h.reduce((f,x)=>(f[x.id]=!0,f),{})};return t.hit.element&&(h.length?delete p[t.hit.element.id]:p[t.hit.element.id]=!0),m=u?m:{...m,selectedGroupIds:{},editingGroupId:null},{...bn({editingGroupId:m.editingGroupId,selectedElementIds:p},this.scene.getNonDeletedElements(),m,this),selectedLinearElement:h.length===1&&Te(h[0])?new ae(h[0],this.scene.getNonDeletedElementsMap()):null,showHyperlinkPopup:h.length===1&&(h[0].link||Tr(h[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,n){if(n.scrollbars.isOverHorizontal){let r=t.clientX,a=r-n.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-a*(r1.horizontal?.deltaMultiplier||1)/this.state.zoom.value}),n.lastCoords.x=r,!0}if(n.scrollbars.isOverVertical){let r=t.clientY,a=r-n.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-a*(r1.vertical?.deltaMultiplier||1)/this.state.zoom.value}),n.lastCoords.y=r,!0}return!1}onPointerUpFromPointerDownHandler(t){return en(n=>{let r=this.scene.getNonDeletedElementsMap();this.removePointer(n),t.drag.blockDragging=!1,t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:a,resizingElement:i,croppingElementId:o,multiElement:l,activeTool:c,isResizing:s,isRotating:d,isCropping:u}=this.state;this.setState(g=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:Gu(g.snapLines,[]),originSnapOffset:null})),this.lassoTrail.endPath(),this.previousPointerMoveCoords=null,ns.setReferenceSnapPoints(null),ns.setVisibleGaps(null),this.savePointer(n.clientX,n.clientY,"up");let h=t.hit.allHitElements,m=dt({clientX:n.clientX,clientY:n.clientY},this.state);if(this.state.activeTool.type==="selection"&&!t.boxSelection.hasOccurred&&!t.resize.isResizing&&!h.some(g=>this.state.selectedElementIds[g.id])){let g=this.getElementAtPosition(m.x,m.y,{includeLockedElements:!0});this.store.scheduleCapture(),g?.locked?this.setState({activeLockedId:g.groupIds.length>0?g.groupIds.at(-1)||"":g.id}):this.setState({activeLockedId:null})}else this.setState({activeLockedId:null});if(ci("COMPLEX_BINDINGS")&&this.resetDelayedBindMode(),this.setState({selectedElementsAreBeingDragged:!1,bindMode:"orbit"}),t.drag.hasOccurred&&t.hit?.element?.id){let g=r.get(t.hit.element.id);nd(g)&&g.boundElements?.filter(v=>v.type==="arrow").map(v=>r.get(v.id)).filter(v=>ze(v)).forEach(v=>{v&&this.scene.mutateElement(v,{})})}if(this.state.selectedLinearElement?.isEditing&&!this.state.newElement&&this.state.selectedLinearElement.draggedFocusPointBinding===null)if(!t.boxSelection.hasOccurred&&t.hit?.element?.id!==this.state.selectedLinearElement.elementId&&this.state.selectedLinearElement.draggedFocusPointBinding===null)this.actionManager.executeAction(qa);else{let g=ae.handlePointerUp(n,this.state.selectedLinearElement,this.state,this.scene);this.actionManager.executeAction(qa,"ui",{event:n,sceneCoords:m}),g!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:g,suggestedBinding:null})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let g=ae.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());g&&this.scene.mutateElement(g,{})}if(this.state.selectedLinearElement.draggedFocusPointBinding?(MA(this.state.selectedLinearElement,this.scene),this.setState({selectedLinearElement:{...this.state.selectedLinearElement,draggedFocusPointBinding:null}})):t.hit?.element?.id!==this.state.selectedLinearElement.elementId?this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null}):this.state.selectedLinearElement.isDragging&&(this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!1}}),this.actionManager.executeAction(qa,"ui",{event:n,sceneCoords:m})),this.state.newElement&&this.state.multiElement&&Te(this.state.newElement)&&this.state.selectedLinearElement){let{multiElement:g}=this.state;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,lastCommittedPoint:g.points[g.points.length-1]}})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener(Q.POINTER_MOVE,t.eventListeners.onMove),window.removeEventListener(Q.POINTER_UP,t.eventListeners.onUp),window.removeEventListener(Q.KEYDOWN,t.eventListeners.onKeyDown),window.removeEventListener(Q.KEYUP,t.eventListeners.onKeyUp),this.props?.onPointerUp?.(c,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,n),a?.type==="freedraw"){let g=dt(n,this.state),v=a.points,b=g.x-a.x,w=g.y-a.y;b===v[0][0]&&w===v[0][1]&&(w+=1e-4,b+=1e-4);let S=a.simulatePressure?[]:[...a.pressures,n.pressure];this.scene.mutateElement(a,{points:[...v,N(b,w)],pressures:S}),this.actionManager.executeAction(qa);return}if(Te(a)){a.points.length>1&&a.points[1][0]!==0&&a.points[1][1]!==0&&this.store.scheduleCapture();let g=dt(n,this.state),v=Cr(N(g.x,g.y),N(t.origin.x,t.origin.y))*this.state.zoom.value;if((!t.drag.hasOccurred||v<wM)&&a&&!l)if(this.editorInterface.isTouchScreen){let b=Math.min(this.state.width*.7/this.state.zoom.value,100);this.scene.mutateElement(a,{x:a.x-b/2,points:[N(0,0),N(b,0)]},{informMutation:!1,isDragging:!1}),this.actionManager.executeAction(qa)}else{let b=g.x-a.x,w=g.y-a.y;this.scene.mutateElement(a,{points:[a.points[0],N(b,w)]},{informMutation:!1,isDragging:!1}),this.setState({multiElement:a,newElement:a})}else t.drag.hasOccurred&&!l&&(Te(a)&&this.actionManager.executeAction(qa,"ui",{event:n,sceneCoords:m}),this.setState({suggestedBinding:null,startBoundElement:null}),c.locked?this.setState(b=>({newElement:null})):(mo(this.interactiveCanvas),this.setState(b=>({newElement:null,activeTool:tt(this.state,{type:this.state.preferredSelectionTool.type}),selectedElementIds:nt({...b.selectedElementIds,[a.id]:!0},b),selectedLinearElement:new ae(a,this.scene.getNonDeletedElementsMap())}))),this.scene.triggerUpdate());return}if(oe(a)){let g=S8(Mt({fontSize:a.fontSize,fontFamily:a.fontFamily}),a.lineHeight);a.width<g&&this.scene.mutateElement(a,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(a,{isExistingElement:!0})}if(c.type!=="selection"&&a&&No(a)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(g=>g.id!==a.id),appState:{newElement:null},captureUpdate:U.NEVER});return}if(he(a)){let g=W8(this.scene.getElementsIncludingDeleted(),a,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(qu(this.scene.getElementsMapIncludingDeleted(),g,a,this.state))}if(a&&(this.scene.mutateElement(a,rA(a),{informMutation:!1,isDragging:!1}),this.scene.triggerUpdate()),t.drag.hasOccurred){let g=dt(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let v=this.scene.getElement(this.state.selectedLinearElement.elementId);if(v?.frameId){let b=id(v,r);b&&v&&(j8(v,b,this.scene.getNonDeletedElementsMap())||(this.scene.mutateElement(v,{groupIds:[]}),Sb([v],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let v=this.getTopLayerFrameAtSceneCoords(g),b=this.scene.getSelectedElements(this.state),w=this.scene.getElementsMapIncludingDeleted(),S=_=>{if(_.length>0){for(let C of _){let k=C.groupIds.indexOf(this.state.editingGroupId);this.scene.mutateElement(C,{groupIds:C.groupIds.slice(0,k)},{informMutation:!1,isDragging:!1})}w.forEach(C=>{C.groupIds.length&&wt(w,C.groupIds[C.groupIds.length-1]).length<2&&this.scene.mutateElement(C,{groupIds:[]},{informMutation:!1,isDragging:!1})}),this.setState({editingGroupId:null})}};if(v&&!this.state.selectedElementIds[v.id]){let _=b.filter(C=>C.frameId!==v.id&&p3(C,w,this.state));this.state.editingGroupId&&S(_),w=qu(w,_,v,this.state)}else if(!v&&this.state.editingGroupId){let _=b.filter(C=>C.frameId&&!p3(C,w,this.state));S(_)}w=Lo(w,this.state,this),this.scene.replaceAllElements(w)}}if(i&&this.store.scheduleCapture(),i&&No(i)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(g=>g.id!==i.id),captureUpdate:U.NEVER}),t.resize.isResizing){let g=Lo(this.scene.getElementsIncludingDeleted(),this.state,this),v=this.scene.getSelectedElements(this.state).filter(b=>he(b));for(let b of v)g=Io(g,da(this.scene.getElementsIncludingDeleted(),b,this.state,r),b,this);this.scene.replaceAllElements(g)}let p=t.hit.element;this.state.selectedLinearElement?.elementId!==p?.id&&Te(p)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new ae(p,this.scene.getNonDeletedElementsMap())}),(!o||o&&(!p&&!u||p&&p.id!==o))&&this.finishImageCropping();let f=this.lastPointerDownEvent,x=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(to(this.state)&&f&&x){if(this.eraserTrail.endPath(),Cr(N(f.clientX,f.clientY),N(x.clientX,x.clientY))===0){let g=dt({clientX:x.clientX,clientY:x.clientY},this.state);this.getElementsAtPosition(g.x,g.y).forEach(v=>this.elementsPendingErasure.add(v.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(p&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.selectedLinearElement?.isEditing||!t.boxSelection.hasOccurred)&&this.state.activeTool.type!=="lasso"&&(n.shiftKey&&!this.state.selectedLinearElement?.isEditing?this.state.selectedElementIds[p.id]?yb(this.state,p)?this.setState(g=>{let v={...g.selectedElementIds};for(let b of p.groupIds.flatMap(w=>wt(this.scene.getNonDeletedElements(),w)))delete v[b.id];return{selectedGroupIds:{...g.selectedElementIds,...p.groupIds.map(b=>({[b]:!1})).reduce((b,w)=>({...b,...w}),{})},selectedElementIds:nt(v,g)}}):this.state.selectedLinearElement?.isDragging||this.setState(g=>{let v={...g.selectedElementIds};delete v[p.id];let b=Re(this.scene.getNonDeletedElements(),{selectedElementIds:v});return{...bn({editingGroupId:g.editingGroupId,selectedElementIds:v},this.scene.getNonDeletedElements(),g,this),selectedLinearElement:b.length===1&&Te(b[0])?new ae(b[0],this.scene.getNonDeletedElementsMap()):g.selectedLinearElement}}):p.frameId&&this.state.selectedElementIds[p.frameId]?this.setState(g=>{let v={...g.selectedElementIds,[p.id]:!0};return delete v[p.frameId],(this.scene.getElement(p.frameId)?.groupIds??[]).flatMap(b=>wt(this.scene.getNonDeletedElements(),b)).forEach(b=>{delete v[b.id]}),{...bn({editingGroupId:g.editingGroupId,selectedElementIds:v},this.scene.getNonDeletedElements(),g,this),showHyperlinkPopup:p.link||Tr(p)?"info":!1}}):this.setState(g=>({selectedElementIds:nt({...g.selectedElementIds,[p.id]:!0},g)})):this.setState(g=>({...bn({editingGroupId:g.editingGroupId,selectedElementIds:{[p.id]:!0}},this.scene.getNonDeletedElements(),g,this),selectedLinearElement:Te(p)&&g.selectedLinearElement?.elementId!==p.id?new ae(p,this.scene.getNonDeletedElementsMap()):g.selectedLinearElement}))),this.state.activeTool.type!=="lasso"&&!(p&&ze(p))&&!t.drag.hasOccurred&&!this.state.isResizing&&(p&&L8({point:N(t.origin.x,t.origin.y),element:p,elementsMap:r,threshold:this.getElementHitThreshold(p),frameNameBound:he(p)?this.frameNameBoundsCache.get(p):null},r)||!p&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.selectedLinearElement?.isEditing?this.actionManager.executeAction(fx):this.setState({selectedElementIds:nt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),ht(this.interactiveCanvas,Ve.AUTO);return}if(!c.locked&&c.type!=="freedraw"&&a&&this.setState(g=>({selectedElementIds:nt({...g.selectedElementIds,[a.id]:!0},g),showHyperlinkPopup:Tr(a)&&!a.link?"editor":g.showHyperlinkPopup})),(c.type!=="selection"||vn(this.scene.getNonDeletedElements(),this.state)||!Qt(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.scheduleCapture(),t.drag.hasOccurred&&!this.state.selectedLinearElement||s||d||u){let g=this.scene.getSelectedElements(this.state).filter(Oe);tf(g,this.scene,this.state)}if(c.type==="laser"){this.laserTrails.endPath();return}!c.locked&&c.type!=="freedraw"&&(c.type!=="lasso"||c.type==="lasso"&&c.fromSelection)?(mo(this.interactiveCanvas),this.setState({newElement:null,suggestedBinding:null,activeTool:tt(this.state,{type:this.state.preferredSelectionTool.type})})):this.setState({newElement:null,suggestedBinding:null})})}clearSelection(t){this.setState(n=>({selectedElementIds:nt({},n),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:n.editingGroupId&&t!=null&&Zu(t,n.editingGroupId)?n.editingGroupId:null})),this.setState({selectedElementIds:nt({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds,selectedLinearElement:null})}getTextWysiwygSnappedToCenterPosition(t,n,r,a){if(a){let i=a.x+a.width/2,o=a.y+a.height/2,l=hb(a,r,this.scene.getNonDeletedElementsMap());if(l&&(i=l.x,o=l.y),Math.hypot(t-i,n-o)<SM){let{x:c,y:s}=zn({sceneX:i,sceneY:o},r);return{viewportX:c,viewportY:s,elementCenterX:i,elementCenterY:o}}}}getCanvasOffsets(){if(this.excalidrawContainerRef?.current){let t=this.excalidrawContainerRef.current,{left:n,top:r}=t.getBoundingClientRect();return{offsetLeft:n,offsetTop:r}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){let t=g_.find(n=>n.code===this.props.langCode)||Fm;await aB(t),this.setAppState({})}},Bde=()=>{(xl()||qn())&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app?.scene.getElementsIncludingDeleted()},set(e){return this.app?.scene.replaceAllElements(eh(e))}},scene:{configurable:!0,get(){return this.app?.scene}}}))};Bde();var Fde=Ude,Hde=e=>{let[t,n]=(0,rw.useState)(!0);return(0,rw.useEffect)(()=>{let r=async()=>{await aB(a),n(!1)},a=g_.find(i=>i.code===e.langCode)||Fm;r()},[e.langCode]),t?(0,AV.jsx)(PH,{theme:e.theme}):e.children},jde=({children:e})=>{let{FooterCenterTunnel:t}=Br(),n=pt();return(0,p_.jsx)(t.In,{children:(0,p_.jsx)("div",{className:H("footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":n.zenModeEnabled}),children:e})})};jde.displayName="FooterCenter";var Vde=({isCollaborating:e,onSelect:t,editorInterface:n,...r})=>{let a=pt(),i=n?.formFactor!=="desktop"||a.width<FM;return(0,aw.jsxs)(hs,{...r,className:H("collab-button",{active:e}),type:"button",onSelect:t,style:{position:"relative",width:i?void 0:"auto"},title:E("labels.liveCollaboration"),children:[i?Iee:E("labels.share"),a.collaborators.size>0&&(0,aw.jsx)("div",{className:"CollabButton-collaborators",children:a.collaborators.size})]})};Vde.displayName="LiveCollaborationTrigger";var Gde=()=>(0,Hi.jsx)("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:(0,Hi.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"})}),Yde=()=>(0,Hi.jsxs)("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[(0,Hi.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)"}),(0,Hi.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)"}),(0,Hi.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)"}),(0,Hi.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)"})]}),Wde=({style:e,size:t="small",withText:n})=>(0,Hi.jsxs)("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[(0,Hi.jsx)(Gde,{}),n&&(0,Hi.jsx)(Yde,{})]}),kk=({icon:e,shortcut:t,children:n})=>{let r=En();return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)("div",{className:"welcome-screen-menu-item__icon",children:e}),(0,_t.jsx)("div",{className:"welcome-screen-menu-item__text",children:n}),t&&r.formFactor!=="phone"&&(0,_t.jsx)("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};kk.displayName="WelcomeScreenMenuItemContent";var X1=({onSelect:e,children:t,icon:n,shortcut:r,className:a="",...i})=>(0,_t.jsx)("button",{...i,type:"button",className:`welcome-screen-menu-item ${a}`,onClick:e,children:(0,_t.jsx)(kk,{icon:n,shortcut:r,children:t})});X1.displayName="WelcomeScreenMenuItem";var DV=({children:e,href:t,icon:n,shortcut:r,className:a="",...i})=>(0,_t.jsx)("a",{...i,className:`welcome-screen-menu-item ${a}`,href:t,target:"_blank",rel:"noopener",children:(0,_t.jsx)(kk,{icon:n,shortcut:r,children:e})});DV.displayName="WelcomeScreenMenuItemLink";var Co=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=Br();return(0,_t.jsx)(t.In,{children:(0,_t.jsx)("div",{className:"welcome-screen-center",children:e||(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Tk,{}),(0,_t.jsx)(Mk,{children:E("welcomeScreen.defaults.center_heading")}),(0,_t.jsxs)(Ak,{children:[(0,_t.jsx)(Ik,{}),(0,_t.jsx)(Dk,{})]})]})})})};Co.displayName="Center";var Tk=({children:e})=>(0,_t.jsx)("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||(0,_t.jsx)(Wde,{withText:!0})});Tk.displayName="Logo";var Mk=({children:e})=>(0,_t.jsx)("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});Mk.displayName="Heading";var Ak=({children:e})=>(0,_t.jsx)("div",{className:"welcome-screen-menu",children:e});Ak.displayName="Menu";var Dk=()=>{let e=Sn();return(0,_t.jsx)(X1,{onSelect:()=>e.executeAction(Y_),shortcut:"?",icon:E_,children:E("helpDialog.title")})};Dk.displayName="MenuItemHelp";var Ik=()=>{let e=pt(),t=Sn();return e.viewModeEnabled?null:(0,_t.jsx)(X1,{onSelect:()=>t.executeAction(HC),shortcut:hn("loadScene"),icon:S_,children:E("buttons.load")})};Ik.displayName="MenuItemLoadScene";var IV=({onSelect:e})=>{let{t}=Lt();return(0,_t.jsx)(X1,{shortcut:null,onSelect:e,icon:fB,children:t("labels.liveCollaboration")})};IV.displayName="MenuItemLiveCollaborationTrigger";Co.Logo=Tk;Co.Heading=Mk;Co.Menu=Ak;Co.MenuItem=X1;Co.MenuItemLink=DV;Co.MenuItemHelp=Dk;Co.MenuItemLoadScene=Ik;Co.MenuItemLiveCollaborationTrigger=IV;var Lk=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=Br();return(0,xo.jsx)(t.In,{children:(0,xo.jsxs)("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[fee,(0,xo.jsx)("div",{className:"welcome-screen-decor-hint__label",children:e||E("welcomeScreen.defaults.menuHint")})]})})};Lk.displayName="MenuHint";var Rk=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=Br();return(0,xo.jsx)(t.In,{children:(0,xo.jsxs)("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[(0,xo.jsx)("div",{className:"welcome-screen-decor-hint__label",children:e||E("welcomeScreen.defaults.toolbarHint")}),bee]})})};Rk.displayName="ToolbarHint";var Nk=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=Br();return(0,xo.jsx)(t.In,{children:(0,xo.jsxs)("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[(0,xo.jsx)("div",{children:e||E("welcomeScreen.defaults.helpHint")}),gee]})})};Nk.displayName="HelpHint";var Ok=e=>(0,go.jsx)(go.Fragment,{children:e.children||(0,go.jsxs)(go.Fragment,{children:[(0,go.jsx)(Co,{}),(0,go.jsx)(Lk,{}),(0,go.jsx)(Rk,{}),(0,go.jsx)(Nk,{})]})});Ok.displayName="WelcomeScreen";Ok.Center=Co;Ok.Hints={MenuHint:Lk,ToolbarHint:Rk,HelpHint:Nk};var Kde=()=>{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)})},$de=Kde,Xde=(e,t,n)=>!!(t&&(t.id===e.editingTextElement?.id||t.id===e.resizingElement?.id||t.id===e.newElement?.id||t.version>n.version||t.version===n.version&&t.versionNonce<=n.versionNonce)),Zde=(0,LV.default)((e,t,n)=>{if(qn()||xl()||window?.DEBUG_FRACTIONAL_INDICES){let r=eh(e.map(a=>({...a})));sA(r,{shouldThrow:xl()||qn(),includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:n}})}},1e3*60,{leading:!0,trailing:!1}),RV=(e,t,n)=>{let r=me(e),a=[],i=new Set;for(let l of t)if(!i.has(l.id)){let c=r.get(l.id),s=Xde(n,c,l);c&&s?(a.push(c),i.add(c.id)):(a.push(l),i.add(l.id))}for(let l of e)i.has(l.id)||(a.push(l),i.add(l.id));let o=Ab(a);return Zde(o,e,t),eh(o),o},qde=({children:e,icon:t})=>{let{t:n}=Lt(),{TTDDialogTriggerTunnel:r}=Br(),a=fn();return(0,Nx.jsx)(r.In,{children:(0,Nx.jsx)(Ae.Item,{onSelect:()=>{at("ai","dialog open","ttd"),a({openDialog:{name:"ttd",tab:"text-to-diagram"}})},icon:t??Ate,badge:(0,Nx.jsx)(Ae.Item.Badge,{children:"AI"}),children:e??n("labels.textToDiagram")})})};qde.displayName="TTDDialogTrigger";$de();var Jde=e=>{let{onExport:t,onChange:n,onIncrement:r,initialData:a,onExcalidrawAPI:i,onMount:o,onUnmount:l,onInitialize:c,isCollaborating:s=!1,onPointerUpdate:d,renderTopLeftUI:u,renderTopRightUI:h,langCode:m=Fm.code,viewModeEnabled:p,zenModeEnabled:f,gridModeEnabled:x,libraryReturnUrl:g,theme:v,name:b,renderCustomStats:w,onPaste:S,detectScroll:_=!0,handleKeyboardGlobally:C=!1,onLibraryChange:k,autoFocus:T=!1,generateIdForFile:I,onLinkOpen:A,generateLinkForSelection:O,onPointerDown:V,onPointerUp:j,onScrollChange:K,onDuplicate:Z,children:R,validateEmbeddable:P,renderEmbeddable:F,aiEnabled:q,showDeprecatedFonts:te,renderScrollbars:ge}=e,be=e.UIOptions?.canvasActions,fe={...e.UIOptions,canvasActions:{...jE.canvasActions,...be},tools:{image:e.UIOptions?.tools?.image??!0}};be?.export&&(fe.canvasActions.export.saveFileToDisk=be.export?.saveFileToDisk??jE.canvasActions.export.saveFileToDisk),fe.canvasActions.toggleTheme===null&&typeof v>"u"&&(fe.canvasActions.toggleTheme=!0);let He=(0,wo.useContext)(TV),je=(0,wo.useRef)(i);je.current=i;let ke=(0,wo.useCallback)(ct=>{He?.(ct),je.current?.(ct)},[He]);return(0,wo.useEffect)(()=>{(async()=>await import("./chunks/roundRect-Z3DX3W5S.js"))();let ct=On=>{typeof On.scale=="number"&&On.scale!==1&&On.preventDefault()};return document.addEventListener("touchmove",ct,{passive:!1}),()=>{document.removeEventListener("touchmove",ct)}},[]),(0,Ox.jsx)(lee,{store:Qa,children:(0,Ox.jsx)(Hde,{langCode:m,theme:v,children:(0,Ox.jsx)(Fde,{onExport:t,onChange:n,onIncrement:r,initialData:a,onExcalidrawAPI:ke,onMount:o,onUnmount:l,onInitialize:c,isCollaborating:s,onPointerUpdate:d,renderTopLeftUI:u,renderTopRightUI:h,langCode:m,viewModeEnabled:p,zenModeEnabled:f,gridModeEnabled:x,libraryReturnUrl:g,theme:v,name:b,renderCustomStats:w,UIOptions:fe,onPaste:S,detectScroll:_,handleKeyboardGlobally:C,onLibraryChange:k,autoFocus:T,generateIdForFile:I,onLinkOpen:A,generateLinkForSelection:O,onPointerDown:V,onPointerUp:j,onScrollChange:K,onDuplicate:Z,validateEmbeddable:P,renderEmbeddable:F,aiEnabled:q!==!1,showDeprecatedFonts:te,renderScrollbars:ge,children:R})})})},eue=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:n,UIOptions:r={},...a}=e,{initialData:i,UIOptions:o={},...l}=t,c=Object.keys(r),s=Object.keys(o);return c.length!==s.length?!1:c.every(d=>d==="getFormFactor"?!0:d==="canvasActions"?Object.keys(r.canvasActions).every(u=>u==="export"&&r?.canvasActions?.export&&o?.canvasActions?.export?r.canvasActions.export.saveFileToDisk===o.canvasActions.export.saveFileToDisk:r?.canvasActions?.[u]===o?.canvasActions?.[u]):r[d]===o[d])&&Qt(a,l)},Pk=wo.default.memo(Jde,eue);Pk.displayName="Excalidraw";function iw(e){let t=String(e||"").trim().replace(/\s+/g," ");return t?t.slice(0,24):null}function bu(){return{type:"excalidraw",version:2,source:"collabmd",elements:[],appState:{gridSize:null,viewBackgroundColor:"#ffffff"},files:{}}}function Jm(e){return!e||typeof e!="object"?bu():{type:"excalidraw",version:2,source:"collabmd",elements:Array.isArray(e.elements)?e.elements:[],appState:{gridSize:e.appState?.gridSize??null,viewBackgroundColor:e.appState?.viewBackgroundColor??"#ffffff"},files:e.files&&typeof e.files=="object"?e.files:{}}}function ni(e){return Uk(e)||bu()}function Uk(e){if(!e)return null;try{return Jm(JSON.parse(e))}catch{return null}}function NV(e,{theme:t="dark"}={}){return{elements:e.elements||[],appState:{theme:t,viewBackgroundColor:e.appState?.viewBackgroundColor??"#ffffff",gridSize:e.appState?.gridSize??null},files:e.files||{}}}function OV(e,t,n){return Jm({elements:Array.isArray(e)?e:[],appState:{gridSize:t?.gridSize??null,viewBackgroundColor:t?.viewBackgroundColor??"#ffffff"},files:n||{}})}var zV=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#14b8a6","#f59e0b","#6366f1","#10b981","#f43f5e","#0ea5e9","#a855f7"];function tue(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function PV(){let e=new Uint8Array(8);return globalThis.crypto?.getRandomValues?.(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}function UV(e){return zV[tue(e)%zV.length]}function Bk(e,t){return t&&/^#[0-9a-fA-F]{8}$/.test(t)?t:/^#[0-9a-fA-F]{6}$/.test(e)?`${e}33`:"#0ea5e933"}function BV({params:e,storedUserName:t,generatePeerIdFn:n=PV}){let r=iw(e.get("userName"))||iw(t)||"User",a=e.get("userPeerId")||n(),i=e.get("userColor")||UV(`${r}-${a}`),o=Bk(i,e.get("userColorLight"));return{color:i,colorLight:o,name:r,peerId:a}}function ow({currentUser:e,nextUser:t={},generatePeerIdFn:n=PV}){let r=iw(t.name)||e?.name||"User",a=t.peerId||e?.peerId||n(),i=t.color||e?.color||UV(`${r}-${a}`),o=Bk(i,t.colorLight||e?.colorLight);return{color:i,colorLight:o,name:r,peerId:a}}function nue(e){if(!e||typeof e!="object")return;let t=Number(e.scrollX),n=Number(e.scrollY),r=Number(e.zoom);if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||r<=0))return{scrollX:t,scrollY:n,zoom:r}}function FV(e){let t=new Map;return e&&e.getStates().forEach((n,r)=>{let a=n?.user;if(!a)return;let i=n.pointer&&Number.isFinite(n.pointer.x)&&Number.isFinite(n.pointer.y)?{x:n.pointer.x,y:n.pointer.y,tool:n.pointer.tool==="laser"?"laser":"pointer"}:void 0,o=nue(n.viewport);t.set(String(r),{button:n.pointerButton==="down"?"down":"up",color:{background:Bk(a.color||"#0ea5e9",a.colorLight),stroke:a.color||"#0ea5e9"},id:a.peerId||String(r),isCurrentUser:r===e.clientID,pointer:i,viewport:o,selectedElementIds:n.selectedElementIds||void 0,socketId:String(r),username:a.name||"User"})}),t}function HV(e,t){if(!(e instanceof Map)||!t)return null;for(let n of e.values())if(n?.id===t)return n;return null}function lw(e){return e.endsWith("/")?e.slice(0,-1):e}function Hk(e){let t=lw(String(e??"").trim());if(!t||t==="/")return"";if(/^[a-zA-Z][a-zA-Z\d+.-]*:/u.test(t))try{return Hk(new URL(t).pathname)}catch{return""}return t.startsWith("/")?t:`/${t}`}function rue(e,t){let n=lw(String(e??"").trim());return!n||n==="/"?t:n.startsWith("/")?n:`/${n}`}function Fk(e,t){let n=Hk(e),r=String(t??"").trim();return r?/^[a-zA-Z][a-zA-Z\d+.-]*:/u.test(r)||n&&(r===n||r.startsWith(`${n}/`))?r:r==="/"?n||"/":r.startsWith("/")?n?`${n}${r}`:r:n?`${n}/${r}`:`/${r}`:n||"/"}function q1(){let e={auth:{enabled:!1,implemented:!0,requiresLogin:!1,sessionEndpoint:"/api/auth/session",statusEndpoint:"/api/auth/status",strategy:"none"},basePath:"",environment:"development",gitEnabled:!0,publicWsBaseUrl:"",wsBasePath:"/ws",...window.__COLLABMD_CONFIG__??{}},t=Hk(e.basePath),n={enabled:!1,implemented:!0,requiresLogin:!1,sessionEndpoint:"/api/auth/session",statusEndpoint:"/api/auth/status",strategy:"none",...e.auth??{}};return{...e,auth:{...n,sessionEndpoint:Fk(t,n.sessionEndpoint),statusEndpoint:Fk(t,n.statusEndpoint)},basePath:t,wsBasePath:rue(e.wsBasePath,"/ws")}}function Z1(e="/",t=q1()){return Fk(t.basePath,e)}function bs(e="/",t=q1()){let n=String(e??"").trim();return!n||n==="/"?Z1("/api",t):n.startsWith("/api")?Z1(n,t):Z1(`/api${n.startsWith("/")?n:`/${n}`}`,t)}function jk(e=q1()){let n=new URLSearchParams(window.location.search).get("server");return n?lw(n):e.publicWsBaseUrl?lw(e.publicWsBaseUrl):`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${Z1(e.wsBasePath,e)}`}function jV(){return q1()}var aue={enabled:!1,implemented:!0,passwordLabel:"Password",requiresLogin:!1,sessionEndpoint:"/api/auth/session",statusEndpoint:"/api/auth/status",strategy:"none",submitLabel:"Continue"},VV=!1;function iue(){if(VV||!document.head)return;let e=document.createElement("style");e.textContent=`
|
|
182
|
-
.auth-gate-overlay {
|
|
183
|
-
position: fixed;
|
|
184
|
-
inset: 0;
|
|
185
|
-
z-index: 5000;
|
|
186
|
-
display: flex;
|
|
187
|
-
align-items: center;
|
|
188
|
-
justify-content: center;
|
|
189
|
-
padding: 24px;
|
|
190
|
-
background:
|
|
191
|
-
radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 42%),
|
|
192
|
-
rgba(10, 15, 29, 0.74);
|
|
193
|
-
backdrop-filter: blur(14px);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.auth-gate-card {
|
|
197
|
-
width: min(100%, 420px);
|
|
198
|
-
padding: 28px;
|
|
199
|
-
border-radius: 18px;
|
|
200
|
-
border: 1px solid rgba(148, 163, 184, 0.24);
|
|
201
|
-
background: rgba(15, 23, 42, 0.94);
|
|
202
|
-
color: #e2e8f0;
|
|
203
|
-
box-shadow: 0 24px 80px rgba(15, 23, 42, 0.36);
|
|
204
|
-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.auth-gate-card h1 {
|
|
208
|
-
margin: 0 0 10px;
|
|
209
|
-
font-size: 1.35rem;
|
|
210
|
-
line-height: 1.2;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.auth-gate-card p {
|
|
214
|
-
margin: 0 0 18px;
|
|
215
|
-
color: #cbd5e1;
|
|
216
|
-
line-height: 1.5;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.auth-gate-form {
|
|
220
|
-
display: grid;
|
|
221
|
-
gap: 12px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.auth-gate-label {
|
|
225
|
-
display: grid;
|
|
226
|
-
gap: 8px;
|
|
227
|
-
font-size: 0.92rem;
|
|
228
|
-
color: #cbd5e1;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.auth-gate-input {
|
|
232
|
-
width: 100%;
|
|
233
|
-
padding: 12px 14px;
|
|
234
|
-
border: 1px solid rgba(148, 163, 184, 0.28);
|
|
235
|
-
border-radius: 12px;
|
|
236
|
-
background: rgba(15, 23, 42, 0.72);
|
|
237
|
-
color: inherit;
|
|
238
|
-
font: inherit;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.auth-gate-input:focus {
|
|
242
|
-
outline: 2px solid rgba(59, 130, 246, 0.5);
|
|
243
|
-
outline-offset: 2px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.auth-gate-actions {
|
|
247
|
-
display: flex;
|
|
248
|
-
align-items: center;
|
|
249
|
-
justify-content: space-between;
|
|
250
|
-
gap: 12px;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.auth-gate-button,
|
|
254
|
-
.auth-gate-secondary-button {
|
|
255
|
-
border: 0;
|
|
256
|
-
border-radius: 999px;
|
|
257
|
-
font: inherit;
|
|
258
|
-
cursor: pointer;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.auth-gate-button {
|
|
262
|
-
padding: 11px 16px;
|
|
263
|
-
background: linear-gradient(135deg, #0f766e, #0284c7);
|
|
264
|
-
color: #f8fafc;
|
|
265
|
-
font-weight: 600;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.auth-gate-secondary-button {
|
|
269
|
-
padding: 10px 0;
|
|
270
|
-
background: transparent;
|
|
271
|
-
color: #93c5fd;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.auth-gate-button[disabled],
|
|
275
|
-
.auth-gate-secondary-button[disabled] {
|
|
276
|
-
opacity: 0.7;
|
|
277
|
-
cursor: wait;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.auth-gate-error {
|
|
281
|
-
min-height: 1.25rem;
|
|
282
|
-
color: #fca5a5;
|
|
283
|
-
font-size: 0.92rem;
|
|
284
|
-
}
|
|
285
|
-
`,document.head.append(e),VV=!0}function oue(){return{...aue,...jV().auth??{}}}function WV(){let e=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash;return new URLSearchParams(e)}function lue(){return WV().get("auth_password")||""}function GV(){let e=WV();if(!e.has("auth_password"))return;e.delete("auth_password");let t=e.toString(),n=`${window.location.pathname}${window.location.search}${t?`#${t}`:""}`;window.history.replaceState(null,"",n)}async function sue(e){let t=await fetch(e.statusEndpoint,{headers:{Accept:"application/json"}}),n=await t.json().catch(()=>({}));if(!t.ok)throw new Error(n.error||"Failed to read auth status");return n}async function YV(e,t){let n=await fetch(e.sessionEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:t})}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Authentication failed");return r}function cue(){iue();let e=document.createElement("div");e.className="auth-gate-overlay";let t=document.createElement("section");return t.className="auth-gate-card",e.append(t),{card:t,overlay:e}}function Vk(e,{title:t,body:n,secondaryActionLabel:r="",onSecondaryAction:a=null}){e.replaceChildren();let i=document.createElement("h1");i.textContent=t;let o=document.createElement("p");if(o.textContent=n,e.append(i,o),r&&typeof a=="function"){let l=document.createElement("button");l.className="auth-gate-secondary-button",l.type="button",l.textContent=r,l.addEventListener("click",()=>{a()}),e.append(l)}}function due(e,t,{onSubmit:n,onRetryStatus:r}){e.replaceChildren();let a=document.createElement("h1");a.textContent="Authentication required";let i=document.createElement("p");i.textContent="Enter the host password to join this shared session.";let o=document.createElement("form");o.className="auth-gate-form";let l=document.createElement("label");l.className="auth-gate-label",l.textContent=t.passwordLabel;let c=document.createElement("input");c.className="auth-gate-input",c.type="password",c.name="password",c.autocomplete="current-password",c.required=!0;let s=document.createElement("div");s.className="auth-gate-error";let d=document.createElement("div");d.className="auth-gate-actions";let u=document.createElement("button");u.className="auth-gate-secondary-button",u.type="button",u.textContent="Retry status";let h=document.createElement("button");h.className="auth-gate-button",h.type="submit",h.textContent=t.submitLabel,d.append(u,h),l.append(c),o.append(a,i,l,s,d),e.append(o),u.addEventListener("click",()=>{r()}),o.addEventListener("submit",m=>{m.preventDefault();let p=c.value;c.disabled=!0,h.disabled=!0,u.disabled=!0,s.textContent="",n(p).catch(f=>{s.textContent=f instanceof Error?f.message:"Authentication failed",c.disabled=!1,h.disabled=!1,u.disabled=!1,c.select(),c.focus()})}),queueMicrotask(()=>{c.focus()})}async function KV(){let e=oue();if(!e.enabled||e.strategy==="none")return{authenticated:!0,auth:e};let{card:t,overlay:n}=cue();return document.body.append(n),new Promise(r=>{let a=()=>{GV(),n.remove(),r({authenticated:!0,auth:e})},i=async()=>{Vk(t,{body:"Checking access to this session\u2026",title:"CollabMD"});try{if((await sue(e)).authenticated){a();return}}catch(o){Vk(t,{body:o instanceof Error?o.message:"Failed to contact the auth service.",secondaryActionLabel:"Retry",title:"Cannot verify access",onSecondaryAction:i});return}if(e.strategy==="password"){let o=lue();if(o)try{GV(),await YV(e,o),a();return}catch{}due(t,e,{onRetryStatus:i,onSubmit:async l=>{await YV(e,l),a()}});return}Vk(t,{body:e.strategy==="oidc"?"OIDC authentication is configured but not implemented in this build yet.":"This authentication strategy is not available.",secondaryActionLabel:"Retry status",title:"Authentication unavailable",onSecondaryAction:i})};i()})}var sr=()=>new Map,sw=e=>{let t=sr();return e.forEach((n,r)=>{t.set(r,n)}),t},ri=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},$V=(e,t)=>{let n=[];for(let[r,a]of e)n.push(t(a,r));return n},XV=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1};var Ki=()=>new Set;var dw=e=>e[e.length-1];var ZV=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},_o=Array.from,uw=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},hw=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1};var qV=(e,t)=>{let n=new Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n};var vu=Array.isArray;var tp=class{constructor(){this._observers=sr()}on(t,n){return ri(this._observers,t,Ki).add(n),n}once(t,n){let r=(...a)=>{this.off(t,r),n(...a)};this.on(t,r)}off(t,n){let r=this._observers.get(t);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(t))}emit(t,n){return _o((this._observers.get(t)||sr()).values()).forEach(r=>r(...n))}destroy(){this._observers=sr()}},mw=class{constructor(){this._observers=sr()}on(t,n){ri(this._observers,t,Ki).add(n)}once(t,n){let r=(...a)=>{this.off(t,r),n(...a)};this.on(t,r)}off(t,n){let r=this._observers.get(t);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(t))}emit(t,n){return _o((this._observers.get(t)||sr()).values()).forEach(r=>r(...n))}destroy(){this._observers=sr()}};var Er=Math.floor;var yu=Math.abs;var np=(e,t)=>e<t?e:t,vs=(e,t)=>e>t?e:t,UTe=Number.isNaN,QV=Math.pow;var pw=e=>e!==0?e<0:1/e<0;var rp=Number.MAX_SAFE_INTEGER,Gk=Number.MIN_SAFE_INTEGER,BTe=1<<31;var JV=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&Er(e)===e),FTe=Number.isNaN,HTe=Number.parseInt;var J1=String.fromCharCode,uue=String.fromCodePoint,jTe=J1(65535),hue=e=>e.toLowerCase(),mue=/^\s*/g,pue=e=>e.replace(mue,""),fue=/([A-Z])/g,Wk=(e,t)=>pue(e.replace(fue,n=>`${t}${hue(n)}`));var gue=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let a=0;a<n;a++)r[a]=t.codePointAt(a);return r},ip=typeof TextEncoder<"u"?new TextEncoder:null,bue=e=>ip.encode(e),eG=ip?bue:gue;var ap=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});ap&&ap.decode(new Uint8Array).length===1&&(ap=null);var tG=(e,t)=>qV(t,()=>e).join("");var wu=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},Wn=()=>new wu;var gw=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t};var Rt=e=>{let t=new Uint8Array(gw(e)),n=0;for(let r=0;r<e.bufs.length;r++){let a=e.bufs[r];t.set(a,n),n+=a.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},vue=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(vs(n,t)*2),e.cpos=0)},cr=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t};var bw=cr;var ue=(e,t)=>{for(;t>127;)cr(e,128|127&t),t=Er(t/128);cr(e,127&t)},vw=(e,t)=>{let n=pw(t);for(n&&(t=-t),cr(e,(t>63?128:0)|(n?64:0)|63&t),t=Er(t/64);t>0;)cr(e,(t>127?128:0)|127&t),t=Er(t/128)},Kk=new Uint8Array(3e4),yue=Kk.length/3,xue=(e,t)=>{if(t.length<yue){let n=ip.encodeInto(t,Kk).written||0;ue(e,n);for(let r=0;r<n;r++)cr(e,Kk[r])}else Xt(e,eG(t))},wue=(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;ue(e,r);for(let a=0;a<r;a++)cr(e,n.codePointAt(a))},ys=ip&&ip.encodeInto?xue:wue;var n0=(e,t)=>{let n=e.cbuf.length,r=e.cpos,a=np(n-r,t.length),i=t.length-a;e.cbuf.set(t.subarray(0,a),r),e.cpos+=a,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(vs(n*2,i)),e.cbuf.set(t.subarray(a)),e.cpos=i)},Xt=(e,t)=>{ue(e,t.byteLength),n0(e,t)},$k=(e,t)=>{vue(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Eue=(e,t)=>$k(e,4).setFloat32(0,t,!1),Sue=(e,t)=>$k(e,8).setFloat64(0,t,!1),Cue=(e,t)=>$k(e,8).setBigInt64(0,t,!1);var rG=new DataView(new ArrayBuffer(4)),_ue=e=>(rG.setFloat32(0,e),rG.getFloat32(0)===e),lp=(e,t)=>{switch(typeof t){case"string":cr(e,119),ys(e,t);break;case"number":JV(t)&&yu(t)<=2147483647?(cr(e,125),vw(e,t)):_ue(t)?(cr(e,124),Eue(e,t)):(cr(e,123),Sue(e,t));break;case"bigint":cr(e,122),Cue(e,t);break;case"object":if(t===null)cr(e,126);else if(vu(t)){cr(e,117),ue(e,t.length);for(let n=0;n<t.length;n++)lp(e,t[n])}else if(t instanceof Uint8Array)cr(e,116),Xt(e,t);else{cr(e,118);let n=Object.keys(t);ue(e,n.length);for(let r=0;r<n.length;r++){let a=n[r];ys(e,a),lp(e,t[a])}}break;case"boolean":cr(e,t?120:121);break;default:cr(e,127)}},t0=class extends wu{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&ue(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}};var aG=e=>{e.count>0&&(vw(e.encoder,e.count===1?e.s:-e.s),e.count>1&&ue(e.encoder,e.count-2))},Eu=class{constructor(){this.encoder=new wu,this.s=0,this.count=0}write(t){this.s===t?this.count++:(aG(this),this.count=1,this.s=t)}toUint8Array(){return aG(this),Rt(this.encoder)}};var iG=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);vw(e.encoder,t),e.count>1&&ue(e.encoder,e.count-2)}},sp=class{constructor(){this.encoder=new wu,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(iG(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return iG(this),Rt(this.encoder)}},fw=class{constructor(){this.sarr=[],this.s="",this.lensE=new Eu}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){let t=new wu;return this.sarr.push(this.s),this.s="",ys(t,this.sarr.join("")),n0(t,this.lensE.toUint8Array()),Rt(t)}};var ai=e=>new Error(e),ii=()=>{throw ai("Method unimplemented")},Pa=()=>{throw ai("Unexpected case")};var oG=ai("Unexpected end of array"),lG=ai("Integer out of Range"),cp=class{constructor(t){this.arr=t,this.pos=0}},To=e=>new cp(e),sG=e=>e.pos!==e.arr.length;var kue=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Kn=e=>kue(e,ve(e));var Su=e=>e.arr[e.pos++];var ve=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let a=e.arr[e.pos++];if(t=t+(a&127)*n,n*=128,a<128)return t;if(t>rp)throw lG}throw oG},ww=e=>{let t=e.arr[e.pos++],n=t&63,r=64,a=(t&64)>0?-1:1;if((t&128)===0)return a*n;let i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&127)*r,r*=128,t<128)return a*n;if(n>rp)throw lG}throw oG};var Tue=e=>{let t=ve(e);if(t===0)return"";{let n=String.fromCodePoint(Su(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Su(e));else for(;t>0;){let r=t<1e4?t:1e4,a=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,a),t-=r}return decodeURIComponent(escape(n))}},Mue=e=>ap.decode(Kn(e)),ko=ap?Mue:Tue;var Zk=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Aue=e=>Zk(e,4).getFloat32(0,!1),Due=e=>Zk(e,8).getFloat64(0,!1),Iue=e=>Zk(e,8).getBigInt64(0,!1);var Lue=[e=>{},e=>null,ww,Aue,Due,Iue,e=>!1,e=>!0,ko,e=>{let t=ve(e),n={};for(let r=0;r<t;r++){let a=ko(e);n[a]=dp(e)}return n},e=>{let t=ve(e),n=[];for(let r=0;r<t;r++)n.push(dp(e));return n},Kn],dp=e=>Lue[127-Su(e)](e),r0=class extends cp{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),sG(this)?this.count=ve(this)+1:this.count=-1),this.count--,this.s}};var Cu=class extends cp{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=ww(this);let t=pw(this.s);this.count=1,t&&(this.s=-this.s,this.count=ve(this)+2)}return this.count--,this.s}};var up=class extends cp{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let t=ww(this),n=t&1;this.diff=Er(t/2),this.count=1,n&&(this.count=ve(this)+2)}return this.s+=this.diff,this.count--,this.s}},xw=class{constructor(t){this.decoder=new Cu(t),this.str=ko(this.decoder),this.spos=0}read(){let t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}};var YTe=crypto.subtle,cG=crypto.getRandomValues.bind(crypto);var qk=()=>cG(new Uint32Array(1))[0];var Rue="10000000-1000-4000-8000"+-1e11,dG=()=>Rue.replace(/[018]/g,e=>(e^qk()&15>>e/4).toString(16));var Mo=Date.now;var Jk=e=>new Promise(e);var $Te=Promise.all.bind(Promise);var eT=e=>e===void 0?null:e;var tT=class{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}},uG=new tT,nT=!0;try{typeof localStorage<"u"&&localStorage&&(uG=localStorage,nT=!1)}catch{}var Ew=uG,hG=e=>nT||addEventListener("storage",e),mG=e=>nT||removeEventListener("storage",e);var _u=Symbol("Equality"),Sw=(e,t)=>e===t||!!e?.[_u]?.(t)||!1;var fG=e=>typeof e=="object",gG=Object.assign,Pue=Object.keys;var bG=(e,t)=>{for(let n in e)t(e[n],n)},vG=(e,t)=>{let n=[];for(let r in e)n.push(t(e[r],r));return n};var i0=e=>Pue(e).length;var yG=e=>{for(let t in e)return!1;return!0},hp=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},o0=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),aT=(e,t)=>e===t||i0(e)===i0(t)&&hp(e,(n,r)=>(n!==void 0||o0(t,r))&&Sw(t[r],n)),Uue=Object.freeze,iT=e=>{for(let t in e){let n=e[t];(typeof n=="object"||typeof n=="function")&&iT(e[t])}return Uue(e)};var l0=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&l0(e,t,n+1)}};var xG=e=>e;var Pc=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[_u]!=null)return e[_u](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break}case Set:{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break}case Map:{if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!Pc(e.get(n),t.get(n)))return!1;break}case void 0:case Object:if(i0(e)!==i0(t))return!1;for(let n in e)if(!o0(e,n)||!Pc(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Pc(e[n],t[n]))return!1;break;default:return!1}return!0},wG=(e,t)=>t.includes(e);var xs=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",kw=typeof window<"u"&&typeof document<"u"&&!xs,XTe=typeof navigator<"u"?/Mac/.test(navigator.platform):!1,dl,Bue=[],Fue=()=>{if(dl===void 0)if(xs){dl=sr();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]==="-"?(t!==null&&dl.set(t,""),t=r):t!==null?(dl.set(t,r),t=null):Bue.push(r)}t!==null&&dl.set(t,"")}else typeof location=="object"?(dl=sr(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){let[t,n]=e.split("=");dl.set(`--${Wk(t,"-")}`,n),dl.set(`-${Wk(t,"-")}`,n)}})):dl=sr();return dl},oT=e=>Fue().has(e);var s0=e=>xs?eT(process.env[e.toUpperCase().replaceAll("-","_")]):eT(Ew.getItem(e));var EG=e=>oT("--"+e)||s0(e)!==null,SG=EG("production"),Hue=xs&&wG(process.env.FORCE_COLOR,["true","1","2"]),CG=Hue||!oT("--no-colors")&&!EG("no-color")&&(!xs||process.stdout.isTTY)&&(!xs||oT("--color")||s0("COLORTERM")!==null||(s0("TERM")||"").includes("color"));var _G=e=>new Uint8Array(e),jue=(e,t,n)=>new Uint8Array(e,t,n),kG=e=>new Uint8Array(e),Vue=e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=J1(e[n]);return btoa(t)},Gue=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Yue=e=>{let t=atob(e),n=_G(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n},Wue=e=>{let t=Buffer.from(e,"base64");return jue(t.buffer,t.byteOffset,t.byteLength)},TG=kw?Vue:Gue,MG=kw?Yue:Wue;var AG=e=>{let t=_G(e.byteLength);return t.set(e),t};var lT=class{constructor(t,n){this.left=t,this.right=n}},ul=(e,t)=>new lT(e,t);var sT=e=>e.next()>=.5,Tw=(e,t,n)=>Er(e.next()*(n+1-t)+t);var cT=(e,t,n)=>Er(e.next()*(n+1-t)+t);var dT=(e,t,n)=>cT(e,t,n);var $ue=e=>J1(dT(e,97,122)),IG=(e,t=0,n=20)=>{let r=dT(e,t,n),a="";for(let i=0;i<r;i++)a+=$ue(e);return a};var Mw=(e,t)=>t[dT(e,0,t.length-1)];var Zue=Symbol("0schema"),uT=class{constructor(){this._rerrs=[]}extend(t,n,r,a=null){this._rerrs.push({path:t,expected:n,has:r,message:a})}toString(){let t=[];for(let n=this._rerrs.length-1;n>0;n--){let r=this._rerrs[n];t.push(tG(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return t.join(`
|
|
286
|
-
`)}},hT=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[_u]?Sw(e,t):vu(e)?uw(e,n=>hw(t,r=>hT(n,r))):fG(e)?hp(e,(n,r)=>hT(n,t[r])):!1,Sr=class{static _dilutes=!1;extends(t){let[n,r]=[this.shape,t.shape];return this.constructor._dilutes&&([r,n]=[n,r]),hT(n,r)}equals(t){return this.constructor===t.constructor&&Pc(this.shape,t.shape)}[Zue](){return!0}[_u](t){return this.equals(t)}validate(t){return this.check(t)}check(t,n){ii()}get nullable(){return bp(this,Fw)}get optional(){return new Aw(this)}cast(t){return LG(t,this),t}expect(t){return LG(t,this),t}},d0=class extends Sr{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n=void 0){let r=t?.constructor===this.shape&&(this._c==null||this._c(t));return!r&&n?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),r}},Nn=(e,t=null)=>new d0(e,t),qTe=Nn(d0),u0=class extends Sr{constructor(t){super(),this.shape=t}check(t,n){let r=this.shape(t);return!r&&n?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),r}},$n=e=>new u0(e),QTe=Nn(u0),fp=class extends Sr{constructor(t){super(),this.shape=t}check(t,n){let r=this.shape.some(a=>a===t);return!r&&n?.extend(null,this.shape.join(" | "),t.toString()),r}},Uw=(...e)=>new fp(e),RG=Nn(fp),que=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),NG=e=>{if(gp.check(e))return[que(e)];if(RG.check(e))return e.shape.map(t=>t+"");if(BG.check(e))return["[+-]?\\d+.?\\d*"];if(FG.check(e))return[".*"];if(zw.check(e))return e.shape.map(NG).flat(1);Pa()},mT=class extends Sr{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(NG).map(n=>`(${n.join("|")})`).join("")+"$")}check(t,n){let r=this._r.exec(t)!=null;return!r&&n?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),r}};var JTe=Nn(mT),Que=Symbol("optional"),Aw=class extends Sr{constructor(t){super(),this.shape=t}check(t,n){let r=t===void 0||this.shape.check(t);return!r&&n?.extend(null,"undefined (optional)","()"),r}get[Que](){return!0}},Jue=Nn(Aw),Dw=class extends Sr{check(t,n){return n?.extend(null,"never",typeof t),!1}},eMe=new Dw,tMe=Nn(Dw),Iw=class e extends Sr{constructor(t,n=!1){super(),this.shape=t,this._isPartial=n}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(t,n){return t==null?(n?.extend(null,"object","null"),!1):hp(this.shape,(r,a)=>{let i=this._isPartial&&!o0(t,a)||r.check(t[a],n);return!i&&n?.extend(a.toString(),r.toString(),typeof t[a],"Object property does not match"),i})}},ehe=e=>new Iw(e),the=Nn(Iw),nhe=$n(e=>e!=null&&(e.constructor===Object||e.constructor==null)),Lw=class extends Sr{constructor(t,n){super(),this.shape={keys:t,values:n}}check(t,n){return t!=null&&hp(t,(r,a)=>{let i=this.shape.keys.check(a,n);return!i&&n?.extend(a+"","Record",typeof t,i?"Key doesn't match schema":"Value doesn't match value"),i&&this.shape.values.check(r,n)})}},OG=(e,t)=>new Lw(e,t),rhe=Nn(Lw),Rw=class extends Sr{constructor(t){super(),this.shape=t}check(t,n){return t!=null&&hp(this.shape,(r,a)=>{let i=r.check(t[a],n);return!i&&n?.extend(a.toString(),"Tuple",typeof r),i})}},ahe=(...e)=>new Rw(e),nMe=Nn(Rw),Nw=class extends Sr{constructor(t){super(),this.shape=t.length===1?t[0]:new h0(t)}check(t,n){let r=vu(t)&&uw(t,a=>this.shape.check(a));return!r&&n?.extend(null,"Array",""),r}},zG=(...e)=>new Nw(e),ihe=Nn(Nw),ohe=$n(e=>vu(e)),Ow=class extends Sr{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n){let r=t instanceof this.shape&&(this._c==null||this._c(t));return!r&&n?.extend(null,this.shape.name,t?.constructor.name),r}},lhe=(e,t=null)=>new Ow(e,t),rMe=Nn(Ow),she=lhe(Sr),pT=class extends Sr{constructor(t){super(),this.len=t.length-1,this.args=ahe(...t.slice(-1)),this.res=t[this.len]}check(t,n){let r=t.constructor===Function&&t.length<=this.len;return!r&&n?.extend(null,"function",typeof t),r}};var che=Nn(pT),dhe=$n(e=>typeof e=="function"),fT=class extends Sr{constructor(t){super(),this.shape=t}check(t,n){let r=uw(this.shape,a=>a.check(t,n));return!r&&n?.extend(null,"Intersectinon",typeof t),r}};var aMe=Nn(fT,e=>e.shape.length>0),h0=class extends Sr{static _dilutes=!0;constructor(t){super(),this.shape=t}check(t,n){let r=hw(this.shape,a=>a.check(t,n));return n?.extend(null,"Union",typeof t),r}},bp=(...e)=>e.findIndex(t=>zw.check(t))>=0?bp(...e.map(t=>m0(t)).map(t=>zw.check(t)?t.shape:[t]).flat(1)):e.length===1?e[0]:new h0(e),zw=Nn(h0),PG=()=>!0,Pw=$n(PG),uhe=Nn(u0,e=>e.shape===PG),bT=$n(e=>typeof e=="bigint"),hhe=$n(e=>e===bT),UG=$n(e=>typeof e=="symbol"),iMe=$n(e=>e===UG),pp=$n(e=>typeof e=="number"),BG=$n(e=>e===pp),gp=$n(e=>typeof e=="string"),FG=$n(e=>e===gp),Bw=$n(e=>typeof e=="boolean"),mhe=$n(e=>e===Bw),HG=Uw(void 0),oMe=Nn(fp,e=>e.shape.length===1&&e.shape[0]===void 0),lMe=Uw(void 0);var Fw=Uw(null),phe=Nn(fp,e=>e.shape.length===1&&e.shape[0]===null),sMe=Nn(Uint8Array),cMe=Nn(d0,e=>e.shape===Uint8Array),fhe=bp(pp,gp,Fw,HG,bT,Bw,UG),dMe=(()=>{let e=zG(Pw),t=OG(gp,Pw),n=bp(pp,gp,Fw,Bw,e,t);return e.shape=n,t.shape.values=n,n})(),m0=e=>{if(she.check(e))return e;if(nhe.check(e)){let t={};for(let n in e)t[n]=m0(e[n]);return ehe(t)}else{if(ohe.check(e))return bp(...e.map(m0));if(fhe.check(e))return Uw(e);if(dhe.check(e))return Nn(e)}Pa()},LG=SG?()=>{}:(e,t)=>{let n=new uT;if(!t.check(e,n))throw ai(`Expected value to be of type ${t.constructor.name}.
|
|
287
|
-
${n.toString()}`)},gT=class{constructor(t){this.patterns=[],this.$state=t}if(t,n){return this.patterns.push({if:m0(t),h:n}),this}else(t){return this.if(Pw,t)}done(){return(t,n)=>{for(let r=0;r<this.patterns.length;r++){let a=this.patterns[r];if(a.if.check(t))return a.h(t,n)}throw ai("Unhandled pattern")}}},ghe=e=>new gT(e),jG=ghe(Pw).if(BG,(e,t)=>Tw(t,Gk,rp)).if(FG,(e,t)=>IG(t)).if(mhe,(e,t)=>sT(t)).if(hhe,(e,t)=>BigInt(Tw(t,Gk,rp))).if(zw,(e,t)=>mp(t,Mw(t,e.shape))).if(the,(e,t)=>{let n={};for(let r in e.shape){let a=e.shape[r];if(Jue.check(a)){if(sT(t))continue;a=a.shape}n[r]=jG(a,t)}return n}).if(ihe,(e,t)=>{let n=[],r=cT(t,0,42);for(let a=0;a<r;a++)n.push(mp(t,e.shape));return n}).if(RG,(e,t)=>Mw(t,e.shape)).if(phe,(e,t)=>null).if(che,(e,t)=>{let n=mp(t,e.res);return()=>n}).if(uhe,(e,t)=>mp(t,Mw(t,[pp,gp,Fw,HG,bT,Bw,zG(pp),OG(bp("a","b","c"),pp)]))).if(rhe,(e,t)=>{let n={},r=Tw(t,0,3);for(let a=0;a<r;a++){let i=mp(t,e.shape.keys),o=mp(t,e.shape.values);n[i]=o}return n}).done(),mp=(e,t)=>jG(m0(t),e);var ku=typeof document<"u"?document:{};var uMe=$n(e=>e.nodeType===whe);var hMe=typeof DOMParser<"u"?new DOMParser:null;var mMe=$n(e=>e.nodeType===vhe);var pMe=$n(e=>e.nodeType===yhe);var VG=e=>$V(e,(t,n)=>`${n}:${t};`).join("");var vhe=ku.ELEMENT_NODE,yhe=ku.TEXT_NODE,fMe=ku.CDATA_SECTION_NODE,gMe=ku.COMMENT_NODE,xhe=ku.DOCUMENT_NODE,bMe=ku.DOCUMENT_TYPE_NODE,whe=ku.DOCUMENT_FRAGMENT_NODE,vMe=$n(e=>e.nodeType===xhe);var hl=Symbol;var p0=hl(),f0=hl(),vT=hl(),yT=hl(),xT=hl(),g0=hl(),wT=hl(),vp=hl(),ET=hl(),GG=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let a=e[r];if(a===void 0)break;if(a.constructor===String||a.constructor===Number)t.push(a);else if(a.constructor===Object)break}for(r>0&&n.push(t.join(""));r<e.length;r++){let a=e[r];a instanceof Symbol||n.push(a)}return n};var yMe=Mo();var _he={[p0]:ul("font-weight","bold"),[f0]:ul("font-weight","normal"),[vT]:ul("color","blue"),[xT]:ul("color","green"),[yT]:ul("color","grey"),[g0]:ul("color","red"),[wT]:ul("color","purple"),[vp]:ul("color","orange"),[ET]:ul("color","black")},khe=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=sr(),a=[],i=0;for(;i<e.length;i++){let o=e[i],l=_he[o];if(l!==void 0)r.set(l.left,l.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){let c=VG(r);i>0||c.length>0?(t.push("%c"+o),n.push(c)):t.push(o)}else break}}for(i>0&&(a=n,a.unshift(t.join("")));i<e.length;i++){let o=e[i];o instanceof Symbol||a.push(o)}return a},YG=CG?khe:GG,WG=(...e)=>{console.log(...YG(e)),$G.forEach(t=>t.print(e))},KG=(...e)=>{console.warn(...YG(e)),e.unshift(vp),$G.forEach(t=>t.print(e))};var $G=Ki();var XG=e=>({[Symbol.iterator](){return this},next:e}),ZG=(e,t)=>XG(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Hw=(e,t)=>XG(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}});var v0=class{constructor(t,n){this.clock=t,this.len=n}},Tu=class{constructor(){this.clients=new Map}},dY=(e,t,n)=>t.clients.forEach((r,a)=>{let i=e.doc.store.clients.get(a);if(i!=null){let o=i[i.length-1],l=o.id.clock+o.length;for(let c=0,s=r[c];c<r.length&&s.clock<l;s=r[++c])EY(e,i,s.clock,s.len,n)}}),Ihe=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let a=Er((n+r)/2),i=e[a],o=i.clock;if(o<=t){if(t<o+i.len)return a;n=a+1}else r=a-1}return null},uY=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&Ihe(n,t.clock)!==null},FT=e=>{e.clients.forEach(t=>{t.sort((a,i)=>a.clock-i.clock);let n,r;for(n=1,r=1;n<t.length;n++){let a=t[r-1],i=t[n];a.clock+a.len>=i.clock?a.len=vs(a.len,i.clock+i.len-a.clock):(r<n&&(t[r]=i),r++)}t.length=r})},Lhe=e=>{let t=new Tu;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,a)=>{if(!t.clients.has(a)){let i=r.slice();for(let o=n+1;o<e.length;o++)ZV(i,e[o].clients.get(a)||[]);t.clients.set(a,i)}});return FT(t),t},Kw=(e,t,n,r)=>{ri(e.clients,t,()=>[]).push(new v0(n,r))},hY=()=>new Tu,Rhe=e=>{let t=hY();return e.clients.forEach((n,r)=>{let a=[];for(let i=0;i<n.length;i++){let o=n[i];if(o.deleted){let l=o.id.clock,c=o.length;if(i+1<n.length)for(let s=n[i+1];i+1<n.length&&s.deleted;s=n[++i+1])c+=s.length;a.push(new v0(l,c))}}a.length>0&&t.clients.set(r,a)}),t},Sp=(e,t)=>{ue(e.restEncoder,t.clients.size),_o(t.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{e.resetDsCurVal(),ue(e.restEncoder,n);let a=r.length;ue(e.restEncoder,a);for(let i=0;i<a;i++){let o=r[i];e.writeDsClock(o.clock),e.writeDsLen(o.len)}})},HT=e=>{let t=new Tu,n=ve(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let a=ve(e.restDecoder),i=ve(e.restDecoder);if(i>0){let o=ri(t.clients,a,()=>[]);for(let l=0;l<i;l++)o.push(new v0(e.readDsClock(),e.readDsLen()))}}return t},JG=(e,t,n)=>{let r=new Tu,a=ve(e.restDecoder);for(let i=0;i<a;i++){e.resetDsCurVal();let o=ve(e.restDecoder),l=ve(e.restDecoder),c=n.clients.get(o)||[],s=dr(n,o);for(let d=0;d<l;d++){let u=e.readDsClock(),h=u+e.readDsLen();if(u<s){s<h&&Kw(r,o,s,h-s);let m=ml(c,u),p=c[m];for(!p.deleted&&p.id.clock<u&&(c.splice(m+1,0,aE(t,p,u-p.id.clock)),m++);m<c.length&&(p=c[m++],p.id.clock<h);)p.deleted||(h<p.id.clock+p.length&&c.splice(m,0,aE(t,p,h-p.id.clock)),p.delete(t))}else Kw(r,o,u,h-u)}}if(r.clients.size>0){let i=new ws;return ue(i.restEncoder,0),Sp(i,r),i.toUint8Array()}return null};var mY=qk,Mu=class e extends tp{constructor({guid:t=dG(),collectionid:n=null,gc:r=!0,gcFilter:a=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=a,this.clientID=mY(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new Qw,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Jk(s=>{this.on("load",()=>{this.isLoaded=!0,s(this)})});let c=()=>Jk(s=>{let d=u=>{(u===void 0||u===!0)&&(this.off("sync",d),s())};this.on("sync",d)});this.on("sync",s=>{s===!1&&this.isSynced&&(this.whenSynced=c()),this.isSynced=s===void 0||s===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=c()}load(){let t=this._item;t!==null&&!this.shouldLoad&&Nt(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(_o(this.subdocs).map(t=>t.guid))}transact(t,n=null){return Nt(this,t,n)}get(t,n=Xn){let r=ri(this.share,t,()=>{let i=new n;return i._integrate(this,null),i}),a=r.constructor;if(n!==Xn&&a!==n)if(a===Xn){let i=new n;i._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=i}),i._start=r._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=r._length,this.share.set(t,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return r}getArray(t=""){return this.get(t,nE)}getText(t=""){return this.get(t,C0)}getMap(t=""){return this.get(t,pl)}getXmlElement(t=""){return this.get(t,_0)}getXmlFragment(t=""){return this.get(t,wp)}toJSON(){let t={};return this.share.forEach((n,r)=>{t[r]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,_o(this.subdocs).forEach(n=>n.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Nt(t.parent.doc,r=>{let a=n.doc;t.deleted||r.subdocsAdded.add(a),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}},$w=class{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return ve(this.restDecoder)}readDsLen(){return ve(this.restDecoder)}},Xw=class extends $w{readLeftID(){return qe(ve(this.restDecoder),ve(this.restDecoder))}readRightID(){return qe(ve(this.restDecoder),ve(this.restDecoder))}readClient(){return ve(this.restDecoder)}readInfo(){return Su(this.restDecoder)}readString(){return ko(this.restDecoder)}readParentInfo(){return ve(this.restDecoder)===1}readTypeRef(){return ve(this.restDecoder)}readLen(){return ve(this.restDecoder)}readAny(){return dp(this.restDecoder)}readBuf(){return AG(Kn(this.restDecoder))}readJSON(){return JSON.parse(ko(this.restDecoder))}readKey(){return ko(this.restDecoder)}},_T=class{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=ve(this.restDecoder),this.dsCurrVal}readDsLen(){let t=ve(this.restDecoder)+1;return this.dsCurrVal+=t,t}},Hc=class extends _T{constructor(t){super(t),this.keys=[],ve(t),this.keyClockDecoder=new up(Kn(t)),this.clientDecoder=new Cu(Kn(t)),this.leftClockDecoder=new up(Kn(t)),this.rightClockDecoder=new up(Kn(t)),this.infoDecoder=new r0(Kn(t),Su),this.stringDecoder=new xw(Kn(t)),this.parentInfoDecoder=new r0(Kn(t),Su),this.typeRefDecoder=new Cu(Kn(t)),this.lenDecoder=new Cu(Kn(t))}readLeftID(){return new Fc(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Fc(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return dp(this.restDecoder)}readBuf(){return Kn(this.restDecoder)}readJSON(){return dp(this.restDecoder)}readKey(){let t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{let n=this.stringDecoder.read();return this.keys.push(n),n}}},Zw=class{constructor(){this.restEncoder=Wn()}toUint8Array(){return Rt(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){ue(this.restEncoder,t)}writeDsLen(t){ue(this.restEncoder,t)}},Au=class extends Zw{writeLeftID(t){ue(this.restEncoder,t.client),ue(this.restEncoder,t.clock)}writeRightID(t){ue(this.restEncoder,t.client),ue(this.restEncoder,t.clock)}writeClient(t){ue(this.restEncoder,t)}writeInfo(t){bw(this.restEncoder,t)}writeString(t){ys(this.restEncoder,t)}writeParentInfo(t){ue(this.restEncoder,t?1:0)}writeTypeRef(t){ue(this.restEncoder,t)}writeLen(t){ue(this.restEncoder,t)}writeAny(t){lp(this.restEncoder,t)}writeBuf(t){Xt(this.restEncoder,t)}writeJSON(t){ys(this.restEncoder,JSON.stringify(t))}writeKey(t){ys(this.restEncoder,t)}},qw=class{constructor(){this.restEncoder=Wn(),this.dsCurrVal=0}toUint8Array(){return Rt(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){let n=t-this.dsCurrVal;this.dsCurrVal=t,ue(this.restEncoder,n)}writeDsLen(t){t===0&&Pa(),ue(this.restEncoder,t-1),this.dsCurrVal+=t}},ws=class extends qw{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new sp,this.clientEncoder=new Eu,this.leftClockEncoder=new sp,this.rightClockEncoder=new sp,this.infoEncoder=new t0(bw),this.stringEncoder=new fw,this.parentInfoEncoder=new t0(bw),this.typeRefEncoder=new Eu,this.lenEncoder=new Eu}toUint8Array(){let t=Wn();return ue(t,0),Xt(t,this.keyClockEncoder.toUint8Array()),Xt(t,this.clientEncoder.toUint8Array()),Xt(t,this.leftClockEncoder.toUint8Array()),Xt(t,this.rightClockEncoder.toUint8Array()),Xt(t,Rt(this.infoEncoder)),Xt(t,this.stringEncoder.toUint8Array()),Xt(t,Rt(this.parentInfoEncoder)),Xt(t,this.typeRefEncoder.toUint8Array()),Xt(t,this.lenEncoder.toUint8Array()),n0(t,Rt(this.restEncoder)),Rt(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){lp(this.restEncoder,t)}writeBuf(t){Xt(this.restEncoder,t)}writeJSON(t){lp(this.restEncoder,t)}writeKey(t){let n=this.keyMap.get(t);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(n)}},Nhe=(e,t,n,r)=>{r=vs(r,t[0].id.clock);let a=ml(t,r);ue(e.restEncoder,t.length-a),e.writeClient(n),ue(e.restEncoder,r);let i=t[a];i.write(e,r-i.id.clock);for(let o=a+1;o<t.length;o++)t[o].write(e,0)},jT=(e,t,n)=>{let r=new Map;n.forEach((a,i)=>{dr(t,i)>a&&r.set(i,a)}),iE(t).forEach((a,i)=>{n.has(i)||r.set(i,0)}),ue(e.restEncoder,r.size),_o(r.entries()).sort((a,i)=>i[0]-a[0]).forEach(([a,i])=>{Nhe(e,t.clients.get(a),a,i)})},Ohe=(e,t)=>{let n=sr(),r=ve(e.restDecoder);for(let a=0;a<r;a++){let i=ve(e.restDecoder),o=new Array(i),l=e.readClient(),c=ve(e.restDecoder);n.set(l,{i:0,refs:o});for(let s=0;s<i;s++){let d=e.readInfo();switch(31&d){case 0:{let u=e.readLen();o[s]=new Ua(qe(l,c),u),c+=u;break}case 10:{let u=ve(e.restDecoder);o[s]=new Ba(qe(l,c),u),c+=u;break}default:{let u=(d&192)===0,h=new ur(qe(l,c),null,(d&128)===128?e.readLeftID():null,null,(d&64)===64?e.readRightID():null,u?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,u&&(d&32)===32?e.readString():null,HY(e,d));o[s]=h,c+=h.length}}}}return n},zhe=(e,t,n)=>{let r=[],a=_o(n.keys()).sort((m,p)=>m-p);if(a.length===0)return null;let i=()=>{if(a.length===0)return null;let m=n.get(a[a.length-1]);for(;m.refs.length===m.i;)if(a.pop(),a.length>0)m=n.get(a[a.length-1]);else return null;return m},o=i();if(o===null)return null;let l=new Qw,c=new Map,s=(m,p)=>{let f=c.get(m);(f==null||f>p)&&c.set(m,p)},d=o.refs[o.i++],u=new Map,h=()=>{for(let m of r){let p=m.id.client,f=n.get(p);f?(f.i--,l.clients.set(p,f.refs.slice(f.i)),n.delete(p),f.i=0,f.refs=[]):l.clients.set(p,[m]),a=a.filter(x=>x!==p)}r.length=0};for(;;){if(d.constructor!==Ba){let p=ri(u,d.id.client,()=>dr(t,d.id.client))-d.id.clock;if(p<0)r.push(d),s(d.id.client,d.id.clock-1),h();else{let f=d.getMissing(e,t);if(f!==null){r.push(d);let x=n.get(f)||{refs:[],i:0};if(x.refs.length===x.i)s(f,dr(t,f)),h();else{d=x.refs[x.i++];continue}}else(p===0||p<d.length)&&(d.integrate(e,p),u.set(d.id.client,d.id.clock+d.length))}}if(r.length>0)d=r.pop();else if(o!==null&&o.i<o.refs.length)d=o.refs[o.i++];else{if(o=i(),o===null)break;d=o.refs[o.i++]}}if(l.clients.size>0){let m=new ws;return jT(m,l,new Map),ue(m.restEncoder,0),{missing:c,update:m.toUint8Array()}}return null},Phe=(e,t)=>jT(e,t.doc.store,t.beforeState),Uhe=(e,t,n,r=new Hc(e))=>Nt(t,a=>{a.local=!1;let i=!1,o=a.doc,l=o.store,c=Ohe(r,o),s=zhe(a,l,c),d=l.pendingStructs;if(d){for(let[h,m]of d.missing)if(m<dr(l,h)){i=!0;break}if(s){for(let[h,m]of s.missing){let p=d.missing.get(h);(p==null||p>m)&&d.missing.set(h,m)}d.update=Jw([d.update,s.update])}}else l.pendingStructs=s;let u=JG(r,a,l);if(l.pendingDs){let h=new Hc(To(l.pendingDs));ve(h.restDecoder);let m=JG(h,a,l);u&&m?l.pendingDs=Jw([u,m]):l.pendingDs=u||m}else l.pendingDs=u;if(i){let h=l.pendingStructs.update;l.pendingStructs=null,pY(a.doc,h)}},n,!1);var pY=(e,t,n,r=Hc)=>{let a=To(t);Uhe(a,e,n,new r(a))},fY=(e,t,n)=>pY(e,t,n,Xw),Bhe=(e,t,n=new Map)=>{jT(e,t.store,n),Sp(e,Rhe(t.store))},Fhe=(e,t=new Uint8Array([0]),n=new ws)=>{let r=bY(t);Bhe(n,e,r);let a=[n.toUint8Array()];if(e.store.pendingDs&&a.push(e.store.pendingDs),e.store.pendingStructs&&a.push(Jhe(e.store.pendingStructs.update,t)),a.length>1){if(n.constructor===Au)return qhe(a.map((i,o)=>o===0?i:tme(i)));if(n.constructor===ws)return Jw(a)}return a[0]},gY=(e,t)=>Fhe(e,t,new Au),Hhe=e=>{let t=new Map,n=ve(e.restDecoder);for(let r=0;r<n;r++){let a=ve(e.restDecoder),i=ve(e.restDecoder);t.set(a,i)}return t},bY=e=>Hhe(new $w(To(e))),vY=(e,t)=>(ue(e.restEncoder,t.size),_o(t.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{ue(e.restEncoder,n),ue(e.restEncoder,r)}),e),jhe=(e,t)=>vY(e,iE(t.store)),Vhe=(e,t=new qw)=>(e instanceof Map?vY(t,e):jhe(t,e),t.toUint8Array()),yY=e=>Vhe(e,new Zw),kT=class{constructor(){this.l=[]}},eY=()=>new kT,tY=(e,t)=>e.l.push(t),nY=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(a=>t!==a),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},xY=(e,t,n)=>l0(e.l,[t,n]),Fc=class{constructor(t,n){this.client=t,this.clock=n}},jw=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,qe=(e,t)=>new Fc(e,t);var Ghe=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw Pa()};var TT=class{constructor(t,n){this.ds=t,this.sv=n}};var Yhe=(e,t)=>new TT(e,t),AMe=Yhe(hY(),new Map);var yp=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!uY(t.ds,e.id),MT=(e,t)=>{let n=ri(e.meta,MT,Ki),r=e.doc.store;n.has(t)||(t.sv.forEach((a,i)=>{a<dr(r,i)&&jc(e,qe(i,a))}),dY(e,t.ds,a=>{}),n.add(t))};var Qw=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},iE=e=>{let t=new Map;return e.clients.forEach((n,r)=>{let a=n[n.length-1];t.set(r,a.id.clock+a.length)}),t},dr=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},wY=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let r=n[n.length-1];if(r.id.clock+r.length!==t.id.clock)throw Pa()}n.push(t)},ml=(e,t)=>{let n=0,r=e.length-1,a=e[r],i=a.id.clock;if(i===t)return r;let o=Er(t/(i+a.length-1)*r);for(;n<=r;){if(a=e[o],i=a.id.clock,i<=t){if(t<i+a.length)return o;n=o+1}else r=o-1;o=Er((n+r)/2)}throw Pa()},Whe=(e,t)=>{let n=e.clients.get(t.client);return n[ml(n,t.clock)]},ST=Whe,AT=(e,t,n)=>{let r=ml(t,n),a=t[r];return a.id.clock<n&&a instanceof ur?(t.splice(r+1,0,aE(e,a,n-a.id.clock)),r+1):r},jc=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[AT(e,n,t.clock)]},rY=(e,t,n)=>{let r=t.clients.get(n.client),a=ml(r,n.clock),i=r[a];return n.clock!==i.id.clock+i.length-1&&i.constructor!==Ua&&r.splice(a+1,0,aE(e,i,n.clock-i.id.clock+1)),i},Khe=(e,t,n)=>{let r=e.clients.get(t.id.client);r[ml(r,t.id.clock)]=n},EY=(e,t,n,r,a)=>{if(r===0)return;let i=n+r,o=AT(e,t,n),l;do l=t[o++],i<l.id.clock+l.length&&AT(e,t,i),a(l);while(o<t.length&&t[o].id.clock<i)},DT=class{constructor(t,n,r){this.doc=t,this.deleteSet=new Tu,this.beforeState=iE(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},aY=(e,t)=>t.deleteSet.clients.size===0&&!XV(t.afterState,(n,r)=>t.beforeState.get(r)!==n)?!1:(FT(t.deleteSet),Phe(e,t),Sp(e,t.deleteSet),!0),iY=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&ri(e.changed,t,Ki).add(n)},Yw=(e,t)=>{let n=e[t],r=e[t-1],a=t;for(;a>0;n=r,r=e[--a-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof ur&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let i=t-a;return i&&e.splice(t+1-i,i),i},$he=(e,t,n)=>{for(let[r,a]of e.clients.entries()){let i=t.clients.get(r);for(let o=a.length-1;o>=0;o--){let l=a[o],c=l.clock+l.len;for(let s=ml(i,l.clock),d=i[s];s<i.length&&d.id.clock<c;d=i[++s]){let u=i[s];if(l.clock+l.len<=u.id.clock)break;u instanceof ur&&u.deleted&&!u.keep&&n(u)&&u.gc(t,!1)}}}},Xhe=(e,t)=>{e.clients.forEach((n,r)=>{let a=t.clients.get(r);for(let i=n.length-1;i>=0;i--){let o=n[i],l=np(a.length-1,1+ml(a,o.clock+o.len-1));for(let c=l,s=a[c];c>0&&s.id.clock>=o.clock;s=a[c])c-=1+Yw(a,c)}})};var SY=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,a=r.store,i=n.deleteSet,o=n._mergeStructs;try{FT(i),n.afterState=iE(n.doc.store),r.emit("beforeObserverCalls",[n,r]);let l=[];n.changed.forEach((c,s)=>l.push(()=>{(s._item===null||!s._item.deleted)&&s._callObserver(n,c)})),l.push(()=>{n.changedParentTypes.forEach((c,s)=>{s._dEH.l.length>0&&(s._item===null||!s._item.deleted)&&(c=c.filter(d=>d.target._item===null||!d.target._item.deleted),c.forEach(d=>{d.currentTarget=s,d._path=null}),c.sort((d,u)=>d.path.length-u.path.length),l.push(()=>{xY(s._dEH,c,n)}))}),l.push(()=>r.emit("afterTransaction",[n,r])),l.push(()=>{n._needFormattingCleanup&&hme(n)})}),l0(l,[])}finally{r.gc&&$he(i,a,r.gcFilter),Xhe(i,a),n.afterState.forEach((d,u)=>{let h=n.beforeState.get(u)||0;if(h!==d){let m=a.clients.get(u),p=vs(ml(m,h),1);for(let f=m.length-1;f>=p;)f-=1+Yw(m,f)}});for(let d=o.length-1;d>=0;d--){let{client:u,clock:h}=o[d].id,m=a.clients.get(u),p=ml(m,h);p+1<m.length&&Yw(m,p+1)>1||p>0&&Yw(m,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(WG(vp,p0,"[yjs] ",f0,g0,"Changed the client-id because another client seems to be using it."),r.clientID=mY()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){let d=new Au;aY(d,n)&&r.emit("update",[d.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){let d=new ws;aY(d,n)&&r.emit("updateV2",[d.toUint8Array(),n.origin,r,n])}let{subdocsAdded:l,subdocsLoaded:c,subdocsRemoved:s}=n;(l.size>0||s.size>0||c.size>0)&&(l.forEach(d=>{d.clientID=r.clientID,d.collectionid==null&&(d.collectionid=r.collectionid),r.subdocs.add(d)}),s.forEach(d=>r.subdocs.delete(d)),r.emit("subdocs",[{loaded:c,added:l,removed:s},r,n]),s.forEach(d=>d.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):SY(e,t+1)}}},Nt=(e,t,n=null,r=!0)=>{let a=e._transactionCleanups,i=!1,o=null;e._transaction===null&&(i=!0,e._transaction=new DT(e,n,r),a.push(e._transaction),a.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{o=t(e._transaction)}finally{if(i){let l=e._transaction===a[0];e._transaction=null,l&&SY(a,0)}}return o};function*Zhe(e){let t=ve(e.restDecoder);for(let n=0;n<t;n++){let r=ve(e.restDecoder),a=e.readClient(),i=ve(e.restDecoder);for(let o=0;o<r;o++){let l=e.readInfo();if(l===10){let c=ve(e.restDecoder);yield new Ba(qe(a,i),c),i+=c}else if((31&l)!==0){let c=(l&192)===0,s=new ur(qe(a,i),null,(l&128)===128?e.readLeftID():null,null,(l&64)===64?e.readRightID():null,c?e.readParentInfo()?e.readString():e.readLeftID():null,c&&(l&32)===32?e.readString():null,HY(e,l));yield s,i+=s.length}else{let c=e.readLen();yield new Ua(qe(a,i),c),i+=c}}}}var y0=class{constructor(t,n){this.gen=Zhe(t),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===Ba);return this.curr}};var x0=class{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}},qhe=e=>Jw(e,Xw,Au);var Qhe=(e,t)=>{if(e.constructor===Ua){let{client:n,clock:r}=e.id;return new Ua(qe(n,r+t),e.length-t)}else if(e.constructor===Ba){let{client:n,clock:r}=e.id;return new Ba(qe(n,r+t),e.length-t)}else{let n=e,{client:r,clock:a}=n.id;return new ur(qe(r,a+t),null,qe(r,a+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},Jw=(e,t=Hc,n=ws)=>{if(e.length===1)return e[0];let r=e.map(d=>new t(To(d))),a=r.map(d=>new y0(d,!0)),i=null,o=new n,l=new x0(o);for(;a=a.filter(h=>h.curr!==null),a.sort((h,m)=>{if(h.curr.id.client===m.curr.id.client){let p=h.curr.id.clock-m.curr.id.clock;return p===0?h.curr.constructor===m.curr.constructor?0:h.curr.constructor===Ba?1:-1:p}else return m.curr.id.client-h.curr.id.client}),a.length!==0;){let d=a[0],u=d.curr.id.client;if(i!==null){let h=d.curr,m=!1;for(;h!==null&&h.id.clock+h.length<=i.struct.id.clock+i.struct.length&&h.id.client>=i.struct.id.client;)h=d.next(),m=!0;if(h===null||h.id.client!==u||m&&h.id.clock>i.struct.id.clock+i.struct.length)continue;if(u!==i.struct.id.client)Uc(l,i.struct,i.offset),i={struct:h,offset:0},d.next();else if(i.struct.id.clock+i.struct.length<h.id.clock)if(i.struct.constructor===Ba)i.struct.length=h.id.clock+h.length-i.struct.id.clock;else{Uc(l,i.struct,i.offset);let p=h.id.clock-i.struct.id.clock-i.struct.length;i={struct:new Ba(qe(u,i.struct.id.clock+i.struct.length),p),offset:0}}else{let p=i.struct.id.clock+i.struct.length-h.id.clock;p>0&&(i.struct.constructor===Ba?i.struct.length-=p:h=Qhe(h,p)),i.struct.mergeWith(h)||(Uc(l,i.struct,i.offset),i={struct:h,offset:0},d.next())}}else i={struct:d.curr,offset:0},d.next();for(let h=d.curr;h!==null&&h.id.client===u&&h.id.clock===i.struct.id.clock+i.struct.length&&h.constructor!==Ba;h=d.next())Uc(l,i.struct,i.offset),i={struct:h,offset:0}}i!==null&&(Uc(l,i.struct,i.offset),i=null),VT(l);let c=r.map(d=>HT(d)),s=Lhe(c);return Sp(o,s),o.toUint8Array()},Jhe=(e,t,n=Hc,r=ws)=>{let a=bY(t),i=new r,o=new x0(i),l=new n(To(e)),c=new y0(l,!1);for(;c.curr;){let d=c.curr,u=d.id.client,h=a.get(u)||0;if(c.curr.constructor===Ba){c.next();continue}if(d.id.clock+d.length>h)for(Uc(o,d,vs(h-d.id.clock,0)),c.next();c.curr&&c.curr.id.client===u;)Uc(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===u&&c.curr.id.clock+c.curr.length<=h;)c.next()}VT(o);let s=HT(l);return Sp(i,s),i.toUint8Array()};var CY=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Rt(e.encoder.restEncoder)}),e.encoder.restEncoder=Wn(),e.written=0)},Uc=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&CY(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),ue(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},VT=e=>{CY(e);let t=e.encoder.restEncoder;ue(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];ue(t,r.written),n0(t,r.restEncoder)}},eme=(e,t,n,r)=>{let a=new n(To(e)),i=new y0(a,!1),o=new r,l=new x0(o);for(let s=i.curr;s!==null;s=i.next())Uc(l,t(s),0);VT(l);let c=HT(a);return Sp(o,c),o.toUint8Array()};var tme=e=>eme(e,xG,Hc,Au),oY="You must not compute changes after the event-handler fired.",xp=class{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=nme(this.currentTarget,this.target))}deletes(t){return uY(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw ai(oY);let t=new Map,n=this.target;this.transaction.changed.get(n).forEach(a=>{if(a!==null){let i=n._map.get(a),o,l;if(this.adds(i)){let c=i.left;for(;c!==null&&this.adds(c);)c=c.left;if(this.deletes(i))if(c!==null&&this.deletes(c))o="delete",l=dw(c.content.getContent());else return;else c!==null&&this.deletes(c)?(o="update",l=dw(c.content.getContent())):(o="add",l=void 0)}else if(this.deletes(i))o="delete",l=dw(i.content.getContent());else return;t.set(a,{action:o,oldValue:l})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw ai(oY);let n=this.target,r=Ki(),a=Ki(),i=[];if(t={added:r,deleted:a,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null,c=()=>{l&&i.push(l)};for(let s=n._start;s!==null;s=s.right)s.deleted?this.deletes(s)&&!this.adds(s)&&((l===null||l.delete===void 0)&&(c(),l={delete:0}),l.delete+=s.length,a.add(s)):this.adds(s)?((l===null||l.insert===void 0)&&(c(),l={insert:[]}),l.insert=l.insert.concat(s.content.getContent()),r.add(s)):((l===null||l.retain===void 0)&&(c(),l={retain:0}),l.retain+=s.length);l!==null&&l.retain===void 0&&c()}this._changes=t}return t}},nme=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let r=0,a=t._item.parent._start;for(;a!==t._item&&a!==null;)!a.deleted&&a.countable&&(r+=a.length),a=a.right;n.unshift(r)}t=t._item.parent}return n},Fr=()=>{KG("Invalid access: Add Yjs type to a document before reading data.")},_Y=80,GT=0,IT=class{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=GT++}},rme=e=>{e.timestamp=GT++},kY=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=GT++},ame=(e,t,n)=>{if(e.length>=_Y){let r=e.reduce((a,i)=>a.timestamp<i.timestamp?a:i);return kY(r,t,n),r}else{let r=new IT(t,n);return e.push(r),r}},oE=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((i,o)=>yu(t-i.index)<yu(t-o.index)?i:o),r=e._start,a=0;for(n!==null&&(r=n.p,a=n.index,rme(n));r.right!==null&&a<t;){if(!r.deleted&&r.countable){if(t<a+r.length)break;a+=r.length}r=r.right}for(;r.left!==null&&a>t;)r=r.left,!r.deleted&&r.countable&&(a-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(a-=r.length);return n!==null&&yu(n.index-a)<r.parent.length/_Y?(kY(n,r,a),n):ame(e._searchMarker,r,a)},w0=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let a=e[r];if(n>0){let i=a.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(a.index-=i.length);if(i===null||i.marker===!0){e.splice(r,1);continue}a.p=i,i.marker=!0}(t<a.index||n>0&&t===a.index)&&(a.index=vs(t,a.index+n))}};var lE=(e,t,n)=>{let r=e,a=t.changedParentTypes;for(;ri(a,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;xY(r._eH,n,t)},Xn=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=eY(),this._dEH=eY(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw ii()}clone(){throw ii()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){tY(this._eH,t)}observeDeep(t){tY(this._dEH,t)}unobserve(t){nY(this._eH,t)}unobserveDeep(t){nY(this._dEH,t)}toJSON(){}},TY=(e,t,n)=>{e.doc??Fr(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,a=[],i=e._start;for(;i!==null&&r>0;){if(i.countable&&!i.deleted){let o=i.content.getContent();if(o.length<=t)t-=o.length;else{for(let l=t;l<o.length&&r>0;l++)a.push(o[l]),r--;t=0}}i=i.right}return a},MY=e=>{e.doc??Fr();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let r=n.content.getContent();for(let a=0;a<r.length;a++)t.push(r[a])}n=n.right}return t};var E0=(e,t)=>{let n=0,r=e._start;for(e.doc??Fr();r!==null;){if(r.countable&&!r.deleted){let a=r.content.getContent();for(let i=0;i<a.length;i++)t(a[i],n++,e)}r=r.right}},AY=(e,t)=>{let n=[];return E0(e,(r,a)=>{n.push(t(r,a,e))}),n},ime=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let a=n[r++];return n.length<=r&&(n=null),{done:!1,value:a}}}},DY=(e,t)=>{e.doc??Fr();let n=oE(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},eE=(e,t,n,r)=>{let a=n,i=e.doc,o=i.clientID,l=i.store,c=n===null?t._start:n.right,s=[],d=()=>{s.length>0&&(a=new ur(qe(o,dr(l,o)),a,a&&a.lastId,c,c&&c.id,t,null,new Ep(s)),a.integrate(e,0),s=[])};r.forEach(u=>{if(u===null)s.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:s.push(u);break;default:switch(d(),u.constructor){case Uint8Array:case ArrayBuffer:a=new ur(qe(o,dr(l,o)),a,a&&a.lastId,c,c&&c.id,t,null,new T0(new Uint8Array(u))),a.integrate(e,0);break;case Mu:a=new ur(qe(o,dr(l,o)),a,a&&a.lastId,c,c&&c.id,t,null,new M0(u)),a.integrate(e,0);break;default:if(u instanceof Xn)a=new ur(qe(o,dr(l,o)),a,a&&a.lastId,c,c&&c.id,t,null,new Ss(u)),a.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},IY=()=>ai("Length exceeded!"),LY=(e,t,n,r)=>{if(n>t._length)throw IY();if(n===0)return t._searchMarker&&w0(t._searchMarker,n,r.length),eE(e,t,null,r);let a=n,i=oE(t,n),o=t._start;for(i!==null&&(o=i.p,n-=i.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&jc(e,qe(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&w0(t._searchMarker,a,r.length),eE(e,t,o,r)},ome=(e,t,n)=>{let a=(t._searchMarker||[]).reduce((i,o)=>o.index>i.index?o:i,{index:0,p:t._start}).p;if(a)for(;a.right;)a=a.right;return eE(e,t,a,n)},RY=(e,t,n,r)=>{if(r===0)return;let a=n,i=r,o=oE(t,n),l=t._start;for(o!==null&&(l=o.p,n-=o.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&jc(e,qe(l.id.client,l.id.clock+n)),n-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&jc(e,qe(l.id.client,l.id.clock+r)),l.delete(e),r-=l.length),l=l.right;if(r>0)throw IY();t._searchMarker&&w0(t._searchMarker,a,-i+r)},tE=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},YT=(e,t,n,r)=>{let a=t._map.get(n)||null,i=e.doc,o=i.clientID,l;if(r==null)l=new Ep([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new Ep([r]);break;case Uint8Array:l=new T0(r);break;case Mu:l=new M0(r);break;default:if(r instanceof Xn)l=new Ss(r);else throw new Error("Unexpected content type")}new ur(qe(o,dr(i.store,o)),a,a&&a.lastId,null,null,t,n,l).integrate(e,0)},WT=(e,t)=>{e.doc??Fr();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},NY=e=>{let t={};return e.doc??Fr(),e._map.forEach((n,r)=>{n.deleted||(t[r]=n.content.getContent()[n.length-1])}),t},OY=(e,t)=>{e.doc??Fr();let n=e._map.get(t);return n!==void 0&&!n.deleted};var lme=(e,t)=>{let n={};return e._map.forEach((r,a)=>{let i=r;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&yp(i,t)&&(n[a]=i.content.getContent()[i.length-1])}),n},Vw=e=>(e.doc??Fr(),ZG(e._map.entries(),t=>!t[1].deleted)),LT=class extends xp{},nE=class e extends Xn{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(n=>n instanceof Xn?n.clone():n)),t}get length(){return this.doc??Fr(),this._length}_callObserver(t,n){super._callObserver(t,n),lE(this,t,new LT(this,t))}insert(t,n){this.doc!==null?Nt(this.doc,r=>{LY(r,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?Nt(this.doc,n=>{ome(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?Nt(this.doc,r=>{RY(r,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return DY(this,t)}toArray(){return MY(this)}slice(t=0,n=this.length){return TY(this,t,n)}toJSON(){return this.map(t=>t instanceof Xn?t.toJSON():t)}map(t){return AY(this,t)}forEach(t){E0(this,t)}[Symbol.iterator](){return ime(this)}_write(t){t.writeTypeRef(Ame)}},sme=e=>new nE,RT=class extends xp{constructor(t,n,r){super(t,n),this.keysChanged=r}},pl=class e extends Xn{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((r,a)=>{this.set(a,r)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((n,r)=>{t.set(r,n instanceof Xn?n.clone():n)}),t}_callObserver(t,n){lE(this,t,new RT(this,t,n))}toJSON(){this.doc??Fr();let t={};return this._map.forEach((n,r)=>{if(!n.deleted){let a=n.content.getContent()[n.length-1];t[r]=a instanceof Xn?a.toJSON():a}}),t}get size(){return[...Vw(this)].length}keys(){return Hw(Vw(this),t=>t[0])}values(){return Hw(Vw(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return Hw(Vw(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??Fr(),this._map.forEach((n,r)=>{n.deleted||t(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?Nt(this.doc,n=>{tE(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?Nt(this.doc,r=>{YT(r,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return WT(this,t)}has(t){return OY(this,t)}clear(){this.doc!==null?Nt(this.doc,t=>{this.forEach(function(n,r,a){tE(t,a,r)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(Dme)}},cme=e=>new pl,Bc=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&aT(e,t),S0=class{constructor(t,n,r,a){this.left=t,this.right=n,this.index=r,this.currentAttributes=a}forward(){this.right===null&&Pa(),this.right.content.constructor===Zn?this.right.deleted||Cp(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}},lY=(e,t,n)=>{for(;t.right!==null&&n>0;)t.right.content.constructor===Zn?t.right.deleted||Cp(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&jc(e,qe(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length),t.left=t.right,t.right=t.right.right;return t},Gw=(e,t,n,r)=>{let a=new Map,i=r?oE(t,n):null;if(i){let o=new S0(i.p.left,i.p,i.index,a);return lY(e,o,n-i.index)}else{let o=new S0(null,t._start,0,a);return lY(e,o,n)}},zY=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Zn&&Bc(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let a=e.doc,i=a.clientID;r.forEach((o,l)=>{let c=n.left,s=n.right,d=new ur(qe(i,dr(a.store,i)),c,c&&c.lastId,s,s&&s.id,t,null,new Zn(l,o));d.integrate(e,0),n.right=d,n.forward()})},Cp=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},PY=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===Zn&&Bc(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},UY=(e,t,n,r)=>{let a=e.doc,i=a.clientID,o=new Map;for(let l in r){let c=r[l],s=n.currentAttributes.get(l)??null;if(!Bc(s,c)){o.set(l,s);let{left:d,right:u}=n;n.right=new ur(qe(i,dr(a.store,i)),d,d&&d.lastId,u,u&&u.id,t,null,new Zn(l,c)),n.right.integrate(e,0),n.forward()}}return o},CT=(e,t,n,r,a)=>{n.currentAttributes.forEach((h,m)=>{a[m]===void 0&&(a[m]=null)});let i=e.doc,o=i.clientID;PY(n,a);let l=UY(e,t,n,a),c=r.constructor===String?new Es(r):r instanceof Xn?new Ss(r):new Du(r),{left:s,right:d,index:u}=n;t._searchMarker&&w0(t._searchMarker,n.index,c.getLength()),d=new ur(qe(o,dr(i.store,o)),s,s&&s.lastId,d,d&&d.id,t,null,c),d.integrate(e,0),n.right=d,n.index=u,n.forward(),zY(e,t,n,l)},sY=(e,t,n,r,a)=>{let i=e.doc,o=i.clientID;PY(n,a);let l=UY(e,t,n,a);e:for(;n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===Zn));){if(!n.right.deleted)switch(n.right.content.constructor){case Zn:{let{key:c,value:s}=n.right.content,d=a[c];if(d!==void 0){if(Bc(d,s))l.delete(c);else{if(r===0)break e;l.set(c,s)}n.right.delete(e)}else n.currentAttributes.set(c,s);break}default:r<n.right.length&&jc(e,qe(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let c="";for(;r>0;r--)c+=`
|
|
288
|
-
`;n.right=new ur(qe(o,dr(i.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Es(c)),n.right.integrate(e,0),n.forward()}zY(e,t,n,l)},BY=(e,t,n,r,a)=>{let i=t,o=sr();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Zn){let s=i.content;o.set(s.key,s)}i=i.right}let l=0,c=!1;for(;t!==i;){if(n===t&&(c=!0),!t.deleted){let s=t.content;if(s.constructor===Zn){let{key:d,value:u}=s,h=r.get(d)??null;(o.get(d)!==s||h===u)&&(t.delete(e),l++,!c&&(a.get(d)??null)===u&&h!==u&&(h===null?a.delete(d):a.set(d,h))),!c&&!t.deleted&&Cp(a,s)}}t=t.right}return l},dme=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Zn){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},ume=e=>{let t=0;return Nt(e.doc,n=>{let r=e._start,a=e._start,i=sr(),o=sw(i);for(;a;)a.deleted===!1&&(a.content.constructor===Zn?Cp(o,a.content):(t+=BY(n,r,a,i,o),i=sw(o),r=a)),a=a.right}),t},hme=e=>{let t=new Set,n=e.doc;for(let[r,a]of e.afterState.entries()){let i=e.beforeState.get(r)||0;a!==i&&EY(e,n.store.clients.get(r),i,a,o=>{!o.deleted&&o.content.constructor===Zn&&o.constructor!==Ua&&t.add(o.parent)})}Nt(n,r=>{dY(e,e.deleteSet,a=>{if(a instanceof Ua||!a.parent._hasFormatting||t.has(a.parent))return;let i=a.parent;a.content.constructor===Zn?t.add(i):dme(r,a)});for(let a of t)ume(a)})},cY=(e,t,n)=>{let r=n,a=sw(t.currentAttributes),i=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case Ss:case Du:case Es:n<t.right.length&&jc(e,qe(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&BY(e,i,t.right,a,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&w0(o._searchMarker,t.index,-r+n),t},NT=class extends xp{constructor(t,n,r){super(t,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(a=>{a===null?this.childListChanged=!0:this.keysChanged.add(a)})}get changes(){if(this._changes===null){let t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){let t=this.target.doc,n=[];Nt(t,r=>{let a=new Map,i=new Map,o=this.target._start,l=null,c={},s="",d=0,u=0,h=()=>{if(l!==null){let m=null;switch(l){case"delete":u>0&&(m={delete:u}),u=0;break;case"insert":(typeof s=="object"||s.length>0)&&(m={insert:s},a.size>0&&(m.attributes={},a.forEach((p,f)=>{p!==null&&(m.attributes[f]=p)}))),s="";break;case"retain":d>0&&(m={retain:d},yG(c)||(m.attributes=gG({},c))),d=0;break}m&&n.push(m),l=null}};for(;o!==null;){switch(o.content.constructor){case Ss:case Du:this.adds(o)?this.deletes(o)||(h(),l="insert",s=o.content.getContent()[0],h()):this.deletes(o)?(l!=="delete"&&(h(),l="delete"),u+=1):o.deleted||(l!=="retain"&&(h(),l="retain"),d+=1);break;case Es:this.adds(o)?this.deletes(o)||(l!=="insert"&&(h(),l="insert"),s+=o.content.str):this.deletes(o)?(l!=="delete"&&(h(),l="delete"),u+=o.length):o.deleted||(l!=="retain"&&(h(),l="retain"),d+=o.length);break;case Zn:{let{key:m,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){let f=a.get(m)??null;Bc(f,p)?p!==null&&o.delete(r):(l==="retain"&&h(),Bc(p,i.get(m)??null)?delete c[m]:c[m]=p)}}else if(this.deletes(o)){i.set(m,p);let f=a.get(m)??null;Bc(f,p)||(l==="retain"&&h(),c[m]=f)}else if(!o.deleted){i.set(m,p);let f=c[m];f!==void 0&&(Bc(f,p)?f!==null&&o.delete(r):(l==="retain"&&h(),p===null?delete c[m]:c[m]=p))}o.deleted||(l==="insert"&&h(),Cp(a,o.content));break}}o=o.right}for(h();n.length>0;){let m=n[n.length-1];if(m.retain!==void 0&&m.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}},C0=class e extends Xn{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Fr(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);let r=new NT(this,t,n);lE(this,t,r),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??Fr();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Es&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?Nt(this.doc,r=>{let a=new S0(null,this._start,0,new Map);for(let i=0;i<t.length;i++){let o=t[i];if(o.insert!==void 0){let l=!n&&typeof o.insert=="string"&&i===t.length-1&&a.right===null&&o.insert.slice(-1)===`
|
|
289
|
-
`?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&CT(r,this,a,l,o.attributes||{})}else o.retain!==void 0?sY(r,this,a,o.retain,o.attributes||{}):o.delete!==void 0&&cY(r,a,o.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,r){this.doc??Fr();let a=[],i=new Map,o=this.doc,l="",c=this._start;function s(){if(l.length>0){let u={},h=!1;i.forEach((p,f)=>{h=!0,u[f]=p});let m={insert:l};h&&(m.attributes=u),a.push(m),l=""}}let d=()=>{for(;c!==null;){if(yp(c,t)||n!==void 0&&yp(c,n))switch(c.content.constructor){case Es:{let u=i.get("ychange");t!==void 0&&!yp(c,t)?(u===void 0||u.user!==c.id.client||u.type!=="removed")&&(s(),i.set("ychange",r?r("removed",c.id):{type:"removed"})):n!==void 0&&!yp(c,n)?(u===void 0||u.user!==c.id.client||u.type!=="added")&&(s(),i.set("ychange",r?r("added",c.id):{type:"added"})):u!==void 0&&(s(),i.delete("ychange")),l+=c.content.str;break}case Ss:case Du:{s();let u={insert:c.content.getContent()[0]};if(i.size>0){let h={};u.attributes=h,i.forEach((m,p)=>{h[p]=m})}a.push(u);break}case Zn:yp(c,t)&&(s(),Cp(i,c.content));break}c=c.right}s()};return t||n?Nt(o,u=>{t&&MT(u,t),n&&MT(u,n),d()},"cleanup"):d(),a}insert(t,n,r){if(n.length<=0)return;let a=this.doc;a!==null?Nt(a,i=>{let o=Gw(i,this,t,!r);r||(r={},o.currentAttributes.forEach((l,c)=>{r[c]=l})),CT(i,this,o,n,r)}):this._pending.push(()=>this.insert(t,n,r))}insertEmbed(t,n,r){let a=this.doc;a!==null?Nt(a,i=>{let o=Gw(i,this,t,!r);CT(i,this,o,n,r||{})}):this._pending.push(()=>this.insertEmbed(t,n,r||{}))}delete(t,n){if(n===0)return;let r=this.doc;r!==null?Nt(r,a=>{cY(a,Gw(a,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,r){if(n===0)return;let a=this.doc;a!==null?Nt(a,i=>{let o=Gw(i,this,t,!1);o.right!==null&&sY(i,this,o,n,r)}):this._pending.push(()=>this.format(t,n,r))}removeAttribute(t){this.doc!==null?Nt(this.doc,n=>{tE(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?Nt(this.doc,r=>{YT(r,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return WT(this,t)}getAttributes(){return NY(this)}_write(t){t.writeTypeRef(Ime)}},mme=e=>new C0,b0=class{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??Fr()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===_0||n.constructor===wp)&&n._start!==null)t=n._start;else for(;t!==null;){let r=t.next;if(r!==null){t=r;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}},wp=class e extends Xn{constructor(){super(),this._prelimContent=[]}get firstChild(){let t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(n=>n instanceof Xn?n.clone():n)),t}get length(){return this.doc??Fr(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new b0(this,t)}querySelector(t){t=t.toUpperCase();let r=new b0(this,a=>a.nodeName&&a.nodeName.toUpperCase()===t).next();return r.done?null:r.value}querySelectorAll(t){return t=t.toUpperCase(),_o(new b0(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){lE(this,t,new OT(this,n,t))}toString(){return AY(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},r){let a=t.createDocumentFragment();return r!==void 0&&r._createAssociation(a,this),E0(this,i=>{a.insertBefore(i.toDOM(t,n,r),null)}),a}insert(t,n){this.doc!==null?Nt(this.doc,r=>{LY(r,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)Nt(this.doc,r=>{let a=t&&t instanceof Xn?t._item:t;eE(r,this,a,n)});else{let r=this._prelimContent,a=t===null?0:r.findIndex(i=>i===t)+1;if(a===0&&t!==null)throw ai("Reference item not found");r.splice(a,0,...n)}}delete(t,n=1){this.doc!==null?Nt(this.doc,r=>{RY(r,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return MY(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return DY(this,t)}slice(t=0,n=this.length){return TY(this,t,n)}forEach(t){E0(this,t)}_write(t){t.writeTypeRef(Rme)}},pme=e=>new wp,_0=class e extends wp{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((r,a)=>{this.setAttribute(a,r)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),n=this.getAttributes();return bG(n,(r,a)=>{t.setAttribute(a,r)}),t.insert(0,this.toArray().map(r=>r instanceof Xn?r.clone():r)),t}toString(){let t=this.getAttributes(),n=[],r=[];for(let l in t)r.push(l);r.sort();let a=r.length;for(let l=0;l<a;l++){let c=r[l];n.push(c+'="'+t[c]+'"')}let i=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${i}${o}>${super.toString()}</${i}>`}removeAttribute(t){this.doc!==null?Nt(this.doc,n=>{tE(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?Nt(this.doc,r=>{YT(r,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return WT(this,t)}hasAttribute(t){return OY(this,t)}getAttributes(t){return t?lme(this,t):NY(this)}toDOM(t=document,n={},r){let a=t.createElement(this.nodeName),i=this.getAttributes();for(let o in i){let l=i[o];typeof l=="string"&&a.setAttribute(o,l)}return E0(this,o=>{a.appendChild(o.toDOM(t,n,r))}),r!==void 0&&r._createAssociation(a,this),a}_write(t){t.writeTypeRef(Lme),t.writeKey(this.nodeName)}},fme=e=>new _0(e.readKey()),OT=class extends xp{constructor(t,n,r){super(t,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(a=>{a===null?this.childListChanged=!0:this.attributesChanged.add(a)})}},zT=class e extends pl{constructor(t){super(),this.hookName=t}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((n,r)=>{t.set(r,n)}),t}toDOM(t=document,n={},r){let a=n[this.hookName],i;return a!==void 0?i=a.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(i,this),i}_write(t){t.writeTypeRef(Nme),t.writeKey(this.hookName)}},gme=e=>new zT(e.readKey()),PT=class e extends C0{get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,r){let a=t.createTextNode(this.toString());return r!==void 0&&r._createAssociation(a,this),a}toString(){return this.toDelta().map(t=>{let n=[];for(let a in t.attributes){let i=[];for(let o in t.attributes[a])i.push({key:o,value:t.attributes[a][o]});i.sort((o,l)=>o.key<l.key?-1:1),n.push({nodeName:a,attrs:i})}n.sort((a,i)=>a.nodeName<i.nodeName?-1:1);let r="";for(let a=0;a<n.length;a++){let i=n[a];r+=`<${i.nodeName}`;for(let o=0;o<i.attrs.length;o++){let l=i.attrs[o];r+=` ${l.key}="${l.value}"`}r+=">"}r+=t.insert;for(let a=n.length-1;a>=0;a--)r+=`</${n[a].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(Ome)}},bme=e=>new PT,k0=class{constructor(t,n){this.id=t,this.length=n}get deleted(){throw ii()}mergeWith(t){return!1}write(t,n,r){throw ii()}integrate(t,n){throw ii()}},vme=0,Ua=class extends k0{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),wY(t.doc.store,this)}write(t,n){t.writeInfo(vme),t.writeLen(this.length-n)}getMissing(t,n){return null}},T0=class e{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(t){throw ii()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}},yme=e=>new T0(e.readBuf()),rE=class e{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){Kw(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}},xme=e=>new rE(e.readLen()),FY=(e,t)=>new Mu({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),M0=class e{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;let n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(FY(this.doc.guid,this.opts))}splice(t){throw ii()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}},wme=e=>new M0(FY(e.readString(),e.readAny())),Du=class e{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(t){throw ii()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}},Eme=e=>new Du(e.readJSON()),Zn=class e{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(t){throw ii()}mergeWith(t){return!1}integrate(t,n){let r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}},Sme=e=>new Zn(e.readKey(),e.readJSON()),UT=class e{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){let r=this.arr.length;t.writeLen(r-n);for(let a=n;a<r;a++){let i=this.arr[a];t.writeString(i===void 0?"undefined":JSON.stringify(i))}}getRef(){return 2}},Cme=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let a=e.readString();a==="undefined"?n.push(void 0):n.push(JSON.parse(a))}return new UT(n)},_me=s0("node_env")==="development",Ep=class e{constructor(t){this.arr=t,_me&&iT(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){let r=this.arr.length;t.writeLen(r-n);for(let a=n;a<r;a++){let i=this.arr[a];t.writeAny(i)}}getRef(){return 8}},kme=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new Ep(n)},Es=class e{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+"\uFFFD",n.str="\uFFFD"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}},Tme=e=>new Es(e.readString()),Mme=[sme,cme,mme,fme,pme,gme,bme],Ame=0,Dme=1,Ime=2,Lme=3,Rme=4,Nme=5,Ome=6,Ss=class e{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(t){throw ii()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(t.beforeState.get(r.id.client)||0)&&t._mergeStructs.push(r):r.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(t,!0),r=r.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}},zme=e=>new Ss(Mme[e.readTypeRef()](e));var aE=(e,t,n)=>{let{client:r,clock:a}=t.id,i=new ur(qe(r,a+n),t,qe(r,a+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),t.redone!==null&&(i.redone=qe(t.redone.client,t.redone.clock+n)),t.right=i,i.right!==null&&(i.right.left=i),e._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),t.length=n,i};var ur=class e extends k0{constructor(t,n,r,a,i,o,l,c){super(t,c.getLength()),this.origin=r,this.left=n,this.right=a,this.rightOrigin=i,this.parent=o,this.parentSub=l,this.redone=null,this.content=c,this.info=this.content.isCountable()?2:0}set marker(t){(this.info&8)>0!==t&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(t){this.keep!==t&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(t){this.deleted!==t&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=dr(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=dr(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Fc&&this.id.client!==this.parent.client&&this.parent.clock>=dr(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=rY(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=jc(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Ua||this.right&&this.right.constructor===Ua)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Fc){let r=ST(n,this.parent);r.constructor===Ua?this.parent=null:this.parent=r.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=rY(t,t.doc.store,qe(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,a;if(r!==null)a=r.right;else if(this.parentSub!==null)for(a=this.parent._map.get(this.parentSub)||null;a!==null&&a.left!==null;)a=a.left;else a=this.parent._start;let i=new Set,o=new Set;for(;a!==null&&a!==this.right;){if(o.add(a),i.add(a),jw(this.origin,a.origin)){if(a.id.client<this.id.client)r=a,i.clear();else if(jw(this.rightOrigin,a.rightOrigin))break}else if(a.origin!==null&&o.has(ST(t.doc.store,a.origin)))i.has(ST(t.doc.store,a.origin))||(r=a,i.clear());else break;a=a.right}this.left=r}if(this.left!==null){let r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),wY(t.doc.store,this),this.content.integrate(t,this),iY(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new Ua(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:qe(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&jw(t.origin,this.lastId)&&this.right===t&&jw(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){let n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===t&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){let n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Kw(t.deleteSet,this.id.client,this.id.clock,this.length),iY(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw Pa();this.content.gc(t),n?Khe(t,this,new Ua(this.id,this.length)):this.content=new rE(this.length)}write(t,n){let r=n>0?qe(this.id.client,this.id.clock+n-1):this.origin,a=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&31|(r===null?0:128)|(a===null?0:64)|(i===null?0:32);if(t.writeInfo(o),r!==null&&t.writeLeftID(r),a!==null&&t.writeRightID(a),r===null&&a===null){let l=this.parent;if(l._item!==void 0){let c=l._item;if(c===null){let s=Ghe(l);t.writeParentInfo(!0),t.writeString(s)}else t.writeParentInfo(!1),t.writeLeftID(c.id)}else l.constructor===String?(t.writeParentInfo(!0),t.writeString(l)):l.constructor===Fc?(t.writeParentInfo(!1),t.writeLeftID(l)):Pa();i!==null&&t.writeString(i)}this.content.write(t,n)}},HY=(e,t)=>Pme[t&31](e),Pme=[()=>{Pa()},xme,Cme,yme,Tme,Eme,Sme,zme,kme,wme,()=>{Pa()}],Ume=10,Ba=class extends k0{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){Pa()}write(t,n){t.writeInfo(Ume),ue(t.restEncoder,this.length-n)}getMissing(t,n){return null}},jY=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},VY="__ $YJS$ __";jY[VY]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");jY[VY]=!0;var YY=new Map,KT=class{constructor(t){this.room=t,this.onmessage=null,this._onChange=n=>n.key===t&&this.onmessage!==null&&this.onmessage({data:MG(n.newValue||"")}),hG(this._onChange)}postMessage(t){Ew.setItem(this.room,TG(kG(t)))}close(){mG(this._onChange)}},Bme=typeof BroadcastChannel>"u"?KT:BroadcastChannel,$T=e=>ri(YY,e,()=>{let t=Ki(),n=new Bme(e);return n.onmessage=r=>t.forEach(a=>a(r.data,"broadcastchannel")),{bc:n,subs:t}}),WY=(e,t)=>($T(e).subs.add(t),t),KY=(e,t)=>{let n=$T(e),r=n.subs.delete(t);return r&&n.subs.size===0&&(n.bc.close(),YY.delete(e)),r},Iu=(e,t,n=null)=>{let r=$T(e);r.bc.postMessage(t),r.subs.forEach(a=>a(t,n))};var $Y=0,sE=1,XY=2,cE=(e,t)=>{ue(e,$Y);let n=yY(t);Xt(e,n)},XT=(e,t,n)=>{ue(e,sE),Xt(e,gY(t,n))},Hme=(e,t,n)=>XT(t,n,Kn(e)),ZY=(e,t,n,r)=>{try{fY(t,Kn(e),n)}catch(a){r?.(a),console.error("Caught error while handling a Yjs update",a)}},qY=(e,t)=>{ue(e,XY),Xt(e,t)},jme=ZY,QY=(e,t,n,r,a)=>{let i=ve(e);switch(i){case $Y:Hme(e,t,n);break;case sE:ZY(e,n,r,a);break;case XY:jme(e,n,r,a);break;default:throw new Error("Unknown message type")}return i};var Gme=0;var JY=(e,t,n)=>{ve(e)===Gme&&n(t,ko(e))};var ZT=3e4,dE=class extends mw{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let n=Mo();this.getLocalState()!==null&&ZT/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let r=[];this.meta.forEach((a,i)=>{i!==this.clientID&&ZT<=n-a.lastUpdated&&this.states.has(i)&&r.push(i)}),r.length>0&&uE(this,r,"timeout")},Er(ZT/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){let n=this.clientID,r=this.meta.get(n),a=r===void 0?0:r.clock+1,i=this.states.get(n);t===null?this.states.delete(n):this.states.set(n,t),this.meta.set(n,{clock:a,lastUpdated:Mo()});let o=[],l=[],c=[],s=[];t===null?s.push(n):i==null?t!=null&&o.push(n):(l.push(n),Pc(i,t)||c.push(n)),(o.length>0||c.length>0||s.length>0)&&this.emit("change",[{added:o,updated:c,removed:s},"local"]),this.emit("update",[{added:o,updated:l,removed:s},"local"])}setLocalStateField(t,n){let r=this.getLocalState();r!==null&&this.setLocalState({...r,[t]:n})}getStates(){return this.states}},uE=(e,t,n)=>{let r=[];for(let a=0;a<t.length;a++){let i=t[a];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let o=e.meta.get(i);e.meta.set(i,{clock:o.clock+1,lastUpdated:Mo()})}r.push(i)}}r.length>0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},_p=(e,t,n=e.states)=>{let r=t.length,a=Wn();ue(a,r);for(let i=0;i<r;i++){let o=t[i],l=n.get(o)||null,c=e.meta.get(o).clock;ue(a,o),ue(a,c),ys(a,JSON.stringify(l))}return Rt(a)};var eW=(e,t,n)=>{let r=To(t),a=Mo(),i=[],o=[],l=[],c=[],s=ve(r);for(let d=0;d<s;d++){let u=ve(r),h=ve(r),m=JSON.parse(ko(r)),p=e.meta.get(u),f=e.states.get(u),x=p===void 0?0:p.clock;(x<h||x===h&&m===null&&e.states.has(u))&&(m===null?u===e.clientID&&e.getLocalState()!=null?h++:e.states.delete(u):e.states.set(u,m),e.meta.set(u,{clock:h,lastUpdated:a}),p===void 0&&m!==null?i.push(u):p!==void 0&&m===null?c.push(u):m!==null&&(Pc(m,f)||l.push(u),o.push(u)))}(i.length>0||l.length>0||c.length>0)&&e.emit("change",[{added:i,updated:l,removed:c},n]),(i.length>0||o.length>0||c.length>0)&&e.emit("update",[{added:i,updated:o,removed:c},n])};var tW=e=>vG(e,(t,n)=>`${encodeURIComponent(n)}=${encodeURIComponent(t)}`).join("&");var Lu=0,rW=3,kp=1,$me=2,A0=[];A0[Lu]=(e,t,n,r,a)=>{ue(e,Lu);let i=QY(t,e,n.doc,n);r&&i===sE&&!n.synced&&(n.synced=!0)};A0[rW]=(e,t,n,r,a)=>{ue(e,kp),Xt(e,_p(n.awareness,Array.from(n.awareness.getStates().keys())))};A0[kp]=(e,t,n,r,a)=>{eW(n.awareness,Kn(t),n)};A0[$me]=(e,t,n,r,a)=>{JY(t,n.doc,(i,o)=>Xme(n,o))};var nW=3e4,Xme=(e,t)=>console.warn(`Permission denied to access ${e.url}.
|
|
290
|
-
${t}`),aW=(e,t,n)=>{let r=To(t),a=Wn(),i=ve(r),o=e.messageHandlers[i];return o?o(a,r,e,n,i):console.error("Unable to compute message"),a},QT=(e,t,n)=>{t===e.ws&&(e.emit("connection-close",[n,e]),e.ws=null,t.close(),e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,uE(e.awareness,Array.from(e.awareness.getStates().keys()).filter(r=>r!==e.doc.clientID),e),e.emit("status",[{status:"disconnected"}])):e.wsUnsuccessfulReconnects++,setTimeout(iW,np(QV(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e))},iW=e=>{if(e.shouldConnect&&e.ws===null){let t=new e._WS(e.url,e.protocols);t.binaryType="arraybuffer",e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{e.wsLastMessageReceived=Mo();let r=aW(e,new Uint8Array(n.data),!0);gw(r)>1&&t.send(Rt(r))},t.onerror=n=>{e.emit("connection-error",[n,e])},t.onclose=n=>{QT(e,t,n)},t.onopen=()=>{e.wsLastMessageReceived=Mo(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit("status",[{status:"connected"}]);let n=Wn();if(ue(n,Lu),cE(n,e.doc),t.send(Rt(n)),e.awareness.getLocalState()!==null){let r=Wn();ue(r,kp),Xt(r,_p(e.awareness,[e.doc.clientID])),t.send(Rt(r))}},e.emit("status",[{status:"connecting"}])}},qT=(e,t)=>{let n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&Iu(e.bcChannel,t,e)},hE=class extends tp{constructor(t,n,r,{connect:a=!0,awareness:i=new dE(r),params:o={},protocols:l=[],WebSocketPolyfill:c=WebSocket,resyncInterval:s=-1,maxBackoffTime:d=2500,disableBc:u=!1}={}){for(super();t[t.length-1]==="/";)t=t.slice(0,t.length-1);this.serverUrl=t,this.bcChannel=t+"/"+n,this.maxBackoffTime=d,this.params=o,this.protocols=l,this.roomname=n,this.doc=r,this._WS=c,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=A0.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=a,this._resyncInterval=0,s>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let h=Wn();ue(h,Lu),cE(h,r),this.ws.send(Rt(h))}},s)),this._bcSubscriber=(h,m)=>{if(m!==this){let p=aW(this,new Uint8Array(h),!1);gw(p)>1&&Iu(this.bcChannel,Rt(p),this)}},this._updateHandler=(h,m)=>{if(m!==this){let p=Wn();ue(p,Lu),qY(p,h),qT(this,Rt(p))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:h,updated:m,removed:p},f)=>{let x=h.concat(m).concat(p),g=Wn();ue(g,kp),Xt(g,_p(i,x)),qT(this,Rt(g))},this._exitHandler=()=>{uE(this.awareness,[r.clientID],"app closed")},xs&&typeof process<"u"&&process.on("exit",this._exitHandler),i.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&nW<Mo()-this.wsLastMessageReceived&&QT(this,this.ws,null)},nW/10),a&&this.connect()}get url(){let t=tW(this.params);return this.serverUrl+"/"+this.roomname+(t.length===0?"":"?"+t)}get synced(){return this._synced}set synced(t){this._synced!==t&&(this._synced=t,this.emit("synced",[t]),this.emit("sync",[t]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),xs&&typeof process<"u"&&process.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||(WY(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);let t=Wn();ue(t,Lu),cE(t,this.doc),Iu(this.bcChannel,Rt(t),this);let n=Wn();ue(n,Lu),XT(n,this.doc),Iu(this.bcChannel,Rt(n),this);let r=Wn();ue(r,rW),Iu(this.bcChannel,Rt(r),this);let a=Wn();ue(a,kp),Xt(a,_p(this.awareness,[this.doc.clientID])),Iu(this.bcChannel,Rt(a),this)}disconnectBc(){let t=Wn();ue(t,kp),Xt(t,_p(this.awareness,[this.doc.clientID],new Map)),qT(this,Rt(t)),this.bcconnected&&(KY(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&QT(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(iW(this),this.connectBc())}};var oW="excalidraw",lW=2,sW="collabmd",Tp="excalidraw-app-state",Mp="excalidraw-elements",Ap="excalidraw-files",mE="excalidraw-meta",JT=1,Zme="codemirror",eM="schemaVersion";function D0(){return{type:oW,version:lW,source:sW,elements:[],appState:{gridSize:null,viewBackgroundColor:"#ffffff"},files:{}}}function tM(e={}){return{gridSize:e?.gridSize??null,viewBackgroundColor:e?.viewBackgroundColor??"#ffffff"}}function pE(e){return!e||typeof e!="object"?D0():{type:oW,version:lW,source:sW,elements:Array.isArray(e.elements)?e.elements:[],appState:tM(e.appState),files:e.files&&typeof e.files=="object"?e.files:{}}}function qme(e,{fallbackToEmpty:t=!0}={}){if(!e)return t?D0():null;try{return pE(JSON.parse(e))}catch{return t?D0():null}}function I0(e){if(e!==void 0)return JSON.parse(JSON.stringify(e))}function Qme(e){let t=Number.isFinite(Number(e?.version))?Number(e.version):0,n=Number.isFinite(Number(e?.versionNonce))?Number(e.versionNonce):0,r=Number.isFinite(Number(e?.updated))?Number(e.updated):0;return`${t}:${n}:${r}`}function cW(e,t){let n=Number(e?.version)||0,r=Number(t?.version)||0;if(n!==r)return n-r;let a=Number(e?.versionNonce)||0,i=Number(t?.versionNonce)||0;if(a!==i)return a-i;let o=Number(e?.updated)||0,l=Number(t?.updated)||0;return o!==l?o-l:String(e?.id||"").localeCompare(String(t?.id||""))}function Jme(e,t){let n=e?.index??"",r=t?.index??"";return n!==r?String(n).localeCompare(String(r)):String(e?.id||"").localeCompare(String(t?.id||""))}function dW(e,t,{create:n=!1}={}){let r=e.get(t);if(r instanceof pl)return r;if(!n)return null;let a=new pl;return e.set(t,a),a}function uW(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return null}return!e||typeof e!="object"?null:I0(e)}function epe(e){if(!(e instanceof pl)||e.size===0)return null;let t=null;return e.forEach(n=>{let r=uW(n);!r||!r.id||(!t||cW(r,t)>0)&&(t=r)}),t}function hW(e,t,{maxRevisions:n=2}={}){let r=Qme(t),a=I0(t),i=e.get(r),o=i&&typeof i=="object"?JSON.stringify(i):"",l=JSON.stringify(a);return o===l?!1:(e.set(r,a),tpe(e,n),!0)}function tpe(e,t=2){if(!(e instanceof pl)||e.size<=t)return;let n=[];for(e.forEach((r,a)=>{let i=uW(r);if(!i){n.push({element:null,key:a});return}n.push({element:i,key:a})}),n.sort((r,a)=>r.element?a.element?cW(r.element,a.element):1:-1);n.length>t;){let r=n.shift();r?.key&&e.delete(r.key)}}function npe(e){return[...e].sort(Jme)}function nM(e){if(!e)return!1;let t=e.getMap(mE);return Number(t.get(eM))===JT?!0:e.getMap(Mp).size>0||e.getMap(Ap).size>0||e.getMap(Tp).size>0}function fE(e){let t=e.getMap(mE);return Number(t.get(eM))!==JT&&t.set(eM,JT),t}function mW(e,{includeDeleted:t=!0}={}){if(!e)return D0();let n=e.getMap(Mp),r=e.getMap(Ap),a=e.getMap(Tp),i=[];n.forEach(c=>{let s=epe(c);s&&(!t&&s.isDeleted||i.push(s))});let o={};return r.forEach((c,s)=>{!c||typeof c!="object"||(o[s]=I0(c))}),pE({appState:{gridSize:a.get("gridSize"),viewBackgroundColor:a.get("viewBackgroundColor")},elements:npe(i),files:o})}function pW(e,t,{maxRevisionsPerElement:n=2}={}){if(!e)return D0();let r=pE(t);fE(e);let a=e.getMap(Mp),i=e.getMap(Ap),o=e.getMap(Tp);Array.from(a.keys()).forEach(c=>a.delete(c)),Array.from(i.keys()).forEach(c=>i.delete(c)),Array.from(o.keys()).forEach(c=>o.delete(c)),r.elements.forEach(c=>{if(!c?.id)return;let s=dW(a,c.id,{create:!0});hW(s,c,{maxRevisions:n})}),Object.entries(r.files||{}).forEach(([c,s])=>{i.set(c,I0(s))});let l=tM(r.appState);return o.set("gridSize",l.gridSize),o.set("viewBackgroundColor",l.viewBackgroundColor),r}function fW(e,t,{maxRevisionsPerElement:n=2}={}){if(!e)return!1;let r=pE(t);fE(e);let a=e.getMap(Mp),i=e.getMap(Ap),o=e.getMap(Tp),l=new Set,c=!1;r.elements.forEach(u=>{if(!u?.id)return;l.add(u.id);let h=dW(a,u.id,{create:!0});c=hW(h,u,{maxRevisions:n})||c}),Array.from(a.keys()).forEach(u=>{l.has(u)||(a.delete(u),c=!0)});let s=r.files||{};Object.entries(s).forEach(([u,h])=>{let m=I0(h),p=i.get(u);JSON.stringify(p)!==JSON.stringify(m)&&(i.set(u,m),c=!0)}),Array.from(i.keys()).forEach(u=>{u in s||(i.delete(u),c=!0)});let d=tM(r.appState);return Object.entries(d).forEach(([u,h])=>{o.get(u)!==h&&(o.set(u,h),c=!0)}),Array.from(o.keys()).forEach(u=>{u in d||(o.delete(u),c=!0)}),c}function gW(e){if(!e)return null;let t=e.getText(Zme).toString();return qme(t,{fallbackToEmpty:!1})}var rpe=new Set(["Room reset","Server shutting down"]);function bW(e){!e||typeof e.on!="function"||typeof e.disconnect!="function"||e.on("connection-close",t=>{let n=String(t?.reason||"");rpe.has(n)&&e.disconnect()})}var ape=250,ipe=48,vW=4e3,gE=class{constructor({cancelAnimationFrameFn:t=x=>cancelAnimationFrame(x),clearTimeoutFn:n=x=>clearTimeout(x),emptySceneGuardMs:r=ape,filePath:a="",now:i=()=>Date.now(),onCollaboratorsChange:o=()=>{},onRemoteSceneJson:l=()=>{},requestAnimationFrameFn:c=x=>requestAnimationFrame(x),resolveWsBaseUrlFn:s=jk,saveThrottleMs:d=ipe,setTimeoutFn:u=(x,g)=>window.setTimeout(x,g),syncTimeoutMs:h=vW,vaultClient:m,websocketProviderFactory:p=(x,g,v,b)=>new hE(x,g,v,b),ydocFactory:f=()=>new Mu}){this.cancelAnimationFrameFn=t,this.clearTimeoutFn=n,this.emptySceneGuardMs=r,this.filePath=a,this.now=i,this.onCollaboratorsChange=o,this.onRemoteSceneJson=l,this.requestAnimationFrameFn=c,this.resolveWsBaseUrlFn=s,this.saveThrottleMs=d,this.setTimeoutFn=u,this.syncTimeoutMs=h,this.vaultClient=m,this.websocketProviderFactory=p,this.ydocFactory=f,this.ydoc=null,this.roomMeta=null,this.roomElements=null,this.roomFiles=null,this.roomAppState=null,this.provider=null,this.awareness=null,this.localUser=null,this.handleProviderSync=null,this.lastSceneJson="",this.sceneSyncTimer=null,this.lastSceneSyncAt=0,this.pendingSceneSyncPayload=null,this.pointerAwarenessFrame=0,this.pendingPointerPayload=null,this.viewportAwarenessFrame=0,this.pendingViewportPayload=null,this.lastViewportSignature="",this.lastSelectedIdsSignature="",this.pendingEmptySceneCandidate=null,this.canWriteToRoom=!1,this.waitingForAuthoritativeSync=!1,this.applyingSharedSnapshotDepth=0,this.handleAwarenessChange=()=>{this.onCollaboratorsChange(FV(this.awareness))},this.handleStructuredSceneUpdate=()=>{if(!this.ydoc)return;let x=this.getStructuredSceneJson();!x||x===this.lastSceneJson||(this.unlockRoomWrites(),this.pendingEmptySceneCandidate=null,this.lastSceneJson=JSON.stringify(ni(x)),this.onRemoteSceneJson(this.lastSceneJson))}}getLastSceneJson(){return this.lastSceneJson}getLocalUser(){return this.localUser}getHistoryState(){return{canRedo:!1,canUndo:!1,head:null,length:null}}canRedo(){return this.getHistoryState().canRedo}canUndo(){return this.getHistoryState().canUndo}isApplyingSharedSnapshot(){return this.applyingSharedSnapshotDepth>0}beginApplyingSharedSnapshot(){this.applyingSharedSnapshotDepth+=1}endApplyingSharedSnapshot(){this.applyingSharedSnapshotDepth=Math.max(0,this.applyingSharedSnapshotDepth-1)}subscribeHistoryState(t){return typeof t=="function"&&t(this.getHistoryState()),()=>{}}setLocalUser(t={}){return this.localUser=ow({currentUser:this.localUser,nextUser:t}),this.awareness&&this.awareness.setLocalStateField("user",this.localUser),this.handleAwarenessChange(),this.localUser}async connect({initialUser:t=null}={}){if(this.localUser=t,!this.filePath){let i=bu();return this.lastSceneJson=JSON.stringify(i),i}this.ydoc=this.ydocFactory(),this.roomMeta=this.ydoc.getMap(mE),this.roomElements=this.ydoc.getMap(Mp),this.roomFiles=this.ydoc.getMap(Ap),this.roomAppState=this.ydoc.getMap(Tp),this.provider=this.websocketProviderFactory(this.resolveWsBaseUrlFn(),this.filePath,this.ydoc,{disableBc:!0,maxBackoffTime:5e3}),bW(this.provider),this.awareness=this.provider.awareness,this.localUser&&this.awareness.setLocalStateField("user",this.localUser),this.awareness.setLocalStateField("pointerButton","up"),this.awareness.setLocalStateField("selectedElementIds",{}),this.awareness.on("change",this.handleAwarenessChange),this.handleProviderSync=i=>{i&&(this.unlockRoomWrites(),this.handleStructuredSceneUpdate())},this.provider.on("sync",this.handleProviderSync);let n=await this.waitForSync(this.provider,this.syncTimeoutMs),r=this.getStructuredSceneJson(),a=!1;if(!r){let i=await this.loadSceneFromApi(),o=this.getStructuredSceneJson();o?r=o:(r=JSON.stringify(i),a=!0)}return r||(r=JSON.stringify(bu())),this.waitingForAuthoritativeSync=a&&!n,this.canWriteToRoom=!this.waitingForAuthoritativeSync,this.lastSceneJson=JSON.stringify(ni(r)),!a&&this.canWriteToRoom&&!nM(this.ydoc)&&this.ydoc.transact(()=>{this.replaceStructuredSceneWithinTransaction(this.lastSceneJson)},"excalidraw-legacy-migrate"),this.roomMeta.observe(this.handleStructuredSceneUpdate),this.roomElements.observeDeep(this.handleStructuredSceneUpdate),this.roomFiles.observeDeep(this.handleStructuredSceneUpdate),this.roomAppState.observe(this.handleStructuredSceneUpdate),a&&this.canWriteToRoom&&this.commitSceneJson(this.lastSceneJson,{origin:"excalidraw-api-fallback"}),this.handleStructuredSceneUpdate(),this.handleAwarenessChange(),ni(this.lastSceneJson)}async loadSceneFromApi({createIfMissing:t=!0}={}){if(!this.filePath)return bu();try{let r=await this.vaultClient.readFile(this.filePath);return ni(r.content)}catch(r){if(r?.status!==404||!t)throw r?.status===404?new Error(r.message||"Excalidraw file not found"):new Error(r?.message||"Failed to load Excalidraw file")}let n=bu();try{return await this.vaultClient.createFile({content:JSON.stringify(n),path:this.filePath}),n}catch(r){if(r?.status===409)try{let a=await this.vaultClient.readFile(this.filePath);return ni(a.content)}catch(a){throw new Error(a?.message||"Failed to load existing Excalidraw file after create conflict")}throw new Error(r?.message||"Failed to create Excalidraw file")}}waitForSync(t,n=vW){return t.synced?Promise.resolve(!0):new Promise(r=>{let a=!1,i=l=>{!l||a||(a=!0,this.clearTimeoutFn(o),t.off("sync",i),r(!0))},o=this.setTimeoutFn(()=>{a||(a=!0,t.off("sync",i),r(!1))},n);t.on("sync",i)})}unlockRoomWrites(){this.waitingForAuthoritativeSync=!1,this.canWriteToRoom=!0,!this.getStructuredSceneJson()&&this.lastSceneJson&&this.commitSceneJson(this.lastSceneJson,{origin:"excalidraw-authoritative-seed"}),this.pendingSceneSyncPayload&&this.scheduleSceneSyncFlush()}getStructuredSceneJson(){if(!this.ydoc)return"";if(nM(this.ydoc))return JSON.stringify(mW(this.ydoc));let t=gW(this.ydoc);return t?JSON.stringify(t):""}replaceStructuredSceneWithinTransaction(t){if(!this.ydoc)return;let n=Uk(t);n&&(fE(this.ydoc),pW(this.ydoc,n))}scheduleSceneSync(t,n,r){this.pendingSceneSyncPayload={appState:n,elements:t,files:r},this.canWriteToRoom&&this.scheduleSceneSyncFlush()}scheduleSceneSyncFlush(){if(this.sceneSyncTimer!==null)return;let t=this.now()-this.lastSceneSyncAt,n=Math.max(0,this.saveThrottleMs-t);this.sceneSyncTimer=this.setTimeoutFn(()=>{this.sceneSyncTimer=null,this.flushSceneSync()},n)}flushSceneSync(){if(!this.ydoc||!this.pendingSceneSyncPayload)return;let{elements:t,appState:n,files:r}=this.pendingSceneSyncPayload;this.pendingSceneSyncPayload=null;let a=OV(t,n,r),i=JSON.stringify(a);if(this.shouldDelayEmptySceneCommit(i)){this.pendingSceneSyncPayload={appState:n,elements:t,files:r},this.scheduleDelayedEmptySceneCommit();return}i!==this.lastSceneJson&&(this.lastSceneSyncAt=this.now(),this.commitSceneJson(i,{origin:"excalidraw-local-change"})),this.pendingEmptySceneCandidate=null,this.pendingSceneSyncPayload&&this.scheduleSceneSyncFlush()}hasRemoteCollaborators(){if(!this.awareness)return!1;for(let[t,n]of this.awareness.getStates())if(t!==this.awareness.clientID&&n?.user)return!0;return!1}shouldDelayEmptySceneCommit(t){if(!this.emptySceneGuardMs||!this.hasRemoteCollaborators())return this.pendingEmptySceneCandidate=null,!1;if(ni(t).elements.length>0)return this.pendingEmptySceneCandidate=null,!1;if(ni(this.lastSceneJson||this.getStructuredSceneJson()).elements.length===0)return this.pendingEmptySceneCandidate=null,!1;let a=this.now();return!this.pendingEmptySceneCandidate||this.pendingEmptySceneCandidate.previousSceneJson!==this.lastSceneJson?(this.pendingEmptySceneCandidate={firstSeenAt:a,previousSceneJson:this.lastSceneJson},console.warn(`[excalidraw:${this.filePath}] Delaying suspicious empty scene commit during active collaboration`),!0):a-this.pendingEmptySceneCandidate.firstSeenAt<this.emptySceneGuardMs}scheduleDelayedEmptySceneCommit(){if(this.sceneSyncTimer!==null)return;let t=this.pendingEmptySceneCandidate?.firstSeenAt??this.now(),n=this.now()-t,r=Math.max(0,this.emptySceneGuardMs-n);this.sceneSyncTimer=this.setTimeoutFn(()=>{this.sceneSyncTimer=null,this.flushSceneSync()},r)}flushPointerAwarenessPayload(){this.pointerAwarenessFrame=0,!(!this.awareness||!this.pendingPointerPayload)&&(this.awareness.setLocalStateField("pointer",this.pendingPointerPayload.pointer),this.awareness.setLocalStateField("pointerButton",this.pendingPointerPayload.button),this.pendingPointerPayload=null)}normalizeViewportAwareness(t){if(!t||typeof t!="object")return null;let n=Number(t.scrollX),r=Number(t.scrollY),a=Number(t.zoom);return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(a)||a<=0?null:{scrollX:n,scrollY:r,zoom:a}}scheduleLocalPointerAwareness(t){!this.awareness||!t?.pointer||(this.pendingPointerPayload={button:t.button==="down"?"down":"up",pointer:{x:t.pointer.x,y:t.pointer.y,tool:t.pointer.tool==="laser"?"laser":"pointer"}},!this.pointerAwarenessFrame&&(this.pointerAwarenessFrame=this.requestAnimationFrameFn(()=>this.flushPointerAwarenessPayload())))}flushViewportAwarenessPayload(){this.viewportAwarenessFrame=0,!(!this.awareness||!this.pendingViewportPayload)&&(this.awareness.setLocalStateField("viewport",this.pendingViewportPayload),this.pendingViewportPayload=null)}scheduleLocalViewportAwareness(t){if(!this.awareness)return;let n=this.normalizeViewportAwareness(t);if(!n)return;let r=`${n.scrollX}:${n.scrollY}:${n.zoom}`;r!==this.lastViewportSignature&&(this.lastViewportSignature=r,this.pendingViewportPayload=n,!this.viewportAwarenessFrame&&(this.viewportAwarenessFrame=this.requestAnimationFrameFn(()=>this.flushViewportAwarenessPayload())))}syncLocalSelectionAwareness(t){if(!this.awareness)return;let n=t?.selectedElementIds||{},r=Object.keys(n).sort().join(",");r!==this.lastSelectedIdsSignature&&(this.lastSelectedIdsSignature=r,this.awareness.setLocalStateField("selectedElementIds",n))}commitSceneJson(t,{origin:n="excalidraw-room-write"}={}){let r=JSON.stringify(ni(t));if(!this.ydoc){let i=r!==this.lastSceneJson;return this.lastSceneJson=r,i}let a=this.getStructuredSceneJson();return r===a&&r===this.lastSceneJson?!1:(this.lastSceneJson=r,this.ydoc.transact(()=>{fW(this.ydoc,ni(r))},n),!0)}disconnect(){this.flushSceneSync(),this.clearTimeoutFn(this.sceneSyncTimer),this.sceneSyncTimer=null,this.pendingSceneSyncPayload=null,this.pointerAwarenessFrame&&this.cancelAnimationFrameFn(this.pointerAwarenessFrame),this.pointerAwarenessFrame=0,this.pendingPointerPayload=null,this.viewportAwarenessFrame&&this.cancelAnimationFrameFn(this.viewportAwarenessFrame),this.viewportAwarenessFrame=0,this.pendingViewportPayload=null,this.lastViewportSignature="",this.lastSelectedIdsSignature="",this.pendingEmptySceneCandidate=null,this.roomMeta?.unobserve(this.handleStructuredSceneUpdate),this.roomElements?.unobserveDeep(this.handleStructuredSceneUpdate),this.roomFiles?.unobserveDeep(this.handleStructuredSceneUpdate),this.roomAppState?.unobserve(this.handleStructuredSceneUpdate),this.awareness&&(this.awareness.off("change",this.handleAwarenessChange),this.awareness.setLocalState(null)),this.awareness=null,this.provider&&this.handleProviderSync&&this.provider.off("sync",this.handleProviderSync),this.handleProviderSync=null,this.provider?.disconnect(),this.provider?.destroy(),this.provider=null,this.ydoc?.destroy(),this.ydoc=null,this.roomMeta=null,this.roomElements=null,this.roomFiles=null,this.roomAppState=null,this.localUser=null,this.canWriteToRoom=!1,this.waitingForAuthoritativeSync=!1,this.applyingSharedSnapshotDepth=0}};function yW(e){return encodeURIComponent(String(e??""))}async function Ru(e,t){let n=await e.json().catch(()=>({}));if(!e.ok||n.ok===!1){let r=new Error(n.error||t);throw r.status=e.status,r.body=n,r}return n}var rM=class{async readTree(){let t=await fetch(bs("/files"));return Ru(t,"Failed to load file tree")}async readFile(t){let n=await fetch(bs(`/file?path=${encodeURIComponent(t)}`));return Ru(n,"Failed to read file")}async createFile({content:t,path:n}){let r=await fetch(bs("/file"),{body:JSON.stringify({content:t,path:n}),headers:{"Content-Type":"application/json"},method:"POST"});return Ru(r,"Failed to create file")}async renameFile({oldPath:t,newPath:n}){let r=await fetch(bs("/file"),{body:JSON.stringify({newPath:n,oldPath:t}),headers:{"Content-Type":"application/json"},method:"PATCH"});return Ru(r,"Failed to rename file")}async deleteFile(t){let n=await fetch(bs(`/file?path=${encodeURIComponent(t)}`),{method:"DELETE"});return Ru(n,"Failed to delete file")}async createDirectory(t){let n=await fetch(bs("/directory"),{body:JSON.stringify({path:t}),headers:{"Content-Type":"application/json"},method:"POST"});return Ru(n,"Failed to create folder")}async uploadImageAttachment({file:t,fileName:n="",sourcePath:r}){let a=await fetch(bs("/attachments"),{body:t,headers:{"Content-Type":t?.type||"application/octet-stream","X-CollabMD-File-Name":yW(n),"X-CollabMD-Source-Path":yW(r)},method:"POST"});return Ru(a,"Failed to upload image")}},xW=new rM;var Rp=new URLSearchParams(window.location.search),ope=Rp.get("file"),lpe=Rp.get("test")==="1",aM=Rp.get("mode")==="preview",kW=window.location.origin,wW=Number.parseInt(Rp.get("syncTimeoutMs")||"",10),Ke=null,R0=Rp.get("theme")||"dark",Dp=BV({params:Rp,storedUserName:localStorage.getItem("collabmd-user-name")}),xE="",fl=!1,SE=!1,N0="",Ip=null,bE=0,Vc=new Map,Nu=null,Yc=null,CE=!1,L0=0,wE="",Gc=[],Lp=0,yE=null,EW=!0,aa=new gE({filePath:ope,onCollaboratorsChange:e=>{if(!fl){Ip=e;return}upe(e)},onRemoteSceneJson:e=>{TW(e)},syncTimeoutMs:Number.isFinite(wW)?wW:void 0,vaultClient:xW});function O0(e){let t=document.querySelector(`[data-testid="button-${e}"]`);return t instanceof HTMLButtonElement?t:null}function spe(){let e=O0("undo"),t=O0("redo");return{canRedo:!!t&&!t.disabled,canUndo:!!e&&!e.disabled,head:null,length:null}}function SW(e){let t=O0(e);return!t||t.disabled?!1:(t.click(),!0)}function cpe(e={}){Dp=ow({currentUser:Dp,nextUser:e}),aa.setLocalUser(Dp)}lpe&&(window.__COLLABMD_EXCALIDRAW_TEST__={getElementBounds:e=>{let t=Ke?.getSceneElementsIncludingDeleted?.()?.find(n=>n.id===e&&!n.isDeleted);return t?{centerX:t.x+t.width/2,centerY:t.y+t.height/2,height:t.height,width:t.width,x:t.x,y:t.y}:null},getElementCount:()=>Ke?.getSceneElementsIncludingDeleted?.()?.filter(e=>!e.isDeleted).length??0,getElementIds:()=>Ke?.getSceneElementsIncludingDeleted?.()?.filter(e=>!e.isDeleted).map(e=>e.id).sort()??[],getHistoryState:()=>spe(),getLocalUserName:()=>Dp?.name||"",getLocalPeerId:()=>Dp?.peerId||"",getViewport:()=>{let e=Ke?.getAppState?.();return e?{scrollX:e.scrollX,scrollY:e.scrollY,zoom:e.zoom?.value??null}:null},isViewMode:()=>!!Ke?.getAppState?.().viewModeEnabled,getSceneJson:()=>aa.getLastSceneJson(),isAuthoritativeReady:()=>!!Ke&&fl&&aa.canWriteToRoom===!0&&aa.waitingForAuthoritativeSync===!1&&aa.isApplyingSharedSnapshot()===!1,isReady:()=>fl&&!!Ke&&!!O0("undo")&&!!O0("redo"),redoShared:()=>SW("redo"),setScene:e=>{mpe(Jm(e),{captureUpdate:U.IMMEDIATELY})},setViewport:e=>{if(!Ke)return;let t=Ke.getAppState();Ke.updateScene({appState:{scrollX:Number.isFinite(e?.scrollX)?e.scrollX:t.scrollX,scrollY:Number.isFinite(e?.scrollY)?e.scrollY:t.scrollY,zoom:Number.isFinite(e?.zoom)&&e.zoom>0?{value:e.zoom}:t.zoom},captureUpdate:U.NEVER})},undoShared:()=>SW("undo")});function dpe(e){if(Vc=e instanceof Map?e:new Map,!Ke){Ip=Vc;return}if(Ke.updateScene({collaborators:Vc,captureUpdate:U.NEVER}),Yc){iM(Yc);return}RW(Vc)}function upe(e){yE=e,!Lp&&(Lp=requestAnimationFrame(()=>{Lp=0;let t=yE;yE=null,dpe(t)}))}function TW(e){let t=ni(e),n=JSON.stringify(t);if(!(n===xE&&!N0)){if(xE=n,!Ke||!fl){N0=n;return}DW(t)}}function MW({trackedSharedSnapshot:e=!1}={}){bE+=1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{bE=Math.max(0,bE-1),e&&aa.endApplyingSharedSnapshot(),bE===0&&(SE=!1)})})}function hpe(){L0+=1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{L0=Math.max(0,L0-1),L0===0&&(CE=!1)})})}function AW(e){let t=Ke.getAppState(),n=Ke.getSceneElementsIncludingDeleted?.()||Ke.getSceneElements(),r=cd(e?.elements||[],n,{repairBindings:!0}),a=sh(e?.appState||{},t),i=RV(n,r,t);return{appState:{theme:R0,viewBackgroundColor:a.viewBackgroundColor??"#ffffff",gridSize:a.gridSize??null},elements:i,files:e?.files||{}}}function DW(e,{captureUpdate:t=U.NEVER,trackedSharedSnapshot:n=!0}={}){let r=AW(e);SE=!0,n&&aa.beginApplyingSharedSnapshot();try{Ke.updateScene({...r,captureUpdate:t})}finally{MW({trackedSharedSnapshot:n})}LW()}function mpe(e,{captureUpdate:t=U.IMMEDIATELY}={}){let n=Jm(e),r=JSON.stringify(n);if(xE=r,!Ke||!fl){N0=r;return}Ke.updateScene({...AW(n),captureUpdate:t})}function ppe(){TW(aa.getLastSceneJson())}function IW(e,t={}){window.parent.postMessage({source:"excalidraw-editor",type:e,...t},kW)}function fpe(){return Ke?.getSceneElementsIncludingDeleted?.()?.filter(e=>!e.isDeleted)??[]}function LW(){if(!EW||!Ke)return;let e=fpe();e.length!==0&&(EW=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ke&&Ke.scrollToContent(e,{animate:!1,fitToViewport:!0,maxZoom:2,viewportZoomFactor:aM?.92:.88})})}))}function CW(){if(!fl||!Ke||CE)return;let e=Ke.getAppState();aa.scheduleLocalViewportAwareness({scrollX:e.scrollX,scrollY:e.scrollY,zoom:e.zoom?.value})}function EE(e,{force:t=!1}={}){let n=e?String(e):null,r=Nu!==n;Nu=n,r&&(wE=""),Nu&&RW(Vc,{force:t||r})}function RW(e=Vc,{force:t=!1}={}){if(!Ke||!Nu)return;let r=e?.get?.(String(Nu))?.viewport;if(!r)return;let a=`${Nu}:${r.scrollX}:${r.scrollY}:${r.zoom}`;!t&&a===wE||(wE=a,CE=!0,Ke.updateScene({appState:{scrollX:r.scrollX,scrollY:r.scrollY,zoom:{value:r.zoom}},captureUpdate:U.NEVER}),hpe())}function iM(e){if(Yc=e||null,!Ke)return;if(!e){Ke.updateScene({appState:{userToFollow:null},captureUpdate:U.NEVER}),EE(null,{force:!0}),Yc=null;return}let t=HV(Vc,e);t?.socketId&&(Ke.updateScene({appState:{userToFollow:{socketId:t.socketId,username:t.username||""}},captureUpdate:U.NEVER}),EE(t.socketId,{force:!0}),Yc=null)}function gpe(){fl=!1,Ip=null,Vc=new Map,Nu=null,Yc=null,CE=!1,L0=0,wE="",Lp&&cancelAnimationFrame(Lp),Lp=0,yE=null,Gc.forEach(e=>e()),Gc=[],aa.disconnect()}window.addEventListener("pagehide",()=>{gpe()});window.addEventListener("message",e=>{if(e.origin!==kW)return;let t=e.data;if(!(!t||t.source!=="collabmd-host")){if(t.type==="set-theme"){R0=t.theme||"dark",Ke&&(SE=!0,Ke.updateScene({appState:{theme:R0},captureUpdate:U.NEVER}),MW());return}if(t.type==="set-user"){cpe(t.user);return}t.type==="follow-user"&&iM(t.peerId||null)}});function bpe(e,t,n){!fl||SE||(xE=JSON.stringify(Jm({elements:e,appState:t,files:n})),aa.scheduleSceneSync(e,t,n))}function vpe(e){Ke=e,Gc.forEach(n=>n()),Gc=[],Gc.push(e.onStateChange(["scrollX","scrollY","zoom"],()=>{CW()})),Gc.push(e.onStateChange("userToFollow",n=>{if(n?.socketId){EE(n.socketId,{force:!0});return}EE(null,{force:!0})}));let t=N0||aa.getLastSceneJson();N0="",DW(ni(t)),Ip&&(Ke.updateScene({collaborators:Ip,captureUpdate:U.NEVER}),Ip=null),fl=!0,CW(),ppe(),Yc&&iM(Yc),LW(),IW("ready")}function ype({excalidrawAPI:e}){Ke=e}async function xpe(){let e=document.getElementById("loadingState");try{await KV();let t=await aa.connect({initialUser:Dp}),n=NV(t,{theme:R0});e?.remove();let r={onMount:ype,onInitialize:o=>{vpe(o)},onUnmount:()=>{Gc.forEach(o=>o()),Gc=[],Ke=null,fl=!1},initialData:n,aiEnabled:!1,isCollaborating:!0,onChange:(o,l,c)=>{bpe(o,l,c),aa.syncLocalSelectionAwareness(l)},onPointerUpdate:o=>{aa.scheduleLocalPointerAwareness(o)},theme:R0,viewModeEnabled:aM,zenModeEnabled:aM,UIOptions:{canvasActions:{export:!1,loadScene:!1,saveToActiveFile:!1,toggleTheme:!1}}},a=()=>vE.default.createElement("div",{style:{height:"100vh",width:"100%"}},vE.default.createElement(Pk,r));(0,_W.createRoot)(document.getElementById("root")).render(vE.default.createElement(a))}catch(t){console.error("[excalidraw] Failed to initialize:",t),IW("error",{message:t instanceof Error?t.message:"Failed to load Excalidraw"}),e&&(e.className="loading-state error",e.textContent=`Failed to load Excalidraw: ${t instanceof Error?t.message:String(t)}`)}}xpe();
|
|
291
|
-
/*! Bundled license information:
|
|
292
|
-
|
|
293
|
-
scheduler/cjs/scheduler.production.js:
|
|
294
|
-
(**
|
|
295
|
-
* @license React
|
|
296
|
-
* scheduler.production.js
|
|
297
|
-
*
|
|
298
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the MIT license found in the
|
|
301
|
-
* LICENSE file in the root directory of this source tree.
|
|
302
|
-
*)
|
|
303
|
-
|
|
304
|
-
react-dom/cjs/react-dom.production.js:
|
|
305
|
-
(**
|
|
306
|
-
* @license React
|
|
307
|
-
* react-dom.production.js
|
|
308
|
-
*
|
|
309
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
310
|
-
*
|
|
311
|
-
* This source code is licensed under the MIT license found in the
|
|
312
|
-
* LICENSE file in the root directory of this source tree.
|
|
313
|
-
*)
|
|
314
|
-
|
|
315
|
-
react-dom/cjs/react-dom-client.production.js:
|
|
316
|
-
(**
|
|
317
|
-
* @license React
|
|
318
|
-
* react-dom-client.production.js
|
|
319
|
-
*
|
|
320
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the MIT license found in the
|
|
323
|
-
* LICENSE file in the root directory of this source tree.
|
|
324
|
-
*)
|
|
325
|
-
|
|
326
|
-
use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
|
|
327
|
-
(**
|
|
328
|
-
* @license React
|
|
329
|
-
* use-sync-external-store-shim.production.js
|
|
330
|
-
*
|
|
331
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the MIT license found in the
|
|
334
|
-
* LICENSE file in the root directory of this source tree.
|
|
335
|
-
*)
|
|
336
|
-
|
|
337
|
-
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js:
|
|
338
|
-
(**
|
|
339
|
-
* @license React
|
|
340
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
341
|
-
*
|
|
342
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the MIT license found in the
|
|
345
|
-
* LICENSE file in the root directory of this source tree.
|
|
346
|
-
*)
|
|
347
|
-
*/
|