@zsviczian/excalidraw 0.10.0-fix-container-04 → 0.10.0-fixjumpingtext-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/excalidraw-assets/i18n-ar-SA-json-bad937b9c5872d8bb08c.js +1 -0
- package/dist/excalidraw-assets/i18n-bg-BG-json-b75f0626e77ba4b93a1a.js +1 -0
- package/dist/excalidraw-assets/i18n-bn-BD-json-ba2910bdfa31bf4a3b47.js +1 -0
- package/dist/excalidraw-assets/i18n-ca-ES-json-d4752239985378d6687b.js +1 -0
- package/dist/excalidraw-assets/i18n-cs-CZ-json-3f0957ec0784a1e70989.js +1 -0
- package/dist/excalidraw-assets/i18n-da-DK-json-30c4bddb0657ba3ec9f0.js +1 -0
- package/dist/excalidraw-assets/i18n-de-DE-json-1f36c83788d93a26c574.js +1 -0
- package/dist/excalidraw-assets/i18n-el-GR-json-c7749e93b5ee2ef46f01.js +1 -0
- package/dist/excalidraw-assets/i18n-es-ES-json-c58a268683a5a98cb339.js +1 -0
- package/dist/excalidraw-assets/i18n-eu-ES-json-a3036124af529be40107.js +1 -0
- package/dist/excalidraw-assets/i18n-fa-IR-json-e49ff1b123f75b3fe6ae.js +1 -0
- package/dist/excalidraw-assets/i18n-fi-FI-json-25e90ae7a679737c89fa.js +1 -0
- package/dist/excalidraw-assets/i18n-fr-FR-json-7d9dfefbcbd632631e26.js +1 -0
- package/dist/excalidraw-assets/i18n-he-IL-json-5f850f9fc31f38e08e11.js +1 -0
- package/dist/excalidraw-assets/i18n-hi-IN-json-022f6946007c53005bf4.js +1 -0
- package/dist/excalidraw-assets/i18n-hu-HU-json-29933e37837a1a237a79.js +1 -0
- package/dist/excalidraw-assets/i18n-id-ID-json-7dc2565e1c0b98d44e81.js +1 -0
- package/dist/excalidraw-assets/i18n-it-IT-json-30125a866f08cd0c8dce.js +1 -0
- package/dist/excalidraw-assets/i18n-ja-JP-json-045af0024c647d78ff48.js +1 -0
- package/dist/excalidraw-assets/i18n-kab-KAB-json-dec84820b3b3b8cea91e.js +1 -0
- package/dist/excalidraw-assets/i18n-kk-KZ-json-a2be2aa000093bb0c4b1.js +1 -0
- package/dist/excalidraw-assets/i18n-ko-KR-json-df4ca911d661a3668791.js +1 -0
- package/dist/excalidraw-assets/i18n-lt-LT-json-e9bd2413c78d8cd605c1.js +1 -0
- package/dist/excalidraw-assets/i18n-lv-LV-json-35f7377cd0651c3473cb.js +1 -0
- package/dist/excalidraw-assets/i18n-my-MM-json-4326db071b2b5ad9ebd2.js +1 -0
- package/dist/excalidraw-assets/i18n-nb-NO-json-f99ea85b15d9c0fd412f.js +1 -0
- package/dist/excalidraw-assets/i18n-nl-NL-json-676bbee6b2201018afea.js +1 -0
- package/dist/excalidraw-assets/i18n-nn-NO-json-1a9f7d30feff1eafa425.js +1 -0
- package/dist/excalidraw-assets/i18n-oc-FR-json-5ce59f015d4aaae56795.js +1 -0
- package/dist/excalidraw-assets/i18n-pa-IN-json-5edc5b8da2685495dc6f.js +1 -0
- package/dist/excalidraw-assets/i18n-pl-PL-json-2a6bca3404366166de44.js +1 -0
- package/dist/excalidraw-assets/i18n-pt-BR-json-df0e1971ca6c9ab7ba96.js +1 -0
- package/dist/excalidraw-assets/i18n-pt-PT-json-088903851b38144d92cd.js +1 -0
- package/dist/excalidraw-assets/i18n-ro-RO-json-e9e42a4eea14e9780121.js +1 -0
- package/dist/excalidraw-assets/i18n-ru-RU-json-6619d335c0dc5729f858.js +1 -0
- package/dist/excalidraw-assets/i18n-si-LK-json-29566ffe4c2aab9bc9d7.js +1 -0
- package/dist/excalidraw-assets/i18n-sk-SK-json-68881f095026d35935f3.js +1 -0
- package/dist/excalidraw-assets/i18n-sv-SE-json-11387dba5283047f00f2.js +1 -0
- package/dist/excalidraw-assets/i18n-ta-IN-json-fadfdd197ff5b857ed62.js +1 -0
- package/dist/excalidraw-assets/i18n-tr-TR-json-b92a92cca02f833721d4.js +1 -0
- package/dist/excalidraw-assets/i18n-uk-UA-json-550e1d2467d2c10ba4c5.js +1 -0
- package/dist/excalidraw-assets/i18n-zh-CN-json-02c2e2cacd9b605b9433.js +1 -0
- package/dist/excalidraw-assets/i18n-zh-HK-json-24ab7abe8e695f165b3b.js +1 -0
- package/dist/excalidraw-assets/i18n-zh-TW-json-9a0e7901a1a58502bfa4.js +1 -0
- package/dist/excalidraw-assets/image-b76d879db8316c30fd0d.js +1 -0
- package/dist/excalidraw-assets/vendor-41e5c0be76c29ad2aba4.js +2 -0
- package/dist/excalidraw-assets/{vendor-8698157b56eb5e0ee549.js.LICENSE.txt → vendor-41e5c0be76c29ad2aba4.js.LICENSE.txt} +0 -0
- package/dist/excalidraw-assets-dev/i18n-ar-SA-json-37ef19edefea75b3680e.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-bg-BG-json-7d5458f5cc2a84d8f6e2.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-bn-BD-json-448d07219c41f8dbb55b.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-ca-ES-json-1b5b2fc0229d73e426e2.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-cs-CZ-json-eb093b2c8ac7708896f3.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-da-DK-json-d8afa5e01e2078a828c2.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-de-DE-json-a6cee4c1996e3aafa069.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-el-GR-json-9db54ad72bc0f1b46368.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-es-ES-json-6d364eae9cd78b062862.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-eu-ES-json-a6295f834d0adb4083eb.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-fa-IR-json-994aead70f24c0e04f88.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-fi-FI-json-0208c92c12556594091e.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-fr-FR-json-d12919b5af660f8cd0e2.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-he-IL-json-ee1c784d61ae761756b4.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-hi-IN-json-77fcce82aa2ea23ebc57.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-hu-HU-json-2afc786729254afcc04b.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-id-ID-json-261de18ed01a905bb8a7.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-it-IT-json-02005e1fe5f9ef001a3e.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-ja-JP-json-ee12ac450c12bf9abd0a.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-kab-KAB-json-4b948b48bde7a5aa988b.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-kk-KZ-json-4902d8f64c4c6345ea0e.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-ko-KR-json-afd4100bf8ede6c92721.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-lt-LT-json-a611d0fc2fe568829b13.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-lv-LV-json-f95d6c285bf18cdd5eaa.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-my-MM-json-84db1bbb92c1dee8e250.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-nb-NO-json-d80c0c3712700e7aaad3.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-nl-NL-json-67080c662a350e8983ec.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-nn-NO-json-5d74e695d9a164368952.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-oc-FR-json-19acf217a1bd641a3e5f.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-pa-IN-json-6070668134134cdc4cc5.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-pl-PL-json-49b6e8525a0d9ac86381.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-pt-BR-json-194bb19328e2a094db3f.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-pt-PT-json-8959660f187eb41da2fc.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-ro-RO-json-a61aaf893c100b18bbb8.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-ru-RU-json-8fb78f4f8f1373c5c428.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-si-LK-json-0a6676ca84d9add83859.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-sk-SK-json-bc378d74487614e52ac9.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-sv-SE-json-aadcfeee9542d5b32173.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-ta-IN-json-4e673cde4ee803280436.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-tr-TR-json-4bcb79efe0490c66f154.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-uk-UA-json-1482d7b2e2e8a0232419.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-zh-CN-json-8c7c0fec6b0765479622.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-zh-HK-json-70b4a1bb0d8d99abfa2a.js +22 -0
- package/dist/excalidraw-assets-dev/i18n-zh-TW-json-d4e760d2810c47bf381a.js +22 -0
- package/dist/excalidraw-assets-dev/{image-e50a452aa26d28419e39.js → image-8825d180ee32659f8996.js} +0 -0
- package/dist/excalidraw.development.js +50 -42
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +16 -13
- package/types/actions/actionAddToLibrary.d.ts +268 -1
- package/types/actions/actionAlign.d.ts +73 -6
- package/types/actions/actionCanvas.d.ts +673 -8
- package/types/actions/actionClipboard.d.ts +493 -4
- package/types/actions/actionDeleteSelected.d.ts +292 -1
- package/types/actions/actionDistribute.d.ts +27 -2
- package/types/actions/actionDuplicateSelection.d.ts +19 -1
- package/types/actions/actionExport.d.ts +849 -8
- package/types/actions/actionFinalize.d.ts +186 -1
- package/types/actions/actionFlip.d.ts +29 -2
- package/types/actions/actionGroup.d.ts +39 -2
- package/types/actions/actionMenu.d.ts +293 -4
- package/types/actions/actionNavigate.d.ts +11 -1
- package/types/actions/actionProperties.d.ts +1160 -12
- package/types/actions/actionSelectAll.d.ts +12 -1
- package/types/actions/actionStyles.d.ts +110 -2
- package/types/actions/actionToggleGridMode.d.ts +98 -1
- package/types/actions/actionToggleStats.d.ts +97 -1
- package/types/actions/actionToggleViewMode.d.ts +97 -1
- package/types/actions/actionToggleZenMode.d.ts +97 -1
- package/types/actions/actionZindex.d.ts +55 -4
- package/types/actions/register.d.ts +3 -1
- package/types/actions/types.d.ts +1 -1
- package/types/align.d.ts +0 -1
- package/types/components/App.d.ts +1 -0
- package/types/constants.d.ts +1 -4
- package/types/disitrubte.d.ts +0 -1
- package/types/element/bounds.d.ts +4 -0
- package/types/element/dragElements.d.ts +2 -2
- package/types/element/newElement.d.ts +1 -1
- package/types/element/textElement.d.ts +7 -4
- package/types/element/textWysiwyg.d.ts +5 -4
- package/types/groups.d.ts +1 -0
- package/types/keys.d.ts +4 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ar-SA-json-bad937b9c5872d8bb08c.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-bg-BG-json-b75f0626e77ba4b93a1a.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-bn-BD-json-ba2910bdfa31bf4a3b47.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ca-ES-json-d4752239985378d6687b.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-cs-CZ-json-3f0957ec0784a1e70989.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-da-DK-json-30c4bddb0657ba3ec9f0.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-de-DE-json-1f36c83788d93a26c574.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-el-GR-json-c7749e93b5ee2ef46f01.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-es-ES-json-c58a268683a5a98cb339.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-eu-ES-json-a3036124af529be40107.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fa-IR-json-e49ff1b123f75b3fe6ae.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fi-FI-json-25e90ae7a679737c89fa.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-fr-FR-json-7d9dfefbcbd632631e26.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-he-IL-json-5f850f9fc31f38e08e11.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hi-IN-json-022f6946007c53005bf4.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-hu-HU-json-29933e37837a1a237a79.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-id-ID-json-7dc2565e1c0b98d44e81.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-it-IT-json-30125a866f08cd0c8dce.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ja-JP-json-045af0024c647d78ff48.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-kab-KAB-json-dec84820b3b3b8cea91e.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-kk-KZ-json-a2be2aa000093bb0c4b1.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ko-KR-json-df4ca911d661a3668791.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-lt-LT-json-e9bd2413c78d8cd605c1.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-lv-LV-json-35f7377cd0651c3473cb.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-my-MM-json-4326db071b2b5ad9ebd2.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nb-NO-json-f99ea85b15d9c0fd412f.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nl-NL-json-676bbee6b2201018afea.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-nn-NO-json-1a9f7d30feff1eafa425.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-oc-FR-json-5ce59f015d4aaae56795.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pa-IN-json-5edc5b8da2685495dc6f.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pl-PL-json-2a6bca3404366166de44.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-BR-json-df0e1971ca6c9ab7ba96.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-pt-PT-json-088903851b38144d92cd.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ro-RO-json-e9e42a4eea14e9780121.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ru-RU-json-6619d335c0dc5729f858.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-si-LK-json-29566ffe4c2aab9bc9d7.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sk-SK-json-68881f095026d35935f3.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-sv-SE-json-11387dba5283047f00f2.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-ta-IN-json-fadfdd197ff5b857ed62.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-tr-TR-json-b92a92cca02f833721d4.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-uk-UA-json-550e1d2467d2c10ba4c5.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-CN-json-02c2e2cacd9b605b9433.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-HK-json-24ab7abe8e695f165b3b.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/i18n-zh-TW-json-9a0e7901a1a58502bfa4.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/image-b76d879db8316c30fd0d.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/vendor-41e5c0be76c29ad2aba4.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ar-SA-json-37ef19edefea75b3680e.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-bg-BG-json-7d5458f5cc2a84d8f6e2.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-bn-BD-json-448d07219c41f8dbb55b.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ca-ES-json-1b5b2fc0229d73e426e2.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-cs-CZ-json-eb093b2c8ac7708896f3.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-da-DK-json-d8afa5e01e2078a828c2.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-de-DE-json-a6cee4c1996e3aafa069.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-el-GR-json-9db54ad72bc0f1b46368.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-es-ES-json-6d364eae9cd78b062862.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-eu-ES-json-a6295f834d0adb4083eb.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-fa-IR-json-994aead70f24c0e04f88.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-fi-FI-json-0208c92c12556594091e.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-fr-FR-json-d12919b5af660f8cd0e2.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-he-IL-json-ee1c784d61ae761756b4.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-hi-IN-json-77fcce82aa2ea23ebc57.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-hu-HU-json-2afc786729254afcc04b.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-id-ID-json-261de18ed01a905bb8a7.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-it-IT-json-02005e1fe5f9ef001a3e.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ja-JP-json-ee12ac450c12bf9abd0a.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-kab-KAB-json-4b948b48bde7a5aa988b.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-kk-KZ-json-4902d8f64c4c6345ea0e.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ko-KR-json-afd4100bf8ede6c92721.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-lt-LT-json-a611d0fc2fe568829b13.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-lv-LV-json-f95d6c285bf18cdd5eaa.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-my-MM-json-84db1bbb92c1dee8e250.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-nb-NO-json-d80c0c3712700e7aaad3.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-nl-NL-json-67080c662a350e8983ec.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-nn-NO-json-5d74e695d9a164368952.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-oc-FR-json-19acf217a1bd641a3e5f.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pa-IN-json-6070668134134cdc4cc5.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pl-PL-json-49b6e8525a0d9ac86381.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pt-BR-json-194bb19328e2a094db3f.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-pt-PT-json-8959660f187eb41da2fc.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ro-RO-json-a61aaf893c100b18bbb8.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ru-RU-json-8fb78f4f8f1373c5c428.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-si-LK-json-0a6676ca84d9add83859.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-sk-SK-json-bc378d74487614e52ac9.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-sv-SE-json-aadcfeee9542d5b32173.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-ta-IN-json-4e673cde4ee803280436.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-tr-TR-json-4bcb79efe0490c66f154.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-uk-UA-json-1482d7b2e2e8a0232419.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-CN-json-8c7c0fec6b0765479622.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-HK-json-70b4a1bb0d8d99abfa2a.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/i18n-zh-TW-json-d4e760d2810c47bf381a.d.ts +2 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-8825d180ee32659f8996.d.ts +0 -0
- package/types/packages/excalidraw/example/App.d.ts +1 -0
- package/types/packages/excalidraw/example/index.d.ts +1 -0
- package/types/packages/excalidraw/example/initialData.d.ts +138 -0
- package/types/packages/excalidraw/example/sidebar/Sidebar.d.ts +1 -0
- package/types/packages/excalidraw/webpack.dev-server.config.d.ts +19 -0
- package/types/packages/excalidraw/webpack.prod.config.d.ts +2 -1
- package/types/scene/comparisons.d.ts +1 -1
- package/types/shapes.d.ts +1 -1
- package/types/types.d.ts +2 -0
- package/types/utils.d.ts +1 -0
- package/dist/excalidraw-assets/i18n-ar-SA-json-6fcb7979cd290e0e51d9.js +0 -1
- package/dist/excalidraw-assets/i18n-bg-BG-json-eb8b237a2970da7034ad.js +0 -1
- package/dist/excalidraw-assets/i18n-bn-BD-json-87d5cd14de43ad6ec162.js +0 -1
- package/dist/excalidraw-assets/i18n-ca-ES-json-93b7462bd1d0fe76d2b5.js +0 -1
- package/dist/excalidraw-assets/i18n-cs-CZ-json-1244df10086a058f2d41.js +0 -1
- package/dist/excalidraw-assets/i18n-da-DK-json-85af69d03d5a188d4d3e.js +0 -1
- package/dist/excalidraw-assets/i18n-de-DE-json-e676479528793fb9755f.js +0 -1
- package/dist/excalidraw-assets/i18n-el-GR-json-cef06f766f46d7ab798a.js +0 -1
- package/dist/excalidraw-assets/i18n-es-ES-json-2996f978aa8d44a1bc72.js +0 -1
- package/dist/excalidraw-assets/i18n-fa-IR-json-84150b1f61e3d7a0afcf.js +0 -1
- package/dist/excalidraw-assets/i18n-fi-FI-json-bb5e3af1d7bb005f0c7d.js +0 -1
- package/dist/excalidraw-assets/i18n-fr-FR-json-f470b9806c21d127df35.js +0 -1
- package/dist/excalidraw-assets/i18n-he-IL-json-dfc95883bf533087b673.js +0 -1
- package/dist/excalidraw-assets/i18n-hi-IN-json-07d3a348a9723eeb51a3.js +0 -1
- package/dist/excalidraw-assets/i18n-hu-HU-json-dbaf9c47430503d4a710.js +0 -1
- package/dist/excalidraw-assets/i18n-id-ID-json-43b313d6c7c52122220b.js +0 -1
- package/dist/excalidraw-assets/i18n-it-IT-json-1cd7244d3b42597e1555.js +0 -1
- package/dist/excalidraw-assets/i18n-ja-JP-json-c6208f4ec6ec8d61df2f.js +0 -1
- package/dist/excalidraw-assets/i18n-kab-KAB-json-7aaa4a5ea8484b941af2.js +0 -1
- package/dist/excalidraw-assets/i18n-kk-KZ-json-654dee98c29976300a26.js +0 -1
- package/dist/excalidraw-assets/i18n-ko-KR-json-fc3ee48a144b19bcca0d.js +0 -1
- package/dist/excalidraw-assets/i18n-lv-LV-json-bfb22930b5a31d1f92ee.js +0 -1
- package/dist/excalidraw-assets/i18n-my-MM-json-6d186d192f0024208fe2.js +0 -1
- package/dist/excalidraw-assets/i18n-nb-NO-json-a8b16b7360f5df195438.js +0 -1
- package/dist/excalidraw-assets/i18n-nl-NL-json-be44386cc68047e2da24.js +0 -1
- package/dist/excalidraw-assets/i18n-nn-NO-json-074a3f14a8e56d66eeb7.js +0 -1
- package/dist/excalidraw-assets/i18n-oc-FR-json-ad1cdc3ba675116187a4.js +0 -1
- package/dist/excalidraw-assets/i18n-pa-IN-json-319132bcecbfaf90ef79.js +0 -1
- package/dist/excalidraw-assets/i18n-pl-PL-json-2df7909ca92201d653d7.js +0 -1
- package/dist/excalidraw-assets/i18n-pt-BR-json-ad09ed1c16a3d2b6d4b8.js +0 -1
- package/dist/excalidraw-assets/i18n-pt-PT-json-73605e7eed8d224609aa.js +0 -1
- package/dist/excalidraw-assets/i18n-ro-RO-json-b48f7b508a0884880f63.js +0 -1
- package/dist/excalidraw-assets/i18n-ru-RU-json-cd5378c60549c20232c7.js +0 -1
- package/dist/excalidraw-assets/i18n-si-LK-json-c5e207625d8f7a06eb15.js +0 -1
- package/dist/excalidraw-assets/i18n-sk-SK-json-0261a2d60b0803cc8354.js +0 -1
- package/dist/excalidraw-assets/i18n-sv-SE-json-4b274bae10479b585716.js +0 -1
- package/dist/excalidraw-assets/i18n-ta-IN-json-f20bc85c68e334566d53.js +0 -1
- package/dist/excalidraw-assets/i18n-tr-TR-json-17f1500f11b6e08b677b.js +0 -1
- package/dist/excalidraw-assets/i18n-uk-UA-json-4798e5a14cecdddbfb50.js +0 -1
- package/dist/excalidraw-assets/i18n-zh-CN-json-a13fbd80677ff3f0122c.js +0 -1
- package/dist/excalidraw-assets/i18n-zh-HK-json-f82802143c7042511410.js +0 -1
- package/dist/excalidraw-assets/i18n-zh-TW-json-79c634b00f4602a2d9a6.js +0 -1
- package/dist/excalidraw-assets/image-87e58979d258cd38208c.js +0 -1
- package/dist/excalidraw-assets/vendor-8698157b56eb5e0ee549.js +0 -2
- package/dist/excalidraw-assets-dev/i18n-ar-SA-json-6681743eb68e3b3041cb.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-bg-BG-json-c907a37ea9ff74c38200.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-bn-BD-json-b02ff15ce32c21861fb1.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-ca-ES-json-f9ecdae168e193e1819d.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-cs-CZ-json-b0c7af8af120bd1ba4ac.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-da-DK-json-bdae60049eb02dee741f.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-de-DE-json-0314c69da1a79cb476ef.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-el-GR-json-db678ec2c7b5ee5b6197.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-es-ES-json-f960cfc72c2bce33bcd9.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-fa-IR-json-3091ac88e5a7ad285607.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-fi-FI-json-b3a67612e607442c8940.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-fr-FR-json-628bf75e5684419e4522.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-he-IL-json-9fa5f88c445c6edfb81d.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-hi-IN-json-a398aa828f8d1bd25761.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-hu-HU-json-8fb512cf21c00656b011.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-id-ID-json-d18bde26a8a7165a4c7b.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-it-IT-json-612f895e69a992314230.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-ja-JP-json-8fb6a4429e8c4a09e6a0.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-kab-KAB-json-01a8363dae577ccfd06c.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-kk-KZ-json-d0fff58ffff7c34c30a2.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-ko-KR-json-d24a9b7640741fe02d9a.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-lv-LV-json-d9b01c32504b031e4160.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-my-MM-json-98a11afd5a8088489b91.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-nb-NO-json-de73a55ddde48cdff43c.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-nl-NL-json-88ff95be82b97ffcc7f1.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-nn-NO-json-8f60e0ec70a2e17ad33c.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-oc-FR-json-6a0ee550cb6fb3f1b259.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-pa-IN-json-9bde99f7eb773f876f85.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-pl-PL-json-bb2ca88481a524fc7a5f.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-pt-BR-json-b40463ff0ba1a0307563.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-pt-PT-json-cb72d009cf6ba3b55e0c.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-ro-RO-json-b516bae00ed365b97098.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-ru-RU-json-328be001476f936e0f00.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-si-LK-json-4be44d4d292b6dbf260e.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-sk-SK-json-2c5b8dc8f0812e1152f1.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-sv-SE-json-d96e772ca45119bbb532.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-ta-IN-json-9ba773bdb3a546e68ec3.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-tr-TR-json-d0b9b5ae9d184cffc8a2.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-uk-UA-json-deae797b510faf78ab8e.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-zh-CN-json-f972d84c7b7156249d21.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-zh-HK-json-239376fabfdff19a7ebd.js +0 -22
- package/dist/excalidraw-assets-dev/i18n-zh-TW-json-7ea4288fed6cce43f00c.js +0 -22
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see excalidraw.production.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{var n,r,i,o,a={200:(e,t,n)=>{var r="Expected a function",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,u=c||d||Function("return this")(),h=Object.prototype.toString,p=Math.max,g=Math.min,m=function(){return u.Date.now()};function f(e,t,n){var i,o,a,s,l,c,d=0,u=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError(r);function v(t){var n=i,r=o;return i=o=void 0,d=t,s=e.apply(r,n)}function y(e){return d=e,l=setTimeout(k,t),u?v(e):s}function w(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=a}function k(){var e=m();if(w(e))return _(e);l=setTimeout(k,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function _(e){return l=void 0,f&&i?v(e):(i=o=void 0,s)}function E(){var e=m(),n=w(e);if(i=arguments,o=this,c=e,n){if(void 0===l)return y(c);if(h)return l=setTimeout(k,t),v(c)}return void 0===l&&(l=setTimeout(k,t)),s}return t=x(t)||0,b(n)&&(u=!!n.leading,a=(h="maxWait"in n)?p(x(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),E.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},E.flush=function(){return void 0===l?s:_(m())},E}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function x(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(r);return b(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:i,maxWait:t,trailing:o})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,c=32,d=64,u=128,h=256,p=1/0,g=9007199254740991,m=NaN,f=4294967295,b=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",h]],x="[object Arguments]",v="[object Array]",y="[object Boolean]",w="[object Date]",k="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",C="[object Number]",j="[object Object]",I="[object Promise]",M="[object RegExp]",T="[object Set]",O="[object String]",L="[object Symbol]",A="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",N="[object Float64Array]",R="[object Int8Array]",H="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",W="[object Uint32Array]",K=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(Z.source),$=RegExp(q.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,xe=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Te="['’]",Oe="[\\ud800-\\udfff]",Le="["+Me+"]",Ae="["+Ee+"]",Pe="\\d+",De="[\\u2700-\\u27bf]",ze="["+Ce+"]",Ne="[^\\ud800-\\udfff"+Me+Pe+Se+Ce+je+"]",Re="\\ud83c[\\udffb-\\udfff]",He="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+je+"]",Ve="(?:"+ze+"|"+Ne+")",We="(?:"+Ue+"|"+Ne+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ae+"|"+Re+")"+"?",Ze="[\\ufe0e\\ufe0f]?",qe=Ze+Ye+("(?:\\u200d(?:"+[He,Be,Fe].join("|")+")"+Ze+Ye+")*"),Xe="(?:"+[De,Be,Fe].join("|")+")"+qe,$e="(?:"+[He+Ae+"?",Ae,Be,Fe,Oe].join("|")+")",Je=RegExp(Te,"g"),Qe=RegExp(Ae,"g"),et=RegExp(Re+"(?="+Re+")|"+$e+qe,"g"),tt=RegExp([Ue+"?"+ze+"+"+Ke+"(?="+[Le,Ue,"$"].join("|")+")",We+"+"+Ge+"(?="+[Le,Ue+Ve,"$"].join("|")+")",Ue+"?"+Ve+"+"+Ke,Ue+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Xe].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Ee+Ie+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,at={};at[z]=at[N]=at[R]=at[H]=at[B]=at[F]=at[U]=at[V]=at[W]=!0,at[x]=at[v]=at[P]=at[y]=at[D]=at[w]=at[k]=at[_]=at[S]=at[C]=at[j]=at[M]=at[T]=at[O]=at[A]=!1;var st={};st[x]=st[v]=st[P]=st[D]=st[y]=st[w]=st[z]=st[N]=st[R]=st[H]=st[B]=st[S]=st[C]=st[j]=st[M]=st[T]=st[O]=st[L]=st[F]=st[U]=st[V]=st[W]=!0,st[k]=st[_]=st[A]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,dt=parseInt,ut="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=ut||ht||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,ft=mt&&mt.exports===gt,bt=ft&&ut.process,xt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),vt=xt&&xt.isArrayBuffer,yt=xt&&xt.isDate,wt=xt&&xt.isMap,kt=xt&&xt.isRegExp,_t=xt&&xt.isSet,Et=xt&&xt.isTypedArray;function St(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Tt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ot(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function At(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function zt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Nt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Rt=Kt("length");function Ht(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Bt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Bt(e,Vt,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Vt(e){return e!=e}function Wt(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:m}function Kt(e){return function(t){return null==t?i:t[e]}}function Gt(e){return function(t){return null==e?i:e[t]}}function Yt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Zt(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);a!==i&&(n=n===i?a:n+a)}return n}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,mn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Jt(e,t){return At(t,(function(t){return e[t]}))}function Qt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Gt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),on=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return sn(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Rt(e)}function gn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var fn=Gt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var bn=function e(t){var n,r=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,se=t.Date,Ee=t.Error,Se=t.Function,Ce=t.Math,je=t.Object,Ie=t.RegExp,Me=t.String,Te=t.TypeError,Oe=r.prototype,Le=Se.prototype,Ae=je.prototype,Pe=t["__core-js_shared__"],De=Le.toString,ze=Ae.hasOwnProperty,Ne=0,Re=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",He=Ae.toString,Be=De.call(je),Fe=pt._,Ue=Ie("^"+De.call(ze).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=ft?t.Buffer:i,We=t.Symbol,Ke=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:i,Ye=cn(je.getPrototypeOf,je),Ze=je.create,qe=Ae.propertyIsEnumerable,Xe=Oe.splice,$e=We?We.isConcatSpreadable:i,et=We?We.iterator:i,nt=We?We.toStringTag:i,lt=function(){try{var e=go(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=se&&se.now!==pt.Date.now&&se.now,gt=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=Ce.ceil,bt=Ce.floor,xt=je.getOwnPropertySymbols,Rt=Ve?Ve.isBuffer:i,Gt=t.isFinite,xn=Oe.join,vn=cn(je.keys,je),yn=Ce.max,wn=Ce.min,kn=se.now,_n=t.parseInt,En=Ce.random,Sn=Oe.reverse,Cn=go(t,"DataView"),jn=go(t,"Map"),In=go(t,"Promise"),Mn=go(t,"Set"),Tn=go(t,"WeakMap"),On=go(je,"create"),Ln=Tn&&new Tn,An={},Pn=Fo(Cn),Dn=Fo(jn),zn=Fo(In),Nn=Fo(Mn),Rn=Fo(Tn),Hn=We?We.prototype:i,Bn=Hn?Hn.valueOf:i,Fn=Hn?Hn.toString:i;function Un(e){if(is(e)&&!Ya(e)&&!(e instanceof Gn)){if(e instanceof Kn)return e;if(ze.call(e,"__wrapped__"))return Uo(e)}return new Kn(e)}var Vn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ze)return Ze(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Wn(){}function Kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Zn(e);this.size=t.size}function Jn(e,t){var n=Ya(e),r=!n&&Ga(e),i=!n&&!r&&$a(e),o=!n&&!r&&!i&&hs(e),a=n||r||i||o,s=a?qt(e.length,Me):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wo(c,l))||s.push(c);return s}function Qn(e){var t=e.length;return t?e[Xr(0,t-1)]:i}function er(e,t){return Ro(Oi(e),cr(t,0,e.length))}function tr(e){return Ro(Oi(e))}function nr(e,t,n){(n!==i&&!Va(e[t],n)||n===i&&!(t in e))&&sr(e,t,n)}function rr(e,t,n){var r=e[t];ze.call(e,t)&&Va(r,n)&&(n!==i||t in e)||sr(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Va(e[n][0],t))return n;return-1}function or(e,t,n,r){return gr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function ar(e,t){return e&&Li(t,Ps(t),e)}function sr(e,t,n){"__proto__"==t&<?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function lr(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:Ms(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function dr(e,t,n,r,o,a){var s,l=1&t,c=2&t,d=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var u=Ya(e);if(u){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Oi(e,s)}else{var h=bo(e),p=h==_||h==E;if($a(e))return Si(e,l);if(h==j||h==x||p&&!o){if(s=c||p?{}:vo(e),!l)return c?function(e,t){return Li(e,fo(e),t)}(e,function(e,t){return e&&Li(t,Ds(t),e)}(s,e)):function(e,t){return Li(e,mo(e),t)}(e,ar(s,e))}else{if(!st[h])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case P:return Ci(e);case y:case w:return new r(+e);case D:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case N:case R:case H:case B:case F:case U:case V:case W:return ji(e,n);case S:case T:return new r;case C:case O:return new r(e);case M:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case L:return i=e,Bn?je(Bn.call(i)):{}}var i}(e,h,l)}}a||(a=new $n);var g=a.get(e);if(g)return g;a.set(e,s),cs(e)?e.forEach((function(r){s.add(dr(r,t,n,r,e,a))})):os(e)&&e.forEach((function(r,i){s.set(i,dr(r,t,n,i,e,a))}));var m=u?i:(d?c?ao:oo:c?Ds:Ps)(e);return jt(m||e,(function(r,i){m&&(r=e[i=r]),rr(s,i,dr(r,t,n,i,e,a))})),s}function ur(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function hr(e,t,n){if("function"!=typeof e)throw new Te(o);return Po((function(){e.apply(i,n)}),t)}function pr(e,t,n,r){var i=-1,o=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=At(t,$t(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Qt,a=!1,t=new Xn(t));e:for(;++i<s;){var d=e[i],u=null==n?d:n(d);if(d=r||0!==d?d:0,a&&u==u){for(var h=c;h--;)if(t[h]===u)continue e;l.push(d)}else o(t,u,r)||l.push(d)}return l}Un.templateSettings={escape:J,evaluate:Q,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Wn.prototype,Un.prototype.constructor=Un,Kn.prototype=Vn(Wn.prototype),Kn.prototype.constructor=Kn,Gn.prototype=Vn(Wn.prototype),Gn.prototype.constructor=Gn,Yn.prototype.clear=function(){this.__data__=On?On(null):{},this.size=0},Yn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Yn.prototype.get=function(e){var t=this.__data__;if(On){var n=t[e];return n===a?i:n}return ze.call(t,e)?t[e]:i},Yn.prototype.has=function(e){var t=this.__data__;return On?t[e]!==i:ze.call(t,e)},Yn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=On&&t===i?a:t,this},Zn.prototype.clear=function(){this.__data__=[],this.size=0},Zn.prototype.delete=function(e){var t=this.__data__,n=ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,!0)},Zn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Zn.prototype.has=function(e){return ir(this.__data__,e)>-1},Zn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(jn||Zn),string:new Yn}},qn.prototype.delete=function(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return ho(this,e).get(e)},qn.prototype.has=function(e){return ho(this,e).has(e)},qn.prototype.set=function(e,t){var n=ho(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,a),this},Xn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new Zn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Zn){var r=n.__data__;if(!jn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var gr=Di(kr),mr=Di(_r,!0);function fr(e,t){var n=!0;return gr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function br(e,t,n){for(var r=-1,o=e.length;++r<o;){var a=e[r],s=t(a);if(null!=s&&(l===i?s==s&&!us(s):n(s,l)))var l=s,c=a}return c}function xr(e,t){var n=[];return gr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function vr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?vr(s,t-1,n,r,i):Pt(i,s):r||(i[i.length]=s)}return i}var yr=zi(),wr=zi(!0);function kr(e,t){return e&&yr(e,t,Ps)}function _r(e,t){return e&&wr(e,t,Ps)}function Er(e,t){return Tt(t,(function(t){return es(e[t])}))}function Sr(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&n<r;)e=e[Bo(t[n++])];return n&&n==r?e:i}function Cr(e,t,n){var r=t(e);return Ya(e)?r:Pt(r,n(e))}function jr(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in je(e)?function(e){var t=ze.call(e,nt),n=e[nt];try{e[nt]=i;var r=!0}catch(e){}var o=He.call(e);r&&(t?e[nt]=n:delete e[nt]);return o}(e):function(e){return He.call(e)}(e)}function Ir(e,t){return e>t}function Mr(e,t){return null!=e&&ze.call(e,t)}function Tr(e,t){return null!=e&&t in je(e)}function Or(e,t,n){for(var o=n?Lt:Ot,a=e[0].length,s=e.length,l=s,c=r(s),d=1/0,u=[];l--;){var h=e[l];l&&t&&(h=At(h,$t(t))),d=wn(h.length,d),c[l]=!n&&(t||a>=120&&h.length>=120)?new Xn(l&&h):i}h=e[0];var p=-1,g=c[0];e:for(;++p<a&&u.length<d;){var m=h[p],f=t?t(m):m;if(m=n||0!==m?m:0,!(g?Qt(g,f):o(u,f,n))){for(l=s;--l;){var b=c[l];if(!(b?Qt(b,f):o(e[l],f,n)))continue e}g&&g.push(f),u.push(m)}}return u}function Lr(e,t,n){var r=null==(e=To(e,t=wi(t,e)))?e:e[Bo(Qo(t))];return null==r?i:St(r,e,n)}function Ar(e){return is(e)&&jr(e)==x}function Pr(e,t,n,r,o){return e===t||(null==e||null==t||!is(e)&&!is(t)?e!=e&&t!=t:function(e,t,n,r,o,a){var s=Ya(e),l=Ya(t),c=s?v:bo(e),d=l?v:bo(t),u=(c=c==x?j:c)==j,h=(d=d==x?j:d)==j,p=c==d;if(p&&$a(e)){if(!$a(t))return!1;s=!0,u=!1}if(p&&!u)return a||(a=new $n),s||hs(e)?ro(e,t,n,r,o,a):function(e,t,n,r,i,o,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new Ke(e),new Ke(t)));case y:case w:case C:return Va(+e,+t);case k:return e.name==t.name&&e.message==t.message;case M:case O:return e==t+"";case S:var s=ln;case T:var l=1&r;if(s||(s=un),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var d=ro(s(e),s(t),r,i,o,a);return a.delete(e),d;case L:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,r,o,a);if(!(1&n)){var g=u&&ze.call(e,"__wrapped__"),m=h&&ze.call(t,"__wrapped__");if(g||m){var f=g?e.value():e,b=m?t.value():t;return a||(a=new $n),o(f,b,n,r,a)}}if(!p)return!1;return a||(a=new $n),function(e,t,n,r,o,a){var s=1&n,l=oo(e),c=l.length,d=oo(t).length;if(c!=d&&!s)return!1;var u=c;for(;u--;){var h=l[u];if(!(s?h in t:ze.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);var f=s;for(;++u<c;){var b=e[h=l[u]],x=t[h];if(r)var v=s?r(x,b,h,t,e,a):r(b,x,h,e,t,a);if(!(v===i?b===x||o(b,x,n,r,a):v)){m=!1;break}f||(f="constructor"==h)}if(m&&!f){var y=e.constructor,w=t.constructor;y==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,o,a)}(e,t,n,r,Pr,o))}function Dr(e,t,n,r){var o=n.length,a=o,s=!r;if(null==e)return!a;for(e=je(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],d=e[c],u=l[1];if(s&&l[2]){if(d===i&&!(c in e))return!1}else{var h=new $n;if(r)var p=r(d,u,c,e,t,h);if(!(p===i?Pr(u,d,3,r,h):p))return!1}}return!0}function zr(e){return!(!rs(e)||(t=e,Re&&Re in t))&&(es(e)?Ue:xe).test(Fo(e));var t}function Nr(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Ya(e)?Vr(e[0],e[1]):Ur(e):ml(e)}function Rr(e){if(!Co(e))return vn(e);var t=[];for(var n in je(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Hr(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var n in je(e))t.push(n);return t}(e);var t=Co(e),n=[];for(var r in e)("constructor"!=r||!t&&ze.call(e,r))&&n.push(r);return n}function Br(e,t){return e<t}function Fr(e,t){var n=-1,i=qa(e)?r(e.length):[];return gr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Ur(e){var t=po(e);return 1==t.length&&t[0][2]?Io(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Vr(e,t){return _o(e)&&jo(t)?Io(Bo(e),t):function(n){var r=Ms(n,e);return r===i&&r===t?Ts(n,e):Pr(t,r,3)}}function Wr(e,t,n,r,o){e!==t&&yr(t,(function(a,s){if(o||(o=new $n),rs(a))!function(e,t,n,r,o,a,s){var l=Lo(e,n),c=Lo(t,n),d=s.get(c);if(d)return void nr(e,n,d);var u=a?a(l,c,n+"",e,t,s):i,h=u===i;if(h){var p=Ya(c),g=!p&&$a(c),m=!p&&!g&&hs(c);u=c,p||g||m?Ya(l)?u=l:Xa(l)?u=Oi(l):g?(h=!1,u=Si(c,!0)):m?(h=!1,u=ji(c,!0)):u=[]:ss(c)||Ga(c)?(u=l,Ga(l)?u=ys(l):rs(l)&&!es(l)||(u=vo(c))):h=!1}h&&(s.set(c,u),o(u,c,r,a,s),s.delete(c));nr(e,n,u)}(e,t,s,n,Wr,r,o);else{var l=r?r(Lo(e,s),a,s+"",e,t,o):i;l===i&&(l=a),nr(e,s,l)}}),Ds)}function Kr(e,t){var n=e.length;if(n)return wo(t+=t<0?n:0,n)?e[t]:i}function Gr(e,t,n){t=t.length?At(t,(function(e){return Ya(e)?function(t){return Sr(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;t=At(t,$t(uo()));var i=Fr(e,(function(e,n,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var l=Ii(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Yr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Sr(e,a);n(s,a)&&ti(o,wi(a,e),s)}return o}function Zr(e,t,n,r){var i=r?Ut:Ft,o=-1,a=t.length,s=e;for(e===t&&(t=Oi(t)),n&&(s=At(e,$t(n)));++o<a;)for(var l=0,c=t[o],d=n?n(c):c;(l=i(s,d,l,r))>-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function qr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?Xe.call(e,i,1):pi(e,i)}}return e}function Xr(e,t){return e+bt(En()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>g)return n;do{t%2&&(n+=e),(t=bt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Do(Mo(e,t,al),e+"")}function Qr(e){return Qn(Vs(e))}function ei(e,t){var n=Vs(e);return Ro(n,cr(t,0,n.length))}function ti(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Bo(t[o]),d=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var u=l[c];(d=r?r(u,c,l):i)===i&&(d=rs(u)?u:wo(t[o+1])?[]:{})}rr(l,c,d),l=l[c]}return e}var ni=Ln?function(e,t){return Ln.set(e,t),e}:al,ri=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:rl(t),writable:!0})}:al;function ii(e){return Ro(Vs(e))}function oi(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function ai(e,t){var n;return gr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function si(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!us(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return li(e,t,al,n)}function li(e,t,n,r){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=us(t),d=t===i;o<a;){var u=bt((o+a)/2),h=n(e[u]),p=h!==i,g=null===h,m=h==h,f=us(h);if(s)var b=r||m;else b=d?m&&(r||p):l?m&&p&&(r||!g):c?m&&p&&!g&&(r||!f):!g&&!f&&(r?h<=t:h<t);b?o=u+1:a=u}return wn(a,4294967294)}function ci(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Va(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function di(e){return"number"==typeof e?e:us(e)?m:+e}function ui(e){if("string"==typeof e)return e;if(Ya(e))return At(e,ui)+"";if(us(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,n){var r=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Lt;else if(o>=200){var c=t?null:$i(e);if(c)return un(c);a=!1,i=Qt,l=new Xn}else l=t?[]:s;e:for(;++r<o;){var d=e[r],u=t?t(d):d;if(d=n||0!==d?d:0,a&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),s.push(d)}else i(l,u,n)||(l!==s&&l.push(u),s.push(d))}return s}function pi(e,t){return null==(e=To(e,t=wi(t,e)))||delete e[Bo(Qo(t))]}function gi(e,t,n,r){return ti(e,t,n(Sr(e,t)),r)}function mi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?oi(e,r?0:o,r?o+1:i):oi(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Gn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))}),n)}function bi(e,t,n){var i=e.length;if(i<2)return i?hi(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=pr(a[o]||s,e[l],t,n));return hi(vr(a,1),t,n)}function xi(e,t,n){for(var r=-1,o=e.length,a=t.length,s={};++r<o;){var l=r<a?t[r]:i;n(s,e[r],l)}return s}function vi(e){return Xa(e)?e:[]}function yi(e){return"function"==typeof e?e:al}function wi(e,t){return Ya(e)?e:_o(e,t)?[e]:Ho(ws(e))}var ki=Jr;function _i(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function ji(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ii(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=us(e),s=t!==i,l=null===t,c=t==t,d=us(t);if(!l&&!d&&!a&&e>t||a&&s&&c&&!l&&!d||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!d&&e<t||d&&n&&o&&!r&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function Mi(e,t,n,i){for(var o=-1,a=e.length,s=n.length,l=-1,c=t.length,d=yn(a-s,0),u=r(c+d),h=!i;++l<c;)u[l]=t[l];for(;++o<s;)(h||o<a)&&(u[n[o]]=e[o]);for(;d--;)u[l++]=e[o++];return u}function Ti(e,t,n,i){for(var o=-1,a=e.length,s=-1,l=n.length,c=-1,d=t.length,u=yn(a-l,0),h=r(u+d),p=!i;++o<u;)h[o]=e[o];for(var g=o;++c<d;)h[g+c]=t[c];for(;++s<l;)(p||o<a)&&(h[g+n[s]]=e[o++]);return h}function Oi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Li(e,t,n,r){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?sr(n,l,c):rr(n,l,c)}return n}function Ai(e,t){return function(n,r){var i=Ya(n)?Ct:or,o=t?t():{};return i(n,e,uo(r,2),o)}}function Pi(e){return Jr((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ko(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}function Di(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=je(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function zi(e){return function(t,n,r){for(var i=-1,o=je(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(e){return function(t){var n=sn(t=ws(t))?gn(t):i,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}function Ri(e){return function(t){return Dt(el(Gs(t).replace(Je,"")),e,"")}}function Hi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Vn(e.prototype),r=e.apply(n,t);return rs(r)?r:n}}function Bi(e){return function(t,n,r){var o=je(t);if(!qa(t)){var a=uo(n,3);t=Ps(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,r);return s>-1?o[a?t[s]:s]:i}}function Fi(e){return io((function(t){var n=t.length,r=n,a=Kn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Te(o);if(a&&!l&&"wrapper"==lo(s))var l=new Kn([],!0)}for(r=l?r:n;++r<n;){var c=lo(s=t[r]),d="wrapper"==c?so(s):i;l=d&&Eo(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&Eo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ya(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ui(e,t,n,o,a,s,l,c,d,h){var p=t&u,g=1&t,m=2&t,f=24&t,b=512&t,x=m?i:Hi(e);return function i(){for(var u=arguments.length,v=r(u),y=u;y--;)v[y]=arguments[y];if(f)var w=co(i),k=nn(v,w);if(o&&(v=Mi(v,o,a,f)),s&&(v=Ti(v,s,l,f)),u-=k,f&&u<h){var _=dn(v,w);return qi(e,t,Ui,i.placeholder,n,v,_,c,d,h-u)}var E=g?n:this,S=m?E[e]:e;return u=v.length,c?v=Oo(v,c):b&&u>1&&v.reverse(),p&&d<u&&(v.length=d),this&&this!==pt&&this instanceof i&&(S=x||Hi(S)),S.apply(E,v)}}function Vi(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Wi(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=di(n),r=di(r)),o=e(n,r)}return o}}function Ki(e){return io((function(t){return t=At(t,$t(uo())),Jr((function(n){var r=this;return e(t,(function(e){return St(e,r,n)}))}))}))}function Gi(e,t){var n=(t=t===i?" ":ui(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,mt(e/pn(t)));return sn(t)?_i(gn(r),0,e).join(""):r.slice(0,e)}function Yi(e){return function(t,n,o){return o&&"number"!=typeof o&&ko(t,n,o)&&(n=o=i),t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n,i){for(var o=-1,a=yn(mt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:fs(o),e)}}function Zi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=vs(t),n=vs(n)),e(t,n)}}function qi(e,t,n,r,o,a,s,l,u,h){var p=8&t;t|=p?c:d,4&(t&=~(p?d:c))||(t&=-4);var g=[e,t,o,p?a:i,p?s:i,p?i:a,p?i:s,l,u,h],m=n.apply(i,g);return Eo(e)&&Ao(m,g),m.placeholder=r,zo(m,e,t)}function Xi(e){var t=Ce[e];return function(e,n){if(e=vs(e),(n=null==n?0:wn(bs(n),292))&&Gt(e)){var r=(ws(e)+"e").split("e");return+((r=(ws(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Mn&&1/un(new Mn([,-0]))[1]==p?function(e){return new Mn(e)}:ul;function Ji(e){return function(t){var n=bo(t);return n==S?ln(t):n==T?hn(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Qi(e,t,n,a,p,g,m,f){var b=2&t;if(!b&&"function"!=typeof e)throw new Te(o);var x=a?a.length:0;if(x||(t&=-97,a=p=i),m=m===i?m:yn(bs(m),0),f=f===i?f:bs(f),x-=p?p.length:0,t&d){var v=a,y=p;a=p=i}var w=b?i:so(e),k=[e,t,n,a,p,v,y,g,m,f];if(w&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==u&&8==n||r==u&&n==h&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?Mi(c,l,t[4]):l,e[4]=c?dn(e[3],s):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Ti(c,l,t[6]):l,e[6]=c?dn(e[5],s):t[6]);(l=t[7])&&(e[7]=l);r&u&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(k,w),e=k[0],t=k[1],n=k[2],a=k[3],p=k[4],!(f=k[9]=k[9]===i?b?0:e.length:yn(k[9]-x,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==l?function(e,t,n){var o=Hi(e);return function a(){for(var s=arguments.length,l=r(s),c=s,d=co(a);c--;)l[c]=arguments[c];var u=s<3&&l[0]!==d&&l[s-1]!==d?[]:dn(l,d);return(s-=u.length)<n?qi(e,t,Ui,a.placeholder,i,l,u,i,i,n-s):St(this&&this!==pt&&this instanceof a?o:e,this,l)}}(e,t,f):t!=c&&33!=t||p.length?Ui.apply(i,k):function(e,t,n,i){var o=1&t,a=Hi(e);return function t(){for(var s=-1,l=arguments.length,c=-1,d=i.length,u=r(d+l),h=this&&this!==pt&&this instanceof t?a:e;++c<d;)u[c]=i[c];for(;l--;)u[c++]=arguments[++s];return St(h,o?n:this,u)}}(e,t,n,a);else var _=function(e,t,n){var r=1&t,i=Hi(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return zo((w?ni:Ao)(_,k),e,t)}function eo(e,t,n,r){return e===i||Va(e,Ae[n])&&!ze.call(r,n)?t:e}function to(e,t,n,r,o,a){return rs(e)&&rs(t)&&(a.set(t,e),Wr(e,t,i,to,a),a.delete(t)),e}function no(e){return ss(e)?i:e}function ro(e,t,n,r,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var d=a.get(e),u=a.get(t);if(d&&u)return d==t&&u==e;var h=-1,p=!0,g=2&n?new Xn:i;for(a.set(e,t),a.set(t,e);++h<l;){var m=e[h],f=t[h];if(r)var b=s?r(f,m,h,t,e,a):r(m,f,h,e,t,a);if(b!==i){if(b)continue;p=!1;break}if(g){if(!Nt(t,(function(e,t){if(!Qt(g,t)&&(m===e||o(m,e,n,r,a)))return g.push(t)}))){p=!1;break}}else if(m!==f&&!o(m,f,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return Do(Mo(e,i,Zo),e+"")}function oo(e){return Cr(e,Ps,mo)}function ao(e){return Cr(e,Ds,fo)}var so=Ln?function(e){return Ln.get(e)}:ul;function lo(e){for(var t=e.name+"",n=An[t],r=ze.call(An,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(ze.call(Un,"placeholder")?Un:e).placeholder}function uo(){var e=Un.iteratee||sl;return e=e===sl?Nr:e,arguments.length?e(arguments[0],arguments[1]):e}function ho(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function po(e){for(var t=Ps(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jo(i)]}return t}function go(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return zr(n)?n:i}var mo=xt?function(e){return null==e?[]:(e=je(e),Tt(xt(e),(function(t){return qe.call(e,t)})))}:xl,fo=xt?function(e){for(var t=[];e;)Pt(t,mo(e)),e=Ye(e);return t}:xl,bo=jr;function xo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=Bo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&ns(i)&&wo(a,i)&&(Ya(e)||Ga(e))}function vo(e){return"function"!=typeof e.constructor||Co(e)?{}:Vn(Ye(e))}function yo(e){return Ya(e)||Ga(e)||!!($e&&e&&e[$e])}function wo(e,t){var n=typeof e;return!!(t=null==t?g:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function ko(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&wo(t,n.length):"string"==r&&t in n)&&Va(n[t],e)}function _o(e,t){if(Ya(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in je(t))}function Eo(e){var t=lo(e),n=Un[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var r=so(n);return!!r&&e===r[0]}(Cn&&bo(new Cn(new ArrayBuffer(1)))!=D||jn&&bo(new jn)!=S||In&&bo(In.resolve())!=I||Mn&&bo(new Mn)!=T||Tn&&bo(new Tn)!=A)&&(bo=function(e){var t=jr(e),n=t==j?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Pn:return D;case Dn:return S;case zn:return I;case Nn:return T;case Rn:return A}return t});var So=Pe?es:vl;function Co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function jo(e){return e==e&&!rs(e)}function Io(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in je(n)))}}function Mo(e,t,n){return t=yn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=yn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(s),St(e,this,l)}}function To(e,t){return t.length<2?e:Sr(e,oi(t,0,-1))}function Oo(e,t){for(var n=e.length,r=wn(t.length,n),o=Oi(e);r--;){var a=t[r];e[r]=wo(a,n)?o[a]:i}return e}function Lo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ao=No(ni),Po=gt||function(e,t){return pt.setTimeout(e,t)},Do=No(ri);function zo(e,t,n){var r=t+"";return Do(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(b,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(de):[]}(r),n)))}function No(e){var t=0,n=0;return function(){var r=kn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ro(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var a=Xr(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Ho=function(e){var t=Na(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,i){t.push(r?i.replace(pe,"$1"):n||e)})),t}));function Bo(e){if("string"==typeof e||us(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Uo(e){if(e instanceof Gn)return e.clone();var t=new Kn(e.__wrapped__,e.__chain__);return t.__actions__=Oi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Vo=Jr((function(e,t){return Xa(e)?pr(e,vr(t,1,Xa,!0)):[]})),Wo=Jr((function(e,t){var n=Qo(t);return Xa(n)&&(n=i),Xa(e)?pr(e,vr(t,1,Xa,!0),uo(n,2)):[]})),Ko=Jr((function(e,t){var n=Qo(t);return Xa(n)&&(n=i),Xa(e)?pr(e,vr(t,1,Xa,!0),i,n):[]}));function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Bt(e,uo(t,3),i)}function Yo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=bs(n),o=n<0?yn(r+o,0):wn(o,r-1)),Bt(e,uo(t,3),o,!0)}function Zo(e){return(null==e?0:e.length)?vr(e,1):[]}function qo(e){return e&&e.length?e[0]:i}var Xo=Jr((function(e){var t=At(e,vi);return t.length&&t[0]===e[0]?Or(t):[]})),$o=Jr((function(e){var t=Qo(e),n=At(e,vi);return t===Qo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Or(n,uo(t,2)):[]})),Jo=Jr((function(e){var t=Qo(e),n=At(e,vi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Or(n,i,t):[]}));function Qo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var ea=Jr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Zr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return qr(e,At(t,(function(e){return wo(e,n)?+e:e})).sort(Ii)),r}));function ra(e){return null==e?e:Sn.call(e)}var ia=Jr((function(e){return hi(vr(e,1,Xa,!0))})),oa=Jr((function(e){var t=Qo(e);return Xa(t)&&(t=i),hi(vr(e,1,Xa,!0),uo(t,2))})),aa=Jr((function(e){var t=Qo(e);return t="function"==typeof t?t:i,hi(vr(e,1,Xa,!0),i,t)}));function sa(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,(function(e){if(Xa(e))return t=yn(e.length,t),!0})),qt(t,(function(t){return At(e,Kt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:At(n,(function(e){return St(t,i,e)}))}var ca=Jr((function(e,t){return Xa(e)?pr(e,t):[]})),da=Jr((function(e){return bi(Tt(e,Xa))})),ua=Jr((function(e){var t=Qo(e);return Xa(t)&&(t=i),bi(Tt(e,Xa),uo(t,2))})),ha=Jr((function(e){var t=Qo(e);return t="function"==typeof t?t:i,bi(Tt(e,Xa),i,t)})),pa=Jr(sa);var ga=Jr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ma(e){var t=Un(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var ba=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Kn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var xa=Ai((function(e,t,n){ze.call(e,n)?++e[n]:sr(e,n,1)}));var va=Bi(Go),ya=Bi(Yo);function wa(e,t){return(Ya(e)?jt:gr)(e,uo(t,3))}function ka(e,t){return(Ya(e)?It:mr)(e,uo(t,3))}var _a=Ai((function(e,t,n){ze.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ea=Jr((function(e,t,n){var i=-1,o="function"==typeof t,a=qa(e)?r(e.length):[];return gr(e,(function(e){a[++i]=o?St(t,e,n):Lr(e,t,n)})),a})),Sa=Ai((function(e,t,n){sr(e,n,t)}));function Ca(e,t){return(Ya(e)?At:Fr)(e,uo(t,3))}var ja=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ia=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ko(e,t[0],t[1])?t=[]:n>2&&ko(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,vr(t,1),[])})),Ma=ht||function(){return pt.Date.now()};function Ta(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Qi(e,u,i,i,i,i,t)}function Oa(e,t){var n;if("function"!=typeof t)throw new Te(o);return e=bs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Jr((function(e,t,n){var r=1;if(n.length){var i=dn(n,co(La));r|=c}return Qi(e,r,t,n,i)})),Aa=Jr((function(e,t,n){var r=3;if(n.length){var i=dn(n,co(Aa));r|=c}return Qi(t,r,e,n,i)}));function Pa(e,t,n){var r,a,s,l,c,d,u=0,h=!1,p=!1,g=!0;if("function"!=typeof e)throw new Te(o);function m(t){var n=r,o=a;return r=a=i,u=t,l=e.apply(o,n)}function f(e){return u=e,c=Po(x,t),h?m(e):l}function b(e){var n=e-d;return d===i||n>=t||n<0||p&&e-u>=s}function x(){var e=Ma();if(b(e))return v(e);c=Po(x,function(e){var n=t-(e-d);return p?wn(n,s-(e-u)):n}(e))}function v(e){return c=i,g&&r?m(e):(r=a=i,l)}function y(){var e=Ma(),n=b(e);if(r=arguments,a=this,d=e,n){if(c===i)return f(d);if(p)return Ei(c),c=Po(x,t),m(d)}return c===i&&(c=Po(x,t)),l}return t=vs(t)||0,rs(n)&&(h=!!n.leading,s=(p="maxWait"in n)?yn(vs(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),y.cancel=function(){c!==i&&Ei(c),u=0,r=d=a=c=i},y.flush=function(){return c===i?l:v(Ma())},y}var Da=Jr((function(e,t){return hr(e,1,t)})),za=Jr((function(e,t,n){return hr(e,vs(t)||0,n)}));function Na(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Na.Cache||qn),n}function Ra(e){if("function"!=typeof e)throw new Te(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Na.Cache=qn;var Ha=ki((function(e,t){var n=(t=1==t.length&&Ya(t[0])?At(t[0],$t(uo())):At(vr(t,1),$t(uo()))).length;return Jr((function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return St(e,this,r)}))})),Ba=Jr((function(e,t){var n=dn(t,co(Ba));return Qi(e,c,i,t,n)})),Fa=Jr((function(e,t){var n=dn(t,co(Fa));return Qi(e,d,i,t,n)})),Ua=io((function(e,t){return Qi(e,h,i,i,i,t)}));function Va(e,t){return e===t||e!=e&&t!=t}var Wa=Zi(Ir),Ka=Zi((function(e,t){return e>=t})),Ga=Ar(function(){return arguments}())?Ar:function(e){return is(e)&&ze.call(e,"callee")&&!qe.call(e,"callee")},Ya=r.isArray,Za=vt?$t(vt):function(e){return is(e)&&jr(e)==P};function qa(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return is(e)&&qa(e)}var $a=Rt||vl,Ja=yt?$t(yt):function(e){return is(e)&&jr(e)==w};function Qa(e){if(!is(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=jr(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==bs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=wt?$t(wt):function(e){return is(e)&&bo(e)==S};function as(e){return"number"==typeof e||is(e)&&jr(e)==C}function ss(e){if(!is(e)||jr(e)!=j)return!1;var t=Ye(e);if(null===t)return!0;var n=ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var ls=kt?$t(kt):function(e){return is(e)&&jr(e)==M};var cs=_t?$t(_t):function(e){return is(e)&&bo(e)==T};function ds(e){return"string"==typeof e||!Ya(e)&&is(e)&&jr(e)==O}function us(e){return"symbol"==typeof e||is(e)&&jr(e)==L}var hs=Et?$t(Et):function(e){return is(e)&&ns(e.length)&&!!at[jr(e)]};var ps=Zi(Br),gs=Zi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(qa(e))return ds(e)?gn(e):Oi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=bo(e);return(t==S?ln:t==T?un:Vs)(e)}function fs(e){return e?(e=vs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function bs(e){var t=fs(e),n=t%1;return t==t?n?t-n:t:0}function xs(e){return e?cr(bs(e),0,f):0}function vs(e){if("number"==typeof e)return e;if(us(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=be.test(e);return n||ve.test(e)?dt(e.slice(2),n?2:8):fe.test(e)?m:+e}function ys(e){return Li(e,Ds(e))}function ws(e){return null==e?"":ui(e)}var ks=Pi((function(e,t){if(Co(t)||qa(t))Li(t,Ps(t),e);else for(var n in t)ze.call(t,n)&&rr(e,n,t[n])})),_s=Pi((function(e,t){Li(t,Ds(t),e)})),Es=Pi((function(e,t,n,r){Li(t,Ds(t),e,r)})),Ss=Pi((function(e,t,n,r){Li(t,Ps(t),e,r)})),Cs=io(lr);var js=Jr((function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&ko(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],s=Ds(a),l=-1,c=s.length;++l<c;){var d=s[l],u=e[d];(u===i||Va(u,Ae[d])&&!ze.call(e,d))&&(e[d]=a[d])}return e})),Is=Jr((function(e){return e.push(i,to),St(Ns,i,e)}));function Ms(e,t,n){var r=null==e?i:Sr(e,t);return r===i?n:r}function Ts(e,t){return null!=e&&xo(e,t,Tr)}var Os=Vi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),e[t]=n}),rl(al)),Ls=Vi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),ze.call(e,t)?e[t].push(n):e[t]=[n]}),uo),As=Jr(Lr);function Ps(e){return qa(e)?Jn(e):Rr(e)}function Ds(e){return qa(e)?Jn(e,!0):Hr(e)}var zs=Pi((function(e,t,n){Wr(e,t,n)})),Ns=Pi((function(e,t,n,r){Wr(e,t,n,r)})),Rs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=At(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Li(e,ao(e),n),r&&(n=dr(n,7,no));for(var i=t.length;i--;)pi(n,t[i]);return n}));var Hs=io((function(e,t){return null==e?{}:function(e,t){return Yr(e,t,(function(t,n){return Ts(e,n)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var n=At(ao(e),(function(e){return[e]}));return t=uo(t),Yr(e,n,(function(e,n){return t(e,n[0])}))}var Fs=Ji(Ps),Us=Ji(Ds);function Vs(e){return null==e?[]:Jt(e,Ps(e))}var Ws=Ri((function(e,t,n){return t=t.toLowerCase(),e+(n?Ks(t):t)}));function Ks(e){return Qs(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(we,rn).replace(Qe,"")}var Ys=Ri((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Zs=Ri((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),qs=Ni("toLowerCase");var Xs=Ri((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Ri((function(e,t,n){return e+(n?" ":"")+Qs(t)}));var Js=Ri((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Qs=Ni("toUpperCase");function el(e,t,n){return e=ws(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Jr((function(e,t){try{return St(e,i,t)}catch(e){return Qa(e)?e:new Ee(e)}})),nl=io((function(e,t){return jt(t,(function(t){t=Bo(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var il=Fi(),ol=Fi(!0);function al(e){return e}function sl(e){return Nr("function"==typeof e?e:dr(e,1))}var ll=Jr((function(e,t){return function(n){return Lr(n,e,t)}})),cl=Jr((function(e,t){return function(n){return Lr(e,n,t)}}));function dl(e,t,n){var r=Ps(t),i=Er(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Er(t,Ps(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Pt([this.value()],arguments))})})),e}function ul(){}var hl=Ki(At),pl=Ki(Mt),gl=Ki(Nt);function ml(e){return _o(e)?Kt(Bo(e)):function(e){return function(t){return Sr(t,e)}}(e)}var fl=Yi(),bl=Yi(!0);function xl(){return[]}function vl(){return!1}var yl=Wi((function(e,t){return e+t}),0),wl=Xi("ceil"),kl=Wi((function(e,t){return e/t}),1),_l=Xi("floor");var El,Sl=Wi((function(e,t){return e*t}),1),Cl=Xi("round"),jl=Wi((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Te(o);return e=bs(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Ta,Un.assign=ks,Un.assignIn=_s,Un.assignInWith=Es,Un.assignWith=Ss,Un.at=Cs,Un.before=Oa,Un.bind=La,Un.bindAll=nl,Un.bindKey=Aa,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},Un.chain=ma,Un.chunk=function(e,t,n){t=(n?ko(e,t,n):t===i)?1:yn(bs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(mt(o/t));a<o;)l[s++]=oi(e,a,a+=t);return l},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Pt(Ya(n)?Oi(n):[n],vr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new Te(o);return[n(e[0]),e[1]]})):[],Jr((function(n){for(var r=-1;++r<t;){var i=e[r];if(St(i[0],this,n))return St(i[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=Ps(e);return function(n){return ur(n,e,t)}}(dr(e,1))},Un.constant=rl,Un.countBy=xa,Un.create=function(e,t){var n=Vn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var o=Qi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.curryRight=function e(t,n,r){var o=Qi(t,l,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.debounce=Pa,Un.defaults=js,Un.defaultsDeep=Is,Un.defer=Da,Un.delay=za,Un.difference=Vo,Un.differenceBy=Wo,Un.differenceWith=Ko,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=n||t===i?1:bs(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,0,(t=r-(t=n||t===i?1:bs(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0):[]},Un.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ko(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=bs(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:bs(r))<0&&(r+=o),r=n>r?0:xs(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(Ya(e)?Tt:xr)(e,uo(t,3))},Un.flatMap=function(e,t){return vr(Ca(e,t),1)},Un.flatMapDeep=function(e,t){return vr(Ca(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===i?1:bs(n),vr(Ca(e,t),n)},Un.flatten=Zo,Un.flattenDeep=function(e){return(null==e?0:e.length)?vr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?vr(e,t=t===i?1:bs(t)):[]},Un.flip=function(e){return Qi(e,512)},Un.flow=il,Un.flowRight=ol,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Un.functions=function(e){return null==e?[]:Er(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:Er(e,Ds(e))},Un.groupBy=_a,Un.initial=function(e){return(null==e?0:e.length)?oi(e,0,-1):[]},Un.intersection=Xo,Un.intersectionBy=$o,Un.intersectionWith=Jo,Un.invert=Os,Un.invertBy=Ls,Un.invokeMap=Ea,Un.iteratee=sl,Un.keyBy=Sa,Un.keys=Ps,Un.keysIn=Ds,Un.map=Ca,Un.mapKeys=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,t(e,r,i),e)})),n},Un.mapValues=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,r,t(e,r,i))})),n},Un.matches=function(e){return Ur(dr(e,1))},Un.matchesProperty=function(e,t){return Vr(e,dr(t,1))},Un.memoize=Na,Un.merge=zs,Un.mergeWith=Ns,Un.method=ll,Un.methodOf=cl,Un.mixin=dl,Un.negate=Ra,Un.nthArg=function(e){return e=bs(e),Jr((function(t){return Kr(t,e)}))},Un.omit=Rs,Un.omitBy=function(e,t){return Bs(e,Ra(uo(t)))},Un.once=function(e){return Oa(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(Ya(t)||(t=null==t?[]:[t]),Ya(n=r?i:n)||(n=null==n?[]:[n]),Gr(e,t,n))},Un.over=hl,Un.overArgs=Ha,Un.overEvery=pl,Un.overSome=gl,Un.partial=Ba,Un.partialRight=Fa,Un.partition=ja,Un.pick=Hs,Un.pickBy=Bs,Un.property=ml,Un.propertyOf=function(e){return function(t){return null==e?i:Sr(e,t)}},Un.pull=ea,Un.pullAll=ta,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,uo(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,i,n):e},Un.pullAt=na,Un.range=fl,Un.rangeRight=bl,Un.rearg=Ua,Un.reject=function(e,t){return(Ya(e)?Tt:xr)(e,Ra(uo(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=uo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return qr(e,i),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Te(o);return Jr(e,t=t===i?t:bs(t))},Un.reverse=ra,Un.sampleSize=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),(Ya(e)?er:ei)(e,t)},Un.set=function(e,t,n){return null==e?e:ti(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ti(e,t,n,r)},Un.shuffle=function(e){return(Ya(e)?tr:ii)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ko(e,t,n)?(t=0,n=r):(t=null==t?0:bs(t),n=n===i?r:bs(n)),oi(e,t,n)):[]},Un.sortBy=Ia,Un.sortedUniq=function(e){return e&&e.length?ci(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ko(e,t,n)&&(t=n=i),(n=n===i?f:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?_i(gn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Te(o);return t=null==t?0:yn(bs(t),0),Jr((function(n){var r=n[t],i=_i(n,0,t);return r&&Pt(i,r),St(e,this,i)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:bs(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:bs(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?mi(e,uo(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Te(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Pa(e,t,{leading:r,maxWait:t,trailing:i})},Un.thru=fa,Un.toArray=ms,Un.toPairs=Fs,Un.toPairsIn=Us,Un.toPath=function(e){return Ya(e)?At(e,Bo):us(e)?[e]:Oi(Ho(ws(e)))},Un.toPlainObject=ys,Un.transform=function(e,t,n){var r=Ya(e),i=r||$a(e)||hs(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?Vn(Ye(e)):{}}return(i?jt:kr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Un.unary=function(e){return Ta(e,1)},Un.union=ia,Un.unionBy=oa,Un.unionWith=aa,Un.uniq=function(e){return e&&e.length?hi(e):[]},Un.uniqBy=function(e,t){return e&&e.length?hi(e,uo(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?hi(e,i,t):[]},Un.unset=function(e,t){return null==e||pi(e,t)},Un.unzip=sa,Un.unzipWith=la,Un.update=function(e,t,n){return null==e?e:gi(e,t,yi(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:gi(e,t,yi(n),r)},Un.values=Vs,Un.valuesIn=function(e){return null==e?[]:Jt(e,Ds(e))},Un.without=ca,Un.words=el,Un.wrap=function(e,t){return Ba(yi(t),e)},Un.xor=da,Un.xorBy=ua,Un.xorWith=ha,Un.zip=pa,Un.zipObject=function(e,t){return xi(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return xi(e||[],t||[],ti)},Un.zipWith=ga,Un.entries=Fs,Un.entriesIn=Us,Un.extend=_s,Un.extendWith=Es,dl(Un,Un),Un.add=yl,Un.attempt=tl,Un.camelCase=Ws,Un.capitalize=Ks,Un.ceil=wl,Un.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=vs(n))==n?n:0),t!==i&&(t=(t=vs(t))==t?t:0),cr(vs(e),t,n)},Un.clone=function(e){return dr(e,4)},Un.cloneDeep=function(e){return dr(e,5)},Un.cloneDeepWith=function(e,t){return dr(e,5,t="function"==typeof t?t:i)},Un.cloneWith=function(e,t){return dr(e,4,t="function"==typeof t?t:i)},Un.conformsTo=function(e,t){return null==t||ur(e,t,Ps(t))},Un.deburr=Gs,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=kl,Un.endsWith=function(e,t,n){e=ws(e),t=ui(t);var r=e.length,o=n=n===i?r:cr(bs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Un.eq=Va,Un.escape=function(e){return(e=ws(e))&&$.test(e)?e.replace(q,on):e},Un.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Un.every=function(e,t,n){var r=Ya(e)?Mt:fr;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.find=va,Un.findIndex=Go,Un.findKey=function(e,t){return Ht(e,uo(t,3),kr)},Un.findLast=ya,Un.findLastIndex=Yo,Un.findLastKey=function(e,t){return Ht(e,uo(t,3),_r)},Un.floor=_l,Un.forEach=wa,Un.forEachRight=ka,Un.forIn=function(e,t){return null==e?e:yr(e,uo(t,3),Ds)},Un.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),Ds)},Un.forOwn=function(e,t){return e&&kr(e,uo(t,3))},Un.forOwnRight=function(e,t){return e&&_r(e,uo(t,3))},Un.get=Ms,Un.gt=Wa,Un.gte=Ka,Un.has=function(e,t){return null!=e&&xo(e,t,Mr)},Un.hasIn=Ts,Un.head=qo,Un.identity=al,Un.includes=function(e,t,n,r){e=qa(e)?e:Vs(e),n=n&&!r?bs(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),ds(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Ft(e,t,i)},Un.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=wn(t,n)&&e<yn(t,n)}(e=vs(e),t,n)},Un.invoke=As,Un.isArguments=Ga,Un.isArray=Ya,Un.isArrayBuffer=Za,Un.isArrayLike=qa,Un.isArrayLikeObject=Xa,Un.isBoolean=function(e){return!0===e||!1===e||is(e)&&jr(e)==y},Un.isBuffer=$a,Un.isDate=Ja,Un.isElement=function(e){return is(e)&&1===e.nodeType&&!ss(e)},Un.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||hs(e)||Ga(e)))return!e.length;var t=bo(e);if(t==S||t==T)return!e.size;if(Co(e))return!Rr(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Pr(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Pr(e,t,i,n):!!r},Un.isError=Qa,Un.isFinite=function(e){return"number"==typeof e&&Gt(e)},Un.isFunction=es,Un.isInteger=ts,Un.isLength=ns,Un.isMap=os,Un.isMatch=function(e,t){return e===t||Dr(e,t,po(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Dr(e,t,po(t),n)},Un.isNaN=function(e){return as(e)&&e!=+e},Un.isNative=function(e){if(So(e))throw new Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=as,Un.isObject=rs,Un.isObjectLike=is,Un.isPlainObject=ss,Un.isRegExp=ls,Un.isSafeInteger=function(e){return ts(e)&&e>=-9007199254740991&&e<=g},Un.isSet=cs,Un.isString=ds,Un.isSymbol=us,Un.isTypedArray=hs,Un.isUndefined=function(e){return e===i},Un.isWeakMap=function(e){return is(e)&&bo(e)==A},Un.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==jr(e)},Un.join=function(e,t){return null==e?"":xn.call(e,t)},Un.kebabCase=Ys,Un.last=Qo,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=bs(n))<0?yn(r+o,0):wn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Vt,o,!0)},Un.lowerCase=Zs,Un.lowerFirst=qs,Un.lt=ps,Un.lte=gs,Un.max=function(e){return e&&e.length?br(e,al,Ir):i},Un.maxBy=function(e,t){return e&&e.length?br(e,uo(t,2),Ir):i},Un.mean=function(e){return Wt(e,al)},Un.meanBy=function(e,t){return Wt(e,uo(t,2))},Un.min=function(e){return e&&e.length?br(e,al,Br):i},Un.minBy=function(e,t){return e&&e.length?br(e,uo(t,2),Br):i},Un.stubArray=xl,Un.stubFalse=vl,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=Sl,Un.nth=function(e,t){return e&&e.length?Kr(e,bs(t)):i},Un.noConflict=function(){return pt._===this&&(pt._=Fe),this},Un.noop=ul,Un.now=Ma,Un.pad=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(bt(i),n)+e+Gi(mt(i),n)},Un.padEnd=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?e+Gi(t-r,n):e},Un.padStart=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?Gi(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ws(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ko(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fs(e),t===i?(t=e,e=0):t=fs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();return wn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Xr(e,t)},Un.reduce=function(e,t,n){var r=Ya(e)?Dt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,gr)},Un.reduceRight=function(e,t,n){var r=Ya(e)?zt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,mr)},Un.repeat=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),$r(ws(e),t)},Un.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++r<o;){var a=null==e?i:e[Bo(t[r])];a===i&&(r=o,a=n),e=es(a)?a.call(e):a}return e},Un.round=Cl,Un.runInContext=e,Un.sample=function(e){return(Ya(e)?Qn:Qr)(e)},Un.size=function(e){if(null==e)return 0;if(qa(e))return ds(e)?pn(e):e.length;var t=bo(e);return t==S||t==T?e.size:Rr(e).length},Un.snakeCase=Xs,Un.some=function(e,t,n){var r=Ya(e)?Nt:ai;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.sortedIndex=function(e,t){return si(e,t)},Un.sortedIndexBy=function(e,t,n){return li(e,t,uo(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=si(e,t);if(r<n&&Va(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return si(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return li(e,t,uo(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=si(e,t,!0)-1;if(Va(e[n],t))return n}return-1},Un.startCase=$s,Un.startsWith=function(e,t,n){return e=ws(e),n=null==n?0:cr(bs(n),0,e.length),t=ui(t),e.slice(n,n+t.length)==t},Un.subtract=jl,Un.sum=function(e){return e&&e.length?Zt(e,al):0},Un.sumBy=function(e,t){return e&&e.length?Zt(e,uo(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ko(e,t,n)&&(t=i),e=ws(e),t=Es({},t,r,eo);var o,a,s=Es({},t.imports,r.imports,eo),l=Ps(s),c=Jt(s,l),d=0,u=t.interpolate||ke,h="__p += '",p=Ie((t.escape||ke).source+"|"+u.source+"|"+(u===ee?ge:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),g="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(p,(function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(d,l).replace(_e,an),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),d=l+t.length,t})),h+="';\n";var m=ze.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new Ee("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(K,""):h).replace(G,"$1").replace(Y,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var f=tl((function(){return Se(l,g+"return "+h).apply(i,c)}));if(f.source=h,Qa(f))throw f;return f},Un.times=function(e,t){if((e=bs(e))<1||e>g)return[];var n=f,r=wn(e,f);t=uo(t),e-=f;for(var i=qt(r,t);++n<e;)t(n);return i},Un.toFinite=fs,Un.toInteger=bs,Un.toLength=xs,Un.toLower=function(e){return ws(e).toLowerCase()},Un.toNumber=vs,Un.toSafeInteger=function(e){return e?cr(bs(e),-9007199254740991,g):0===e?e:0},Un.toString=ws,Un.toUpper=function(e){return ws(e).toUpperCase()},Un.trim=function(e,t,n){if((e=ws(e))&&(n||t===i))return Xt(e);if(!e||!(t=ui(t)))return e;var r=gn(e),o=gn(t);return _i(r,en(r,o),tn(r,o)+1).join("")},Un.trimEnd=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.slice(0,mn(e)+1);if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,0,tn(r,gn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.replace(ae,"");if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,en(r,gn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?bs(t.length):n,r="omission"in t?ui(t.omission):r}var a=(e=ws(e)).length;if(sn(e)){var s=gn(e);a=s.length}if(n>=a)return e;var l=n-pn(r);if(l<1)return r;var c=s?_i(s,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(s&&(l+=c.length-l),ls(o)){if(e.slice(l).search(o)){var d,u=c;for(o.global||(o=Ie(o.source,ws(me.exec(o))+"g")),o.lastIndex=0;d=o.exec(u);)var h=d.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(ui(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Un.unescape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Z,fn):e},Un.uniqueId=function(e){var t=++Ne;return ws(e)+t},Un.upperCase=Js,Un.upperFirst=Qs,Un.each=wa,Un.eachRight=ka,Un.first=qo,dl(Un,(El={},kr(Un,(function(e,t){ze.call(Un.prototype,t)||(El[t]=e)})),El),{chain:!1}),Un.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),jt(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===i?1:yn(bs(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Lr(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ra(uo(e)))},Gn.prototype.slice=function(e,t){e=bs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=bs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(f)},kr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Un.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Gn,c=s[0],d=l||Ya(t),u=function(e){var t=o.apply(Un,Pt([e],s));return r&&h?t[0]:t};d&&n&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,p=!!this.__actions__.length,g=a&&!h,m=l&&!p;if(!a&&d){t=m?t:new Gn(this);var f=e.apply(t,s);return f.__actions__.push({func:fa,args:[u],thisArg:i}),new Kn(f,h)}return g&&m?e.apply(this,s):(f=this.thru(u),g?r?f.value()[0]:f.value():f)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[n]((function(n){return t.apply(Ya(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";ze.call(An,r)||(An[r]=[]),An[r].push({name:t,func:n})}})),An[Ui(i,2).name]=[{name:"wrapper",func:i}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ya(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,d=this.__iteratees__,u=d.length,h=0,p=wn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return fi(e,this.__actions__);var g=[];e:for(;l--&&h<p;){for(var m=-1,f=e[c+=t];++m<u;){var b=d[m],x=b.iteratee,v=b.type,y=x(f);if(2==v)f=y;else if(!y){if(1==v)continue e;break e}}g[h++]=f}return g},Un.prototype.at=ba,Un.prototype.chain=function(){return ma(this)},Un.prototype.commit=function(){return new Kn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=ms(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Wn;){var r=Uo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:fa,args:[ra],thisArg:i}),new Kn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,et&&(Un.prototype[et]=function(){return this}),Un}();pt._=bn,(r=function(){return bn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},4516:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),c=1;c<arguments.length;c++){for(var d in a=Object(arguments[c]))n.call(a,d)&&(l[d]=a[d]);if(t){s=t(a);for(var u=0;u<s.length;u++)r.call(a,s[u])&&(l[s[u]]=a[s[u]])}}return l}},6094:(e,t,n)=>{"use strict";n(4516);var r=n(9787),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:d,props:o,_owner:a.current}}t.jsx=c,t.jsxs=c},4512:(e,t,n)=>{"use strict";e.exports=n(6094)},8336:(e,t,n)=>{var r=n(487),i=n(4295);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},554:(e,t,n)=>{var r=n(487),i=n(9135);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2789:(e,t,n)=>{var r=n(487),i=n(3729);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5080:(e,t,n)=>{var r=n(487),i=n(4241);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7225:(e,t,n)=>{var r=n(487),i=n(6029);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},778:(e,t,n)=>{var r=n(487),i=n(9609);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4220:(e,t,n)=>{var r=n(487),i=n(2345);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4678:(e,t,n)=>{var r=n(487),i=n(9393);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1292:(e,t,n)=>{var r=n(487),i=n(6578);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},196:(e,t,n)=>{var r=n(487),i=n(9482);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2205:(e,t,n)=>{var r=n(487),i=n(7955);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1310:(e,t,n)=>{var r=n(487),i=n(3195);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3922:(e,t,n)=>{var r=n(487),i=n(2978);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7096:(e,t,n)=>{var r=n(487),i=n(1587);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7117:(e,t,n)=>{var r=n(487),i=n(9478);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1106:(e,t,n)=>{var r=n(487),i=n(7369);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3336:(e,t,n)=>{var r=n(487),i=n(1434);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4406:(e,t,n)=>{var r=n(487),i=n(8923);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6043:(e,t,n)=>{var r=n(487),i=n(5605);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},694:(e,t,n)=>{var r=n(487),i=n(5644);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8328:(e,t,n)=>{var r=n(487),i=n(6843);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8051:(e,t,n)=>{var r=n(487),i=n(8461);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4301:(e,t,n)=>{var r=n(487),i=n(9935);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9966:(e,t,n)=>{var r=n(487),i=n(532);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9295:(e,t,n)=>{var r=n(487),i=n(7589);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9781:(e,t,n)=>{var r=n(487),i=n(8465);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},371:(e,t,n)=>{var r=n(487),i=n(5892);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4623:(e,t,n)=>{var r=n(487),i=n(3874);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1528:(e,t,n)=>{var r=n(487),i=n(2681);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},518:(e,t,n)=>{var r=n(487),i=n(6759);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9757:(e,t,n)=>{var r=n(487),i=n(9650);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5422:(e,t,n)=>{var r=n(487),i=n(2044);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},276:(e,t,n)=>{var r=n(487),i=n(9144);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6781:(e,t,n)=>{var r=n(487),i=n(6626);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},580:(e,t,n)=>{var r=n(487),i=n(6359);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4285:(e,t,n)=>{var r=n(487),i=n(9915);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3313:(e,t,n)=>{var r=n(487),i=n(9310);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8635:(e,t,n)=>{var r=n(487),i=n(6464);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},487:(e,t,n)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=n[l]||0,d="".concat(l," ").concat(c);n[l]=c+1;var u=s(d),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(a[u].references++,a[u].updater(h)):a.push({identifier:d,updater:f(h,t),references:1}),r.push(d)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function p(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var g=null,m=0;function f(e,t){var n,r,i;if(t.singleton){var o=m++;n=g||(g=c(t)),r=h.bind(null,n,o,!1),i=h.bind(null,n,o,!0)}else n=c(t),r=p.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=s(n[r]);a[i].references--}for(var o=l(e,t),c=0;c<n.length;c++){var d=s(n[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=o}}}},788:(e,t,n)=>{var r={"./ar-SA.json":[7822,558],"./bg-BG.json":[1203,384],"./bn-BD.json":[8525,603],"./ca-ES.json":[510,351],"./cs-CZ.json":[7605,387],"./da-DK.json":[2392,617],"./de-DE.json":[2853,43],"./el-GR.json":[9876,526],"./en.json":[1463],"./es-ES.json":[2264,317],"./fa-IR.json":[3747,710],"./fi-FI.json":[9490,472],"./fr-FR.json":[7830,364],"./he-IL.json":[1994,262],"./hi-IN.json":[4646,933],"./hu-HU.json":[6373,661],"./id-ID.json":[3247,491],"./it-IT.json":[3257,465],"./ja-JP.json":[198,137],"./kab-KAB.json":[228,164],"./kk-KZ.json":[8972,649],"./ko-KR.json":[7596,60],"./lv-LV.json":[2327,899],"./my-MM.json":[7704,242],"./nb-NO.json":[1167,246],"./nl-NL.json":[290,196],"./nn-NO.json":[4481,920],"./oc-FR.json":[2284,565],"./pa-IN.json":[6773,280],"./percentages.json":[4451],"./pl-PL.json":[3661,852],"./pt-BR.json":[8881,381],"./pt-PT.json":[5622,149],"./ro-RO.json":[2013,752],"./ru-RU.json":[2253,869],"./si-LK.json":[5497,58],"./sk-SK.json":[4570,401],"./sv-SE.json":[6006,698],"./ta-IN.json":[3952,395],"./tr-TR.json":[7315,213],"./uk-UA.json":[334,583],"./zh-CN.json":[1037,304],"./zh-HK.json":[5334,9],"./zh-TW.json":[931,62]};function i(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((()=>n.t(i,19)))}i.keys=()=>Object.keys(r),i.id=788,e.exports=i},4295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(3940),n.b),d=new URL(n(3147),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,'@font-face{font-family:"Virgil";src:url('+h+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+p+");font-display:swap}",""]);const g=u},9135:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;margin-inline-end:.3em;transform:scaleY(0.9)}",""]);const s=a},3729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500}",""]);const s=a},4241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]);const s=a},6029:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]);const s=a},9609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]);const s=a},2345:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+u+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]);const h=d},9393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]);const s=a},6578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]);const s=a},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]);const s=a},7955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+u+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]);const h=d},3195:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);const s=a},2978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]);const s=a},1587:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]);const s=a},9478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus-visible,.excalidraw .picker button:focus-visible{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus-visible svg,.excalidraw .picker button:focus-visible svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]);const s=a},7369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:var(--border-radius-lg);padding:calc(var(--padding)*var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]);const s=a},1434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;margin-inline-end:1em}",""]);const s=a},8923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{margin-inline-start:auto;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .publish-library-success .Dialog__content{display:flex;flex-direction:column}.excalidraw .publish-library-success-close.ToolIcon_type_button{background-color:#228be6;align-self:flex-end}.excalidraw .publish-library-success-close.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library-success-close.ToolIcon_type_button .ToolIcon__icon{width:auto;font-size:1rem;color:#fff;padding:0 .5rem}",""]);const s=a},5605:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]);const s=a},5644:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__checkbox-container,.excalidraw .library-unit__checkbox-container:hover,.excalidraw .library-unit__checkbox-container:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:.5rem;position:absolute;left:2rem;bottom:2rem;cursor:pointer}.excalidraw .library-unit__checkbox-container input,.excalidraw .library-unit__checkbox-container:hover input,.excalidraw .library-unit__checkbox-container:active input{cursor:pointer}.excalidraw .library-unit__checkbox{position:absolute;left:2.3rem;bottom:2.3rem}.excalidraw .library-unit__checkbox .Checkbox-box{width:13px;height:13px;border-radius:2px;margin:.5em .5em .2em .2em;background-color:#d0ebff}.excalidraw .library-unit__checkbox.Checkbox:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__adder{transform:scale(1);animation:library-unit__adder-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:40%;top:40%;width:2rem;height:2rem;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit:hover .library-unit__adder{fill:#1c7ed6}.excalidraw .library-unit:active .library-unit__adder{animation:none;transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@keyframes library-unit__adder-animation{0%{transform:scale(0.85)}50%{transform:scale(1)}100%{transform:scale(0.85)}}",""]);const s=a},6843:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;transform:translateY(10px);animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@keyframes Modal__content_fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]);const s=a},8461:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]);const s=a},9935:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]);const s=a},532:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]);const s=a},7589:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]);const s=a},8465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]);const s=a},5892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{animation:rotate 1.6s linear infinite;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]);const s=a},3874:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]);const s=a},2681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]);const s=a},6759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]);const s=a},9650:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]);const s=a},2044:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon{background-color:var(--button-gray-1)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:hover,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--border-radius-lg)}.excalidraw .ToolIcon__icon+.ToolIcon__label{margin-inline-start:0}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__label{display:flex;align-items:center;color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon__label .Spinner{margin-left:.6em}.excalidraw .ToolIcon_size_small .ToolIcon__icon{width:2rem;height:2rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:focus-visible,.excalidraw .Modal .ToolIcon_type_button:focus-visible,.excalidraw .ToolIcon_type_button:focus-visible{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_radio:focus-visible+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus-visible+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{background-color:var(--button-gray-1);width:2rem;height:2em}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:-8px;margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{margin-inline-end:0;top:60px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]);const s=a},9144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar-container .ToolIcon_type_floating:not(.is-mobile) .ToolIcon__icon{padding:1px;background-color:var(--island-bg-color);box-shadow:1px 3px 4px 0px rgba(0,0,0,.15);border-radius:50%;transition:box-shadow .5s ease,transform .5s ease}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:focus-within+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:focus-within+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock{margin-inline-end:var(--space-factor)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .App-toolbar-container .ToolIcon__library{margin-inline-start:var(--space-factor)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon__icon{box-shadow:none;transform:scale(0.9)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon_type_checkbox:not(:checked):not(:hover):not(:active)+.ToolIcon__icon svg{fill:#adb5bd;color:#adb5bd}.excalidraw .App-toolbar{border-radius:var(--border-radius-lg);box-shadow:0 0 0 1px rgba(0,0,0,.01),1px 1px 5px rgba(0,0,0,.15)}.excalidraw .App-toolbar .ToolIcon:hover{--icon-fill-color: var(--color-primary-chubb);--keybinding-color: var(--color-primary-chubb)}.excalidraw .App-toolbar .ToolIcon:active{--icon-fill-color: #212529;--keybinding-color: #212529}.excalidraw .App-toolbar .ToolIcon .ToolIcon__icon{background:transparent;border-radius:var(--border-radius-lg)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar .ToolIcon .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar.zen-mode .ToolIcon__keybinding,.excalidraw .App-toolbar.zen-mode .HintViewer{display:none}.excalidraw.theme--dark .App-toolbar .ToolIcon:active{--icon-fill-color: #dee2e6;--keybinding-color: #dee2e6}",""]);const s=a},6626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]);const s=a},6359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor) var(--space-factor) var(--space-factor) var(--space-factor);display:flex;flex-wrap:wrap;justify-content:flex-end}.excalidraw .UserList:empty{display:none}.excalidraw .UserList>*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]);const s=a},9915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]);const s=a},9310:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(7984),n.b),d=new URL(n(1639),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url("+h+");--focus-highlight-color: #a5d8ff;--icon-fill-color: #212529;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 12%);--space-factor: 0.25rem;--text-primary-color: #343a40;--color-primary: #6965db;--color-primary-chubb: #625ee0;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;--color-primary-light: #e2e1fc;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem}.excalidraw.theme--dark{background:#000}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url("+p+');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #4dabf7;--shadow-island: 1px 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da;--color-primary: #5650f0;--color-primary-chubb: #726dff;--color-primary-darker: #4b46d8;--color-primary-darkest: #3e39be;--color-primary-light: #3f3d64}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button,.excalidraw .buttonList label{-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1);border:0;border-radius:var(--border-radius-md);margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus-visible,.excalidraw .buttonList label:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button:hover,.excalidraw .buttonList label:hover{background-color:var(--button-gray-2)}.excalidraw button:active,.excalidraw .buttonList label:active{background-color:var(--button-gray-3)}.excalidraw button:disabled,.excalidraw .buttonList label:disabled{cursor:not-allowed}.excalidraw .active,.excalidraw .buttonList label.active{background-color:var(--color-primary);--icon-fill-color: #ffffff}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--color-primary-darker)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--color-primary-darkest)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:35px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns:auto -webkit-max-content auto;grid-template-columns:auto max-content auto;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;padding-inline-start:.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.excalidraw input[type=text],.excalidraw textarea:not(.excalidraw-wysiwyg){color:var(--text-primary-color);border:1.5px solid var(--input-border-color);padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw input[type=text]:not(:focus):hover,.excalidraw textarea:not(.excalidraw-wysiwyg):not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw input[type=text]:focus,.excalidraw textarea:not(.excalidraw-wysiwyg):focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]);const g=u},6464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};const s=a},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:e=>{"use strict";e.exports=function(e){return e[1]}},8288:(e,t,n)=>{"use strict";n.d(t,{iC:()=>o,f:()=>a,qx:()=>s,Iw:()=>l,$e:()=>c,wZ:()=>d,ay:()=>u,oc:()=>h,Oh:()=>p,Ks:()=>g,Vi:()=>m,$C:()=>f,ut:()=>b,C6:()=>x,_D:()=>v,n5:()=>y,rk:()=>w,Hg:()=>k,hs:()=>_,k:()=>E,LO:()=>S,r8:()=>C,pb:()=>j,LL:()=>I,Gj:()=>M,nM:()=>T,Lg:()=>O,HM:()=>L,V4:()=>A,EH:()=>P,ZF:()=>D,UO:()=>z,ah:()=>N,cW:()=>R,kV:()=>H,sS:()=>B,Yx:()=>F,zK:()=>U,ZB:()=>V,qy:()=>W,h6:()=>K,jo:()=>G,$n:()=>Y,hR:()=>Z,Kr:()=>q,tr:()=>X});var r=n(8635),i=n.n(r);const o="Excalidraw",a=10,s=8,l=5,c=1,d=30,u=Math.PI/12,h={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},p={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};let g;!function(e){e.COPY="copy",e.PASTE="paste",e.CUT="cut",e.KEYDOWN="keydown",e.KEYUP="keyup",e.MOUSE_MOVE="mousemove",e.RESIZE="resize",e.UNLOAD="unload",e.FOCUS="focus",e.BLUR="blur",e.DRAG_OVER="dragover",e.DROP="drop",e.GESTURE_END="gestureend",e.BEFORE_UNLOAD="beforeunload",e.GESTURE_START="gesturestart",e.GESTURE_CHANGE="gesturechange",e.POINTER_MOVE="pointermove",e.POINTER_UP="pointerup",e.STATE_CHANGE="statechange",e.WHEEL="wheel",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.HASHCHANGE="hashchange",e.VISIBILITY_CHANGE="visibilitychange",e.SCROLL="scroll"}(g||(g={}));const m={TEST:"test",DEVELOPMENT:"development"},f={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},x={LIGHT:"light",DARK:"dark"},v="Segoe UI Emoji",y=20,w=b.Virgil,k="left",_="top",E=20,S={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},C={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},j=window.location.origin,I=500,M=300,T=500,O=5e3,L=100,A=.1,P={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=i().themeFilter,z={addLibrary:"addLibrary"},N={addLibrary:"addLibrary"},R={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},H=730,B=1e3,F=500,U=2,V=[1,2,3],W=10,K=1440,G=[S.png,S.jpg,S.svg,S.gif],Y=2097152,Z="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},X=30},2254:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>qr,default:()=>mp,defaultLang:()=>c,exportToBlob:()=>Eh,exportToCanvas:()=>_h,exportToSvg:()=>Sh,getFreeDrawSvgPath:()=>Fr,getNonDeletedElements:()=>_a,getSceneVersion:()=>ka,isInvisiblySmallElement:()=>Xr,isLinearElement:()=>je,languages:()=>d,loadFromBlob:()=>td,loadLibraryFromBlob:()=>nd,mutateElement:()=>Yr,newElementWith:()=>Zr,restore:()=>qc,restoreAppState:()=>Zc,restoreElements:()=>Yc,serializeAsJSON:()=>cd});var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@zsviczian/excalidraw","i8":"0.10.0-fix-container-03"}');"production"!==o.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(a.u2,"@").concat(a.i8,"/dist/"));var s=n(1463),l=n(4451);const c={code:"en",label:"English"},d=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"ko-KR",label:"한국어"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"lv-LV",label:"Latviešu"},{code:"cs-CZ",label:"Česky"},{code:"kk-KZ",label:"Қазақ тілі"}].concat([c]).sort(((e,t)=>e.label>t.label?1:-1)).filter((e=>l[e.code]>=85)),u="__test__";"production"===o.Vi.DEVELOPMENT&&d.unshift({code:u,label:"test language"},{code:"".concat(u,".rtl"),label:"test language (rtl)",rtl:!0});let h=c,p={};const g=async e=>{h=e,document.documentElement.dir=h.rtl?"rtl":"ltr",document.documentElement.lang=h.code,p=e.code.startsWith(u)?{}:await n(788)("./".concat(h.code,".json"))},m=()=>h,f=(e,t)=>{for(let n=0;n<t.length;++n){const r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},b=(e,t)=>{if(h.code.startsWith(u)){const n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"[[".concat(n,"]]")}const n=e.split(".");let r=f(p,n)||f(s,n);if(void 0===r)throw new Error("Can't find translation for ".concat(e));if(t)for(const e in t)r=r.replace("{{".concat(e,"}}"),String(t[e]));return r};var x=n(4512);const v=()=>(0,x.jsx)("div",{className:"LoadingMessage",children:(0,x.jsx)("span",{children:b("labels.loadingScene")})}),y=e=>{const[t,n]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{const t=d.find((t=>t.code===e.langCode))||c;(async()=>{await g(t)})(),n(!1)}),[e.langCode]),t?(0,x.jsx)(v,{}):e.children};function w(e,t,n){if(e&&e.length){const[r,i]=t,o=Math.PI/180*n,a=Math.cos(o),s=Math.sin(o);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-i)*s+r,e[1]=(t-r)*s+(n-i)*a+i}))}}function k(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function _(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const i=[0,0];if(n)for(const t of e)w(t,i,n);const o=function(e,t){const n=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const i=[];for(const e of n)for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n[1]!==r[1]){const e=Math.min(n[1],r[1]);i.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(i.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!i.length)return r;let o=[],a=i[0].ymin;for(;o.length||i.length;){if(i.length){let e=-1;for(let t=0;t<i.length&&!(i[t].ymin>a);t++)e=t;i.splice(0,e+1).forEach((e=>{o.push({s:a,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=a))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),o.length>1)for(let e=0;e<o.length;e+=2){const t=e+1;if(t>=o.length)break;const n=o[e].edge,i=o[t].edge;r.push([[Math.round(n.x),a],[Math.round(i.x),a]])}a+=t,o.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)w(t,i,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),w(r,t,n)}(o,i,-n)}return o}class E{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}class S extends E{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=_(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,o=[],a=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(const[e,t]of r)k([e,t])&&o.push([[e[0]-a,e[1]+s],[...t]],[[e[0]+a,e[1]-s],[...t]]);return{type:"fillSketch",ops:this.renderLines(o,t)}}}class C extends E{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}class j{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);const o=r/4;for(const a of e){const e=k(a),s=e/r,l=Math.ceil(s)-1,c=e-l*r,d=(a[0][0]+a[1][0])/2-r/4,u=Math.min(a[0][1],a[1][1]);for(let e=0;e<l;e++){const a=u+c+e*r,s=d-o+2*Math.random()*o,l=a-o+2*Math.random()*o,h=this.helper.ellipse(s,l,i,i,t);n.push(...h.ops)}}return{type:"fillSketch",ops:n}}}class I{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.dashedLine(n,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{const o=k(e),a=Math.floor(o/(n+r)),s=(o+r-a*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const d=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e<a;e++){const o=e*(n+r),a=o+n,c=[l[0]+o*Math.cos(d)+s*Math.cos(d),l[1]+o*Math.sin(d)+s*Math.sin(d)],u=[l[0]+a*Math.cos(d)+s*Math.cos(d),l[1]+a*Math.sin(d)+s*Math.sin(d)];i.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],t))}})),i}}class M{constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=_(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const i=k(e),o=Math.round(i/(2*t));let a=e[0],s=e[1];a[0]>s[0]&&(a=e[1],s=e[0]);const l=Math.atan((s[1]-a[1])/(s[0]-a[0]));for(let e=0;e<o;e++){const i=2*e*t,o=2*(e+1)*t,s=Math.sqrt(2*Math.pow(t,2)),c=[a[0]+i*Math.cos(l),a[1]+i*Math.sin(l)],d=[a[0]+o*Math.cos(l),a[1]+o*Math.sin(l)],u=[c[0]+s*Math.cos(l+Math.PI/4),c[1]+s*Math.sin(l+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],n),...this.helper.doubleLineOps(u[0],u[1],d[0],d[1],n))}})),r}}const T={};class O{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const L={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function A(e,t){return e.type===t}function P(e){const t=[],n=function(e){const t=new Array;for(;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e);let r="BOD",i=0,o=n[i];for(;!A(o,2);){let a=0;const s=[];if("BOD"===r){if("M"!==o.text&&"m"!==o.text)return P("M0,0"+e);i++,a=L[o.text],r=o.text}else A(o,1)?a=L[r]:(i++,a=L[o.text],r=o.text);if(!(i+a<n.length))throw new Error("Path data ended short");for(let e=i;e<i+a;e++){const t=n[e];if(!A(t,1))throw new Error("Param not a number: "+r+","+t.text);s[s.length]=+t.text}if("number"!=typeof L[r])throw new Error("Bad segment: "+r);{const e={key:r,data:s};t.push(e),i+=a,o=n[i],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function D(e){let t=0,n=0,r=0,i=0;const o=[];for(const{key:a,data:s}of e)switch(a){case"M":o.push({key:"M",data:[...s]}),[t,n]=s,[r,i]=s;break;case"m":t+=s[0],n+=s[1],o.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":o.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],o.push({key:"L",data:[t,n]});break;case"C":o.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":o.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":o.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],o.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":o.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],o.push({key:"V",data:[n]});break;case"S":o.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":o.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],o.push({key:"T",data:[t,n]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,n=i}return o}function z(e){const t=[];let n="",r=0,i=0,o=0,a=0,s=0,l=0;for(const{key:c,data:d}of e){switch(c){case"M":t.push({key:"M",data:[...d]}),[r,i]=d,[o,a]=d;break;case"C":t.push({key:"C",data:[...d]}),r=d[4],i=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[r,i]=d;break;case"H":r=d[0],t.push({key:"L",data:[r,i]});break;case"V":i=d[0],t.push({key:"L",data:[r,i]});break;case"S":{let e=0,o=0;"C"===n||"S"===n?(e=r+(r-s),o=i+(i-l)):(e=r,o=i),t.push({key:"C",data:[e,o,...d]}),s=d[0],l=d[1],r=d[2],i=d[3];break}case"T":{const[e,o]=d;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-s),c=i+(i-l)):(a=r,c=i);const u=r+2*(a-r)/3,h=i+2*(c-i)/3,p=e+2*(a-e)/3,g=o+2*(c-o)/3;t.push({key:"C",data:[u,h,p,g,e,o]}),s=a,l=c,r=e,i=o;break}case"Q":{const[e,n,o,a]=d,c=r+2*(e-r)/3,u=i+2*(n-i)/3,h=o+2*(e-o)/3,p=a+2*(n-a)/3;t.push({key:"C",data:[c,u,h,p,o,a]}),s=e,l=n,r=o,i=a;break}case"A":{const e=Math.abs(d[0]),n=Math.abs(d[1]),o=d[2],a=d[3],s=d[4],l=d[5],c=d[6];if(0===e||0===n)t.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c;else if(r!==l||i!==c){R(r,i,l,c,e,n,o,a,s).forEach((function(e){t.push({key:"C",data:e})})),r=l,i=c}break}case"Z":t.push({key:"Z",data:[]}),r=o,i=a}n=c}return t}function N(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function R(e,t,n,r,i,o,a,s,l,c){const d=(u=a,Math.PI*u/180);var u;let h=[],p=0,g=0,m=0,f=0;if(c)[p,g,m,f]=c;else{[e,t]=N(e,t,-d),[n,r]=N(n,r,-d);const a=(e-n)/2,c=(t-r)/2;let u=a*a/(i*i)+c*c/(o*o);u>1&&(u=Math.sqrt(u),i*=u,o*=u);const h=i*i,b=o*o,x=h*b-h*c*c-b*a*a,v=h*c*c+b*a*a,y=(s===l?-1:1)*Math.sqrt(Math.abs(x/v));m=y*i*c/o+(e+n)/2,f=y*-o*a/i+(t+r)/2,p=Math.asin(parseFloat(((t-f)/o).toFixed(9))),g=Math.asin(parseFloat(((r-f)/o).toFixed(9))),e<m&&(p=Math.PI-p),n<m&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let b=g-p;if(Math.abs(b)>120*Math.PI/180){const e=g,t=n,s=r;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=R(n=m+i*Math.cos(g),r=f+o*Math.sin(g),t,s,i,o,a,0,l,[g,e,m,f])}b=g-p;const x=Math.cos(p),v=Math.sin(p),y=Math.cos(g),w=Math.sin(g),k=Math.tan(b/4),_=4/3*i*k,E=4/3*o*k,S=[e,t],C=[e+_*v,t-E*x],j=[n+_*w,r-E*y],I=[n,r];if(C[0]=2*S[0]-C[0],C[1]=2*S[1]-C[1],c)return[C,j,I].concat(h);{h=[C,j,I].concat(h);const e=[];for(let t=0;t<h.length;t+=3){const n=N(h[t][0],h[t][1],d),r=N(h[t+1][0],h[t+1][1],d),i=N(h[t+2][0],h[t+2][1],d);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}const H={randOffset:function(e,t){return $(e,t)},randOffsetWithRange:function(e,t,n){return X(e,t,n)},ellipse:function(e,t,n,r,i){const o=W(n,r,i);return K(e,t,i,o).opset},doubleLineOps:function(e,t,n,r,i){return J(e,t,n,r,i,!0)}};function B(e,t,n,r,i){return{type:"path",ops:J(e,t,n,r,i)}}function F(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let t=0;t<r-1;t++)i.push(...J(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...J(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}return 2===r?B(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function U(e,t,n,r,i){return function(e,t){return F(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function V(e,t){let n=ee(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=ee(e,1.5*(1+.22*t.roughness),function(e){const t=Object.assign({},e);t.randomizer=void 0,e.seed&&(t.seed=e.seed+1);return t}(t));n=n.concat(r)}return{type:"path",ops:n}}function W(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),o=2*Math.PI/i;let a=Math.abs(e/2),s=Math.abs(t/2);const l=1-n.curveFitting;return a+=$(a*l,n),s+=$(s*l,n),{increment:o,rx:a,ry:s}}function K(e,t,n,r){const[i,o]=ne(r.increment,e,t,r.rx,r.ry,1,r.increment*X(.1,X(.4,1,n),n),n);let a=te(i,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[i]=ne(r.increment,e,t,r.rx,r.ry,1.5,0,n),o=te(i,null,n);a=a.concat(o)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function G(e,t,n,r,i,o,a,s,l){const c=e,d=t;let u=Math.abs(n/2),h=Math.abs(r/2);u+=$(.01*u,l),h+=$(.01*h,l);let p=i,g=o;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,f=Math.min(m/2,(g-p)/2),b=re(f,c,d,u,h,p,g,1,l);if(!l.disableMultiStroke){const e=re(f,c,d,u,h,p,g,1.5,l);b.push(...e)}return a&&(s?b.push(...J(c,d,c+u*Math.cos(p),d+h*Math.sin(p),l),...J(c,d,c+u*Math.cos(g),d+h*Math.sin(g),l)):b.push({op:"lineTo",data:[c,d]},{op:"lineTo",data:[c+u*Math.cos(p),d+h*Math.sin(p)]})),{type:"path",ops:b}}function Y(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+$(e,t),r[0][1]+$(e,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+$(e,t),r[o][1]+$(e,t)]})}}return{type:"fillPath",ops:n}}function Z(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!T[n])switch(n){case"zigzag":T[n]||(T[n]=new S(t));break;case"cross-hatch":T[n]||(T[n]=new C(t));break;case"dots":T[n]||(T[n]=new j(t));break;case"dashed":T[n]||(T[n]=new I(t));break;case"zigzag-line":T[n]||(T[n]=new M(t));break;default:n="hachure",T[n]||(T[n]=new E(t))}return T[n]}(t,H).fillPolygons(e,t)}function q(e){return e.randomizer||(e.randomizer=new O(e.seed||0)),e.randomizer.next()}function X(e,t,n,r=1){return n.roughness*r*(q(n)*(t-e)+e)}function $(e,t,n=1){return X(-e,e,t,n)}function J(e,t,n,r,i,o=!1){const a=o?i.disableMultiStrokeFill:i.disableMultiStroke,s=Q(e,t,n,r,i,!0,!1);if(a)return s;const l=Q(e,t,n,r,i,!0,!0);return s.concat(l)}function Q(e,t,n,r,i,o,a){const s=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(s);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const u=d/2,h=.2+.2*q(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=$(p,i,c),g=$(g,i,c);const m=[],f=()=>$(u,i,c),b=()=>$(d,i,c),x=i.preserveVertices;return o&&(a?m.push({op:"move",data:[e+(x?0:f()),t+(x?0:f())]}):m.push({op:"move",data:[e+(x?0:$(d,i,c)),t+(x?0:$(d,i,c))]})),a?m.push({op:"bcurveTo",data:[p+e+(n-e)*h+f(),g+t+(r-t)*h+f(),p+e+2*(n-e)*h+f(),g+t+2*(r-t)*h+f(),n+(x?0:f()),r+(x?0:f())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*h+b(),g+t+(r-t)*h+b(),p+e+2*(n-e)*h+b(),g+t+2*(r-t)*h+b(),n+(x?0:b()),r+(x?0:b())]}),m}function ee(e,t,n){const r=[];r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]),r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]),i===e.length-1&&r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]);return te(r,null,n)}function te(e,t,n){const r=e.length,i=[];if(r>3){const o=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];o[0]=[n[0],n[1]],o[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],o[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],o[3]=[e[t+1][0],e[t+1][1]],i.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+$(e,n),t[1]+$(e,n)]})}}else 3===r?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&i.push(...J(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function ne(e,t,n,r,i,o,a,s){const l=[],c=[];if(0===s.roughness){e/=4,c.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let o=0;o<=2*Math.PI;o+=e){const e=[t+r*Math.cos(o),n+i*Math.sin(o)];l.push(e),c.push(e)}c.push([t+r*Math.cos(0),n+i*Math.sin(0)]),c.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const d=$(.5,s)-Math.PI/2;c.push([$(o,s)+t+.9*r*Math.cos(d-e),$(o,s)+n+.9*i*Math.sin(d-e)]);const u=2*Math.PI+d-.01;for(let a=d;a<u;a+=e){const e=[$(o,s)+t+r*Math.cos(a),$(o,s)+n+i*Math.sin(a)];l.push(e),c.push(e)}c.push([$(o,s)+t+r*Math.cos(d+2*Math.PI+.5*a),$(o,s)+n+i*Math.sin(d+2*Math.PI+.5*a)]),c.push([$(o,s)+t+.98*r*Math.cos(d+a),$(o,s)+n+.98*i*Math.sin(d+a)]),c.push([$(o,s)+t+.9*r*Math.cos(d+.5*a),$(o,s)+n+.9*i*Math.sin(d+.5*a)])}return[c,l]}function re(e,t,n,r,i,o,a,s,l){const c=o+$(.1,l),d=[];d.push([$(s,l)+t+.9*r*Math.cos(c-e),$(s,l)+n+.9*i*Math.sin(c-e)]);for(let o=c;o<=a;o+=e)d.push([$(s,l)+t+r*Math.cos(o),$(s,l)+n+i*Math.sin(o)]);return d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),te(d,null,l)}function ie(e,t,n,r,i,o,a,s){const l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let d=[0,0];const u=s.disableMultiStroke?1:2,h=s.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(h?0:$(c[0],s)),a[1]+(h?0:$(c[0],s))]}),d=h?[i,o]:[i+$(c[p],s),o+$(c[p],s)],l.push({op:"bcurveTo",data:[e+$(c[p],s),t+$(c[p],s),n+$(c[p],s),r+$(c[p],s),d[0],d[1]]});return l}function oe(e){return[...e]}function ae(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function se(e,t,n){const r=ae(t,n);if(0===r)return ae(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ae(e,le(t,n,i))}function le(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ce(e,t,n,r){const i=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],o=e[t+3];let a=3*r[0]-2*n[0]-o[0];a*=a;let s=3*r[1]-2*n[1]-o[1];s*=s;let l=3*i[0]-2*o[0]-n[0];l*=l;let c=3*i[1]-2*o[1]-n[1];return c*=c,a<l&&(a=l),s<c&&(s=c),a+s}(e,t)<n){const n=e[t+0];if(i.length){(o=i[i.length-1],a=n,Math.sqrt(ae(o,a)))>1&&i.push(n)}else i.push(n);i.push(e[t+3])}else{const r=.5,o=e[t+0],a=e[t+1],s=e[t+2],l=e[t+3],c=le(o,a,r),d=le(a,s,r),u=le(s,l,r),h=le(c,d,r),p=le(d,u,r),g=le(h,p,r);ce([o,c,h,g],0,n,i),ce([g,p,u,l],0,n,i)}var o,a;return i}function de(e,t){return ue(e,0,e.length,t)}function ue(e,t,n,r,i){const o=i||[],a=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;r<n-1;++r){const t=se(e[r],a,s);t>l&&(l=t,c=r)}return Math.sqrt(l)>r?(ue(e,t,c+1,r,o),ue(e,c,n,r,o)):(o.length||o.push(a),o.push(s)),o}function he(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n<i;n++){ce(e,3*n,t,r)}return n&&n>0?ue(r,0,r.length,n):r}const pe="none";class ge{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){const o=this._o(i);return this._d("line",[B(e,t,n,r,o)],o)}rectangle(e,t,n,r,i){const o=this._o(i),a=[],s=U(e,t,n,r,o);if(o.fill){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===o.fillStyle?a.push(Y([i],o)):a.push(Z([i],o))}return o.stroke!==pe&&a.push(s),this._d("rectangle",a,o)}ellipse(e,t,n,r,i){const o=this._o(i),a=[],s=W(n,r,o),l=K(e,t,o,s);if(o.fill)if("solid"===o.fillStyle){const n=K(e,t,o,s).opset;n.type="fillPath",a.push(n)}else a.push(Z([l.estimatedPoints],o));return o.stroke!==pe&&a.push(l.opset),this._d("ellipse",a,o)}circle(e,t,n,r){const i=this.ellipse(e,t,n,n,r);return i.shape="circle",i}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[F(e,!1,n)],n)}arc(e,t,n,r,i,o,a=!1,s){const l=this._o(s),c=[],d=G(e,t,n,r,i,o,a,!0,l);if(a&&l.fill)if("solid"===l.fillStyle){const a=Object.assign({},l);a.disableMultiStroke=!0;const s=G(e,t,n,r,i,o,!0,!1,a);s.type="fillPath",c.push(s)}else c.push(function(e,t,n,r,i,o,a){const s=e,l=t;let c=Math.abs(n/2),d=Math.abs(r/2);c+=$(.01*c,a),d+=$(.01*d,a);let u=i,h=o;for(;u<0;)u+=2*Math.PI,h+=2*Math.PI;h-u>2*Math.PI&&(u=0,h=2*Math.PI);const p=(h-u)/a.curveStepCount,g=[];for(let e=u;e<=h;e+=p)g.push([s+c*Math.cos(e),l+d*Math.sin(e)]);return g.push([s+c*Math.cos(h),l+d*Math.sin(h)]),g.push([s,l]),Z([g],a)}(e,t,n,r,i,o,l));return l.stroke!==pe&&c.push(d),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=V(e,n);if(n.fill&&n.fill!==pe&&e.length>=3){const t=function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(oe(e[0]),oe(e[1]),oe(e[2]),oe(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);const i=[],o=1-t;r.push(oe(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(o*n[e+1][0]-o*n[e-1][0])/6,t[1]+(o*n[e+1][1]-o*n[e-1][1])/6],i[2]=[n[e+1][0]+(o*n[e][0]-o*n[e+2][0])/6,n[e+1][1]+(o*n[e][1]-o*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}(e),i=he(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(Y([i],n)):r.push(Z([i],n))}return n.stroke!==pe&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=F(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(Y([e],n)):r.push(Z([e],n))),n.stroke!==pe&&r.push(i),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=n.fill&&"transparent"!==n.fill&&n.fill!==pe,o=n.stroke!==pe,a=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=z(D(P(e))),i=[];let o=[],a=[0,0],s=[];const l=()=>{s.length>=4&&o.push(...he(s,t)),s=[]},c=()=>{l(),o.length&&(i.push(o),o=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),a=[t[0],t[1]],o.push(a);break;case"L":l(),o.push([t[0],t[1]]);break;case"C":if(!s.length){const e=o.length?o[o.length-1]:a;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),o.push([a[0],a[1]])}if(c(),!n)return i;const d=[];for(const e of i){const t=de(e,n);t.length&&d.push(t)}return d}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return i&&("solid"===n.fillStyle?r.push(Y(s,n)):r.push(Z(s,n))),o&&(a?s.forEach((e=>{r.push(F(e,!1,n))})):r.push(function(e,t){const n=z(D(P(e))),r=[];let i=[0,0],o=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:a.map((r=>r+(n?0:$(e,t))))}),o=[a[0],a[1]],i=[a[0],a[1]];break}case"L":r.push(...J(o[0],o[1],a[0],a[1],t)),o=[a[0],a[1]];break;case"C":{const[e,n,i,s,l,c]=a;r.push(...ie(e,n,i,s,l,c,o,t)),o=[l,c];break}case"Z":r.push(...J(o[0],o[1],i[0],i[1],t)),o=[i[0],i[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:pe};break;case"fillPath":t={d:this.opsToPath(e),stroke:pe,strokeWidth:0,fill:n.fill||pe};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||pe,strokeWidth:n,fill:pe}}}class me{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(const o of t)switch(o.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,o,i),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,o,i,t),r.restore();break}case"fillSketch":this.fillSketch(r,o,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const r of t.ops){const t="number"==typeof n&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o),o}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o),o}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o),o}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l),l}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const fe="http://www.w3.org/2000/svg";class be{constructor(e,t){this.svg=e,this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(fe,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=e.createElementNS(fe,"path");return i.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o)}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o)}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o)}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}const xe={canvas:(e,t)=>new me(e,t),svg:(e,t)=>new be(e,t),generator:e=>new ge(e),newSeed:()=>ge.newSeed()};function ve(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ve(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ye(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ve(e))&&(r&&(r+=" "),r+=t);return r}let we=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};const ke=e=>!!e&&"image"===e.type&&!!e.fileId,_e=e=>!!e&&"image"===e.type,Ee=e=>null!=e&&"text"===e.type,Se=e=>null!=e&&Ce(e.type),Ce=e=>"freedraw"===e,je=e=>null!=e&&Ie(e.type),Ie=e=>"arrow"===e||"line"===e,Me=e=>null!=e&&Te(e.type),Te=e=>"arrow"===e,Oe=e=>null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type||"text"===e.type&&!e.containerId),Le=e=>{var t;return Oe(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((e=>{let{type:t}=e;return"text"===t})))},Ae=e=>null!==e&&Ee(e)&&null!==e.containerId,Pe=(e,t,n,r,i)=>[(e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r],De=(e,t,n)=>Pe(e[0],e[1],t[0],t[1],n),ze=(e,t,n,r,i,o,a,s)=>{const l=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=i+a:e.e?(t+=i*(1+l),n+=i*c,t+=a*(1-l),n+=a*-c):e.w&&(t+=i*(1-l),n+=i*-c,t+=a*(1+l),n+=a*c),e.n&&e.s?n+=o+s:e.n?(t+=o*c,n+=o*(1-l),t+=s*-c,n+=s*(1+l)):e.s&&(t+=o*-c,n+=o*(1+l),t+=s*c,n+=s*(1-l)),[t,n]},Ne=(e,t,n,r)=>{const i=n-e,o=r-t;return Math.hypot(i,o)},Re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){const[n,r]=[e[0],e[e.length-1]];return Ne(n[0],n[1],r[0],r[1])<=o.qx/t}return!1},He=(e,t,n)=>{const r=e.length;if(r<3)return!1;const i=[Number.MAX_SAFE_INTEGER,n],o=[t,n];let a=0;for(let t=0;t<r;t++){const n=e[t],s=e[(t+1)%r];if(Ue(n,s,o,i)){if(0===Fe(n,o,s))return Be(n,o,s);a++}}return a%2==1},Be=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]),Fe=(e,t,n)=>{const r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},Ue=(e,t,n,r)=>{const i=Fe(e,t,n),o=Fe(e,t,r),a=Fe(n,r,e),s=Fe(n,r,t);return i!==o&&a!==s||(!(0!==i||!Be(e,n,t))||(!(0!==o||!Be(e,r,t))||(!(0!==a||!Be(n,e,r))||!(0!==s||!Be(n,t,r)))))},Ve=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],We=e=>{const t=e.map((e=>e[0])),n=e.map((e=>e[1]));return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Ke=(e,t,n)=>{const r=n.map((t=>t[e])),i=Math.max(...r),o=Math.min(...r),a=i-o,s=0===a?1:t/a;let l=1/0;const c=n.map((t=>t.map(((t,n)=>{if(n!==e)return t;const r=t*s;return l=Math.min(r,l),r}))));if(2===c.length)return c;const d=o-l;return c.map((t=>t.map(((t,n)=>n===e?t+d:t))))},Ge=e=>Se(e)?Xe(e):je(e)?$e(e):[e.x,e.y,e.x+e.width,e.y+e.height],Ye=e=>{for(const t of e.sets)if("path"===t.type)return t.ops;return e.sets[0].ops},Ze=(e,t)=>{let n=[0,0];const{minX:r,minY:i,maxX:o,maxY:a}=e.reduce(((e,r)=>{let{op:i,data:o}=r;if("move"===i)n=o;else if("bcurveTo"===i){const r=[o[0],o[1]],i=[o[2],o[3]],a=[o[4],o[5]],s=n;n=a;const l=(e,t)=>Math.pow(1-e,3)*a[t]+3*e*Math.pow(1-e,2)*i[t]+3*Math.pow(e,2)*(1-e)*r[t]+s[t]*Math.pow(e,3);let c=0;for(;c<=1;){let n=l(c,0),r=l(c,1);t&&([n,r]=t(n,r)),e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),c+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]},qe=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const[o,a]of e)t=Math.min(t,o),n=Math.min(n,a),r=Math.max(r,o),i=Math.max(i,a);return[t,n,r,i]},Xe=e=>{const[t,n,r,i]=qe(e.points);return[t+e.x,n+e.y,r+e.x,i+e.y]},$e=e=>{let t;if(e.points.length<2||!Tr(e)){const{minX:n,minY:r,maxX:i,maxY:o}=e.points.reduce(((e,t)=>{let[n,r]=t;return e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});t=[n+e.x,r+e.y,i+e.x,o+e.y]}else{const n=Tr(e),r=Ye(n[0]),[i,o,a,s]=Ze(r);t=[i+e.x,o+e.y,a+e.x,s+e.y]}return t},Je=e=>{let t;const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2;if(Se(e)){const[t,n,r,i]=qe(e.points.map((t=>{let[n,r]=t;return Pe(n,r,a-e.x,s-e.y,e.angle)})));return[t+e.x,n+e.y,r+e.x,i+e.y]}if(je(e))t=((e,t,n)=>{if(e.points.length<2||!Tr(e)){const{minX:r,minY:i,maxX:o,maxY:a}=e.points.reduce(((r,i)=>{let[o,a]=i;return[o,a]=Pe(e.x+o,e.y+a,t,n,e.angle),r.minY=Math.min(r.minY,a),r.minX=Math.min(r.minX,o),r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,a),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]}const r=Tr(e),i=Ye(r[0]);return Ze(i,((r,i)=>Pe(e.x+r,e.y+i,t,n,e.angle)))})(e,a,s);else if("diamond"===e.type){const[l,c]=Pe(a,r,a,s,e.angle),[d,u]=Pe(a,o,a,s,e.angle),[h,p]=Pe(n,s,a,s,e.angle),[g,m]=Pe(i,s,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}else if("ellipse"===e.type){const l=(i-n)/2,c=(o-r)/2,d=Math.cos(e.angle),u=Math.sin(e.angle),h=Math.hypot(l*d,c*u),p=Math.hypot(c*d,l*u);t=[a-h,s-p,a+h,s+p]}else{const[l,c]=Pe(n,r,a,s,e.angle),[d,u]=Pe(n,o,a,s,e.angle),[h,p]=Pe(i,o,a,s,e.angle),[g,m]=Pe(i,r,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}return t},Qe=e=>{if(!e.length)return[0,0,0,0];let t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEach((e=>{const[o,a,s,l]=Je(e);t=Math.min(t,o),r=Math.min(r,a),n=Math.max(n,s),i=Math.max(i,l)})),[t,r,n,i]},et=(e,t,n)=>{if(!je(e)&&!Se(e))return[e.x,e.y,e.x+t,e.y+n];const r=Ke(0,t,Ke(1,n,e.points));let i;if(Se(e))i=qe(r);else{const t=xe.generator(),n="sharp"===e.strokeSharpness?t.linearPath(r,Lr(e)):t.curve(r,Lr(e)),o=Ye(n);i=Ze(o)}const[o,a,s,l]=i;return[o+e.x,a+e.y,s+e.x,l+e.y]},tt=(e,t,n)=>{const r=xe.generator(),i="sharp"===n?r.linearPath(t,Lr(e)):r.curve(t,Lr(e)),o=Ye(i),[a,s,l,c]=Ze(o);return[a+e.x,s+e.y,l+e.x,c+e.y]},nt=e=>{const[t,n,r,i]=Qe(e);return{minX:t,minY:n,maxX:r,maxY:i}},rt=JSON.parse('{"white":"#ffffff","black":"#000000","gray":["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],"red":["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],"pink":["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],"grape":["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],"violet":["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],"indigo":["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],"blue":["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],"cyan":["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],"teal":["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],"green":["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],"lime":["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],"yellow":["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],"orange":["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}'),it=e=>[rt.red[e],rt.pink[e],rt.grape[e],rt.violet[e],rt.indigo[e],rt.blue[e],rt.cyan[e],rt.teal[e],rt.green[e],rt.lime[e],rt.yellow[e],rt.orange[e]],ot={canvasBackground:[rt.white,rt.gray[0],rt.gray[1],...it(0)],elementBackground:["transparent",rt.gray[4],rt.gray[6],...it(6)],elementStroke:[rt.black,rt.gray[8],rt.gray[7],...it(9)]};var at=n(5156);const st=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),lt=/^Win/.test(window.navigator.platform),ct="Equal",dt="Minus",ut="NumpadAdd",ht="NumpadSubtract",pt="Numpad0",gt="BracketRight",mt="BracketLeft",ft="Digit1",bt="Digit2",xt="Quote",vt="Digit0",yt="Slash",wt="KeyC",kt="KeyD",_t="KeyG",Et="KeyF",St="KeyH",Ct="KeyV",jt="KeyX",It="KeyZ",Mt="KeyR",Tt="ArrowDown",Ot="ArrowLeft",Lt="ArrowRight",At="ArrowUp",Pt="Backspace",Dt="Alt",zt=st?"metaKey":"ctrlKey",Nt="Delete",Rt="Enter",Ht="Escape",Bt="?",Ft=" ",Ut="Tab",Vt="a",Wt="d",Kt="e",Gt="g",Yt="l",Zt="o",qt="p",Xt="q",$t="r",Jt="s",Qt="t",en="v",tn="x",nn="y",rn="z",on=e=>e===Ot||e===Lt||e===Tt||e===At,an=e=>e.altKey,sn=e=>e.shiftKey,ln=e=>e.shiftKey;let cn=null;const dn=()=>{if(cn)return cn;const e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),i="".concat(e.getHours()).padStart(2,"0"),o="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(i).concat(o)},un=e=>e.charAt(0).toUpperCase()+e.slice(1),hn=e=>e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type),pn=e=>{let{fontFamily:t}=e;for(const[e,n]of Object.entries(o.ut))if(n===t)return"".concat(e,", ").concat(o._D);return o._D},gn=e=>{let{fontSize:t,fontFamily:n}=e;return"".concat(t,"px ").concat(pn({fontFamily:n}))},mn=(e,t)=>{let n=0,r=null;const i=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];r=o,clearTimeout(n),n=window.setTimeout((()=>{r=null,e(...o)}),t)};return i.flush=()=>{if(clearTimeout(n),r){const t=r;r=null,e(...t)}},i.cancel=()=>{r=null,clearTimeout(n)},i},fn=(e,t)=>Math.abs(e-t),bn=e=>{e&&(e.style.cursor="")},xn=(e,t)=>{e&&(e.style.cursor=t)},vn=(e,t)=>{e&&("selection"===t?bn(e):"image"!==t&&(e.style.cursor=o.oc.CROSSHAIR))},yn=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},wn=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),st?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")),kn=(e,t)=>{let{clientX:n,clientY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;const c=1/i.value;return{x:(n-i.translation.x-o)*c-s,y:(r-i.translation.y-a)*c-l}},_n=(e,t)=>{let{sceneX:n,sceneY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;return{x:(n+s)*i.value+i.translation.x+o,y:(r+l)*i.value+i.translation.y+a}},En=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),Sn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),Cn=e=>Sn.test(e),jn=e=>{const[t,n]=e;return{x:t,y:n}},In=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},Mn=e=>{const t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===ot.elementBackground[0]},Tn=e=>t=>{(0,at.unstable_batchedUpdates)(e,t)},On=()=>Date.now(),Ln=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),An=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,Pn=()=>({theme:o.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:o.rk,currentItemFontSize:o.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:rt.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:o.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:An,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(b("labels.untitled"),"-").concat(dn()),openMenu:null,openPopup:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:rt.white,zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1,pendingImageElement:null}),Dn={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},elementLocked:{browser:!0,export:!1,server:!1},elementType:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1}},zn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=Dn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},Nn=e=>zn(e,"export"),Rn=e=>zn(e,"server");function Hn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function Bn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Fn(e,t){return[e[0]-t[0],e[1]-t[1]]}function Un(e,t){return[e[0]*t,e[1]*t]}function Vn(e){return[e[1],-e[0]]}function Wn(e,t){return e[0]*t[0]+e[1]*t[1]}function Kn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Gn(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Fn(e,t))}function Yn(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Zn(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function qn(e,t,n){let r=Math.sin(n),i=Math.cos(n),o=e[0]-t[0],a=e[1]-t[1],s=o*r+a*i;return[o*i-a*r+t[0],s+t[1]]}function Xn(e,t,n){return Bn(e,Un(Fn(t,e),n))}function $n(e,t,n){return Bn(e,Un(t,n))}var{min:Jn,PI:Qn}=Math,er=Qn+1e-4;function tr(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:o=!0,easing:a=(e=>e),start:s={},end:l={},last:c=!1}=t,{cap:d=!0,taper:u=0,easing:h=(e=>e*(2-e))}=s,{cap:p=!0,taper:g=0,easing:m=(e=>--e*e*e+1)}=l;if(0===e.length||n<=0)return[];let f,b=e[e.length-1].runningLength,x=Math.pow(n*r,2),v=[],y=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(o){let i=Jn(1,t.distance/n),o=Jn(1,1-i);r=Jn(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),k=Hn(n,i,e[e.length-1].pressure,a),_=e[0].vector,E=e[0].point,S=E,C=E,j=S;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:l,distance:c,runningLength:d}=e[t];if(t<e.length-1&&b-d<3)continue;if(i){if(o){let e=Jn(1,c/n),t=Jn(1,1-e);r=Jn(1,w+.275*e*(t-w))}k=Hn(n,i,r,a)}else k=n/2;void 0===f&&(f=k);let p=d<u?h(d/u):1,I=b-d<g?m((b-d)/g):1;if(k=Math.max(.01,k*Math.min(p,I)),t===e.length-1){let e=Un(Vn(l),k);v.push(Fn(s,e)),y.push(Bn(s,e));continue}let M=e[t+1].vector,T=Wn(l,M);if(T<0){let e=Un(Vn(_),k);for(let t=1/13,n=0;n<=1;n+=t)C=qn(Fn(s,e),s,er*n),v.push(C),j=qn(Bn(s,e),s,er*-n),y.push(j);E=C,S=j;continue}let O=Un(Vn(Xn(M,l,T)),k);C=Fn(s,O),(t<=1||Gn(E,C)>x)&&(v.push(C),E=C),j=Bn(s,O),(t<=1||Gn(S,j)>x)&&(y.push(j),S=j),w=r,_=l}let I=e[0].point.slice(0,2),M=e.length>1?e[e.length-1].point.slice(0,2):Bn(e[0].point,[1,1]),T=[],O=[];if(1===e.length){if(!u&&!g||c){let e=$n(I,Yn(Vn(Fn(I,M))),-(f||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(qn(e,I,2*er*r));return t}}else{if(!(u||g&&1===e.length))if(d)for(let e=1/13,t=e;t<=1;t+=e){let e=qn(y[0],I,er*t);T.push(e)}else{let e=Fn(v[0],y[0]),t=Un(e,.5),n=Un(e,.51);T.push(Fn(I,t),Fn(I,n),Bn(I,n),Bn(I,t))}let t=Vn(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(g||u&&1===e.length)O.push(M);else if(p){let e=$n(M,t,k);for(let t=1/29,n=t;n<1;n+=t)O.push(qn(e,M,3*er*n))}else O.push(Bn(M,Un(t,k)),Bn(M,Un(t,.99*k)),Fn(M,Un(t,.99*k)),Fn(M,Un(t,k)))}return v.concat(O,y.reverse(),T)}(function(e,t={}){var n;let{streamline:r=.5,size:i=16,last:o=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),s=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===s.length){let e=s[1];s=s.slice(0,-1);for(let t=1;t<5;t++)s.push(Xn(s[0],e,t/4))}1===s.length&&(s=[...s,[...Bn(s[0],[1,1]),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,d=0,u=l[0],h=s.length-1;for(let e=1;e<s.length;e++){let t=o&&e===h?s[e].slice(0,2):Xn(u.point,s[e],a);if(Kn(u.point,t))continue;let n=Zn(t,u.point);if(d+=n,e<h&&!c){if(d<i)continue;c=!0}u={point:t,pressure:s[e][2]>=0?s[e][2]:.5,vector:Yn(Fn(u.point,t)),distance:n,runningLength:d},l.push(u)}return l[0].vector=(null==(n=l[1])?void 0:n.vector)||[0,0],l}(e,t),t)}const nr=e=>"string"==typeof e;class rr{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){nr(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return nr(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}getElementsIncludingDeleted(){return this.elements}getElements(){return this.nonDeletedElements}getElement(e){return this.elementsMap.get(e)||null}getNonDeletedElement(e){const t=this.getElement(e);return t&&Ea(t)?t:null}getNonDeletedElements(e){const t=[];return e.forEach((e=>{const n=this.getNonDeletedElement(e);null!=n&&t.push(n)})),t}replaceAllElements(e){this.elements=e,this.elementsMap.clear(),e.forEach((e=>{this.elementsMap.set(e.id,e),rr.mapElementToScene(e,this)})),this.nonDeletedElements=_a(this.elements),this.informMutation()}informMutation(){for(const e of Array.from(this.callbacks))e()}addCallback(e){if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),()=>{if(!this.callbacks.has(e))throw new Error;this.callbacks.delete(e)}}destroy(){rr.sceneMapById.forEach(((e,t)=>{e===this&&rr.sceneMapById.delete(t)})),this.callbacks.clear()}}rr.sceneMapByElement=new WeakMap,rr.sceneMapById=new Map;const ir=rr,or=e=>{let t;e.containerId&&(t=e.width);const n=lr(e.originalText,gn(e),t);Yr(e,{width:n.width,height:n.height,baseline:n.baseline})},ar=(e,t,n)=>{const r=Ln(e);t.forEach((e=>{const t=n.get(e.id),i=br(e);if(i){var o;const a=n.get(i);Yr(r.get(t),{boundElements:null===(o=e.boundElements)||void 0===o?void 0:o.concat({type:"text",id:a})}),Yr(r.get(a),{containerId:t})}}))},sr=(e,t)=>{e.forEach((e=>{const n=br(e);if(n){const r=ir.getScene(e).getElement(n);if(r&&r.text){if(!e)return;let n=r.text,i=r.height,a=e.height,s=r.baseline;if("n"!==t&&"s"!==t){let t=0;if(n){t=fr(gn(r));Math.abs(e.width-r.width+2*o.tr)>=t&&(n=pr(r.originalText,gn(r),e.width))}const a=lr(n,gn(r),e.width);i=a.height,s=a.baseline}if(i>e.height-2*o.tr){a=i+2*o.tr;const n=a-e.height,r="ne"===t||"nw"===t||"n"===t?e.y-n:e.y;Yr(e,{height:a,y:r})}const l=e.y+a/2-i/2;Yr(r,{text:n,width:e.width-2*o.tr,height:i,x:e.x+o.tr,y:l,baseline:s})}}}))},lr=(e,t,n)=>{e=e.split("\n").map((e=>e||" ")).join("\n");const r=document.createElement("div");if(r.style.position="absolute",r.style.whiteSpace="pre",r.style.font=t,r.style.minHeight="1em",n){const e=dr(t);r.style.width="".concat(String(n),"px"),r.style.maxWidth="".concat(String(n),"px"),r.style.overflow="hidden",r.style.wordBreak="break-word",r.style.lineHeight="".concat(String(e),"px"),r.style.whiteSpace="pre-wrap"}document.body.appendChild(r),r.innerText=e;const i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",r.appendChild(i);const o=i.offsetTop+i.offsetHeight,a=r.offsetWidth,s=r.offsetHeight;return document.body.removeChild(r),{width:a,height:s,baseline:o}},cr="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),dr=e=>lr(cr,e,null).height;let ur;const hr=(e,t)=>{ur||(ur=document.createElement("canvas"));const n=ur.getContext("2d");n.font=t;return n.measureText(e).width},pr=(e,t,n)=>{const r=n-2*o.tr,i=[],a=e.split("\n"),s=hr(" ",t);return a.forEach((e=>{const n=e.split(" ");if(1===n.length&&""===n[0])i.push(n[0]);else{let e="",o=0,a=0;for(;a<n.length;){if(hr(n[a],t)>r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=gr.calculate(s,t);o+=l,n[a]=n[a].slice(1),o>=r?(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e),e=s,o=l,o===r&&(e="",o=0)):e+=s}o+s>r?(i.push(e),e="",o=0):(e+=" ",o+=s),a++}else{for(;o<r&&a<n.length;){const s=n[a];if(o=hr(e+s,t),o>=r){i.push(e),o=0,e="";break}a++,e+="".concat(s," ")}o===r&&(e="",o=0)}}e&&(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e))}})),i.join("\n")},gr=(()=>{const e={},t=(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=hr(t,n);e[n][r]=i}return e[n][r]};return{calculate:t,updateCache:(n,r)=>{const i=n.charCodeAt(0);e[r][i]||(e[r][i]=t(n,r))},clearCacheforFont:t=>{e[t]=[]},getCache:t=>e[t]}})(),mr=e=>lr(cr.split("").join("\n"),e).width+2*o.tr,fr=e=>{const t=gr.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.min(...n)},br=e=>{var t,n;return null==e||null===(t=e.boundElements)||void 0===t||null===(n=t.filter((e=>"text"===e.type))[0])||void 0===n?void 0:n.id},xr="invert(100%) hue-rotate(180deg) saturate(1.25)",vr=Pn(),yr=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),wr=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!yr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},kr=e=>[8,8+e],_r=e=>[1.5,6+e],Er=e=>"freedraw"===e.type?12*e.strokeWidth:20,Sr=document.createElement("img");Sr.src="data:".concat(o.LO.svg,",").concat(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>'));const Cr=document.createElement("img");Cr.src="data:".concat(o.LO.svg,",").concat(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>'));const jr=(e,t,n,r)=>{switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(Tr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",Tr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const t=function(e){return Hr.get(e)}(e);n.fillStyle=e.strokeColor,n.fill(t),n.restore();break}case"image":{var i;const t=ke(e)?null===(i=r.imageCache.get(e.fileId))||void 0===i?void 0:i.image:void 0;null==t||t instanceof Promise?((e,t,n)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);const r=Math.min(e.width,e.height),i=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?Cr:Sr,e.width/2-i/2,e.height/2-i/2,i,i)})(e,n,r.zoom.value):n.drawImage(t,0,0,e.width,e.height);break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=Cn(e.text),r=t&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",t?"rtl":"ltr"),n.save(),n.font=gn(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;const i=e.text.replace(/\r\n?/g,"\n").split("\n"),o=e.containerId?dr(gn(e)):e.height/i.length,a=e.height-e.baseline,s="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0;for(let e=0;e<i.length;e++)n.fillText(i[e],s,(e+1)*o-a);n.restore(),r&&n.canvas.remove()}}n.globalAlpha=1},Ir=new WeakMap,Mr=new WeakMap,Tr=e=>Mr.get(e),Or=e=>Mr.delete(e),Lr=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?kr(e.strokeWidth):"dotted"===e.strokeStyle?_r(e.strokeWidth):void 0,disableMultiStroke:"solid"!==e.strokeStyle,strokeWidth:"solid"!==e.strokeStyle?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:4*e.strokeWidth,roughness:e.roughness,stroke:e.strokeColor,preserveVertices:t};switch(e.type){case"rectangle":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":return Re(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"freedraw":case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},Ar=(e,t)=>{let n=Mr.get(e)||null;if(!n){switch(Ir.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){const r=e.width,i=e.height,o=.25*Math.min(r,i);n=t.path("M ".concat(o," 0 L ").concat(r-o," 0 Q ").concat(r," 0, ").concat(r," ").concat(o," L ").concat(r," ").concat(i-o," Q ").concat(r," ").concat(i,", ").concat(r-o," ").concat(i," L ").concat(o," ").concat(i," Q 0 ").concat(i,", 0 ").concat(i-o," L 0 ").concat(o," Q 0 0, ").concat(o," 0"),Lr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,Lr(e));break;case"diamond":{const[r,i,o,a,s,l,c,d]=(e=>{const t=Math.floor(e.width/2)+1,n=e.width,r=Math.floor(e.height/2)+1;return[t,0,n,r,t,e.height,0,r]})(e);n="round"===e.strokeSharpness?t.path("M ".concat(r+.25*(o-r)," ").concat(i+.25*(a-i)," L ").concat(o-.25*(o-r)," ").concat(a-.25*(a-i)," \n C ").concat(o," ").concat(a,", ").concat(o," ").concat(a,", ").concat(o-.25*(o-s)," ").concat(a+.25*(l-a)," \n L ").concat(s+.25*(o-s)," ").concat(l-.25*(l-a)," \n C ").concat(s," ").concat(l,", ").concat(s," ").concat(l,", ").concat(s-.25*(s-c)," ").concat(l-.25*(l-d)," \n L ").concat(c+.25*(s-c)," ").concat(d+.25*(l-d)," \n C ").concat(c," ").concat(d,", ").concat(c," ").concat(d,", ").concat(c+.25*(r-c)," ").concat(d-.25*(d-i)," \n L ").concat(r-.25*(r-c)," ").concat(i+.25*(d-i)," \n C ").concat(r," ").concat(i,", ").concat(r," ").concat(i,", ").concat(r+.25*(o-r)," ").concat(i+.25*(a-i)),Lr(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],Lr(e));break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,Lr(e));break;case"line":case"arrow":{const r=Lr(e),i=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?r.fill?[t.polygon(i,r)]:[t.linearPath(i,r)]:[t.curve(i,r)],"arrow"===e.type){const{startArrowhead:i=null,endArrowhead:o="arrow"}=e,a=(e,n,i,o)=>{const a=((e,t,n,r)=>{const i=Ye(t[0]);if(i.length<1)return null;const o="start"===n?1:i.length-1,a=i[o].data,s=[a[4],a[5]],l=[a[2],a[3]],c=[a[0],a[1]],d=i[o-1];let u=[0,0];"move"===d.op?u=d.data:"bcurveTo"===d.op&&(u=[d.data[4],d.data[5]]);const h=(e,t)=>Math.pow(1-e,3)*s[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*c[t]+u[t]*Math.pow(e,3),[p,g]="start"===n?u:s,[m,f]=[h(.3,0),h(.3,1)],b=Math.hypot(p-m,g-f),x=(p-m)/b,v=(g-f)/b,y={arrow:30,bar:15,dot:15,triangle:15}[r];let w=0;if("arrow"===r){const[t,n]=e.points[e.points.length-1],[r,i]=e.points.length>1?e.points[e.points.length-2]:[0,0];w=Math.hypot(t-r,n-i)}else for(let t=0;t<e.points.length;t++){const[n,r]=e.points[t-1]||[0,0],[i,o]=e.points[t];w+=Math.hypot(i-n,o-r)}const k=Math.min(y,w/2),_=p-x*k,E=g-v*k;if("dot"===r)return[p,g,Math.hypot(E-g,_-p)+e.strokeWidth];const S={arrow:20,bar:90,triangle:25}[r],[C,j]=Pe(_,E,p,g,-S*Math.PI/180),[I,M]=Pe(_,E,p,g,S*Math.PI/180);return[p,g,C,j,I,M]})(e,n,i,o);if(null===a)return[];if("dot"===o){const[n,i,o]=a;return[t.circle(n,i,o,Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){const[n,i,o,s,l,c]=a;return delete r.strokeLineDash,[t.polygon([[n,i],[o,s],[l,c],[n,i]],Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid"}))]}const[s,l,c,d,u,h]=a;if("dotted"===e.strokeStyle){const t=_r(e.strokeWidth-1);r.strokeLineDash=[t[0],t[1]-1]}else delete r.strokeLineDash;return[t.line(c,d,s,l,r),t.line(u,h,s,l,r)]};if(null!==i){const t=a(e,n,"start",i);n.push(...t)}if(null!==o){const t=a(e,n,"end",o);n.push(...t)}}break}case"freedraw":Br(e),n=[];break;case"text":case"image":n=[]}Mr.set(e,n)}},Pr=(e,t)=>{const n=t?t.zoom:vr.zoom,r=Ir.get(e),i=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||i||r.theme!==t.theme){const r=((e,t,n)=>{const r=document.createElement("canvas"),i=r.getContext("2d"),o=Er(e);let a=0,s=0;if(je(e)||Se(e)){const[n,l,c,d]=Ge(e);r.width=fn(n,c)*window.devicePixelRatio*t.value+o*t.value*2,r.height=fn(l,d)*window.devicePixelRatio*t.value+o*t.value*2,a=e.x>n?fn(e.x,n)*window.devicePixelRatio*t.value:0,s=e.y>l?fn(e.y,l)*window.devicePixelRatio*t.value:0,i.translate(a,s)}else r.width=e.width*window.devicePixelRatio*t.value+o*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+o*t.value*2;i.save(),i.translate(o*t.value,o*t.value),i.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);const l=xe.canvas(r);return wr(e,n)&&(i.filter=xr),jr(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return Ir.set(e,r),r}return r},Dr=(e,t,n,r)=>{const i=e.element,o=Er(i);let[a,s,l,c]=Ge(i);Se(i)&&(a=Math.floor(a),l=Math.ceil(l),s=Math.floor(s),c=Math.ceil(c));const d=((a+l)/2+r.scrollX)*window.devicePixelRatio,u=((s+c)/2+r.scrollY)*window.devicePixelRatio,h=yr(i,r),p="scale"in e.element&&!h?e.element.scale[0]:1,g="scale"in e.element&&!h?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*p,1/window.devicePixelRatio*g),n.translate(d*p,u*g),n.rotate(i.angle*p*g),n.drawImage(e.canvas,-(l-a)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,-(c-s)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},zr=(e,t,n,r)=>{const i=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(Ar(e,i),r.isExporting){const t=Pr(e,r);Dr(t,0,n,r)}else{const[i,o,a,s]=Ge(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),jr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Ar(e,i),r.isExporting){const[i,o,a,s]=Ge(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),wr(e,r)&&(n.filter="none"),jr(e,t,n,r),n.restore()}else{const t=Pr(e,r);Dr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Nr=(e,t,n)=>{if(void 0===n)return e.draw(t);const r={sets:t.sets,shape:t.shape,options:Object.assign(Object.assign({},t.options),{fixedDecimalPlaceDigits:n})};return e.draw(r)},Rr=(e,t,n,r,i,a,s)=>{const[l,c,d,u]=Ge(e),h=(d-l)/2-(e.x-l),p=(u-c)/2-(e.y-c),g=180*e.angle/Math.PI,m=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{Ar(e,m);const r=Nr(t,Tr(e),o.zK),s=e.opacity/100;1!==s&&(r.setAttribute("stroke-opacity","".concat(s)),r.setAttribute("fill-opacity","".concat(s))),r.setAttribute("stroke-linecap","round"),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),n.appendChild(r);break}case"line":case"arrow":{Ar(e,m);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),Tr(e).forEach((n=>{const l=Nr(t,n,o.zK);1!==s&&(l.setAttribute("stroke-opacity","".concat(s)),l.setAttribute("fill-opacity","".concat(s))),l.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),"line"===e.type&&Re(e.points)&&"transparent"!==e.backgroundColor&&l.setAttribute("fill-rule","evenodd"),r.appendChild(l)})),n.appendChild(r);break}case"freedraw":{Br(e);const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=n.ownerDocument.createElementNS(o.hR,"path");r.setAttribute("stroke","none"),r.setAttribute("fill",e.strokeColor),s.setAttribute("d",Fr(e)),r.appendChild(s),n.appendChild(r);break}case"image":{const t=ke(e)&&r[e.fileId];if(t){const r="image-".concat(t.id);let l=n.querySelector("#".concat(r));if(!l){l=n.ownerDocument.createElementNS(o.hR,"symbol"),l.id=r;const e=n.ownerDocument.createElementNS(o.hR,"image");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("href",t.dataURL),l.appendChild(e),n.prepend(l)}const c=n.ownerDocument.createElementNS(o.hR,"use");c.setAttribute("href","#".concat(r)),s&&t.mimeType!==o.LO.svg&&c.setAttribute("filter",xr),c.setAttribute("width","".concat(Math.round(e.width))),c.setAttribute("height","".concat(Math.round(e.height))),c.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),n.appendChild(c)}break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=e.text.replace(/\r\n?/g,"\n").split("\n"),l=e.height/s.length,c=e.height-e.baseline,d="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,u=Cn(e.text)?"rtl":"ltr",m="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===u?"end":"start";for(let t=0;t<s.length;t++){const i=n.ownerDocument.createElementNS(o.hR,"text");i.textContent=s[t],i.setAttribute("x","".concat(d)),i.setAttribute("y","".concat((t+1)*l-c)),i.setAttribute("font-family",pn(e)),i.setAttribute("font-size","".concat(e.fontSize,"px")),i.setAttribute("fill",e.strokeColor),i.setAttribute("text-anchor",m),i.setAttribute("style","white-space: pre;"),i.setAttribute("direction",u),r.appendChild(i)}n.appendChild(r)}}},Hr=new WeakMap([]);function Br(e){const t=Fr(e),n=new Path2D(t);return Hr.set(e,n),n}function Fr(e){const t=e.simulatePressure?e.points:e.points.length?e.points.map(((t,n)=>{let[r,i]=t;return[r,i,e.pressures[n]]})):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:e=>Math.sin(e*Math.PI/2),last:!!e.lastCommittedPoint};return function(e){if(!e.length)return"";const t=e.length-1;return e.reduce(((e,n,r,i)=>(r===t?e.push(n,Ur(n,i[0]),"L",i[0],"Z"):e.push(n,Ur(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Vr,"$1")}(tr(t,n))}function Ur(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const Vr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let Wr=new O(Date.now());const Kr=()=>Math.floor(Wr.next()*2**31),Gr=()=>we(),Yr=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!1;const{points:i,fileId:o}=t;void 0!==i&&(t=Object.assign(Object.assign({},We(i)),t));for(const n in t){const i=t[n];if(void 0!==i){if(e[n]===i&&("object"!=typeof i||null===i||"groupIds"===n||"scale"===n))continue;if("scale"===n){const t=e[n],r=i;if(t[0]===r[0]&&t[1]===r[1])continue}else if("points"===n){const t=e[n],r=i;if(t.length===r.length){let e=!1,n=t.length;for(;--n;){const i=t[n],o=r[n];if(i[0]!==o[0]||i[1]!==o[1]){e=!0;break}}if(!e)continue}}e[n]=i,r=!0}}if(!r)return e;var a;(void 0===t.height&&void 0===t.width&&void 0===o&&void 0===i||Or(e),e.version++,e.versionNonce=Kr(),e.updated=On(),n)&&(null===(a=ir.getScene(e))||void 0===a||a.informMutation());return e},Zr=(e,t)=>{let n=!1;for(const r in t){const i=t[r];if(void 0!==i){if(e[r]===i&&("object"!=typeof i||null===i))continue;n=!0}}return n?Object.assign(Object.assign(Object.assign({},e),t),{updated:On(),version:e.version+1,versionNonce:Kr()}):e},qr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Kr(),e.updated=On(),e),Xr=e=>je(e)||Se(e)?e.points.length<2:0===e.width&&0===e.height,$r=(e,t,n)=>{const r=Math.abs(t),i=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){const e=Math.round(Math.atan(i/r)/o.ay)*o.ay;0===e?n=0:e===Math.PI/2?t=0:n=Math.round(r*Math.tan(e))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},Jr=e=>{const t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){const n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){const n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},Qr=(e,t,n)=>{const r=n.filter((t=>t.groupIds.includes(e)));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!1}),editingGroupId:null}):t:Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!0}),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),Object.fromEntries(r.map((e=>[e.id,!0]))))})},ei=(e,t)=>null!=ti(e,t),ti=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),ni=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),ri=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Ta(t,e);if(!r.length)return Object.assign(Object.assign({},n),{editingGroupId:null});for(const i of r){let r=i.groupIds;if(e.editingGroupId){const t=r.indexOf(e.editingGroupId);t>-1&&(r=r.slice(0,t))}if(r.length>0){const e=r[r.length-1];n=Qr(e,n,t)}}return n},ii=(e,t)=>e.groupIds.includes(t),oi=(e,t)=>e.filter((e=>ii(e,t))),ai=(e,t,n)=>{const r=[...e],i=n?r.indexOf(n):-1,o=i>-1?i:r.length;return r.splice(o,0,t),r};var si=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const li=(e,t)=>{var n,r;let{x:i,y:o,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,width:p=0,height:g=0,angle:m=0,groupIds:f=[],strokeSharpness:b,boundElements:x=null}=t,v=si(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements"]);return{id:v.id||Gr(),type:e,x:i,y:o,width:p,height:g,angle:m,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,groupIds:f,strokeSharpness:b,seed:null!==(n=v.seed)&&void 0!==n?n:Kr(),version:v.version||1,versionNonce:null!==(r=v.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:x,updated:On()}},ci=e=>li(e.type,e),di=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),ui=e=>{const t=lr(e.text,gn(e)),n=di(e,t);return Zr(Object.assign(Object.assign({},li("text",e)),{text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,textAlign:e.textAlign,verticalAlign:e.verticalAlign,x:e.x-n.x,y:e.y-n.y,width:t.width,height:t.height,baseline:t.baseline,containerId:e.containerId||null,originalText:e.text}),{})},hi=(e,t,n)=>{let{text:r,isDeleted:i,originalText:a}=t;const s=n?((e,t)=>{const n=e.containerId?e.width:null,{width:r,height:i,baseline:a}=lr(t,gn(e),n),{textAlign:s,verticalAlign:l}=e;let c,d;if("center"!==s||"middle"!==l||e.containerId){const[t,n,o,a]=Ge(e),[l,u,h,p]=et(e,r,i),g=(t-l)/2,m=(n-u)/2,f=(o-h)/2,b=(a-p)/2;[c,d]=ze({s:!0,e:"center"===s||"left"===s,w:"center"===s||"right"===s},e.x,e.y,e.angle,g,m,f,b)}else{const t=lr(e.text,gn(e),n),o=di(e,{width:r-t.width,height:i-t.height});c=e.x-o.x,d=e.y-o.y}if(Ae(e)){const t=ir.getScene(e).getElement(e.containerId);let n=t.height,a=t.width;i>n-2*o.tr&&(n=i+2*o.tr),r>a-2*o.tr&&(a=r+2*o.tr),n===t.height&&a===t.width||Yr(t,{height:n,width:a})}return{width:r,height:i,x:Number.isFinite(c)?c:e.x,y:Number.isFinite(d)?d:e.y,baseline:a}})(e,r):void 0;return Zr(e,Object.assign({text:r,originalText:a,isDeleted:null!=i?i:e.isDeleted},s))},pi=e=>Object.assign(Object.assign({},li(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),gi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||"object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){const n="function"==typeof e.constructor?Object.create(Object.getPrototypeOf(e)):{};for(const r in e)if(e.hasOwnProperty(r)){if(0===t&&("shape"===r||"canvas"===r))continue;n[r]=gi(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=gi(e[n],t+1);return r}return e},mi=(e,t,n,r)=>{let i=gi(n);return i.id=Gr(),i.updated=On(),i.seed=Kr(),i.groupIds=((e,t,n)=>{const r=[...e],i=t?e.indexOf(t):-1,o=i>-1?i:e.length;for(let e=0;e<o;e++)r[e]=n(r[e]);return r})(i.groupIds,e,(e=>(t.has(e)||t.set(e,Gr()),t.get(e)))),r&&(i=Object.assign(i,r)),i},fi={mouse:8,pen:16,touch:28},bi={e:!0,s:!0,n:!0,w:!0},xi={e:!0,s:!0,n:!0,w:!0},vi={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},yi={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},wi=(e,t,n,r,i,o,a)=>{const[s,l]=Pe(e+n/2,t+r/2,i,o,a);return[s-n/2,l-r/2,n,r]},ki=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=fi[r],d=c/n.value,u=c/n.value,h=c/n.value,p=c/n.value,g=a-i,m=s-o,f=(i+a)/2,b=(o+s)/2,x=4/n.value,v=(c-8)/(2*n.value),y={nw:l.nw?void 0:wi(i-x-h+v,o-x-p+v,d,u,f,b,t),ne:l.ne?void 0:wi(a+x-v,o-x-p+v,d,u,f,b,t),sw:l.sw?void 0:wi(i-x-h+v,s+x-v,d,u,f,b,t),se:l.se?void 0:wi(a+x-v,s+x-v,d,u,f,b,t),rotation:l.rotation?void 0:wi(i+g/2-d/2,o-x-p+v-16/n.value,d,u,f,b,t)},w=5*fi.mouse/n.value;return Math.abs(g)>w&&(l.n||(y.n=wi(i+g/2-d/2,o-x-p+v,d,u,f,b,t)),l.s||(y.s=wi(i+g/2-d/2,s+x-v,d,u,f,b,t))),Math.abs(m)>w&&(l.w||(y.w=wi(i-x-h+v,o+m/2-u/2,d,u,f,b,t)),l.e||(y.e=wi(a+x-v,o+m/2-u/2,d,u,f,b,t))),y},_i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"freedraw"===e.type){if(2===e.points.length){const[,t]=e.points;0===t[0]||0===t[1]?r=yi:t[0]>0&&t[1]<0?r=vi:t[0]>0&&t[1]>0?r=yi:t[0]<0&&t[1]>0?r=vi:t[0]<0&&t[1]<0&&(r=yi)}}else Ee(e)&&(r=xi);return ki(Ge(e),e.angle,t,n,r)},Ei=(e,t)=>[0,0,0,0,t,e,1,0],Si=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Ci=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],ji=(e,t)=>Di(t)?[e[0]-t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3],e[4]-t[4],e[5]-t[5],e[6]-t[6],e[7]-t[7]],Ii=(e,t)=>Di(t)?[e[0]*t,e[1]*t,e[2]*t,e[3]*t,e[4]*t,e[5]*t,e[6]*t,e[7]*t]:[Mi(e,t),t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[7]*e[3]+t[0]*e[4]+t[6]*e[5]-t[5]*e[6]+t[3]*e[7],t[5]*e[0]-t[3]*e[1]+t[7]*e[2]+t[1]*e[3]-t[6]*e[4]+t[0]*e[5]+t[4]*e[6]+t[2]*e[7],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]+t[0]*e[7]],Mi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],Ti=(e,t)=>[Oi(e,t),e[1]*t[7]+e[4]*t[5]-e[5]*t[4]+e[7]*t[1],e[2]*t[7]-e[4]*t[6]+e[6]*t[4]+e[7]*t[2],e[3]*t[7]+e[5]*t[6]-e[6]*t[5]+e[7]*t[3],e[4]*t[7]+e[7]*t[4],e[5]*t[7]+e[7]*t[5],e[6]*t[7]+e[7]*t[6],e[7]*t[7]],Oi=(e,t)=>e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0],Li=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),Ai=e=>{const t=Li(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return Ii(e,n/t)},Pi=e=>{const t=(e=>Math.sqrt(Math.abs(e[7]*e[7]-e[5]*e[5]-e[4]*e[4]+e[1]*e[1])))(e);return 0===t||1===t?e:Ii(e,1/t)},Di=e=>"number"==typeof e,zi=(Si(1,1),Si(1,2),Si(1,3),Si(1,4),Si(1,5),Si(1,6),Si(1,7),(e,t,n)=>Ai([0,n,e,t,0,0,0,0])),Ni=(e,t)=>Ai(Ti(t,e)),Ri=(e,t)=>((e,t)=>[t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[7]*e[3]+t[0]*e[4]+t[3]*e[7],t[5]*e[0]+t[7]*e[2]+t[0]*e[5]+t[2]*e[7],t[6]*e[0]+t[0]*e[6],t[7]*e[0]+t[0]*e[7]])(e,t),Hi=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Bi=e=>[e[5],e[4]],Fi=(e,t)=>Ai(((e,t)=>[t[0]*e[0],t[1]*e[0]+t[0]*e[1],t[2]*e[0]+t[0]*e[2],t[3]*e[0]+t[0]*e[3],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[0]*e[4],t[5]*e[0]-t[3]*e[1]+t[1]*e[3]+t[0]*e[5],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]])(e,t)),Ui=(e,t)=>Li(Ti(e,t)),Vi=(e,t)=>Oi(e,t),Wi=e=>[0,0,0,0,e[4],e[5],0,0],Ki=(e,t)=>((e,t)=>Di(t)?[e[0]+t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]+t[0],e[1]+t[1],e[2]+t[2],e[3]+t[3],e[4]+t[4],e[5]+t[5],e[6]+t[6],e[7]+t[7]])(Ii(e,Math.sin(t/2)),Math.cos(t/2)),Gi=(e,t)=>Ai(Ii(Ii(e,t),Ci(e))),Yi=(e,t,n,r)=>{const i=10/t.zoom.value;return!Zi(e,t,[n,r])&&Xi(e,[n,r],i)},Zi=(e,t,n)=>{const r=10/t.zoom.value,i=Ee(e)?to:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!Mn(e.backgroundColor)||Mn(e.backgroundColor)&&Le(e);return"line"===e.type?t&&Re(e.points):t||_e(e)})(e)?no:ro;return Qi({element:e,point:n,threshold:r,check:i})},qi=(e,t)=>e.selectedElementIds[t.id],Xi=(e,t,n)=>{let[r,i]=t;const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);return u>o-n&&u<s+n&&h>a-n&&h<l+n},$i=(e,t)=>{let{x:n,y:r}=t;const i=Ji(e,e.width,e.height);return Qi({element:e,point:[n,r],threshold:i,check:io})},Ji=(e,t,n)=>{const r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},Qi=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=eo(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(oo(e.element,e.point),e.threshold)&&co(e.element,e.point,e.threshold);case"arrow":case"line":return uo(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},eo=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return oo(e,t);case"diamond":return ao(e,t);case"ellipse":return so(e,t)}},to=(e,t)=>e<0,no=(e,t)=>e<t,ro=(e,t)=>Math.abs(e)<t,io=(e,t)=>0<=e&&e<t,oo=(e,t)=>{const[,n,r,i]=ho(e,t);return Math.max(Vi(n,zi(0,1,-i)),Vi(n,zi(1,0,-r)))},ao=(e,t)=>{const[,n,r,i]=ho(e,t),o=zi(i,r,-i*r);return Vi(n,o)},so=(e,t)=>{const[n,r]=lo(e,t);return-(e=>Math.sign(e[1]))(r)*Vi(n,r)},lo=(e,t)=>{const[,n,r,i]=ho(e,t),[o,a]=Bi(n);let s=.707,l=.707;const c=r,d=i;[0,1,2,3].forEach((e=>{const t=(c*c-d*d)*s**3/c,n=(d*d-c*c)*l**3/d,r=c*s-t,i=d*l-n,u=o-t,h=a-n,p=Math.hypot(i,r),g=Math.hypot(h,u);s=Math.min(1,Math.max(0,(u*p/g+t)/c)),l=Math.min(1,Math.max(0,(h*p/g+n)/d));const m=Math.hypot(l,s);s/=m,l/=m}));const u=Ei(c*s,d*l);var h;return[n,Ri(Ni(n,h=u),h)]},co=(e,t,n)=>{let r,i;if(0===e.angle)r=t[0]-e.x,i=t[1]-e.y;else{const[n,o,a,s]=Ge(e),l=De(t,[n+(a-n)/2,o+(s-o)/2],-e.angle);r=l[0]-e.x,i=l[1]-e.y}let o,[a,s]=e.points;if(Ne(a[0],a[1],r,i)<n||Ne(s[0],s[1],r,i)<n)return!0;for(let t=0;t<e.points.length;t++){const l=[s[0]-a[0],s[1]-a[1]],c=Math.hypot(l[1],l[0]),d=[l[0]/c,l[1]/c],u=[r-a[0],i-a[1]],h=(u[0]*d[0]+u[1]*d[1])/Math.hypot(d[1],d[0]);o=[a[0]+d[0]*h,a[1]+d[1]*h];const p=Ne(o[0],o[1],a[0],a[1]),g=Ne(o[0],o[1],s[0],s[1]);if(o=g<p&&p>c?s:p<g&&g>c?a:o,Math.hypot(i-o[1],r-o[0])<n)return!0;a=s,s=e.points[t+1]}return!1},uo=e=>{const{element:t,threshold:n}=e;if(!Tr(t))return!1;const[r,i,o,a]=ho(e.element,e.point),s=zi(0,1,-a),l=zi(1,0,-o);if(!no(Vi(i,s),n)||!no(Vi(i,l),n))return!1;const[c,d]=Bi(r),u=Tr(t);if(e.check===no){if(u.some((e=>Eo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>So(e,c,d,n)))},ho=(e,t)=>{const n=Hi(t),r=Ge(e),i=go(r),o=Ki(i,e.angle),a=Gi(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(ji(a,Wi(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=ji(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},po=e=>{const t=Ge(e),n=go(t),r=Ki(n,e.angle),i=Ci((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Wi(n)));return Ii(i,r)},go=e=>{let[t,n,r,i]=e;return Ei((t+r)/2,(n+i)/2)},mo=(e,t,n)=>{const r=po(e),i=Gi(r,Hi(t)),o=Gi(r,Hi(n)),a=Ni(i,o),s=e.height/e.width,l=e.width/2,c=e.height/2,d=a[2],u=a[3],h=a[1],p=Math.abs(u),g=Math.abs(d);switch(e.type){case"rectangle":case"image":case"text":return h/(l*(g+s*p));case"diamond":return p<g?h/(g*l):h/(p*c);case"ellipse":return h/(l*Math.sqrt(d**2+s**2*u**2))}},fo=function(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":const n=bo(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return xo(t,vo(o,i))})).concat(n.flatMap((e=>wo(e,i,t))));break;case"ellipse":r=yo(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Ui(e,n)-Ui(t,n)));return[o[0],o[o.length-1]]},bo=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[Ei(n,r),Ei(n,-r),Ei(-n,-r),Ei(-n,r)];case"diamond":return[Ei(0,r),Ei(n,0),Ei(0,-r),Ei(-n,0)]}},xo=(e,t)=>{const[n,r]=t;return Vi(n,e)*Vi(r,e)>=0?[]:[Fi(e,Ni(n,r))]},vo=(e,t)=>{const[n,r]=e,i=((e,t)=>{const n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]})(((e,t)=>Pi([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Gi(i,n),Gi(i,r)]},yo=(e,t,n)=>{const r=e.width/2+t,i=e.height/2+t,o=n[2],a=n[3],s=n[1],l=r*r*o*o+i*i*a*a,c=l-s*s;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=-r*r*o*s,h=-i*i*a*s;return[Ei((u+r*i*a*d)/l,(h-r*i*o*d)/l),Ei((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},wo=(e,t,n)=>{if(0===t)return 0===Vi(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Bi(e),l=r*r+i*i,c=t*t*l-(r*a+i*s+o)**2;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=a*i*i-s*r*i-r*o,h=s*r*r-a*r*i-i*o;return[Ei((u+i*d)/l,(h-r*d)/l),Ei((u-i*d)/l,(h+r*d)/l)]},ko=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Bi(n),c=0===l?1e-4:l,d=s**2*o**2+c**2*i**2,u=(-s*o**2+a*c*Math.sqrt(Math.max(0,d-i**2*o**2)))/d,h=(-u*s-1)/c,p=-(i**2)*u/(h**2*o**2+u**2*i**2);return Ei(p,(-u*p-1)/h)},_o=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=bo(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*Ni(n,e)[1];t>a&&(a=t,s=e)})),s},Eo=(e,t,n,r)=>{const i=Ye(e),o=[];let a=!1;for(const e of i)"move"===e.op?(a=!a,a&&o.push([e.data[0],e.data[1]])):"bcurveTo"===e.op&&a&&(o.push([e.data[0],e.data[1]]),o.push([e.data[2],e.data[3]]),o.push([e.data[4],e.data[5]]));if(o.length>=4){if("sharp"===r)return He(o,t,n);const e=he(o,10,5);return He(e,t,n)}return!1},So=(e,t,n,r)=>{const i=Ye(e);let o=[0,0];return i.some(((e,i)=>{let{op:a,data:s}=e;if("move"===a)o=s;else if("bcurveTo"===a){const e=[s[0],s[1]],i=[s[2],s[3]],a=[s[4],s[5]],l=o;o=a;const c=((e,t,n,r,i,o)=>{let[a,s]=i;const l=(i,o)=>Math.pow(1-i,3)*r[o]+3*i*Math.pow(1-i,2)*n[o]+3*Math.pow(i,2)*(1-i)*t[o]+e[o]*Math.pow(i,3);let c=0;for(;c<=1;){const e=l(c,0),t=l(c,1);if(Math.sqrt(Math.pow(e-a,2)+Math.pow(t-s,2))<o)return!0;c+=.01}return!1})(l,e,i,a,[t,n],r);return c}return!1}))};var Co=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const jo=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],Io=(e,t,n,r,i,o)=>e.reduce(((e,a)=>{if(e)return e;const s=((e,t,n,r,i,o)=>{if(!t.selectedElementIds[e.id])return!1;const a=_i(e,i,o),{rotation:s}=a,l=Co(a,["rotation"]);if(s&&jo(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&jo(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),Mo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=ki([o,a,s,l],0,r,i,bi);return Object.keys(c).find((e=>{const r=c[e];return r&&jo(r,t,n)}))||!1},To=["ns","nesw","ew","nwse"],Oo=e=>{const{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1;let i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":i=r?"nesw":"nwse";break;case"ne":case"sw":i=r?"nwse":"nesw";break;case"rotation":return"grab"}return i&&t&&(i=((e,t)=>{const n=To.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=To[(n+r)%To.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class Lo{constructor(e,t){this.elementId=e.id,ir.mapElementToScene(this.elementId,t),Lo.normalizePoints(e),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1}}static getElement(e){var t;const n=null===(t=ir.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null}static handleBoxSelection(e,t,n){var r;if(!t.editingLinearElement||"selection"!==(null===(r=t.draggingElement)||void 0===r?void 0:r.type))return!1;const{editingLinearElement:i}=t,{selectedPointsIndices:o,elementId:a}=i,s=Lo.getElement(a);if(!s)return!1;const[l,c,d,u]=Ge(t.draggingElement),h=Lo.getPointsGlobalCoordinates(s).reduce(((t,n,r)=>((n[0]>=l&&n[0]<=d&&n[1]>=c&&n[1]<=u||e.shiftKey&&null!=o&&o.includes(r))&&t.push(r),t)),[]);n({editingLinearElement:Object.assign(Object.assign({},i),{selectedPointsIndices:h.length?h:null})})}static handlePointDragging(e,t,n,r,i){if(!e.editingLinearElement)return!1;const{editingLinearElement:o}=e,{selectedPointsIndices:a,elementId:s,isDragging:l}=o,c=Lo.getElement(s);if(!c)return!1;const d=c.points[o.pointerDownState.lastClickedPoint];if(a&&d){!1===l&&t({editingLinearElement:Object.assign(Object.assign({},o),{isDragging:!0})});const s=Lo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(Lo.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?Lo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize):[c.points[t][0]+u,c.points[t][1]+h],isDragging:t===o.pointerDownState.lastClickedPoint})))),Me(c)){const e=[];0===a[0]&&e.push(jn(Lo.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(jn(Lo.getPointGlobalCoordinates(c,c.points[t]))),e.length&&i(c,e)}return!0}return!1}static handlePointerUp(e,t,n){var r;const{elementId:i,selectedPointsIndices:o,isDragging:a,pointerDownState:s}=t,l=Lo.getElement(i);if(!l)return t;const c={};if(a&&o)for(const e of o)if(0===e||e===l.points.length-1){Re(l.points,n.zoom.value)&&Lo.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=Po(n)?Ko(jn(Lo.getPointAtIndexGlobalCoordinates(l,e)),ir.getScene(l)):null;c[0===e?"startBindingElement":"endBindingElement"]=t}return Object.assign(Object.assign(Object.assign({},t),c),{selectedPointsIndices:a||e.shiftKey?!a&&e.shiftKey&&null!==(r=s.prevSelectedPointsIndices)&&void 0!==r&&r.includes(s.lastClickedPoint)?o&&o.filter((e=>e!==s.lastClickedPoint)):o:null!=o&&o.includes(s.lastClickedPoint)?[s.lastClickedPoint]:o,isDragging:!1,pointerOffset:{x:0,y:0}})}static handlePointerDown(e,t,n,r,i){var o;const a={didAddPoint:!1,hitElement:null};if(!t.editingLinearElement)return a;const{elementId:s}=t.editingLinearElement,l=Lo.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Yr(l,{points:[...l.points,Lo.createPointAt(l,i.x,i.y,t.gridSize)]}),r.resumeRecording(),n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:-1},selectedPointsIndices:[l.points.length-1],lastUncommittedPoint:null,endBindingElement:Ko(i,ir.getScene(l))})}),a.didAddPoint=!0,a;const c=Lo.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;Po(t)&&Me(l)&&Do(l,e,n)}const[d,u,h,p]=Ge(l),g=(d+h)/2,m=(u+p)/2,f=c>-1&&Pe(l.x+l.points[c][0],l.y+l.points[c][1],g,m,l.angle),b=c>-1||e.shiftKey?e.shiftKey||null!==(o=t.editingLinearElement.selectedPointsIndices)&&void 0!==o&&o.includes(c)?Ao([...t.editingLinearElement.selectedPointsIndices||[],c]):[c]:null;return n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:c},selectedPointsIndices:b,pointerOffset:f?{x:i.x-f[0],y:i.y-f[1]}:{x:0,y:0}})}),a}static handlePointerMove(e,t,n,r,i){const{elementId:o,lastUncommittedPoint:a}=r,s=Lo.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&Lo.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=Lo.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?Lo.movePoints(s,[{index:s.points.length-1,point:d}]):Lo.addPoints(s,[{point:d}]),Object.assign(Object.assign({},r),{lastUncommittedPoint:s.points[s.points.length-1]})}static getPointGlobalCoordinates(e,t){const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2;let{x:l,y:c}=e;return[l,c]=Pe(l+t[0],c+t[1],a,s,e.angle),[l,c]}static getPointsGlobalCoordinates(e){const[t,n,r,i]=Ge(e),o=(t+r)/2,a=(n+i)/2;return e.points.map((t=>{let{x:n,y:r}=e;return[n,r]=Pe(n+t[0],r+t[1],o,a,e.angle),[n,r]}))}static getPointAtIndexGlobalCoordinates(e,t){const n=t<0?e.points.length+t:t,[r,i,o,a]=Ge(e),s=(r+o)/2,l=(i+a)/2,c=e.points[n],{x:d,y:u}=e;return Pe(d+c[0],u+c[1],s,l,e.angle)}static pointFromAbsoluteCoords(e,t){const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2,[l,c]=Pe(t[0],t[1],a,s,-e.angle);return[l-e.x,c-e.y]}static getPointIndexUnderCursor(e,t,n,r){const i=this.getPointsGlobalCoordinates(e);let o=i.length;for(;--o>-1;){const e=i[o];if(Ne(n,r,e[0],e[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return o}return-1}static createPointAt(e,t,n,r){const i=Ve(t,n,r),[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(i[0],i[1],c,d,-e.angle);return[u-e.x,h-e.y]}static getNormalizedPoints(e){const{points:t}=e,n=t[0][0],r=t[0][1];return{points:t.map(((e,t)=>[e[0]-n,e[1]-r])),x:e.x+n,y:e.y+r}}static normalizePoints(e){Yr(e,Lo.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=Lo.getElement(n);if(!r||null===t)return!1;const{points:i}=r,o=[];let a=!1,s=-1;const l=i.reduce(((e,n,r)=>{++s,e.push(n);if(t.includes(r)){const t=i[r+1];t||(a=!0),e.push(t?[(n[0]+t[0])/2,(n[1]+t[1])/2]:[n[0],n[1]]),o.push(s+1),++s}return e}),[]);if(Yr(r,{points:l}),a){const e=r.points[r.points.length-1];Lo.movePoints(r,[{index:r.points.length-1,point:[e[0]+30,e[1]+30]}])}return{appState:Object.assign(Object.assign({},e),{editingLinearElement:Object.assign(Object.assign({},e.editingLinearElement),{selectedPointsIndices:o})})}}static deletePoints(e,t){let n=0,r=0;if(t.includes(0)){const i=e.points.find(((e,n)=>!t.includes(n)));i&&(n=i[0],r=i[1])}const i=e.points.reduce(((e,i,o)=>(t.includes(o)||e.push(e.length?[i[0]-n,i[1]-r]:[0,0]),e)),[]);Lo._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];Lo._updatePoints(e,n,0,0)}static movePoints(e,t,n){const{points:r}=e;let i=0,o=0;const a=t.find((e=>{let{index:t}=e;return 0===t}));a&&(i=a.point[0]-r[a.index][0],o=a.point[1]-r[a.index][1]);const s=r.map(((e,n)=>{const s=t.find((e=>e.index===n));if(s){if(a)return e;const t=s.point[0]-r[s.index][0],n=s.point[1]-r[s.index][1];return[e[0]+t,e[1]+n]}return i||o?[e[0]-i,e[1]-o]:e}));Lo._updatePoints(e,s,i,o,n)}static _updatePoints(e,t,n,r,i){const o=tt(e,t,e.strokeSharpness||"round"),a=tt(e,e.points,e.strokeSharpness||"round"),s=(o[0]+o[2])/2,l=(o[1]+o[3])/2,c=(a[0]+a[2])/2,d=(a[1]+a[3])/2,u=Pe(n,r,c-s,d-l,e.angle);Yr(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}Lo.POINT_HANDLE_SIZE=20;const Ao=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},Po=e=>e.isBindingEnabled,Do=(e,t,n)=>{const r=new Set,i=new Set;zo(e,t,n,"start",r,i),zo(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));ir.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Yr(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},zo=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?Fo(e,t,r):"start"!==r&&n.id===t.id)||(Bo(e,t,r),i.add(t.id));else{const t=Wo(e,r);null!=t&&o.add(t)}},No=e=>{e.forEach((e=>{Me(e)?Do(e,Qo(e,"start"),Qo(e,"end")):Oe(e)&&Ro(e)}))},Ro=e=>{ta(e).forEach((t=>{let[n,r]=t;return Do(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Ho=(e,t,n,r)=>{null!=t.startBoundElement&&Bo(e,t.startBoundElement,"start");const i=Ko(r,n);null==i||Fo(e,i,"end")||Bo(e,i,"end")},Bo=(e,t,n)=>{Yr(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Go(e,t,n))});Ln(t.boundElements||[]).has(e.id)||Yr(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Fo=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return Uo(e,null==r?void 0:r.elementId,t)},Uo=(e,t,n)=>t===n.id&&e.points.length<3,Vo=e=>{e.forEach((e=>{Me(e)&&Do(e,null,null)}))},Wo=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Yr(e,{[n]:null}),r.elementId)},Ko=(e,t)=>Fa(t.getElements(),(t=>Oe(t)&&$i(t,e))),Go=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=Lo.getPointAtIndexGlobalCoordinates(e,i),s=Lo.getPointAtIndexGlobalCoordinates(e,o);return{focus:mo(t,s,a),gap:Math.max(1,eo(t,a))}},Yo=(e,t)=>{var n;const r=(null!==(n=e.boundElements)&&void 0!==n?n:[]).filter((e=>"arrow"===e.type));if(0===r.length)return;const{newSize:i,simultaneouslyUpdated:o}=null!=t?t:{},a=qo(o);ir.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!je(t))return;const n=e;if(!Zo(t,n))return;const r=$o(n,t.startBinding,i),o=$o(n,t.endBinding,i);a.has(t.id)?Yr(t,{startBinding:r,endBinding:o}):(Xo(t,"start",r,e),Xo(t,"end",o,e))}))},Zo=(e,t)=>{var n,r;return(null===(n=e.startBinding)||void 0===n?void 0:n.elementId)===t.id||(null===(r=e.endBinding)||void 0===r?void 0:r.elementId)===t.id},qo=e=>new Set((e||[]).map((e=>e.id))),Xo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=ir.getScene(e).getElement(n.elementId);if(null==i)return;const o="start"===t?-1:1,a=-1===o?0:e.points.length-1,s=a-o,l=Lo.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ge(e),n=go(t);return Bi(n)}const r=po(e),i=Gi(r,Hi(n)),o=Ci(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=_o(e,t,i);break;case"ellipse":a=ko(e,t,i)}return Bi(Gi(o,a))})(i,n.focus,l);let d;if(0===n.gap)d=c;else{const e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=po(e),o=Gi(i,Hi(t)),a=Gi(i,Hi(n)),s=Ni(o,a),l=Ci(i);return fo(e,s,o,r).map((e=>Bi(Gi(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}Lo.movePoints(e,[{index:a,point:Lo.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},$o=(e,t,n)=>{if(null==t||null==n)return t;const{gap:r,focus:i,elementId:o}=t,{width:a,height:s}=n,{width:l,height:c}=e;return{elementId:o,gap:Math.max(1,Math.min(Ji(e,a,s),r*(a<s?a/l:s/c))),focus:i}},Jo=e=>[Qo(e,"start"),Qo(e,"end")].filter((e=>null!=e)),Qo=(e,t)=>Ko(ea(e,t),ir.getScene(e)),ea=(e,t)=>{const n="start"===t?0:-1;return jn(Lo.getPointAtIndexGlobalCoordinates(e,n))},ta=e=>ir.getScene(e).getElements().map((t=>{if(!Me(t))return null;const n=na(t,"start",e),r=na(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),na=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Fo(e,n,t)&&$i(n,ea(e,t)),ra=(e,t,n,r)=>{const i=new Set,o=new Set,a="duplicatesServeAsOld"===r;t.forEach((e=>{const{boundElements:t}=e;if(null!=t&&t.length>0&&(t.forEach((e=>{a&&!n.has(e.id)&&i.add(e.id)})),o.add(n.get(e.id))),Me(e)){if(null!=e.startBinding){const{elementId:t}=e.startBinding;a&&!n.has(t)&&o.add(t)}if(null!=e.endBinding){const{elementId:t}=e.endBinding;a&&!n.has(t)&&o.add(t)}null==e.startBinding&&null==e.endBinding||i.add(n.get(e.id))}})),e.filter((e=>{let{id:t}=e;return i.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Yr(e,{startBinding:ia(t,n),endBinding:ia(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Yr(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},ia=(e,t)=>{var n;if(null==e)return null;const{elementId:r,focus:i,gap:o}=e;return{focus:i,gap:o,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},oa=(e,t)=>{const n=new Set(t.map((e=>e.id))),r=new Set;t.forEach((e=>{var t;Oe(e)&&(null===(t=e.boundElements)||void 0===t||t.forEach((e=>{n.has(e.id)||r.add(e.id)})))})),e.filter((e=>{let{id:t}=e;return r.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Yr(e,{startBinding:aa(t,n),endBinding:aa(r,n)})}))},aa=(e,t)=>null==e||t.has(e.elementId)?null:e,sa=e=>e>=2*Math.PI?e-2*Math.PI:e,la=(e,t,n,r)=>{const[i,a,s,l]=Ge(e),c=(i+s)/2,d=(a+l)/2;let u=5*Math.PI/2+Math.atan2(n-d,t-c);r&&(u+=o.ay/2,u-=u%o.ay),u=sa(u),Yr(e,{angle:u});const h=br(e);if(h){const t=ir.getScene(e).getElement(h);Yr(t,{angle:u})}},ca=(e,t,n,r,i)=>{const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);let[p,g]="end"===t?[u-e.x,h-e.y]:[e.x+e.points[1][0]-u,e.y+e.points[1][1]-h];n&&([p,g]=((e,t,n,r)=>{const i=$r(e,...Pe(t,n,0,0,r));return Pe(i.width,i.height,0,0,-r)})(e.type,p,g,e.angle));const[m,f]=ze("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-p)/2,(e.points[1][1]-g)/2);Yr(e,{x:m,y:f,points:[[0,0],[p,g]]})},da=(e,t,n)=>je(e)||Se(e)?{points:Ke(0,t,Ke(1,n,e.points))}:{},ua=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=lr(e.text,gn({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},ha=(e,t,n,r,i)=>{const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);let p;switch(t){case"se":p=Math.max((u-o)/(s-o),(h-a)/(l-a));break;case"nw":p=Math.max((s-u)/(s-o),(l-h)/(l-a));break;case"ne":p=Math.max((u-o)/(s-o),(l-h)/(l-a));break;case"sw":p=Math.max((s-u)/(s-o),(h-a)/(l-a))}if(p>0){const r=e.width*p,i=e.height*p,c=ua(e,r,i);if(null===c)return;const[d,u,h,g]=et(e,r,i),m=(o-d)/2,f=(a-u)/2,b=(s-h)/2,x=(l-g)/2,[v,y]=ze(((e,t)=>({n:/^(n|ne|nw)$/.test(e)||t&&/^(s|se|sw)$/.test(e),s:/^(s|se|sw)$/.test(e)||t&&/^(n|ne|nw)$/.test(e),w:/^(w|nw|sw)$/.test(e)||t&&/^(e|ne|se)$/.test(e),e:/^(e|ne|se)$/.test(e)||t&&/^(w|nw|sw)$/.test(e)}))(t,n),e.x,e.y,e.angle,m,f,b,x);Yr(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x:v,y})}},pa=(e,t,n,r,i,o,a)=>{const[s,l,c,d]=et(e,e.width,e.height),u=[s,l],h=[c,d],p=((e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2])(u,h),g=De([o,a],p,-e.angle),[m,f,b,x]=et(n,n.width,n.height),v=br(n),y=b-m,w=x-f;let k=(h[0]-u[0])/y,_=(h[1]-u[1])/w;r.includes("e")&&(k=(g[0]-u[0])/y),r.includes("s")&&(_=(g[1]-u[1])/w),r.includes("w")&&(k=(h[0]-g[0])/y),r.includes("n")&&(_=(h[1]-g[1])/w);const E=e.width,S=e.height;let C=n.width*k,j=n.height*_;if(i&&(C=2*C-E,j=2*j-S),t){const e=Math.abs(C)/E,t=Math.abs(j)/S;if(1===r.length&&(j*=e,C*=t),2===r.length){const n=Math.max(e,t);C=E*n*Math.sign(C),j=S*n*Math.sign(j)}}const[I,M,T,O]=et(e,C,j),L=T-I,A=O-M;if((L<0||A<0)&&v)return;let P=[...u];if(["n","w","nw"].includes(r)&&(P=[h[0]-Math.abs(L),h[1]-Math.abs(A)]),"ne"===r){const e=[u[0],h[1]];P=[e[0],e[1]-Math.abs(A)]}if("sw"===r){const e=[h[0],u[1]];P=[e[0]-Math.abs(L),e[1]]}t&&(["s","n"].includes(r)&&(P[0]=p[0]-L/2),["e","w"].includes(r)&&(P[1]=p[1]-A/2)),C<0&&(r.includes("e")&&(P[0]-=Math.abs(L)),r.includes("w")&&(P[0]+=Math.abs(L))),j<0&&(r.includes("s")&&(P[1]-=Math.abs(A)),r.includes("n")&&(P[1]+=Math.abs(A))),i&&(P[0]=p[0]-Math.abs(L)/2,P[1]=p[1]-Math.abs(A)/2);const D=e.angle,z=De(P,p,D),N=[P[0]+Math.abs(L)/2,P[1]+Math.abs(A)/2],R=De(N,p,D);P=De(z,R,-D);const H=da(e,C,j),B=[...P];B[0]+=e.x-I,B[1]+=e.y-M;const F=Object.assign({width:Math.abs(C),height:Math.abs(j),x:B[0],y:B[1]},H);"scale"in n&&"scale"in e&&Yr(n,{scale:[(Math.sign(k)||e.scale[0])*e.scale[0],(Math.sign(_)||e.scale[1])*e.scale[1]]});let U=0;if(v){const e=ir.getScene(n).getElement(v);U=mr(gn(e))}F.width>U&&0!==F.height&&Number.isFinite(F.x)&&Number.isFinite(F.y)&&(Yo(n,{newSize:{width:F.width,height:F.height}}),Yr(n,F),sr([n],r))},ga=(e,t,n,r)=>{const[i,o,a,s]=Qe(e);let l,c;switch(t){case"se":l=Math.max((n-i)/(a-i),(r-o)/(s-o)),c=(e,t,n)=>{let[r,a]=t,[s,c]=n;return{x:e.x+(r-i)*(l-1)+r-s,y:e.y+(a-o)*(l-1)+a-c}};break;case"nw":l=Math.max((a-n)/(a-i),(s-r)/(s-o)),c=(e,t,n)=>{let[,,r,i]=t,[,,o,c]=n;return{x:e.x-(a-r)*(l-1)+r-o,y:e.y-(s-i)*(l-1)+i-c}};break;case"ne":l=Math.max((n-i)/(a-i),(s-r)/(s-o)),c=(e,t,n)=>{let[r,,,o]=t,[a,,,c]=n;return{x:e.x+(r-i)*(l-1)+r-a,y:e.y-(s-o)*(l-1)+o-c}};break;case"sw":l=Math.max((a-n)/(a-i),(r-o)/(s-o)),c=(e,t,n)=>{let[,r,i]=t,[,s,c]=n;return{x:e.x-(a-i)*(l-1)+i-c,y:e.y+(r-o)*(l-1)+r-s}}}if(l>0){const t=e.reduce(((t,n)=>{if(!t)return t;const r=n.width*l,i=n.height*l;let o={};if(Ee(n)){const e=ua(n,r,i);if(null===e)return null;o={fontSize:e.size,baseline:e.baseline}}const a=Ge(n),s=da(n,r,i);Yo(n,{newSize:{width:r,height:i},simultaneouslyUpdated:e});const d=et(Object.assign(Object.assign({},n),s),r,i),{x:u,y:h}=c(n,a,d);return[...t,Object.assign(Object.assign({width:r,height:i,x:u,y:h},s),o)]}),[]);t&&e.forEach(((e,n)=>{Yr(e,t[n])}))}},ma=(e,t,n,r,i,a,s)=>{let l=5*Math.PI/2+Math.atan2(r-s,n-a);i&&(l+=o.ay/2,l-=l%o.ay),t.forEach(((t,n)=>{var r,i;const[o,c,d,u]=Ge(t),h=(o+d)/2,p=(c+u)/2,g=null!==(r=null===(i=e.originalElements.get(t.id))||void 0===i?void 0:i.angle)&&void 0!==r?r:t.angle,[m,f]=Pe(h,p,a,s,l+g-t.angle);Yr(t,{x:t.x+(m-h),y:t.y+(f-p),angle:sa(l+g)});const b=br(t);if(b){const e=ir.getScene(t).getElement(b);Yr(e,{x:e.x+(m-h),y:e.y+(f-p),angle:sa(l+g)})}}))},fa=(e,t,n,r,i,o)=>{let a,s;if(e){const l=e&&t<n,c=e&&t>n,d=r.originalElements.get(i.id);a=l&&d?d.x:i.x+o.x,s=c&&d?d.y:i.y+o.y}else a=i.x+o.x,s=i.y+o.y;Yr(i,{x:a,y:s})},ba=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=$r(t,a,o<r?-s:s)),s<0&&(s=-s)));let u=i<n?n-a:n,h=o<r?r-s:r;c&&(u=n-(a+=a)/2,h=r-(s+=s)/2),0!==a&&0!==s&&Yr(e,{x:u,y:h,width:a,height:s})},xa=e=>e.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n"),va=(e,t,n,r,i)=>{const{zoom:o,offsetTop:a,offsetLeft:s}=r,l=180*n/Math.PI;let c=(e-2*s)*(o.value-1)/2;const d=(t-2*a)*(o.value-1)/2;return e>i&&1!==o.value&&(c=i/2*(o.value-1)),"translate(".concat(c,"px, ").concat(d,"px) scale(").concat(o.value,") rotate(").concat(l,"deg)")},ya=e=>{let{id:t,appState:n,onChange:r,onSubmit:i,getViewportCoords:a,getSceneCoords:s,element:l,canvas:c,excalidrawContainer:d}=e;let u,h=Ee(l)?dr(gn(l)):0;const p=()=>{var e;const r=null===(e=ir.getScene(l))||void 0===e?void 0:e.getElement(t);if(r&&Ee(r)){let e=r.x,t=r.y,s=null!=r&&r.containerId?ir.getScene(r).getElement(r.containerId):null,l=r.width,c=r.height,p=r.width,m=r.height;if(s&&r.containerId){const n=((e,t)=>{const n=t.style.fontFamily.replaceAll('"',"");return pn({fontFamily:e.fontFamily})!==n||"".concat(e.fontSize,"px")!==t.style.fontSize})(r,g);if(n){var i;const e=null===(i=ir.getScene(r))||void 0===i?void 0:i.getElement(r.containerId);if(h=Ee(r)?dr(gn(r)):0,r.height>e.height-2*o.tr){const e=r.height+2*o.tr;u=e,Yr(s,{height:e}),s=Object.assign(Object.assign({},s),{height:e})}g.style.height="".concat(r.height,"px")}if(u||(u=s.height),l=s.width-2*o.tr,c=s.height-2*o.tr,p=l,m=Math.min(m,c),e=s.x+o.tr,g.clientHeight>c){const e=Math.min(g.clientHeight-c,h);return void Yr(s,{height:s.height+e})}if(s.height>u&&g.clientHeight<c){const e=Math.min(c-g.clientHeight,h);Yr(s,{height:s.height-e})}else{(g.clientHeight/h>2||n)&&(t=s.y+s.height/2-g.clientHeight/2)}}const[f,b]=a(e,t),{textAlign:x,angle:v}=r;g.value=r.originalText||r.text;const y=r.originalText.split("\n"),w=r.containerId?h:r.height/y.length;s||(l=(n.offsetLeft+n.width-f-8)/n.zoom.value-Number(getComputedStyle(null==d?void 0:d.parentNode).marginRight.slice(0,-2)));const k=(n.offsetTop+n.height-b)/n.zoom.value;Object.assign(g.style,{font:gn(r),lineHeight:"".concat(w,"px"),width:"".concat(p,"px"),height:"".concat(Math.max(g.clientHeight,r.height),"px"),left:"".concat(f,"px"),top:"".concat(b,"px"),transform:va(p,m,v,n,l),textAlign:x,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(l,"px"),maxHeight:"".concat(k,"px")})}},g=document.createElement("textarea");g.dir="auto",g.tabIndex=0,g.dataset.type="wysiwyg",g.wrap="off",g.classList.add("excalidraw-wysiwyg");let m="pre",f="normal";Ae(l)&&(m="pre-wrap",f="break-word"),Object.assign(g.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:f,whiteSpace:m,overflowWrap:"break-word"}),p(),r&&(g.oninput=()=>{Ae(l)&&(g.style.height="auto",g.style.height="".concat(g.scrollHeight,"px")),r(xa(g.value))}),g.onkeydown=e=>{if(e.stopPropagation(),e.key===Ht)e.preventDefault(),_=!0,E();else if(e.key===Rt&&e[zt]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;_=!0,E()}else(e.key===Ut||e[zt]&&(e.code===mt||e.code===gt))&&(e.preventDefault(),e.shiftKey||e.code===mt?y():v(),g.dispatchEvent(new Event("input")))};const b=" ".repeat(4),x=new RegExp("^ {1,".concat(4,"}")),v=()=>{const{selectionStart:e,selectionEnd:t}=g,n=w();let r=g.value;n.forEach((e=>{const t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(b).concat(n)})),g.value=r,g.selectionStart=e+4,g.selectionEnd=t+4*n.length},y=()=>{const{selectionStart:e,selectionEnd:t}=g,n=w(),r=[];let i=g.value;n.forEach((e=>{const t=i.slice(e,e+4).match(x);if(t){const n=i.slice(0,e),o=i.slice(e+t[0].length);i="".concat(n).concat(o),r.push(e)}})),g.value=i,r.length&&(e>r[r.length-1]?g.selectionStart=Math.max(e-4,r[r.length-1]):g.selectionStart=e,g.selectionEnd=Math.max(g.selectionStart,t-4*r.length))},w=()=>{let{selectionStart:e,selectionEnd:t,value:n}=g;const r=n.slice(0,e).match(/[^\n]*$/)[0].length;e-=r;return n.slice(e,t).split("\n").reduce(((t,n,r,i)=>t.concat(r?t[r-1]+i[r-1].length+1:e)),[]).reverse()},k=e=>{e.preventDefault(),e.stopPropagation()};let _=!1;const E=()=>{var e;S();const t=null===(e=ir.getScene(l))||void 0===e?void 0:e.getElement(l.id);if(!t)return;let n="",r=null;if(Ee(t)&&null!=t&&t.containerId){if(r=ir.getScene(t).getElement(t.containerId),r){n=pr(g.value,gn(t),r.width);const[e,i]=s(Number(g.style.left.slice(0,-2)),Number(g.style.top.slice(0,-2)));if(Ee(t)&&t.containerId)if(g.value){Yr(t,{y:i,height:Number(g.style.height.slice(0,-2)),width:Number(g.style.width.slice(0,-2)),x:e});const n=br(r);n&&n===l.id||Yr(r,{boundElements:(r.boundElements||[]).concat({type:"text",id:l.id})})}else{var o;Yr(r,{boundElements:null===(o=r.boundElements)||void 0===o?void 0:o.filter((e=>"text"!==e.type))})}}}else n=g.value;i({text:xa(n),viaKeyboard:_,originalText:g.value}),r&&sr([r],!1)},S=()=>{M||(M=!0,g.onblur=null,g.oninput=null,g.onkeydown=null,T&&T.disconnect(),window.removeEventListener("resize",p),window.removeEventListener("wheel",k,!0),window.removeEventListener("pointerdown",j),window.removeEventListener("pointerup",C),window.removeEventListener("blur",E),I(),g.remove())},C=e=>{window.removeEventListener("pointerup",C);const t=null==e?void 0:e.target,n=t instanceof HTMLInputElement&&t.closest(".color-picker-input")&&hn(t);setTimeout((()=>{g.onblur=E,t&&n&&(t.onblur=()=>{g.focus()}),n||g.focus()}))},j=e=>{const t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&hn(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(o.$C.SHAPE_ACTIONS_MENU))&&!hn(e.target)||t)&&(g.onblur=null,window.addEventListener("pointerup",C),window.addEventListener("blur",E))},I=ir.getScene(l).addCallback((()=>{var e;p();!(null===(e=document.activeElement)||void 0===e||!e.closest(".color-picker-input"))||g.focus()}));let M=!1;g.select(),C();let T=null;c&&"ResizeObserver"in window?(T=new window.ResizeObserver((()=>{p()})),T.observe(c)):window.addEventListener("resize",p),window.addEventListener("pointerdown",j),window.addEventListener("wheel",k,{passive:!1,capture:!0}),null==d||d.querySelector(".excalidraw-textEditorContainer").appendChild(g)},wa=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Ta(t,e).length||"selection"!==e.elementType)),ka=e=>e.reduce(((e,t)=>e+t.version),0),_a=e=>e.filter((e=>!e.isDeleted)),Ea=e=>!e.isDeleted,Sa=e=>_a(e).map((e=>Ie(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Ca=e=>Sa(e),ja=e=>Sa(e),Ia=(e,t,n)=>{const[r,i]=[e.horizontal,e.vertical].map((e=>null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height));return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},Ma=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),Ta=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((e=>t.selectedElementIds[e.id]||n&&Ae(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null))},Oa=(e,t)=>t.editingElement?[t.editingElement]:Ta(e,t),La=e=>{let{scenePoint:t,viewportDimensions:n,zoom:r}=e;return{scrollX:n.width/2*(1/r.value)-t.x-r.translation.x*(1/r.value),scrollY:n.height/2*(1/r.value)-t.y-r.translation.y*(1/r.value)}},Aa=(e,t,n)=>{if(!(e=(e=>e.filter((e=>!e.isDeleted&&!Xr(e))))(e)).length)return{scrollX:0,scrollY:0};let[r,i,o,a]=Qe(e);((e,t,n)=>{const[r,i,o,a]=n,{x:s,y:l}=_n({sceneX:r,sceneY:i},e),{x:c,y:d}=_n({sceneX:o,sceneY:a},e);return c-s>e.width||d-l>e.height})(t,0,[r,i,o,a])&&([r,i,o,a]=((e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0];return e.forEach((e=>{const[i,o,a,s]=Je(e),l=Ne((i+a)/2,(o+s)/2,t.x,t.y);l<n&&(n=l,r=e)})),Je(r)})(e,kn({clientX:t.scrollX,clientY:t.scrollY},t)));return La({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},Pa=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e,Da=e=>"image"!==e,za=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Na=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Ra=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Ha=e=>"text"===e,Ba=e=>"arrow"===e,Fa=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){const i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},Ua=(e,t,n,r)=>{let i=null;for(let o=e.length-1;o>=0;--o){if(e[o].isDeleted)continue;const[a,s,l,c]=Ge(e[o]);if(a<t&&t<l&&s<n&&n<c&&e[o].type!==r){i=e[o];break}}return i},Va=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:e,translation:{x:r.x-n.left-(r.x-n.left-t.translation.x)*(e/t.value),y:r.y-n.top-(r.y-n.top-t.translation.y)*(e/t.value)}}},Wa=e=>{const t=parseFloat(e.toFixed(2));return Math.max(.1,Math.min(t,30))};n(5422);class Ka extends Error{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";super(),this.name=t,this.message=e}}class Ga extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}n(371);const Ya=e=>{let{size:t="1em",circleWidth:n=8}=e;return(0,x.jsx)("div",{className:"Spinner",children:(0,x.jsx)("svg",{viewBox:"0 0 100 100",style:{width:t,height:t},children:(0,x.jsx)("circle",{cx:"50",cy:"50",r:50-n/2,strokeWidth:n,fill:"none",strokeMiterlimit:"10"})})})},Za=i().forwardRef(((e,t)=>{const{id:n}=Zh(),o=i().useRef(null);i().useImperativeHandle(t,(()=>o.current));const a="ToolIcon_size_".concat(e.size),[s,l]=(0,r.useState)(!1),c=(0,r.useRef)(!0),d=async t=>{var n;const r="onClick"in e&&(null===(n=e.onClick)||void 0===n?void 0:n.call(e,t));if(r&&"then"in r)try{l(!0),await r}catch(e){if(!(e instanceof Ga))throw e;console.warn(e)}finally{c.current&&l(!1)}};(0,r.useEffect)((()=>()=>{c.current=!1}),[]);const u=(0,r.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){const t="icon"===e.type?"button":e.type;return(0,x.jsxs)("button",{className:ye("ToolIcon_type_button",a,e.className,e.visible&&!e.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!e.hidden,"ToolIcon--selected":e.selected,"ToolIcon--plain":"icon"===e.type}),"data-testid":e["data-testid"],hidden:e.hidden,title:e.title,"aria-label":e["aria-label"],type:t,onClick:d,ref:o,disabled:s||e.isLoading,children:[(e.icon||e.label)&&(0,x.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,x.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,x.jsx)(Ya,{})]}),e.showAriaLabel&&(0,x.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,x.jsx)(Ya,{})]}),e.children]})}return(0,x.jsxs)("label",{className:ye("ToolIcon",e.className),title:e.title,onPointerDown:e=>{u.current=e.pointerType||null},onPointerUp:()=>{requestAnimationFrame((()=>{u.current=null}))},children:[(0,x.jsx)("input",{className:"ToolIcon_type_radio ".concat(a),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:"".concat(n,"-").concat(e.id),onChange:()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:u.current})},checked:e.checked,ref:o}),(0,x.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,x.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));Za.defaultProps={visible:!0,className:"",size:"medium"};const qa=e=>e===o.C6.LIGHT?rt.orange[4]:rt.orange[9],Xa=e=>e===o.C6.LIGHT?rt.white:"#1e1e1e",$a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;const{width:n=512,height:r=n,mirror:i,style:o}="number"==typeof t?{width:t}:t;return(0,x.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(n," ").concat(r),className:ye({"rtl-mirror":i}),style:o,children:"string"==typeof e?(0,x.jsx)("path",{fill:"currentColor",d:e}):e})},Ja=$a((0,x.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Qa=$a("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",{mirror:!0}),es=$a("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}),ts=$a("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}),ns=$a("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),rs=$a("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}),is=$a("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),os=$a("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"),as=$a("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),ss=$a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"}),(0,x.jsx)("path",{d:"M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"})]}),{width:576,height:512,mirror:!0}),ls=$a("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}),cs=$a("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}),ds=$a("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}),us=$a("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"),hs=$a("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"),ps=$a("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",{mirror:!0}),gs=$a("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",{mirror:!0}),ms=$a("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}),fs=($a("M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",{width:24,height:24}),$a("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}),$a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{stroke:"currentColor",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,x.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}),$a((0,x.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}),i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),bs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),xs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),vs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),ys=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),ws=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),ks=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),_s=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Es=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Ss=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Cs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M 2,12 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),js=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M 12,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),Is=$a("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",{width:640,height:512,mirror:!0}),Ms=($a("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"),$a("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"),$a("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",{width:352,height:512})),Ts=$a("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),Os=$a("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}),Ls=($a("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}),$a("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})),As=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,x.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,x.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsxs)("g",{fill:Xa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,x.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ps=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,x.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,x.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsxs)("g",{fill:Xa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,x.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ds=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),zs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,x.jsx)("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),(0,x.jsx)("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})]}),{width:40,height:20})})),Ns=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),Rs=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return $a((0,x.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),Hs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Bs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Fs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H36",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Us=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Vs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ws=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ks=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Gs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ys=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),Zs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,x.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,x.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),qs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,x.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,x.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),Xs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,x.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),$s=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,x.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,x.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),Js=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),{width:47,height:77})})),Qs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"}),{width:77,height:75})})),el=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"}),{width:45,height:75})})),tl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"}),{width:120,height:75})})),nl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"}),{width:448,height:512})})),rl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"}),(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"})]}),{width:70,height:78})})),il=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)(x.Fragment,{children:(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),{width:640,height:512})})),ol=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),al=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z",fill:"var(--icon-fill-color)"}),{width:448,height:512})})),sl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),ll=$a((0,x.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});let cl=[];const dl=e=>(cl=cl.concat(e),e),ul=(e,t)=>{if(e.editingGroupId){const n=oi(_a(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},hl=dl({name:"deleteSelectedElements",perform:(e,t)=>{if(t.editingLinearElement){const{elementId:n,selectedPointsIndices:r,startBindingElement:i,endBindingElement:o}=t.editingLinearElement,a=Lo.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=ul(t,n);return{elements:n,appState:Object.assign(Object.assign({},r),{editingLinearElement:null}),commitToHistory:!1}}const s={startBindingElement:null!=r&&r.includes(0)?null:i,endBindingElement:null!=r&&r.includes(a.points.length-1)?null:o};return Lo.deletePoints(a,r),{elements:e,appState:Object.assign(Object.assign({},t),{editingLinearElement:Object.assign(Object.assign(Object.assign({},t.editingLinearElement),s),{selectedPointsIndices:(null==r?void 0:r[0])>0?[r[0]-1]:[0]})}),commitToHistory:!0}}let{elements:n,appState:r}=((e,t)=>({elements:e.map((e=>t.selectedElementIds[e.id]||Ae(e)&&t.selectedElementIds[e.containerId]?Zr(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return oa(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=ul(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{elementType:"selection",multiElement:null}),commitToHistory:Ma(_a(e),t)}},contextItemLabel:"labels.delete",keyTest:e=>e.key===Pt||e.key===Nt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",icon:is,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Ma(_a(t),n)})}}),pl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=Ln(Ta(e,t,!0));for(;++o<e.length;)a.get(e[o].id)?(r.length&&(n=n.concat(r),r=[]),n.push(o),i=o+1):e[o].isDeleted&&i===o?(i=o+1,r.push(o)):r=[];return n},gl=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=ir.getScene(e).getElement(e.containerId);if(n)return t.indexOf(n)}}else{var r,i;const o=null===(r=e.boundElements)||void 0===r||null===(i=r.find((e=>"arrow"!==e.type)))||void 0===i?void 0:i.id;if(o){if("left"===n)return t.indexOf(e);const r=ir.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},ml=(e,t,n,r)=>{const i=t[n],o=t=>!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId)),a="left"===r?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,o,Math.max(0,n-1)):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,o,n+1),s=t[a];if(!s)return-1;if(e.editingGroupId){var l;if((null==i?void 0:i.groupIds.join(""))===(null==s?void 0:s.groupIds.join("")))return null!==(l=gl(s,t,r))&&void 0!==l?l:a;if(null==s||!s.groupIds.includes(e.editingGroupId))return-1}var c;if(!s.groupIds.length)return null!==(c=gl(s,t,r))&&void 0!==c?c:a;const d=e.editingGroupId?s.groupIds[s.groupIds.indexOf(e.editingGroupId)-1]:s.groupIds[s.groupIds.length-1],u=oi(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},fl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),bl=(e,t,n)=>{const r=pl(t,e),i=fl(t,r);let o=(e=>{let t=0;return e.reduce(((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n)),[])})(r);return"right"===n&&(o=o.reverse()),o.forEach(((r,i)=>{const o=r[0],a=r[r.length-1],s="left"===n?o:a,l=ml(e,t,s,n);if(-1===l||s===l)return;const c="left"===n?t.slice(0,l):t.slice(0,o),d=t.slice(o,a+1),u="left"===n?t.slice(l,o):t.slice(a+1,l+1),h="left"===n?t.slice(a+1):t.slice(l+1);t="left"===n?[...c,...d,...u,...h]:[...c,...u,...d,...h]})),t.map((e=>i[e.id]?qr(e):e))},xl=(e,t,n)=>{const r=pl(e,t),i=fl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=oi(e,t.editingGroupId);if(!n.length)return e;a=e.indexOf(n[0])}else a=0;s=r[r.length-1]}else{if(t.editingGroupId){const n=oi(e,t.editingGroupId);if(!n.length)return e;s=e.indexOf(n[n.length-1])}else s=e.length-1;a=r[0]}for(let t=a;t<s+1;t++)r.includes(t)||o.push(e[t]);const l=Object.values(i).map((e=>qr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},vl=(e,t)=>bl(t,e,"left"),yl=(e,t)=>bl(t,e,"right"),wl=(e,t)=>xl(e,t,"left"),kl=(e,t)=>xl(e,t,"right"),_l=dl({name:"sendBackward",perform:(e,t)=>({elements:vl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:e=>e[zt]&&!e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendBackward")," — ").concat(wn("CtrlOrCmd+[")),children:(0,x.jsx)(bs,{theme:n.theme})})}}),El=dl({name:"bringForward",perform:(e,t)=>({elements:yl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:e=>e[zt]&&!e.shiftKey&&e.code===gt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.bringForward")," — ").concat(wn("CtrlOrCmd+]")),children:(0,x.jsx)(fs,{theme:n.theme})})}}),Sl=dl({name:"sendToBack",perform:(e,t)=>({elements:wl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendToBack",keyTest:e=>st?e[zt]&&e.altKey&&e.code===mt:e[zt]&&e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendToBack")," — ").concat(wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,x.jsx)(vs,{theme:n.theme})})}}),Cl=dl({name:"bringToFront",perform:(e,t)=>({elements:kl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringToFront",keyTest:e=>st?e[zt]&&e.altKey&&e.code===gt:e[zt]&&e.shiftKey&&e.code===gt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:e=>t(null),title:"".concat(b("labels.bringToFront")," — ").concat(wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,x.jsx)(xs,{theme:n.theme})})}}),jl=dl({name:"selectAll",perform:(e,t)=>!t.editingLinearElement&&{appState:ri(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ee(t)&&t.containerId||(e[t.id]=!0),e)),{})}),_a(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[zt]&&e.key===Vt}),Il=dl({name:"duplicateSelection",perform:(e,t)=>{if(t.editingLinearElement){const n=Lo.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},Ml(e,t)),{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:e=>e[zt]&&e.key===Wt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",icon:Os,title:"".concat(b("labels.duplicateSelection")," — ").concat(wn("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Ma(_a(t),n)})}}),Ml=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=mi(t.editingGroupId,n,e,{x:e.x+o.k/2,y:e.y+o.k/2});return a.set(e.id,s.id),i.push(e),r.push(s),s},l=[];let c=0;const d=Ln(Ta(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=ti(t,n);if(r){const t=oi(e,r);l.push(...t,...t.map((e=>s(e)))),c+=t.length;continue}}l.push(n,s(n))}else l.push(n);c++}return ar(l,i,a),ra(l,i,a),{elements:l,appState:ri(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(Ae(t)||(e[t.id]=!0),e)),{})}),_a(l))}},Tl=e=>{let{options:t,value:n,onChange:r,group:i}=e;return(0,x.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((e=>(0,x.jsxs)("label",{className:ye({active:n===e.value}),title:e.text,children:[(0,x.jsx)("input",{type:"radio",name:i,onChange:()=>r(e.value),checked:n===e.value}),e.icon]},e.text)))})};n(4301);const Ol=e=>{let{children:t,left:n,top:i,onCloseRequest:o,fitInViewport:a=!1}=e;const s=(0,r.useRef)(null);return(0,r.useLayoutEffect)((()=>{if(a&&s.current){const e=s.current,{x:t,y:n,width:r,height:i}=e.getBoundingClientRect(),o=window.innerWidth;t+r>o&&(e.style.left="".concat(o-r,"px"));const a=window.innerHeight;n+i>a&&(e.style.top="".concat(a-i,"px"))}}),[a]),(0,r.useEffect)((()=>{if(o){const e=e=>{var t;null!==(t=s.current)&&void 0!==t&&t.contains(e.target)||(0,at.unstable_batchedUpdates)((()=>o(e)))};return document.addEventListener("pointerdown",e,!1),()=>document.removeEventListener("pointerdown",e,!1)}}),[o]),(0,x.jsx)("div",{className:"popover",style:{top:i,left:n},ref:s,children:t})};n(4220);const Ll=e=>{const t=(new Option).style;return t.color=e,!!t.color},Al=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Pl=e=>{let{colors:t,color:n,onChange:r,onClose:o,label:a,showInput:s=!0,type:l}=e;const c=i().useRef(),d=i().useRef(),u=i().useRef(),h=i().useRef();i().useEffect((()=>{d.current?d.current.focus():h.current?h.current.focus():u.current&&u.current.focus()}),[]);return(0,x.jsxs)("div",{className:"color-picker color-picker-type-".concat(l),role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),onKeyDown:e=>{if(e.key===Ut){const{activeElement:r}=document;var t;if(e.shiftKey){if(r===c.current)null===(t=h.current)||void 0===t||t.focus(),e.preventDefault()}else if(r===h.current){var n;null===(n=c.current)||void 0===n||n.focus(),e.preventDefault()}}else if(on(e.key)){const{activeElement:t}=document,n=m().rtl,r=Array.prototype.indexOf.call(u.current.children,t);if(-1!==r){const t=u.current.children.length-(s?1:0),i=e.key===(n?Ot:Lt)?(r+1)%t:e.key===(n?Lt:Ot)?(t+r-1)%t:e.key===Tt?(r+5)%t:e.key===At?(t+r-5)%t:r;u.current.children[i].focus()}e.preventDefault()}else if(Al.includes(e.key.toLowerCase())&&!hn(e.target)){const t=Al.indexOf(e.key.toLowerCase());u.current.children[t].focus(),e.preventDefault()}else e.key!==Ht&&e.key!==Rt||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,x.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,x.jsx)("div",{className:"color-picker-triangle"}),(0,x.jsxs)("div",{className:"color-picker-content",ref:e=>{e&&(u.current=e)},tabIndex:0,children:[t.map(((e,t)=>{const i=e.replace("#","");return(0,x.jsxs)("button",{className:"color-picker-swatch",onClick:t=>{t.currentTarget.focus(),r(e)},title:"".concat(b("colors.".concat(i))).concat(Mn(e)?"":" (".concat(e,")")," — ").concat(Al[t].toUpperCase()),"aria-label":b("colors.".concat(i)),"aria-keyshortcuts":Al[t],style:{color:e},ref:r=>{r&&0===t&&(c.current=r),r&&e===n&&(d.current=r)},onFocus:()=>{r(e)},children:[Mn(e)?(0,x.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,x.jsx)("span",{className:"color-picker-keybinding",children:Al[t]})]},e)})),s&&(0,x.jsx)(Dl,{color:n,label:a,onChange:e=>{r(e)},ref:h})]})]})},Dl=i().forwardRef(((e,t)=>{let{color:n,onChange:r,label:o}=e;const[a,s]=i().useState(n),l=i().useRef(null);i().useEffect((()=>{s(n)}),[n]),i().useImperativeHandle(t,(()=>l.current));const c=i().useCallback((e=>{const t=e.toLowerCase(),n=(e=>Mn(e)||Ll(e)?e:Ll("#".concat(e))?"#".concat(e):null)(t);n&&r(n),s(t)}),[r]);return(0,x.jsxs)("label",{className:"color-input-container",children:[(0,x.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,x.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:e=>c(e.target.value),value:(a||"").replace(/^#/,""),onBlur:()=>s(n),ref:l})]})})),zl=e=>{let{type:t,color:n,onChange:r,label:o,isActive:a,setActive:s}=e;const l=i().useRef(null);return(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"color-picker-control-container",children:[(0,x.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:()=>s(!a),ref:l}),(0,x.jsx)(Dl,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,x.jsx)(i().Suspense,{fallback:"",children:a?(0,x.jsx)(Ol,{onCloseRequest:e=>e.target!==l.current&&s(!1),children:(0,x.jsx)(Pl,{colors:ot[t],color:n||null,onChange:e=>{r(e)},onClose:()=>{var e;s(!1),null===(e=l.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})}):null})]})};n(7117);function Nl(e){let{options:t,value:n,label:r,onChange:o,onClose:a}=e;const s=i().useRef(),l=i().useRef(),c=i().useRef(null);i().useEffect((()=>{l.current?l.current.focus():c.current&&c.current.focus()}),[]);return(0,x.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:e=>{const n=t.find((t=>t.keyBinding===e.key.toLowerCase()));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===Ut)setTimeout((()=>{l.current!==document.activeElement&&a()}),0);else if(on(e.key)){const{activeElement:n}=document,r=m().rtl,i=Array.prototype.indexOf.call(c.current.children,n);if(-1!==i){const n=t.length;let o=i;switch(e.key){case r?Ot:Lt:case Tt:o=(i+1)%n;break;case r?Lt:Ot:case At:o=(n+i-1)%n}c.current.children[o].focus()}e.preventDefault()}else e.key!==Ht&&e.key!==Rt||(e.preventDefault(),a());else{const r=t.indexOf(n);c.current.children[r].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,x.jsx)("div",{className:"picker-content",ref:c,children:t.map(((e,t)=>(0,x.jsxs)("button",{className:"picker-option",onClick:t=>{t.currentTarget.focus(),o(e.value)},title:"".concat(e.text," — ").concat(e.keyBinding.toUpperCase()),"aria-label":e.text||"none","aria-keyshortcuts":e.keyBinding,ref:r=>{r&&0===t&&(s.current=r),r&&e.value===n&&(l.current=r)},onFocus:()=>{o(e.value)},children:[e.icon,(0,x.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)))})})}function Rl(e){var t;let{value:n,label:r,options:o,onChange:a,group:s=""}=e;const[l,c]=i().useState(!1),d=i().useRef(null),u=m().rtl;return(0,x.jsxs)("label",{className:"picker-container",children:[(0,x.jsx)("button",{name:s,className:l?"active":"","aria-label":r,onClick:()=>c(!l),ref:d,children:null===(t=o.find((e=>e.value===n)))||void 0===t?void 0:t.icon}),(0,x.jsx)(i().Suspense,{fallback:"",children:l?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ol,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,x.jsx)(Nl,{options:o,value:n,label:r,onChange:a,onClose:()=>{var e;c(!1),null===(e=d.current)||void 0===e||e.focus()}})})),(0,x.jsx)("div",{className:"picker-triangle"})]}):null})]})}const Hl=(e,t,n)=>e.map((e=>{var r;return t.selectedElementIds[e.id]||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e})),Bl=function(e,t,n,r){var i,o;const a=t.editingElement,s=_a(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Ma(s,t)?((e,t,n)=>{const r=Array.from(new Set(Ta(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null})(s,t,n):r)&&void 0!==i?i:null},Fl=(dl({name:"changeStrokeColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Hl(e,t,(e=>Da(e.type)?Zr(e,{strokeColor:n.currentItemStrokeColor}):e))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemStrokeColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{"aria-hidden":"true",children:b("labels.stroke")}),(0,x.jsx)(zl,{type:"elementStroke",label:b("labels.stroke"),color:Bl(t,n,(e=>e.strokeColor),n.currentItemStrokeColor),onChange:e=>r({currentItemStrokeColor:e}),isActive:"strokeColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"strokeColorPicker":null})})]})}}),dl({name:"changeBackgroundColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Hl(e,t,(e=>Zr(e,{backgroundColor:n.currentItemBackgroundColor})))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemBackgroundColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{"aria-hidden":"true",children:b("labels.background")}),(0,x.jsx)(zl,{type:"elementBackground",label:b("labels.background"),color:Bl(t,n,(e=>e.backgroundColor),n.currentItemBackgroundColor),onChange:e=>r({currentItemBackgroundColor:e}),isActive:"backgroundColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"backgroundColorPicker":null})})]})}}),dl({name:"changeFillStyle",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{fillStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemFillStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fill")}),(0,x.jsx)(Tl,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,x.jsx)(Ds,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,x.jsx)(zs,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,x.jsx)(Ns,{theme:n.theme})}],group:"fill",value:Bl(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),dl({name:"changeStrokeWidth",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{strokeWidth:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeWidth:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.strokeWidth")}),(0,x.jsx)(Tl,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:10})}],value:Bl(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),dl({name:"changeSloppiness",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{seed:Kr(),roughness:n}))),appState:Object.assign(Object.assign({},t),{currentItemRoughness:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.sloppiness")}),(0,x.jsx)(Tl,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,x.jsx)(Us,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,x.jsx)(Vs,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,x.jsx)(Ws,{theme:n.theme})}],value:Bl(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),dl({name:"changeStrokeStyle",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{strokeStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.strokeStyle")}),(0,x.jsx)(Tl,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,x.jsx)(Hs,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,x.jsx)(Bs,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,x.jsx)(Fs,{theme:n.theme})}],value:Bl(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),dl({name:"changeOpacity",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{opacity:n}))),appState:Object.assign(Object.assign({},t),{currentItemOpacity:n}),commitToHistory:!0}),PanelComponent:e=>{var t;let{elements:n,appState:r,updateData:i}=e;return(0,x.jsxs)("label",{className:"control-label",children:[b("labels.opacity"),(0,x.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:e=>i(+e.target.value),onWheel:e=>{e.stopPropagation();const t=+e.target.value;e.deltaY<0&&t<100?i(t+10):e.deltaY>0&&t>0&&i(t-10)},value:null!==(t=Bl(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),dl({name:"changeFontSize",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{fontSize:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemFontSize:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fontSize")}),(0,x.jsx)(Tl,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,x.jsx)(Js,{theme:n.theme})},{value:20,text:b("labels.medium"),icon:(0,x.jsx)(Qs,{theme:n.theme})},{value:28,text:b("labels.large"),icon:(0,x.jsx)(el,{theme:n.theme})},{value:36,text:b("labels.veryLarge"),icon:(0,x.jsx)(tl,{theme:n.theme})}],value:Bl(t,n,(e=>Ee(e)&&e.fontSize),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),dl({name:"changeFontFamily",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{fontFamily:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemFontFamily:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=[{value:o.ut.Virgil,text:b("labels.handDrawn"),icon:(0,x.jsx)(nl,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,x.jsx)(rl,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,x.jsx)(il,{theme:n.theme})}];return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fontFamily")}),(0,x.jsx)(Tl,{group:"font-family",options:i,value:Bl(t,n,(e=>Ee(e)&&e.fontFamily),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),dl({name:"changeTextAlign",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{textAlign:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemTextAlign:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.textAlign")}),(0,x.jsx)(Tl,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,x.jsx)(ol,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,x.jsx)(al,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,x.jsx)(sl,{theme:n.theme})}],value:Bl(t,n,(e=>Ee(e)&&e.textAlign),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),dl({name:"changeSharpness",perform:(e,t,n)=>{const r=Oa(_a(e),t),i=r.length?r.every((e=>!je(e))):!Ie(t.elementType),o=r.length?r.every(je):Ie(t.elementType);return{elements:Hl(e,t,(e=>Zr(e,{strokeSharpness:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeSharpness:i?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:o?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.edges")}),(0,x.jsx)(Tl,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,x.jsx)(Ks,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,x.jsx)(Gs,{theme:n.theme})}],value:Bl(t,n,(e=>e.strokeSharpness),Ra(n.elementType)&&(Ie(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),dl({name:"changeArrowhead",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(je(e)){const{position:t,type:r}=n;if("start"===t){return Zr(e,{startArrowhead:r})}if("end"===t){return Zr(e,{endArrowhead:r})}}return e})),appState:Object.assign(Object.assign({},t),{["start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=m().rtl;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.arrowheads")}),(0,x.jsxs)("div",{className:"iconSelectList",children:[(0,x.jsx)(Rl,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,x.jsx)(Ys,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,x.jsx)(Zs,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,x.jsx)(Xs,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,x.jsx)(qs,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,x.jsx)($s,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:Bl(t,n,(e=>je(e)&&Ba(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,x.jsx)(Rl,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,x.jsx)(Ys,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,x.jsx)(Zs,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,x.jsx)(Xs,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,x.jsx)(qs,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,x.jsx)($s,{theme:n.theme,flip:i}),keyBinding:"t"}],value:Bl(t,n,(e=>je(e)&&Ba(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}}),e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,x.jsx)(Za,{type:"icon",icon:e.value===o.C6.LIGHT?Ul.MOON:Ul.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===o.C6.DARK?o.C6.LIGHT:o.C6.DARK),"data-testid":"toggle-dark-mode"})}),Ul={SUN:(0,x.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,x.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,x.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,x.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"})})};n(6781);const Vl=()=>{const e=document.querySelector(".excalidraw-tooltip");if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},Wl=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>Vl().classList.remove("excalidraw-tooltip--visible")),[]),(0,x.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:e=>((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;const{x:i,bottom:o,top:a,width:s}=e.getBoundingClientRect(),{width:l,height:c}=t.getBoundingClientRect(),d=window.innerWidth,u=i+s/2-l/2,h=u+l>=d?u+l-d:0,p=o+5,g=p+c>=window.innerHeight?o-a+c+10:0;Object.assign(t.style,{top:"".concat(p-g,"px"),left:"".concat(u-h,"px")})})(e.currentTarget,Vl(),n,i),onPointerLeave:()=>Vl().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const Kl=i().forwardRef(((e,t)=>{let{children:n,padding:r,className:i,style:o}=e;return(0,x.jsx)("div",{className:ye("Island",i),style:Object.assign({"--padding":r},o),ref:t,children:n})}));n(8328);const Gl=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=Yl(t);if(!r)return null;return(0,at.createPortal)((0,x.jsxs)("div",{className:ye("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:t=>{t.key===Ht&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,x.jsx)("div",{className:"Modal__background",onClick:n?e.onCloseRequest:void 0}),(0,x.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),r)},Yl=e=>{const[t,n]=(0,r.useState)(null),i=Gh(),o=(0,r.useRef)(i);o.current=i;const{container:a}=Zh();return(0,r.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",i)}),[t,i]),(0,r.useLayoutEffect)((()=>{const t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,r=document.createElement("div");return r.classList.add("excalidraw","excalidraw-modal-container"),r.classList.toggle("excalidraw--mobile",o.current),t&&(r.classList.add("theme--dark"),r.classList.add("theme--dark-background-none")),document.body.appendChild(r),n(r),()=>{document.body.removeChild(r)}}),[a,e]),t},Zl=e=>{const[t,n]=(()=>{const[e,t]=(0,r.useState)(null);return[e,(0,r.useCallback)((e=>t(e)),[])]})(),[i]=(0,r.useState)(document.activeElement),{id:o}=Zh();(0,r.useEffect)((()=>{if(!t)return;const n=a(t);n.length>0&&!1!==e.autofocus&&(n[1]||n[0]).focus();const r=e=>{if(e.key===Ut){const n=a(t),{activeElement:r}=document,i=n.findIndex((e=>e===r));0===i&&e.shiftKey?(n[n.length-1].focus(),e.preventDefault()):i!==n.length-1||e.shiftKey||(n[0].focus(),e.preventDefault())}};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)}),[t,e.autofocus]);const a=e=>{const t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=()=>{i.focus(),e.onCloseRequest()};return(0,x.jsx)(Gl,{className:ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,x.jsxs)(Kl,{ref:n,children:[(0,x.jsxs)("h2",{id:"".concat(o,"-dialog-title"),className:"Dialog__title",children:[(0,x.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,x.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":b("buttons.close"),children:Gh()?Ts:Ms})]}),(0,x.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var ql=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Xl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=ql(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,x.jsxs)(Zl,Object.assign(Object.assign({onCloseRequest:n,small:!0},s),{className:"confirm-dialog ".concat(a),children:[r,(0,x.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,x.jsx)(Za,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,x.jsx)(Za,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},$l=e=>{let{onConfirm:t}=e;const[n,i]=(0,r.useState)(!1),o=()=>{i(!n)};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{type:"button",icon:is,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:Gh(),onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,x.jsx)(Xl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,x.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},Jl=(dl({name:"changeViewBackgroundColor",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.viewBackgroundColor}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{position:"relative"},children:(0,x.jsx)(zl,{label:b("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:e=>n({viewBackgroundColor:e}),isActive:"canvasColorPicker"===t.openPopup,setActive:e=>n({openPopup:e?"canvasColorPicker":null}),"data-testid":"canvas-background-picker"})})}}),dl({name:"clearCanvas",perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Zr(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},Pn()),{files:{},theme:t.theme,elementLocked:t.elementLocked,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog}),commitToHistory:!0}),PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)($l,{onConfirm:t})}}),dl({name:"zoomIn",perform:(e,t)=>{const n=Va(Wa(t.zoom.value+o.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Object.assign(Object.assign({},t),{zoom:n}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:cs,title:"".concat(b("buttons.zoomIn")," — ").concat(wn("CtrlOrCmd++")),"aria-label":b("buttons.zoomIn"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ct||e.code===ut)&&(e[zt]||e.shiftKey)}),dl({name:"zoomOut",perform:(e,t)=>{const n=Va(Wa(t.zoom.value-o.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Object.assign(Object.assign({},t),{zoom:n}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:ds,title:"".concat(b("buttons.zoomOut")," — ").concat(wn("CtrlOrCmd+-")),"aria-label":b("buttons.zoomOut"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===dt||e.code===ht)&&(e[zt]||e.shiftKey)}),dl({name:"resetZoom",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{zoom:Va(1,t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2})}),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)(Wl,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,x.jsxs)(Za,{type:"button",className:"reset-zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:e=>(e.code===vt||e.code===pt)&&(e[zt]||e.shiftKey)}),(e,t,n)=>{const r=_a(e),i=Ta(r,t),a=n&&i.length>0?Qe(i):Qe(r),s=((e,t)=>{const[n,r,i,a]=e,s=i-n,l=t.width/s,c=a-r,d=t.height/c,u=Math.min(l,d),h=Math.floor(u/o.V4)*o.V4;return Math.min(Math.max(h,o.V4),1)})(a,{width:t.width,height:t.height}),l=Va(s,t.zoom,{left:t.offsetLeft,top:t.offsetTop}),[c,d,u,h]=a,p=(c+u)/2,g=(d+h)/2;return{appState:Object.assign(Object.assign(Object.assign({},t),La({scenePoint:{x:p,y:g},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{zoom:l}),commitToHistory:!1}}),Ql=(dl({name:"zoomToSelection",perform:(e,t)=>Jl(e,t,!0),keyTest:e=>e.code===bt&&e.shiftKey&&!e.altKey&&!e[zt]}),dl({name:"zoomToFit",perform:(e,t)=>Jl(e,t,!1),keyTest:e=>e.code===ft&&e.shiftKey&&!e.altKey&&!e[zt]}),dl({name:"toggleTheme",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{theme:n||(t.theme===o.C6.LIGHT?o.C6.DARK:o.C6.LIGHT)}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,x.jsx)(Fl,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===kt}),dl({name:"finalize",perform:(e,t,n,r)=>{var i;let{canvas:o,focusContainer:a}=r;if(t.editingLinearElement){const{elementId:n,startBindingElement:r,endBindingElement:i}=t.editingLinearElement,o=Lo.getElement(n);if(o)return Me(o)&&Do(o,r,i),{elements:o.points.length<2||Xr(o)?e.filter((e=>e.id!==o.id)):void 0,appState:Object.assign(Object.assign({},t),{editingLinearElement:null}),commitToHistory:!0}}let s=e;t.pendingImageElement&&Yr(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();const l=t.multiElement?t.multiElement:"freedraw"===(null===(i=t.editingElement)||void 0===i?void 0:i.type)?t.editingElement:null;if(l){if("freedraw"!==l.type&&"touch"!==t.lastPointerDownWith){const{points:e,lastCommittedPoint:t}=l;t&&e[e.length-1]===t||Yr(l,{points:l.points.slice(0,-1)})}Xr(l)&&(s=s.slice(0,-1));const e=Re(l.points,t.zoom.value);if(("line"===l.type||"freedraw"===l.type)&&e){const e=l.points,t=e[0];Yr(l,{points:e.map(((n,r)=>r===e.length-1?[t[0],t[1]]:n))})}if(Me(l)&&!e&&l.points.length>1){const[e,n]=Lo.getPointAtIndexGlobalCoordinates(l,-1);Ho(l,t,ir.getScene(l),{x:e,y:n})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[l.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&l||bn(o),{elements:s,appState:Object.assign(Object.assign({},t),{elementType:(t.elementLocked||"freedraw"===t.elementType)&&l?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.elementLocked&&"freedraw"!==t.elementType?Object.assign(Object.assign({},t.selectedElementIds),{[l.id]:!0}):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:(e,t)=>e.key===Ht&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Ht||e.key===Rt)&&null!==t.multiElement,PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Za,{type:"button",icon:us,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:n,visible:null!=t.multiElement})}}));var ec,tc;const nc="undefined"!=typeof process&&null!==(ec={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==ec&&ec.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?(e,t,n,r)=>{window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(tc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==tc&&tc.JEST_WORKER_ID,(e,t,n,r)=>{});n(518),n(9966);const rc=e=>{const{id:t}=Zh(),[n,i]=(0,r.useState)(e.value);return(0,x.jsxs)("div",{className:"ProjectName",children:[(0,x.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,x.jsx)("input",{type:"text",className:"TextInput",onBlur:t=>{(e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}})(t.target);const n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:e=>{if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:n,onChange:e=>i(e.target.value)}):(0,x.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})},ic=(e,t)=>{if(null!=t&&t.collaborators){const n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}const n=e.split("").reduce(((e,t)=>e+t.charCodeAt(0)),0),r=ot.elementBackground.slice(1),i=ot.elementStroke.slice(1);return{background:r[n%r.length],stroke:i[n%i.length]}};let oc;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(oc||(oc={}));const ac=(()=>{const e=document.createElement("canvas").getContext("2d");if(!e)return!1;return e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0]})(),sc=function(e,t,n,r,i,o,a,s){let l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(o,a),e.rotate(s),l&&e.fillRect(t-o,n-a,r,i),e.strokeRect(t-o,n-a,r,i),e.restore()},lc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},cc=(e,t,n,r,i,a,s)=>{if(null===a)return{atLeastOneVisibleElement:!1};const{renderScrollbars:l=!0,renderSelection:c=!0,renderGrid:d=!0,isExporting:u}=s,h=a.getContext("2d");h.setTransform(1,0,0,1,0,0),h.save(),h.scale(r,r);const p=a.width/r,g=a.height/r;if(u&&"dark"===s.theme&&(h.filter=o.ZF),"string"==typeof s.viewBackgroundColor){("transparent"===s.viewBackgroundColor||5===s.viewBackgroundColor.length||9===s.viewBackgroundColor.length||/(hsla|rgba)\(/.test(s.viewBackgroundColor))&&h.clearRect(0,0,p,g),h.save(),h.fillStyle=s.viewBackgroundColor,h.fillRect(0,0,p,g),h.restore()}else h.clearRect(0,0,p,g);const f=s.zoom.translation.x,b=s.zoom.translation.y;h.save(),h.translate(f,b),h.scale(s.zoom.value,s.zoom.value),d&&t.gridSize&&((e,t,n,r,i,o)=>{e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(let a=n;a<n+i+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+o+2*t);for(let a=r;a<r+o+2*t;a+=t)e.moveTo(n-t,a),e.lineTo(n+i+2*t,a);e.stroke(),e.restore()})(h,t.gridSize,-Math.ceil(f/s.zoom.value/t.gridSize)*t.gridSize+s.scrollX%t.gridSize,-Math.ceil(b/s.zoom.value/t.gridSize)*t.gridSize+s.scrollY%t.gridSize,p/s.zoom.value,g/s.zoom.value);const x=e.filter((e=>mc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(x.forEach((e=>{try{zr(e,i,h,s)}catch(e){console.error(e)}})),t.editingLinearElement){const e=Lo.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,Lo.getPointsGlobalCoordinates(r).forEach(((r,i)=>{var o,a;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=null!==(o=t.editingLinearElement)&&void 0!==o&&null!==(a=o.selectedPointsIndices)&&void 0!==a&&a.includes(i)?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";const{POINT_HANDLE_SIZE:s}=Lo;lc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{zr(n,i,h,s)}catch(e){console.error(e)}if(Po(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{hc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!ei(t,n)&&r.push(rt.black),s.remoteSelectedElementIds[n.id]&&r.push(...s.remoteSelectedElementIds[n.id].map((e=>{const{background:n}=ic(e,t);return n}))),r.length){const[t,i,o,a]=Ge(n);e.push({angle:n.angle,elementX1:t,elementY1:i,elementX2:o,elementY2:a,selectionColors:r})}return e}),[]),r=t=>{const r=oi(e,t),[i,o,a,s]=Qe(r);n.push({angle:0,elementX1:i,elementX2:a,elementY1:o,elementY2:s,selectionColors:[rt.black]})};for(const e of ni(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>uc(h,s,e)));const i=Ta(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=rt.white;const e=_i(i[0],s.zoom,"mouse");t.viewModeEnabled||dc(h,s,e,i[0].angle)}else if(i.length>1&&!t.isRotating){const e=4/s.zoom.value;h.fillStyle=rt.white;const[t,n,r,o]=Qe(i),a=h.getLineDash();h.setLineDash([2/s.zoom.value]);const l=h.lineWidth;h.lineWidth=1/s.zoom.value,sc(h,t-e,n-e,r-t+2*e,o-n+2*e,(t+r)/2,(n+o)/2,0),h.lineWidth=l,h.setLineDash(a);const c=ki([t,n,r,o],0,s.zoom,"mouse",bi);dc(h,s,c,0)}h.restore()}h.restore();for(const e in s.remotePointerViewportCoords){let{x:n,y:r}=s.remotePointerViewportCoords[e];n-=t.offsetLeft,r-=t.offsetTop;const i=9,o=14,a=n<0||n>p-i||r<0||r>g-o;n=Math.max(n,0),n=Math.min(n,p-i),r=Math.max(r,0),r=Math.min(r,g-o);const{background:l,stroke:c}=ic(e,t);h.save(),h.strokeStyle=c,h.fillStyle=l;const d=s.remotePointerUserStates[e];(a||d===oc.AWAY)&&(h.globalAlpha=.48),s.remotePointerButton&&"down"===s.remotePointerButton[e]&&(h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=3,h.strokeStyle="#ffffff88",h.stroke(),h.closePath(),h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=1,h.strokeStyle=c,h.stroke(),h.closePath()),h.beginPath(),h.moveTo(n,r),h.lineTo(n+1,r+14),h.lineTo(n+4,r+9),h.lineTo(n+9,r+10),h.lineTo(n,r),h.fill(),h.stroke();const u=s.remotePointerUsernames[e];let m="";d===oc.AWAY?m=ac?"⚫️":" (".concat(oc.AWAY,")"):d===oc.IDLE?m=ac?"💤":" (".concat(oc.IDLE,")"):d===oc.ACTIVE&&(m=ac?"🟢":"");const f="".concat(u?"".concat(u," "):"").concat(m);if(!a&&f){const e=n+i,t=r+o,a=4,s=4,d=h.measureText(f),u=d.actualBoundingBoxDescent+d.actualBoundingBoxAscent;h.fillStyle=c,h.fillRect(e-1,t-1,d.width+2*a+2,u+2*s+2),h.fillStyle=l,h.fillRect(e,t,d.width+2*a,u+2*s),h.fillStyle=rt.white,h.fillText(f,e+a,t+s+d.actualBoundingBoxAscent)}h.restore(),h.closePath()}let v;return l&&(v=((e,t,n,r)=>{let{scrollX:i,scrollY:o,zoom:a}=r;if(0===e.length)return{horizontal:null,vertical:null};const[s,l,c,d]=Qe(e),u=t/a.value,h=n/a.value,p=t-u,g=n-h,f={top:parseInt(En("sat")),bottom:parseInt(En("sab")),left:parseInt(En("sal")),right:parseInt(En("sar"))},b=m().rtl,x=p/2-i+f.left,v=g/2-o+f.top,y=x+u-f.right,w=v+h-f.bottom,k=Math.min(s,x),_=Math.min(l,v),E=Math.max(c,y),S=Math.max(d,w);return{horizontal:x===k&&y===E?null:{x:Math.max(f.left,4)+(x-k)/(E-k)*t,y:n-6-Math.max(4,f.bottom),width:(y-x)/(E-k)*t-Math.max(8,f.left+f.right),height:6},vertical:v===_&&w===S?null:{x:b?Math.max(f.left,4):t-6-Math.max(f.right,4),y:(v-_)/(S-_)*n+Math.max(f.top,4),width:6,height:(w-v)/(S-_)*n-Math.max(8,f.top+f.bottom)}}})(e,p,g,s),h.save(),h.fillStyle="rgba(0,0,0,0.3)",h.strokeStyle="rgba(255,255,255,0.8)",[v.horizontal,v.vertical].forEach((e=>{e&&((e,t,n,r,i,o)=>{e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill(),e.stroke()})(h,e.x,e.y,e.width,e.height,3)})),h.restore()),h.restore(),{atLeastOneVisibleElement:x.length>0,scrollBars:v}},dc=(e,t,n,r)=>{Object.keys(n).forEach((i=>{const o=n[i];void 0!==o&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===i?lc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):sc(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},uc=(e,t,n)=>{const{angle:r,elementX1:i,elementY1:o,elementX2:a,elementY2:s,selectionColors:l}=n,c=a-i,d=s-o,u=4/t.zoom.value,h=8/t.zoom.value,p=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;const g=l.length;for(let t=0;t<g;++t)e.strokeStyle=l[t],e.setLineDash([h,p+(h+p)*(g-1)]),e.lineDashOffset=(h+p)*t,sc(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},hc=(e,t,n)=>{const r=Array.isArray(n)?gc:pc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},pc=(e,t)=>{const[n,r,i,o]=Ge(t),a=i-n,s=o-r,l=Ji(t,a,s);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;const c=2+l/2;switch(t.type){case"rectangle":case"text":case"image":sc(e,n-c,r-c,a+2*c,s+2*c,n+a/2,r+s/2,t.angle);break;case"diamond":const i=Math.hypot(a,s);((e,t,n,r,i,o)=>{e.save(),e.translate(r,i),e.rotate(o),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()})(e,a+2*(c*i/s),s+2*(c*i/a),n+a/2,r+s/2,t.angle);break;case"ellipse":((e,t,n,r,i,o)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,o,0,2*Math.PI),e.stroke()})(e,a+2*c,s+2*c,n+a/2,r+s/2,t.angle)}},gc=(e,t)=>{const[n,r,i]=t,o=Ji(i,i.width,i.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)";("both"===r?[0,-1]:"start"===r?[0]:[-1]).forEach((t=>{const[r,i]=Lo.getPointAtIndexGlobalCoordinates(n,t);lc(e,r,i,o)}))},mc=(e,t,n,r)=>{const[i,o,a,s]=Je(e),l=kn({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=kn({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var fc=Object.defineProperty,bc=(e,t)=>()=>(e&&(t=e(e=0)),t),xc=(e,t)=>{for(var n in(e=>{fc(e,"__esModule",{value:!0})})(e),t)fc(e,n,{get:t[n],enumerable:!0})},vc={};xc(vc,{default:()=>yc});var yc,wc=bc((()=>{yc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise(((t,n)=>{let r=document.createElement("input");r.type="file";let i=[...e.map((e=>e.mimeTypes||[])).join(),e.map((e=>e.extensions||[])).join()].join();r.multiple=e[0].multiple||!1,r.accept=i||"";let o=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(o,(()=>a(n)),r);r.addEventListener("change",(()=>{o(r.multiple?Array.from(r.files):r.files[0])})),r.click()})))})),kc={};xc(kc,{default:()=>Ec});var _c,Ec,Sc=bc((()=>{_c=async e=>{let t=await e.getFile();return t.handle=e,t},Ec=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach(((e,n)=>{t[n]={description:e.description||"",accept:{}},e.mimeTypes?e.mimeTypes.map((r=>{t[n].accept[r]=e.extensions||[]})):t[n].accept["*/*"]=e.extensions||[]}));let n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(_c));return e[0].multiple?r:r[0]}})),Cc={};xc(Cc,{default:()=>jc});var jc,Ic=bc((()=>{jc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise(((t,n)=>{let r=document.createElement("input");r.type="file",r.webkitdirectory=!0;let i=e=>{"function"==typeof o&&o(),t(e)},o=e[0].legacySetup&&e[0].legacySetup(i,(()=>o(n)),r);r.addEventListener("change",(()=>{let t=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter((t=>t.webkitRelativePath.split("/").every((t=>!e[0].skipDirectory({name:t,kind:"directory"})))))):t=t.filter((e=>2===e.webkitRelativePath.split("/").length)),i(t)})),r.click()})))})),Mc={};xc(Mc,{default:()=>Oc});var Tc,Oc,Lc=bc((()=>{Tc=async(e,t,n=e.name,r)=>{let i=[],o=[];for await(let a of e.values()){let s=`${n}/${a.name}`;"file"===a.kind?o.push(a.getFile().then((t=>(t.directoryHandle=e,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s}))))):"directory"===a.kind&&t&&(!r||!r(a))&&i.push(Tc(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},Oc=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return Tc(t,e.recursive,void 0,e.skipDirectory)}})),Ac={};xc(Ac,{default:()=>Pc});var Pc,Dc=bc((()=>{Pc=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement("a"),r=e;"body"in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then((({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()}))}()}),i=new Response(r);return n.releaseLock(),new Blob([await i.blob()],{type:t})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(r);let i=()=>{"function"==typeof o&&o()},o=t.legacySetup&&t.legacySetup(i,(()=>o(reject)),n);return n.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(n.href)),3e4),i()})),n.click(),null}})),zc={};xc(zc,{default:()=>Nc});var Nc,Rc=bc((()=>{Nc=async(e,t=[{}],n=null,r=!1)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let i=[];if(t.forEach(((t,n)=>{i[n]={description:t.description||"",accept:{}},t.mimeTypes?(0===n&&(e.type?t.mimeTypes.push(e.type):e.headers&&e.headers.get("content-type")&&t.mimeTypes.push(e.headers.get("content-type"))),t.mimeTypes.map((e=>{i[n].accept[e]=t.extensions||[]}))):e.type&&(i[n].accept[e.type]=t.extensions||[])})),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let o=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:i,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1}),a=await o.createWritable();return"stream"in e?(await e.stream().pipeTo(a),o):"body"in e?(await e.body.pipeTo(a),o):(await a.write(blob),await a.close(),o)}})),Hc=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),Bc=Hc?Promise.resolve().then((()=>(Sc(),kc))):Promise.resolve().then((()=>(wc(),vc)));Hc?Promise.resolve().then((()=>(Lc(),Mc))):Promise.resolve().then((()=>(Ic(),Cc)));var Fc=Hc?Promise.resolve().then((()=>(Rc(),zc))):Promise.resolve().then((()=>(Dc(),Ac)));const Uc=e=>{var t,n,r;const i=null===(t=e.extensions)||void 0===t?void 0:t.reduce(((e,t)=>(e.push(o.LO[t]),e)),[]),a=null===(n=e.extensions)||void 0===n?void 0:n.reduce(((e,t)=>"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))),[]);return async function(...e){return(await Bc).default(...e)}({description:e.description,extensions:a,mimeTypes:i,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:(t,n,r)=>{const i=mn(n,500),a=()=>{s(),document.addEventListener(o.Ks.KEYUP,i),document.addEventListener(o.Ks.POINTER_UP,i),i()},s=()=>{var n;if(null!==(n=r.files)&&void 0!==n&&n.length){const n=e.multiple?[...r.files]:r.files[0];t(n)}};requestAnimationFrame((()=>{window.addEventListener(o.Ks.FOCUS,a)}));const l=window.setInterval((()=>{s()}),500);return e=>{clearInterval(l),i.cancel(),window.removeEventListener(o.Ks.FOCUS,a),document.removeEventListener(o.Ks.KEYUP,i),document.removeEventListener(o.Ks.POINTER_UP,i),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new Ga))}}})},Vc=(e,t)=>async function(...e){return(await Fc).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),Wc={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Kc=(e,t)=>{var n,r,i,o,a,s,l,c,d,u,h,p,g;const m={type:t.type||e.type,version:e.version||1,versionNonce:null!==(n=e.versionNonce)&&void 0!==n?n:0,isDeleted:null!==(r=e.isDeleted)&&void 0!==r&&r,id:e.id||Gr(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(i=e.strokeStyle)&&void 0!==i?i:"solid",roughness:null!==(o=e.roughness)&&void 0!==o?o:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(s=t.x)&&void 0!==s?s:e.x)&&void 0!==a?a:0,y:null!==(l=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==l?l:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(d=e.seed)&&void 0!==d?d:1,groupIds:null!==(u=e.groupIds)&&void 0!==u?u:[],strokeSharpness:null!==(h=e.strokeSharpness)&&void 0!==h?h:Ie(e.type)?"round":"sharp",boundElements:e.boundElementIds?e.boundElementIds.map((e=>({type:"arrow",id:e}))):null!==(p=e.boundElements)&&void 0!==p?p:[],updated:null!==(g=e.updated)&&void 0!==g?g:On()};return Object.assign(Object.assign(Object.assign({},m),Jr(m)),t)},Gc=e=>{var t,n,r,i;switch(e.type){case"text":let a=e.fontSize,s=e.fontFamily;if("font"in e){const[t,n]=e.font.split(" ");a=parseInt(t,10),i=n,s=Object.keys(o.ut).includes(i)?o.ut[i]:o.rk}return Kc(e,{fontSize:a,fontFamily:s,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||o.Hg,verticalAlign:e.verticalAlign||o.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:null!==(r=e.originalText)&&void 0!==r?r:""});case"freedraw":return Kc(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Kc(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":{const{startArrowhead:t=null,endArrowhead:n=("arrow"===e.type?"arrow":null)}=e;let r=e.x,i=e.y,o=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;return 0===o[0][0]&&0===o[0][1]||({points:o,x:r,y:i}=Lo.getNormalizedPoints(e)),Kc(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:t,endArrowhead:n,points:o,x:r,y:i})}case"ellipse":case"rectangle":case"diamond":return Kc(e,{})}},Yc=(e,t)=>{const n=t?Ln(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Xr(t)){let r=Gc(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=qr(r,i.version)),e.push(r)}}return e}),[])},Zc=(e,t)=>{e=e||{};const n=Pn(),r={};for(const[i,o]of Object.entries(n)){const n=e[i],a=t?t[i]:void 0;r[i]=void 0!==n?n:void 0!==a?a:o}return Object.assign(Object.assign({},r),{elementType:Wc[r.elementType]?r.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:n.zoom.translation}:e.zoom||n.zoom})},qc=(e,t,n)=>({elements:Yc(null==e?void 0:e.elements,n),appState:Zc(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),Xc=(e,t)=>{const n=[];for(const r of e)if(Array.isArray(r))n.push({status:t,elements:r,id:Gr(),created:Date.now()});else{const e=r;n.push(Object.assign(Object.assign({},e),{id:e.id||Gr(),status:e.status||t,created:e.created||Date.now()}))}return n},$c=async e=>{let t;if(e.type===o.LO.png)try{return await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).decodePngMetadata(e)}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}else if(t="text"in Blob?await e.text():await new Promise((t=>{const n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=()=>{n.readyState===FileReader.DONE&&t(n.result)}})),e.type===o.LO.svg)try{return await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).decodeSvgMetadata({svg:t})}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}return t},Jc=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},Qc=e=>{const t=Jc(e);return"png"===t||"svg"===t},ed=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},td=async(e,t,n)=>{const r=await $c(e);try{const i=JSON.parse(r);if(!ud(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return qc({elements:ja(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},Nn(i.appState||{})),t?Aa(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},nd=async e=>{const t=await $c(e),n=JSON.parse(t);if(n.type!==o.r8.excalidrawLibrary)throw new Error(b("alerts.couldNotLoadInvalidFile"));return n},rd=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new Ka(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),id=async e=>{try{const n=await window.crypto.subtle.digest("SHA-1",await e.arrayBuffer());return t=new Uint8Array(n),Array.from(t).map((e=>"0".concat(e.toString(16)).slice(-2))).join("")}catch(e){return console.error(e),we(40)}var t},od=async e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=()=>{const e=r.result;t(e)},r.onerror=e=>n(e),r.readAsDataURL(e)})),ad=async(e,t)=>{if(e.type===o.LO.svg)return e;const[r,i]=await Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((e=>e.default)),n.e(736).then(n.bind(n,100)).then((e=>e.default))]),a=i({pica:r({features:["js","wasm"]})});if(t.outputType){const{outputType:e}=t;a._create_blob=function(t){return this.pica.toBlob(t.out_canvas,e,.8).then((e=>(t.out_blob=e,t)))}}if(!ed(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},sd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:o.LO.svg})},ld=(e,t)=>{const n={};for(const r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},cd=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?ja(e):Ca(e),appState:"local"===r?Nn(t):Rn(t),files:"local"===r?ld(e,n):void 0};return JSON.stringify(i,null,2)},dd=async(e,t,n)=>{const r=cd(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await Vc(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Qc(t.fileHandle)?null:t.fileHandle})}},ud=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),hd=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),pd=async e=>{let{fileIds:t,files:n,imageCache:r}=e;const i=new Map,a=new Map;return await Promise.all(t.reduce(((e,t)=>{const s=n[t];return s&&!i.has(t)?(i.set(t,!0),e.concat((async()=>{try{if(s.mimeType===o.LO.binary)throw new Error("Only images can be added to ImageCache");const e=hd(s.dataURL),n={image:e,mimeType:s.mimeType};r.set(t,n);const i=await e;r.set(t,Object.assign(Object.assign({},n),{image:i}))}catch(e){a.set(t,!0)}})())):e}),[])),{imageCache:r,updatedFiles:i,erroredFiles:a}},gd=e=>e.filter((e=>ke(e))),md="\x3c!-- svg-source:excalidraw --\x3e",fd=async function(e,t,n,r){let{exportBackground:i,exportPadding:a=o.qy,viewBackgroundColor:s}=r,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(e,n)=>{const r=document.createElement("canvas");return r.width=e*t.exportScale,r.height=n*t.exportScale,{canvas:r,scale:t.exportScale}};const[c,d,u,h]=xd(e,a),{canvas:p,scale:g=1}=l(u,h),m=Pn(),{imageCache:f}=await pd({imageCache:new Map,fileIds:gd(e).map((e=>e.fileId)),files:n});return cc(e,t,null,g,xe.canvas(p),p,{viewBackgroundColor:i?s:null,scrollX:-c+a,scrollY:-d+a,zoom:m.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:f,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),p},bd=async(e,t,r)=>{const{exportPadding:i=o.qy,viewBackgroundColor:a,exportScale:s=1,exportEmbedScene:l}=t;let c="";if(l)try{c=await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).encodeSvgMetadata({text:cd(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=xd(e,i),g=document.createElementNS(o.hR,"svg");if(g.setAttribute("version","1.1"),g.setAttribute("xmlns",o.hR),g.setAttribute("viewBox","0 0 ".concat(h," ").concat(p)),g.setAttribute("width","".concat(h*s)),g.setAttribute("height","".concat(p*s)),t.exportWithDarkMode&&g.setAttribute("filter",o.ZF),g.innerHTML="\n ".concat(md,"\n ").concat(c,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),t.exportBackground&&a){const e=g.ownerDocument.createElementNS(o.hR,"rect");e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width","".concat(h)),e.setAttribute("height","".concat(p)),e.setAttribute("fill",a),g.appendChild(e)}return function(e,t,n,r){let{offsetX:i=0,offsetY:o=0,exportWithDarkMode:a=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};n&&e.forEach((e=>{if(!e.isDeleted)try{Rr(e,t,n,r,e.x+i,e.y+o,a)}catch(e){console.error(e)}}))}(e,xe.svg(g),g,r||{},{offsetX:-d+i,offsetY:-u+i,exportWithDarkMode:t.exportWithDarkMode}),g},xd=(e,t)=>{const[n,r,i,o]=Qe(e);return[n,r,fn(n,i)+2*t,fn(r,o)+t+t]},vd=32,yd=12,wd=256,kd="NOT_SPREADSHEET",_d="VALID_SPREADSHEET",Ed=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Sd=(e,t)=>e.slice(1).every((e=>null!==Ed(e[t]))),Cd=e=>{const t=e[0].length;if(t>2)return{type:kd,reason:"More than 2 columns"};if(1===t){if(!Sd(e,0))return{type:kd,reason:"Value is not numeric"};const t=null===Ed(e[0][0]),n=(t?e.slice(1):e).map((e=>Ed(e[0])));return n.length<2?{type:kd,reason:"Less than two rows"}:{type:_d,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Sd(e,0)?0:1;if(!Sd(e,n))return{type:kd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Ed(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:kd,reason:"Less than 2 rows"}:{type:_d,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Ed(e[n])))}}},jd=ot.elementBackground.slice(2,ot.elementBackground.length),Id={fillStyle:"hachure",fontFamily:o.rk,fontSize:o.n5,opacity:100,roughness:1,strokeColor:ot.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},Md=e=>({chartWidth:44*e.values.length+yd,chartHeight:280}),Td=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:vd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},Od=(e,t,n,r,i)=>{const o=ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{x:t-yd,y:n-yd,text:"0",textAlign:"right"}));return[o,ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{x:t-yd,y:n-wd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},Ld=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=Md(e);return[pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n-wd-yd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},Ad=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=Md(e),c=e.title?ui(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{text:e.title,x:t+s/2,y:n-wd-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?ci(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"rectangle",x:t,y:n-l,width:s,height:l,strokeColor:ot.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[...d?[d]:[],...c?[c]:[],...Td(e,t,n,r,i),...Od(e,t,n,r,i),...Ld(e,t,n,r,i)]},Pd=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=Gr(),a=jd[Math.floor(Math.random()*jd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*wd;l.push([e,n]),s++}const c=Math.max(...l.map((e=>e[0]))),d=Math.max(...l.map((e=>e[1]))),u=Math.min(...l.map((e=>e[0]))),h=Math.min(...l.map((e=>e[1]))),p=pi(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"line",x:t+yd+16,y:n-yd,startArrowhead:null,endArrowhead:null,height:d-h,width:c-u,strokeWidth:2,points:l})),g=e.values.map(((e,o)=>{const s=44*o+6,l=-e/r*wd+6;return ci(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:yd,height:yd}))})),m=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*wd+6+yd;return pi(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"line",x:t+s+16+6,y:n-l,startArrowhead:null,endArrowhead:null,height:l,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,l]]}))}));return[...Ad(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT),p,...m,...g]})(t,n,r):((e,t,n)=>{const r=Math.max(...e.values),i=Gr(),a=jd[Math.floor(Math.random()*jd.length)],s=e.values.map(((e,o)=>{const s=e/r*wd;return ci(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"rectangle",x:t+44*o+yd,y:n-s-yd,width:vd,height:s}))}));return[...s,...Ad(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let Dd="",zd=!1;const Nd="clipboard"in navigator&&"readText"in navigator.clipboard,Rd="clipboard"in navigator&&"writeText"in navigator.clipboard,Hd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Bd=async(e,t,n)=>{const r=Ta(e,t,!0),i={type:o.r8.excalidrawClipboard,elements:r,files:r.reduce(((e,t)=>(ke(t)&&n[t.fileId]&&(e[t.fileId]=n[t.fileId]),e)),{})},a=JSON.stringify(i);Dd=a;try{zd=!1,await Wd(a)}catch(e){zd=!0,console.error(e)}},Fd=()=>{if(!Dd)return{};try{return JSON.parse(Dd)}catch(e){return console.error(e),{}}},Ud=e=>{const t=(e=>{let t=e.trim().split("\n").map((e=>e.trim().split("\t")));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((e=>e.trim().split(",")))),0===t.length)return{type:kd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:kd,reason:"All rows don't have same number of columns"};const i=Cd(t);if(i.type!==_d){const e=Cd((e=>{const t=[];for(let n=0;n<e[0].length;n++){const r=[];for(let t=0;t<e.length;t++)r.push(e[t][n]);t.push(r)}return t})(t));if(e.type===_d)return e}return i})(e);return t.type===_d?{spreadsheet:t.spreadsheet}:null},Vd=async e=>{const t=await(async e=>{try{var t;return(e?null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain").trim():Nd&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(md))return Fd();const n=Ud(t);if(n)return n;const r=Fd();try{const e=JSON.parse(t);return i=e,[o.r8.excalidraw,o.r8.excalidrawClipboard].includes(null==i?void 0:i.type)&&Array.isArray(i.elements)?{elements:e.elements,files:e.files}:r}catch(e){return zd&&r.elements?r:{text:t}}var i},Wd=async e=>{let t=!1;if(Rd)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!Kd(e||" "))throw new Error("couldn't copy")},Kd=e=>{const t="rtl"===document.documentElement.getAttribute("dir"),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";const r=window.pageYOffset||document.documentElement.scrollTop;n.style.top="".concat(r,"px"),n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),i},Gd=async(e,t,r,i,a)=>{let{exportBackground:s,exportPadding:l=o.qy,viewBackgroundColor:c,name:d,fileHandle:u=null}=a;if(0===t.length)throw new Error(b("alerts.cannotExportEmptyCanvas"));if("svg"===e||"clipboard-svg"===e){const n=await bd(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await Vc(new Blob([n.outerHTML],{type:o.LO.svg}),{description:"Export to SVG",name:d,extension:"svg",fileHandle:u});if("clipboard-svg"===e)return void await Wd(n.outerHTML)}const h=await fd(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});h.style.display="none",document.body.appendChild(h);let p=await rd(h);if(h.remove(),"png"===e)return r.exportEmbedScene&&(p=await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).encodePngMetadata({blob:p,metadata:cd(t,r,i,"local")})),await Vc(p,{description:"Export to PNG",name:d,extension:"png",fileHandle:u});if("clipboard"===e)try{await(async e=>{await navigator.clipboard.write([new window.ClipboardItem({[o.LO.png]:e})])})(p)}catch(e){if("CANVAS_POSSIBLY_TOO_BIG"===e.name)throw e;throw new Error(b("alerts.couldNotCopyToClipboard"))}};n(7225);const Yd=e=>{let{children:t,checked:n,onChange:r,className:i}=e;return(0,x.jsxs)("div",{className:ye("Checkbox",i,{"is-checked":n}),onClick:e=>{r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,x.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:Ja}),(0,x.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const Zd=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o,style:a}=e;return(0,x.jsx)("div",{className:ye("Stack Stack_horizontal",o),style:Object.assign({"--gap":n,alignItems:r,justifyContent:i},a),children:t})},qd=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o}=e;return(0,x.jsx)("div",{className:ye("Stack Stack_vertical",o),style:{"--gap":n,justifyItems:r,justifyContent:i},children:t})};n(554);const Xd=e=>{let{fileName:t,onSave:n}=e;return(0,x.jsxs)(Zd,{className:"ActiveFile",gap:1,align:"center",children:[(0,x.jsxs)("span",{className:"ActiveFile__fileName",children:[Ls,(0,x.jsx)("span",{children:t})]}),(0,x.jsx)(Za,{type:"icon",icon:es,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},$d=(dl({name:"changeProjectName",perform:(e,t,n)=>(nc("change","title"),{appState:Object.assign(Object.assign({},t),{name:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n,appProps:r}=e;return(0,x.jsx)(rc,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),dl({name:"changeExportScale",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportScale:n}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=_a(t),a=Ma(i,n)?Ta(i,n):i;return(0,x.jsx)(x.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=xd(e,t).map((e=>Math.trunc(e*n)));return[r,i]})(a,o.qy,e),s="".concat(b("buttons.scale")," ").concat(e,"x (").concat(t,"x").concat(i,")");return(0,x.jsx)(Za,{size:"small",type:"radio",icon:"".concat(e,"x"),name:"export-canvas-scale",title:s,"aria-label":s,id:"export-canvas-scale",checked:e===n.exportScale,onChange:()=>r(e)},e)}))})}}),dl({name:"changeExportBackground",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportBackground:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Yd,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),dl({name:"changeExportEmbedScene",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportEmbedScene:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsxs)(Yd,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,x.jsx)(Wl,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,x.jsx)("div",{className:"excalidraw-tooltip-icon",children:ms})})]})}}),dl({name:"saveToActiveFile",perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=Qc(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=Jc(a);if(!a||"png"!==(l=s)&&"svg"!==l)throw new Error("fileHandle should exist and should be of type svg or png when resaving");var l;return t=Object.assign(Object.assign({},t),{exportEmbedScene:!0}),await Gd(s,_a(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await dd(e,t,r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n,toastMessage:i?null!=n&&n.name?b("toast.fileSavedToFilename").replace("{filename}",'"'.concat(n.name,'"')):b("toast.fileSaved"):null})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Jt&&e[zt]&&!e.shiftKey,PanelComponent:e=>{var t;let{updateData:n,appState:r}=e;return(0,x.jsx)(Xd,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),dl({name:"saveFileToDisk",perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await dd(e,Object.assign(Object.assign({},t),{fileHandle:null}),r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Jt&&e.shiftKey&&e[zt],PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:ts,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:Gh(),hidden:!Hc,onClick:()=>t(null),"data-testid":"save-as-button"})}}));dl({name:"loadScene",perform:async(e,t,n,r)=>{try{const{elements:n,appState:r,files:i}=await(async(e,t)=>{const n=await Uc({description:"Excalidraw files"});return td(n,e,t)})(t,e);return{elements:n,appState:r,files:i,commitToHistory:!0}}catch(n){return"AbortError"===(null==n?void 0:n.name)?(console.warn(n),!1):{elements:e,appState:Object.assign(Object.assign({},t),{errorMessage:n.message}),files:r.files,commitToHistory:!1}}},keyTest:e=>e[zt]&&e.key===Zt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)(Za,{type:"button",icon:ns,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:Gh(),onClick:t,"data-testid":"load-button"})}}),dl({name:"exportWithDarkMode",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportWithDarkMode:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,x.jsx)(Fl,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let Jd="{}";const Qd=dl({name:"copyStyles",perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(Jd=JSON.stringify(n)),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:e=>e[zt]&&e.altKey&&e.code===wt}),eu=dl({name:"pasteStyles",perform:(e,t)=>{const n=JSON.parse(Jd);return"text"!==(null==(r=n)?void 0:r.type)&&"diamond"!==(null==r?void 0:r.type)&&"rectangle"!==(null==r?void 0:r.type)&&"ellipse"!==(null==r?void 0:r.type)&&"arrow"!==(null==r?void 0:r.type)&&"freedraw"!==(null==r?void 0:r.type)&&"line"!==(null==r?void 0:r.type)?{elements:e,commitToHistory:!1}:{elements:e.map((e=>{if(t.selectedElementIds[e.id]){const t=Zr(e,{backgroundColor:null==n?void 0:n.backgroundColor,strokeWidth:null==n?void 0:n.strokeWidth,strokeColor:null==n?void 0:n.strokeColor,strokeStyle:null==n?void 0:n.strokeStyle,fillStyle:null==n?void 0:n.fillStyle,opacity:null==n?void 0:n.opacity,roughness:null==n?void 0:n.roughness});return Ee(t)&&(Yr(t,{fontSize:(null==n?void 0:n.fontSize)||o.n5,fontFamily:(null==n?void 0:n.fontFamily)||o.rk,textAlign:(null==n?void 0:n.textAlign)||o.Hg}),or(t)),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[zt]&&e.altKey&&e.code===Ct}),tu=e=>(0,x.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:ms}),nu=(dl({name:"toggleCanvasMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Za,{type:"button",icon:hs,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),dl({name:"toggleEditMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{visible:wa(n,_a(t)),type:"button",icon:os,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),dl({name:"toggleFullScreen",perform:()=>(yn()||document.documentElement.requestFullscreen(),yn()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===Et&&!e[zt]}),dl({name:"toggleShortcuts",perform:(e,t,n,r)=>{let{focusContainer:i}=r;return t.showHelpDialog&&i(),{appState:Object.assign(Object.assign({},t),{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(tu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Bt}),(e,t)=>{const n=Ta(_a(e),t,!0);return n.length>=2&&!(e=>{if(e.length>=2){const t=e[0].groupIds;for(const n of t)if(e.reduce(((e,t)=>e&&ii(t,n)),!0))return!0}return!1})(n)}),ru=dl({name:"group",perform:(e,t)=>{const n=Ta(_a(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=ni(t);if(1===r.length){const i=r[0],o=new Set(oi(e,i).map((e=>e.id))),a=new Set(n.map((e=>e.id)));if(new Set([...Array.from(o),...Array.from(a)]).size===o.size)return{appState:t,elements:e,commitToHistory:!1}}const i=Gr(),o=Ln(n),a=e.map((e=>o.get(e.id)?Zr(e,{groupIds:ai(e.groupIds,i,t.editingGroupId)}):e)),s=oi(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!ii(e,i))),...s,...d];return{appState:Qr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_a(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>nu(e,t),keyTest:e=>!e.shiftKey&&e[zt]&&e.code===_t,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!nu(t,n),type:"button",icon:(0,x.jsx)(As,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(wn("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Ma(_a(t),n)})}}),iu=dl({name:"ungroup",perform:(e,t)=>{if(0===ni(t).length)return{appState:t,elements:e,commitToHistory:!1};const n=e.map((e=>{const n=((e,t)=>e.filter((e=>!t[e])))(e.groupIds,t.selectedGroupIds);return n.length===e.groupIds.length?e:Zr(e,{groupIds:n})}));return{appState:ri(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_a(n)),elements:n,commitToHistory:!0}},keyTest:e=>e.shiftKey&&e[zt]&&e.code===_t,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>ni(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",hidden:0===ni(n).length,icon:(0,x.jsx)(Ps,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(wn("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Ma(_a(t),n)})}});n(2789);const ou=e=>{let{children:t,color:n,border:r,onClick:i}=e;return(0,x.jsx)("div",{className:"Avatar",style:{background:n,border:"1px solid ".concat(r)},onClick:i,children:t})},au=(dl({name:"goToCollaborator",perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),La({scenePoint:r,viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})),{openMenu:"canvas"===t.openMenu?null:t.openMenu}),commitToHistory:!1}:{appState:t,commitToHistory:!1}},PanelComponent:e=>{let{appState:t,updateData:n,data:r}=e;const i=null==r?void 0:r.id;if(!i)return null;const o=t.collaborators.get(i);if(!o)return null;const{background:a,stroke:s}=ic(i,t),l=(e=>{if(!e)return"?";const t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();const n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()})(o.username);return(0,x.jsx)(ou,{color:a,border:s,onClick:()=>n(o.pointer),children:l})}}),dl({name:"addToLibrary",perform:(e,t,n,r)=>{const i=Ta(_a(e),t,!0);return i.some((e=>"image"===e.type))?{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((e=>r.library.saveLibrary([{id:Gr(),status:"unpublished",elements:i.map(gi),created:Date.now()},...e]))).then((()=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.addedToLibrary")})}))).catch((e=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:e.message})})))},contextItemLabel:"labels.addToLibrary"})),su=e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[...r,e])})),Array.from(t.values())},lu=(e,t,n)=>{let{axis:r,position:i}=n;const o=nt(e),[a,s]="x"===r?["minX","maxX"]:["minY","maxY"],l={x:0,y:0};return"start"===i?Object.assign(Object.assign({},l),{[r]:t[a]-o[a]}):"end"===i?Object.assign(Object.assign({},l),{[r]:t[s]-o[s]}):Object.assign(Object.assign({},l),{[r]:(t[a]+t[s])/2-(o[a]+o[s])/2})},cu=(e,t)=>Ta(_a(e),t).length>1,du=(e,t,n)=>{const r=((e,t)=>{const n=su(e),r=nt(e);return n.flatMap((e=>{const n=lu(e,r,t);return e.map((e=>Zr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Ta(_a(e),t),n),i=Ln(r);return e.map((e=>i.get(e.id)||e))},uu=(dl({name:"alignTop",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"start",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===At,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ys,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(wn("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Ma(_a(t),n)})}}),dl({name:"alignBottom",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"end",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Tt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ws,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(wn("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Ma(_a(t),n)})}}),dl({name:"alignLeft",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"start",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Ot,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ks,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(wn("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Ma(_a(t),n)})}}),dl({name:"alignRight",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"end",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Lt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(_s,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(wn("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Ma(_a(t),n)})}}),dl({name:"alignVerticallyCentered",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(Cs,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Ma(_a(t),n)})}}),dl({name:"alignHorizontallyCentered",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(js,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Ma(_a(t),n)})}}),e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[...r,e])})),Array.from(t.values())}),hu=e=>{const[t,n,r,i]=Qe(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},pu=(e,t)=>Ta(_a(e),t).length>1,gu=(e,t,n)=>{const r=((e,t)=>{const[n,r,i,o]="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],a=hu(e),s=uu(e).map((e=>[e,hu(e)])).sort(((e,t)=>e[1][r]-t[1][r]));let l=0;for(const e of s)l+=e[1][o];const c=(a[o]-l)/(s.length-1);if(c<0){const e=s.findIndex((e=>e[1][n]===a[n])),o=s.findIndex((e=>e[1][i]===a[i])),l=(s[o][1][r]-s[e][1][r])/(s.length-1);let c=s[e][1][r];return s.flatMap(((n,i)=>{let[a,s]=n;const d={x:0,y:0};return i!==e&&i!==o&&(c+=l,d[t.axis]=c-s[r]),a.map((e=>Zr(e,{x:e.x+d.x,y:e.y+d.y})))}))}let d=a[n];return s.flatMap((e=>{let[r,i]=e;const a={x:0,y:0};return a[t.axis]=d-i[n],d+=c,d+=i[o],r.map((e=>Zr(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Ta(_a(e),t),n),i=Ln(r);return e.map((e=>i.get(e.id)||e))},mu=(dl({name:"distributeHorizontally",perform:(e,t)=>({appState:t,elements:gu(e,t,{space:"between",axis:"x"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===St,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!pu(t,n),type:"button",icon:(0,x.jsx)(Es,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(wn("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Ma(_a(t),n)})}}),dl({name:"distributeVertically",perform:(e,t)=>({appState:t,elements:gu(e,t,{space:"between",axis:"y"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===Ct,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!pu(t,n),type:"button",icon:(0,x.jsx)(Ss,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(wn("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Ma(_a(t),n)})}}),dl({name:"flipHorizontal",perform:(e,t)=>({elements:bu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Ta(_a(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),fu=dl({name:"flipVertical",perform:(e,t)=>({elements:bu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Ta(_a(e),t).length)(e,t)}),bu=(e,t,n)=>{const r=Ta(_a(e),t);if(r.length>1)return e;const i=xu(r,t,n),o=Ln(i);return e.map((e=>o.get(e.id)||e))},xu=(e,t,n)=>(e.forEach((e=>{vu(e,t),"vertical"===n&&yu(e,Math.PI)})),e),vu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=sa(e.angle);let s=0;(je(e)||Se(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Yr(e,{angle:sa(0)});const l=_i(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Yr(e,{angle:a});if(je(e)){for(let t=1;t<e.points.length;t++)Lo.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);Lo.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,pa(e,!0,e,c?"nw":"ne",!1,d,u[1]),Yr(e,{width:i,height:o});let h=sa(2*Math.PI-a);h<0&&(h=sa(h+2*Math.PI)),Yr(e,{angle:h}),Yr(e,{x:n+s,y:r}),Yo(e)},yu=(e,t)=>{const n=e.x,r=e.y;let i=sa(e.angle+t);i<0&&(i=sa(2*Math.PI+i)),Yr(e,{angle:i}),Yr(e,{x:n,y:r})},wu=dl({name:"copy",perform:(e,t,n,r)=>(Bd(_a(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),ku=dl({name:"cut",perform:(e,t,n,r)=>(wu.perform(e,t,n,r),hl.perform(e,t,n,r)),contextItemLabel:"labels.cut",keyTest:e=>e[zt]&&e.code===jt}),_u=dl({name:"copyAsSvg",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ta(_a(e),t,!0);try{return await Gd("clipboard-svg",i.length?i:_a(e),t,r.files,t),{commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsSvg"}),Eu=dl({name:"copyAsPng",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ta(_a(e),t,!0);try{return await Gd("clipboard",i.length?i:_a(e),t,r.files,t),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyToClipboardAsPng",{exportSelection:i.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}),commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsPng",keyTest:e=>e.code===wt&&e.altKey&&e.shiftKey}),Su=dl({name:"gridMode",perform(e,t){return nc("view","mode","grid"),{appState:Object.assign(Object.assign({},t),{gridSize:this.checked(t)?null:o.k}),commitToHistory:!1}},checked:e=>null!==e.gridSize,contextItemLabel:"labels.showGrid",keyTest:e=>e[zt]&&e.code===xt}),Cu=dl({name:"zenMode",perform(e,t){return nc("view","mode","zen"),{appState:Object.assign(Object.assign({},t),{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.zenModeEnabled,contextItemLabel:"buttons.zenMode",keyTest:e=>!e[zt]&&e.altKey&&e.code===It}),ju=dl({name:"stats",perform(e,t){return{appState:Object.assign(Object.assign({},t),{showStats:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.showStats,contextItemLabel:"stats.title",keyTest:e=>!e[zt]&&e.altKey&&e.code===yt}),Iu=(e,t,n)=>{const r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){const i=n();if(null===i)return{commitToHistory:r};const o=Ln(e),a=i.elements,s=Ln(a),l=e.filter((e=>!s.has(e.id))),c=a.map((e=>Zr(o.get(e.id)||e,e))).concat(l.map((e=>Zr(e,{isDeleted:!0}))));return oa(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}};class Mu{constructor(e,t,n,r){this.actions={},this.renderAction=(e,t)=>{const n=this.app.props.UIOptions.canvasActions;if(this.actions[e]&&"PanelComponent"in this.actions[e]&&(!(e in n)||n[e])){const n=this.actions[e],r=n.PanelComponent,i=e=>{this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app))};return(0,x.jsx)(r,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:i,appProps:this.app.props,data:t})}return null},this.updater=t=>{if(!t||!("then"in t))return e(t);t.then((t=>e(t)))},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach((e=>this.registerAction(e)))}handleKeyDown(e){const t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort(((e,t)=>(t.keyPriority||0)-(e.keyPriority||0))).filter((n=>(!(n.name in t)||t[n.name])&&n.keyTest&&n.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted())));if(0===n.length)return!1;const{viewModeEnabled:r}=this.getAppState();return!(r&&!Object.values(o.EH).includes(n[0].name))&&(e.preventDefault(),this.updater(n[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0)}executeAction(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}const Tu=class{constructor(e){this.libraryCache=null,this.resetLibrary=async()=>{var e,t;await(null===(e=(t=this.app.props).onLibraryChange)||void 0===e?void 0:e.call(t,[])),this.libraryCache=[]},this.restoreLibraryItem=e=>{const t=_a(Yc(e.elements,null));return t.length?Object.assign(Object.assign({},e),{elements:t}):null},this.loadLibrary=()=>new Promise((async e=>{if(this.libraryCache)return e(JSON.parse(JSON.stringify(this.libraryCache)));try{const t=this.app.libraryItemsFromStorage;if(!t)return e([]);const n=t.reduce(((e,t)=>(this.restoreLibraryItem(t)&&e.push(t),e)),[]);this.libraryCache=JSON.parse(JSON.stringify(n)),e(n)}catch(t){console.error(t),e([])}})),this.saveLibrary=async e=>{const t=this.libraryCache;try{var n,r;const t=JSON.stringify(e);this.libraryCache=JSON.parse(t),await(null===(n=(r=this.app.props).onLibraryChange)||void 0===n?void 0:n.call(r,e))}catch(e){throw this.libraryCache=t,e}},this.app=e}async importLibrary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";const n=await nd(e);if(!n||!n.libraryItems&&!n.library)return;const r=(e,t)=>!e.find((e=>e.elements.length===t.elements.length&&e.elements.every(((e,n)=>e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce)))),i=await this.loadLibrary(),o=n.libraryItems||n.library||[],a=Xc(o,t),s=[];for(const e of a){const t=this.restoreLibraryItem(e);t&&r(i,t)&&s.push(t)}await this.saveLibrary([...s,...i])}},Ou=e=>{const t=Array.from(e.values());return{x:Au(t,(e=>e.x))/t.length,y:Au(t,(e=>e.y))/t.length}},Lu=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Au=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),Pu=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const Du=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:Pu(e),elements:t.reduce(((t,n)=>{if(je(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(Object.assign(Object.assign({},n),{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}hydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.parse(t),elements:n.map((e=>{var t;const n=null===(t=this.elementCache.get(e.id))||void 0===t?void 0:t.get(e.versionNonce);if(!n)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return n}))}}dehydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.stringify(t),elements:n.map((e=>{this.elementCache.has(e.id)||this.elementCache.set(e.id,new Map);const t=this.elementCache.get(e.id);return t.has(e.versionNonce)||t.set(e.versionNonce,gi(e)),{id:e.id,versionNonce:e.versionNonce}}))}}getSnapshotForTest(){return{recording:this.recording,stateHistory:this.stateHistory.map((e=>this.hydrateHistoryEntry(e))),redoStack:this.redoStack.map((e=>this.hydrateHistoryEntry(e)))}}clear(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}shouldCreateEntry(e){const{lastEntry:t}=this;if(!t)return!0;if(e.elements.length!==t.elements.length)return!0;for(let n=e.elements.length-1;n>-1;n--){const r=e.elements[n],i=t.elements[n];if(!r||!i||r.id!==i.id||r.versionNonce!==i.versionNonce)return!0}let n;for(n in e.appState){var r,i;if("editingLinearElement"===n)if((null===(r=e.appState[n])||void 0===r?void 0:r.elementId)===(null===(i=t.appState[n])||void 0===i?void 0:i.elementId))continue;if("selectedElementIds"!==n&&"selectedGroupIds"!==n&&e.appState[n]!==t.appState[n])return!0}return!1}pushEntry(e,t){const n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}}clearRedoStack(){this.redoStack.splice(0,this.redoStack.length)}redoOnce(){if(0===this.redoStack.length)return null;const e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}undoOnce(){if(1===this.stateHistory.length)return null;const e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}setCurrentState(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}resumeRecording(){this.recording=!0}record(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}},zu=[{icon:(0,x.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,x.jsx)("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})}),value:"selection",key:en},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",children:(0,x.jsx)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})}),value:"rectangle",key:$t},{icon:(0,x.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,x.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:Wt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:Kt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,x.jsx)("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})}),value:"arrow",key:Vt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 6 6",children:(0,x.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[qt,Yt]},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})}),value:"freedraw",key:tn},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",children:(0,x.jsx)("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})}),value:"text",key:Qt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"})}),value:"image",key:null}];n(1292);const Nu={cut:[wn("CtrlOrCmd+X")],copy:[wn("CtrlOrCmd+C")],paste:[wn("CtrlOrCmd+V")],copyStyles:[wn("CtrlOrCmd+Alt+C")],pasteStyles:[wn("CtrlOrCmd+Alt+V")],selectAll:[wn("CtrlOrCmd+A")],deleteSelectedElements:[wn("Del")],duplicateSelection:[wn("CtrlOrCmd+D"),wn("Alt+".concat(b("helpDialog.drag")))],sendBackward:[wn("CtrlOrCmd+[")],bringForward:[wn("CtrlOrCmd+]")],sendToBack:[wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[wn("Shift+Alt+C")],copyAsSvg:[],group:[wn("CtrlOrCmd+G")],ungroup:[wn("CtrlOrCmd+Shift+G")],gridMode:[wn("CtrlOrCmd+'")],zenMode:[wn("Alt+Z")],stats:[wn("Alt+/")],addToLibrary:[],flipHorizontal:[wn("Shift+H")],flipVertical:[wn("Shift+V")],viewMode:[wn("Alt+R")]},Ru=e=>{const t=Nu[e];return t&&t.length>0?t[0]:""},Hu=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a}=e;return(0,x.jsx)(Ol,{onCloseRequest:n,top:r,left:i,fitInViewport:!0,children:(0,x.jsx)("ul",{className:"context-menu",onContextMenu:e=>e.preventDefault(),children:t.map(((e,t)=>{var r;if("separator"===e)return(0,x.jsx)("hr",{className:"context-menu-option-separator"},t);const i=e.name,s=e.contextItemLabel?b(e.contextItemLabel):"";return(0,x.jsx)("li",{"data-testid":i,onClick:n,children:(0,x.jsxs)("button",{className:ye("context-menu-option",{dangerous:"deleteSelectedElements"===i,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:()=>o.executeAction(e),children:[(0,x.jsx)("div",{className:"context-menu-option__label",children:s}),(0,x.jsx)("kbd",{className:"context-menu-option__shortcut",children:i?Ru(i):""})]})},t)}))})})},Bu=new WeakMap,Fu={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,at.render)((0,x.jsx)(Hu,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=Bu.get(e);t&&((0,at.unmountComponentAtNode)(t),t.remove(),Bu.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState}),(e=>{let t=Bu.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),Bu.set(e,t),t)})(e.container))}},Uu=e=>{var t;let{appState:n,elements:r,renderAction:i,elementType:o}=e;const a=Oa(_a(r),n),s=Boolean(n.editingElement),l=Gh(),c="rtl"===document.documentElement.getAttribute("dir"),d=Pa(o)||a.some((e=>Pa(e.type)&&!Mn(e.backgroundColor))),u=Pa(o)||a.some((e=>Pa(e.type)));let h=(null===(t=a[0])||void 0===t?void 0:t.type)||null;for(const e of a)if(e.type!==h){h=null;break}return(0,x.jsxs)("div",{className:"panelColumn",children:[(Da(o)&&"image"!==o&&"image"!==h||a.some((e=>Da(e.type))))&&i("changeStrokeColor"),u&&i("changeBackgroundColor"),d&&i("changeFillStyle"),(za(o)||a.some((e=>za(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Na(o)||a.some((e=>Na(e.type))))&&(0,x.jsxs)(x.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Ra(o)||a.some((e=>Ra(e.type))))&&(0,x.jsx)(x.Fragment,{children:i("changeSharpness")}),(Ha(o)||a.some((e=>Ha(e.type))))&&(0,x.jsxs)(x.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),(Ba(o)||a.some((e=>Ba(e.type))))&&(0,x.jsx)(x.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.layers")}),(0,x.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),a.length>1&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.align")}),(0,x.jsxs)("div",{className:"buttonList",children:[c?(0,x.jsxs)(x.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,x.jsxs)(x.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),a.length>2&&i("distributeHorizontally"),(0,x.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),a.length>2&&i("distributeVertically")]})]})]}),!l&&!s&&a.length>0&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.actions")}),(0,x.jsxs)("div",{className:"buttonList",children:[i("duplicateSelection"),i("deleteSelectedElements"),i("group"),i("ungroup")]})]})]})},Vu=e=>{let{canvas:t,elementType:n,setAppState:r,onImageAction:i}=e;return(0,x.jsx)(x.Fragment,{children:zu.map(((e,o)=>{let{value:a,icon:s,key:l}=e;const c=b("toolBar.".concat(a)),d=l&&("string"==typeof l?l:l[0]),u=d?"".concat(un(d)," ").concat(b("helpDialog.or")," ").concat(o+1):"".concat(o+1);return(0,x.jsx)(Za,{className:"Shape",type:"radio",icon:s,checked:n===a,name:"editor-current-shape",title:"".concat(un(c)," — ").concat(u),keyBindingLabel:"".concat(o+1),"aria-label":un(c),"aria-keyshortcuts":u,"data-testid":a,onChange:e=>{let{pointerType:n}=e;r({elementType:a,multiElement:null,selectedElementIds:{}}),vn(t,a),"image"===a&&i({pointerType:n})}},a)}))})},Wu=e=>{let{renderAction:t,zoom:n}=e;return(0,x.jsx)(qd,{gap:1,children:(0,x.jsxs)(Zd,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},Ku=e=>{let{appState:t,setAppState:n,actionManager:r,showThemeBtn:i}=e;return(0,x.jsxs)("div",{style:{display:"flex"},children:[r.renderAction("changeViewBackgroundColor"),i&&r.renderAction("toggleTheme")]})};n(778);const Gu=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(Za,{className:ye("CollabButton",{"is-collaborating":t}),onClick:r,icon:Is,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:Gh(),children:n>0&&(0,x.jsx)("div",{className:"CollabButton-collaborators",children:n})})})},Yu=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=Zh(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,x.jsx)(x.Fragment,{children:o&&(0,x.jsx)(Zl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,x.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const Zu="filter"in document.createElement("canvas").getContext("2d"),qu=()=>(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{children:b("canvasError.cannotShowPreview")}),(0,x.jsx)("p",{children:(0,x.jsx)("span",{children:b("canvasError.canvasTooBig")})}),(0,x.jsxs)("em",{children:["(",b("canvasError.canvasTooBigTip"),")"]})]}),Xu=(e,t)=>{(0,at.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,at.render)((0,x.jsx)(qu,{}),t)},$u=e=>{let{children:t,title:n,onClick:r,color:i,shade:o=6}=e;return(0,x.jsx)("button",{className:"ExportDialog-imageExportButton",style:{"--button-color":rt[i][o],"--button-color-darker":rt[i][o+1],"--button-color-darkest":rt[i][o+2]},title:n,"aria-label":n,onClick:r,children:t})},Ju=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Ma(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:m,viewBackgroundColor:f}=n,v=h?Ta(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&fd(v,n,i,{exportBackground:m,viewBackgroundColor:f,exportPadding:a}).then((t=>rd(t).then((()=>{Xu(t,e)})))).catch((t=>{console.error(t),Xu(new Ka,e)}))}),[n,i,v,m,a,f]),(0,x.jsxs)("div",{className:"ExportDialog",children:[(0,x.jsx)("div",{className:"ExportDialog__preview",ref:g}),Zu&&s.renderAction("exportWithDarkMode"),(0,x.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,x.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[s.renderAction("changeExportBackground"),u&&(0,x.jsx)(Yd,{checked:h,onChange:e=>p(e),children:b("labels.onlySelected")}),s.renderAction("changeExportEmbedScene")]})}),(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,x.jsx)(Zd,{gap:2,children:s.renderAction("changeExportScale")}),(0,x.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,x.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!Hc&&s.renderAction("changeProjectName")}),(0,x.jsxs)(Zd,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,x.jsx)($u,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(v),children:"PNG"}),(0,x.jsx)($u,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(v),children:"SVG"}),Hd&&(0,x.jsx)($u,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(v),color:"gray",shade:7,children:rs})]})]})},Qu=e=>{let{elements:t,appState:n,files:a,exportPadding:s=o.qy,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u}=e;const[h,p]=(0,r.useState)(!1),g=i().useCallback((()=>{p(!1)}),[]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:ss,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:Gh(),title:b("buttons.exportImage")}),h&&(0,x.jsx)(Zl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,x.jsx)(Ju,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const eh=e=>{let{children:t,side:n,className:r}=e;return(0,x.jsx)("div",{className:ye("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})};n(7096);const th=e=>{let{appState:t,elements:n,isMobile:r}=e,i=(e=>{let{appState:t,elements:n,isMobile:r}=e;const{elementType:i,isResizing:o,isRotating:a,lastPointerDownWith:s}=t,l=null!==t.multiElement;if("arrow"===i||"line"===i)return b(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i)return b("hints.freeDraw");if("text"===i)return b("hints.text");if("image"===t.elementType&&t.pendingImageElement)return b("hints.placeImage");const c=Ta(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return je(e)&&2===e.points.length?b("hints.lockAngle"):_e(e)?b("hints.resizeImage"):b("hints.resize")}if(a&&"mouse"===s)return b("hints.rotate");if(1===c.length){if(je(c[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?b("hints.lineEditor_pointSelected"):b("hints.lineEditor_nothingSelected"):b("hints.lineEditor_info");if(null!=(d=c[0])&&("rectangle"===d.type||"diamond"===d.type||"ellipse"===d.type||"image"===d.type))return b("hints.bindTextToElement")}var d;return 1===c.length&&Ee(c[0])?b("hints.text_selected"):t.editingElement&&Ee(t.editingElement)?b("hints.text_editing"):"selection"!==i||c.length||r?null:b("hints.canvasPanning")})({appState:t,elements:n,isMobile:r});return i?(i=wn(i),(0,x.jsx)("div",{className:"HintViewer",children:(0,x.jsx)("span",{children:i})})):null},nh={CHECKED:(0,x.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,x.jsx)("path",{d:"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"})}),UNCHECKED:(0,x.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:(0,x.jsx)("path",{d:"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z"})})},rh=e=>(0,x.jsxs)("label",{className:ye("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,x.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,x.jsx)("div",{className:"ToolIcon__icon",children:e.checked?nh.CHECKED:nh.UNCHECKED})]});var ih=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const oh=e=>{let{heading:t,children:n}=e,r=ih(e,["heading","children"]);const{id:i}=Zh(),o=(0,x.jsx)("h2",{className:"visually-hidden",id:"".concat(i,"-").concat(t,"-title"),children:b("headings.".concat(t))});return(0,x.jsx)("section",Object.assign(Object.assign({},r),{"aria-labelledby":"".concat(i,"-").concat(t,"-title"),children:"function"==typeof n?n(o):(0,x.jsxs)(x.Fragment,{children:[o,n]})}))};n(580);const ah=e=>{let{children:t,className:n,mobile:r}=e;return(0,x.jsx)("div",{className:ye("UserList",n,{UserList_mobile:r}),children:t})},sh=(0,x.jsx)("svg",{viewBox:"0 0 576 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"})}),lh=e=>{let{appState:t,setAppState:n,isMobile:r}=e;return(0,x.jsxs)("label",{className:ye("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(un(b("toolBar.library"))," — 0"),children:[(0,x.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:e=>{n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":un(b("toolBar.library")),"aria-keyshortcuts":"0"}),(0,x.jsx)("div",{className:"ToolIcon__icon",children:sh})]})},ch=e=>{let{appState:t,elements:n,libraryMenu:r,actionManager:o,renderJSONExportDialog:a,renderImageExportDialog:s,setAppState:l,onCollabButtonClick:c,onLockToggle:d,canvas:u,isCollaborating:h,renderCustomFooter:p,viewModeEnabled:g,showThemeBtn:m,onImageAction:f,renderTopRightUI:v}=e;return(0,x.jsxs)(x.Fragment,{children:[!g&&(0,x.jsxs)(eh,{side:"top",className:"App-top-bar",children:[(0,x.jsx)(oh,{heading:"shapes",children:e=>(0,x.jsxs)(qd,{gap:4,align:"center",children:[(0,x.jsxs)(Zd,{gap:1,className:"App-toolbar-container",children:[(0,x.jsxs)(Kl,{padding:1,className:"App-toolbar",children:[e,(0,x.jsx)(Zd,{gap:1,children:(0,x.jsx)(Vu,{canvas:u,elementType:t.elementType,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;f({insertOnCanvasDirectly:"mouse"!==t})}})})]}),v&&v(!0,t),(0,x.jsx)(rh,{checked:t.elementLocked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,x.jsx)(lh,{appState:t,setAppState:l,isMobile:!0})]}),r]})}),(0,x.jsx)(th,{appState:t,elements:n,isMobile:!0})]}),(0,x.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,x.jsxs)(Kl,{padding:0,children:["canvas"===t.openMenu?(0,x.jsx)(oh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,x.jsx)("div",{className:"panelColumn",children:(0,x.jsxs)(qd,{gap:4,children:[g?(0,x.jsxs)(x.Fragment,{children:[a(),s()]}):(0,x.jsxs)(x.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),a(),s(),c&&(0,x.jsx)(Gu,{isCollaborating:h,collaboratorCount:t.collaborators.size,onClick:c}),(0,x.jsx)(Ku,{actionManager:o,appState:t,setAppState:l,showThemeBtn:m})]}),null==p?void 0:p(!0,t),t.collaborators.size>0&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.collaborators")}),(0,x.jsx)(ah,{mobile:!0,children:Array.from(t.collaborators).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[t,n]=e;return(0,x.jsx)(i().Fragment,{children:o.renderAction("goToCollaborator",{id:t})},t)}))})]})]})})}):"shape"===t.openMenu&&!g&&wa(t,n)?(0,x.jsx)(oh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,x.jsx)(Uu,{appState:t,elements:n,renderAction:o.renderAction,elementType:t.elementType})}):null,(0,x.jsxs)("footer",{className:"App-toolbar",children:[g?(0,x.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,x.jsxs)("div",{className:"App-toolbar-content",children:[o.renderAction("toggleCanvasMenu"),o.renderAction("toggleEditMenu"),o.renderAction("undo"),o.renderAction("redo"),o.renderAction(t.multiElement?"finalize":"duplicateSelection"),o.renderAction("deleteSelectedElements")]}),t.scrolledOutside&&!t.openMenu&&(0,x.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{l(Object.assign({},Aa(n,t)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const dh=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=Pd(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await bd(n,{exportBackground:!1,viewBackgroundColor:rt.white},null),o.appendChild(r),e.selected&&o.parentNode.focus()})(),()=>{o.removeChild(r)}}),[e.spreadsheet,e.chartType,e.selected]),(0,x.jsx)("button",{className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:(0,x.jsx)("div",{ref:t})})},uh=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),nc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,x.jsx)(Zl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,x.jsxs)("div",{className:"container",children:[(0,x.jsx)(dh,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,x.jsx)(dh,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const hh=()=>(0,x.jsxs)("div",{className:"HelpDialog--header",children:[(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.documentation")}),(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.blog")}),(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.github")})]}),ph=e=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{children:e.title}),e.children]}),gh=e=>(0,x.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),mh=e=>(0,x.jsx)("div",{style:{width:"49%"},children:e.children}),fh=e=>(0,x.jsxs)("div",{className:"HelpDialog--island",children:[(0,x.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),bh=e=>(0,x.jsx)("div",{className:"HelpDialog--shortcut",children:(0,x.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,x.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,x.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map(((t,n)=>(0,x.jsxs)(i().Fragment,{children:[(0,x.jsx)(xh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});bh.defaultProps={isOr:!0};const xh=e=>(0,x.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),vh=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(Zl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,x.jsx)(hh,{}),(0,x.jsx)(ph,{title:b("helpDialog.shortcuts"),children:(0,x.jsxs)(gh,{children:[(0,x.jsxs)(mh,{children:[(0,x.jsxs)(fh,{caption:b("helpDialog.shapes"),children:[(0,x.jsx)(bh,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,x.jsx)(bh,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,x.jsx)(bh,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,x.jsx)(bh,{label:b("toolBar.ellipse"),shortcuts:["E","4"]}),(0,x.jsx)(bh,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,x.jsx)(bh,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,x.jsx)(bh,{label:b("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),(0,x.jsx)(bh,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,x.jsx)(bh,{label:b("toolBar.image"),shortcuts:["9"]}),(0,x.jsx)(bh,{label:b("toolBar.library"),shortcuts:["0"]}),(0,x.jsx)(bh,{label:b("helpDialog.editSelectedShape"),shortcuts:[wn("Enter"),b("helpDialog.doubleClick")]}),(0,x.jsx)(bh,{label:b("helpDialog.textNewLine"),shortcuts:[wn("Enter"),wn("Shift+Enter")]}),(0,x.jsx)(bh,{label:b("helpDialog.textFinish"),shortcuts:[wn("Esc"),wn("CtrlOrCmd+Enter")]}),(0,x.jsx)(bh,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,x.jsx)(bh,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,x.jsx)(bh,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,x.jsx)(bh,{label:b("helpDialog.preventBinding"),shortcuts:[wn("CtrlOrCmd")]})]}),(0,x.jsxs)(fh,{caption:b("helpDialog.view"),children:[(0,x.jsx)(bh,{label:b("buttons.zoomIn"),shortcuts:[wn("CtrlOrCmd++")]}),(0,x.jsx)(bh,{label:b("buttons.zoomOut"),shortcuts:[wn("CtrlOrCmd+-")]}),(0,x.jsx)(bh,{label:b("buttons.resetZoom"),shortcuts:[wn("CtrlOrCmd+0")]}),(0,x.jsx)(bh,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,x.jsx)(bh,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,x.jsx)(bh,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,x.jsx)(bh,{label:b("buttons.zenMode"),shortcuts:[wn("Alt+Z")]}),(0,x.jsx)(bh,{label:b("labels.showGrid"),shortcuts:[wn("CtrlOrCmd+'")]}),(0,x.jsx)(bh,{label:b("labels.viewMode"),shortcuts:[wn("Alt+R")]}),(0,x.jsx)(bh,{label:b("labels.toggleTheme"),shortcuts:[wn("Alt+Shift+D")]}),(0,x.jsx)(bh,{label:b("stats.title"),shortcuts:[wn("Alt+/")]})]})]}),(0,x.jsx)(mh,{children:(0,x.jsxs)(fh,{caption:b("helpDialog.editor"),children:[(0,x.jsx)(bh,{label:b("labels.selectAll"),shortcuts:[wn("CtrlOrCmd+A")]}),(0,x.jsx)(bh,{label:b("labels.multiSelect"),shortcuts:[wn("Shift+".concat(b("helpDialog.click")))]}),(0,x.jsx)(bh,{label:b("labels.moveCanvas"),shortcuts:[wn("Space+".concat(b("helpDialog.drag"))),wn("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,x.jsx)(bh,{label:b("labels.cut"),shortcuts:[wn("CtrlOrCmd+X")]}),(0,x.jsx)(bh,{label:b("labels.copy"),shortcuts:[wn("CtrlOrCmd+C")]}),(0,x.jsx)(bh,{label:b("labels.paste"),shortcuts:[wn("CtrlOrCmd+V")]}),(0,x.jsx)(bh,{label:b("labels.copyAsPng"),shortcuts:[wn("Shift+Alt+C")]}),(0,x.jsx)(bh,{label:b("labels.copyStyles"),shortcuts:[wn("CtrlOrCmd+Alt+C")]}),(0,x.jsx)(bh,{label:b("labels.pasteStyles"),shortcuts:[wn("CtrlOrCmd+Alt+V")]}),(0,x.jsx)(bh,{label:b("labels.delete"),shortcuts:[wn("Del")]}),(0,x.jsx)(bh,{label:b("labels.sendToBack"),shortcuts:[wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,x.jsx)(bh,{label:b("labels.bringToFront"),shortcuts:[wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,x.jsx)(bh,{label:b("labels.sendBackward"),shortcuts:[wn("CtrlOrCmd+[")]}),(0,x.jsx)(bh,{label:b("labels.bringForward"),shortcuts:[wn("CtrlOrCmd+]")]}),(0,x.jsx)(bh,{label:b("labels.alignTop"),shortcuts:[wn("CtrlOrCmd+Shift+Up")]}),(0,x.jsx)(bh,{label:b("labels.alignBottom"),shortcuts:[wn("CtrlOrCmd+Shift+Down")]}),(0,x.jsx)(bh,{label:b("labels.alignLeft"),shortcuts:[wn("CtrlOrCmd+Shift+Left")]}),(0,x.jsx)(bh,{label:b("labels.alignRight"),shortcuts:[wn("CtrlOrCmd+Shift+Right")]}),(0,x.jsx)(bh,{label:b("labels.duplicateSelection"),shortcuts:[wn("CtrlOrCmd+D"),wn("Alt+".concat(b("helpDialog.drag")))]}),(0,x.jsx)(bh,{label:b("buttons.undo"),shortcuts:[wn("CtrlOrCmd+Z")]}),(0,x.jsx)(bh,{label:b("buttons.redo"),shortcuts:lt?[wn("CtrlOrCmd+Y"),wn("CtrlOrCmd+Shift+Z")]:[wn("CtrlOrCmd+Shift+Z")]}),(0,x.jsx)(bh,{label:b("labels.group"),shortcuts:[wn("CtrlOrCmd+G")]}),(0,x.jsx)(bh,{label:b("labels.ungroup"),shortcuts:[wn("CtrlOrCmd+Shift+G")]}),(0,x.jsx)(bh,{label:b("labels.flipHorizontal"),shortcuts:[wn("Shift+H")]}),(0,x.jsx)(bh,{label:b("labels.flipVertical"),shortcuts:[wn("Shift+V")]}),(0,x.jsx)(bh,{label:b("labels.showStroke"),shortcuts:[wn("S")]}),(0,x.jsx)(bh,{label:b("labels.showBackground"),shortcuts:[wn("G")]})]})})]})})]})})};n(5080);const yh=e=>{let{children:t,color:n}=e;return(0,x.jsx)("div",{className:"Card",style:{"--card-color":"primary"===n?"var(--color-primary)":rt[n][7],"--card-color-darker":"primary"===n?"var(--color-primary-darker)":rt[n][8],"--card-color-darkest":"primary"===n?"var(--color-primary-darkest)":rt[n][9]},children:t})},wh=e=>{let{elements:t,appState:n,files:r,actionManager:i,exportOpts:o,canvas:a}=e;const{onExportToBackend:s}=o;return(0,x.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,x.jsxs)("div",{className:"ExportDialog-cards",children:[o.saveFileToDisk&&(0,x.jsxs)(yh,{color:"lime",children:[(0,x.jsx)("div",{className:"Card-icon",children:ls}),(0,x.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,x.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!Hc&&i.renderAction("changeProjectName")]}),(0,x.jsx)(Za,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction($d)}})]}),s&&(0,x.jsxs)(yh,{color:"pink",children:[(0,x.jsx)("div",{className:"Card-icon",children:Qa}),(0,x.jsx)("h2",{children:b("exportDialog.link_title")}),(0,x.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,x.jsx)(Za,{className:"Card-button",type:"button",title:b("exportDialog.link_button"),"aria-label":b("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>s(t,n,r,a)})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},kh=e=>{let{elements:t,appState:n,files:o,actionManager:a,exportOpts:s,canvas:l}=e;const[c,d]=(0,r.useState)(!1),u=i().useCallback((()=>{d(!1)}),[]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{onClick:()=>{d(!0)},"data-testid":"json-export-button",icon:as,type:"button","aria-label":b("buttons.export"),showAriaLabel:Gh(),title:b("buttons.export")}),c&&(0,x.jsx)(Zl,{onCloseRequest:u,title:b("buttons.export"),children:(0,x.jsx)(wh,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})},_h=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=qc({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return fd(_a(a),Object.assign(Object.assign({},s),{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:l,viewBackgroundColor:c},((e,t)=>{var n;const r=document.createElement("canvas");if(i){"function"==typeof o&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");const n=Math.max(e,t),a=i/n;return r.width=e*a,r.height=t*a,{canvas:r,scale:a}}const a=(null==o?void 0:o(e,t))||{width:e,height:t};return r.width=a.width,r.height=a.height,{canvas:r,scale:null!==(n=a.scale)&&void 0!==n?n:1}}))},Eh=async e=>{var t;let{mimeType:n=o.LO.png,quality:r}=e;n===o.LO.png&&"number"==typeof r&&console.warn('"quality" will be ignored for "'.concat(o.LO.png,'" mimeType')),"image/jpg"===n&&(n=o.LO.jpg),n!==o.LO.jpg||null!==(t=e.appState)&&void 0!==t&&t.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(o.LO.jpg,'" mimeType')),e=Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState),{exportBackground:!0})}));const i=await _h(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((e=>{i.toBlob((t=>{e(t)}),n,r)}))},Sh=async e=>{let{elements:t,appState:n=Pn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=qc({elements:t,appState:n},null,null);return bd(_a(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)};n(9295),n(9781);const Ch=e=>{let{libItem:t,appState:n,index:i,onChange:o,onRemove:a}=e;const s=(0,r.useRef)(null),l=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const e=s.current;e&&(async()=>{const r=await Sh({elements:t.elements,appState:Object.assign(Object.assign({},n),{viewBackgroundColor:rt.white,exportBackground:!0}),files:null});e.innerHTML=r.outerHTML})()}),[t.elements,n]),(0,x.jsxs)("div",{className:"single-library-item",children:[(0,x.jsx)("div",{ref:s,className:"single-library-item__svg"}),(0,x.jsx)(Za,{"aria-label":b("buttons.remove"),type:"button",icon:Ms,className:"single-library-item--remove",onClick:a.bind(null,t.id),title:b("buttons.remove")}),(0,x.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,x.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,x.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,x.jsx)("span",{style:{fontWeight:500,color:rt.gray[6]},children:b("publishDialog.itemName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",ref:l,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:e=>{o(e.target.value,i)}})]}),(0,x.jsx)("span",{className:"error",children:t.error})]})]})},jh="publish-library-data",Ih=async e=>{const t=128,n=Math.round(8),r=Math.max(Math.round(2),2),i=((e,t)=>{if(!e.length||t<1)return[];let n=0,r=0;const i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i})(e,6),a=document.createElement("canvas");a.width=i[0].length*t+(i[0].length+1)*(2*n)-2*n,a.height=i.length*t+(i.length+1)*(2*n)-2*n;const s=a.getContext("2d");s.fillStyle=rt.white,s.fillRect(0,0,a.width,a.height);for(const[i,o]of e.entries()){const e=await _h({elements:o.elements,files:null,maxWidthOrHeight:t}),{width:a,height:l}=e,c=Math.floor(i/6)*(t+2*n),d=i%6*(t+2*n);s.drawImage(e,d+(t-a)/2+n,c+(t-l)/2+n),s.lineWidth=r,s.strokeStyle=rt.gray[4],s.strokeRect(d+n/2,c+n/2,t+n,t+n)}return await ad(new File([await rd(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Mh=e=>{let{onClose:t,libraryItems:n,appState:i,onSuccess:a,onError:s,updateItemsInStorage:l,onRemove:c}=e;const[d,u]=(0,r.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[h,p]=(0,r.useState)(!1);(0,r.useEffect)((()=>{const e=(()=>{try{const e=localStorage.getItem(jh);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null})();e&&u(e)}),[]);const[g,m]=(0,r.useState)(n.slice());(0,r.useEffect)((()=>{m(n.slice())}),[n]);const f=e=>{u(Object.assign(Object.assign({},d),{[e.target.name]:e.target.value}))},v=(0,r.useCallback)((()=>{l(g),(e=>{try{localStorage.setItem(jh,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),y=!!n.length;return(0,x.jsx)(Zl,{onCloseRequest:v,title:b("publishDialog.title"),className:"publish-library",children:y?(0,x.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),p(!0);const t=[];let n=!1;if(g.forEach((e=>{let r="";e.name||(r=b("publishDialog.errors.required"),n=!0),t.push(Object.assign(Object.assign({},e),{error:r}))})),n)return m(t),void p(!1);const r=await Ih(g),i={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:g},l=JSON.stringify(i,null,2),c=new Blob([l],{type:"application/json"}),u=new FormData;u.append("excalidrawLib",c),u.append("previewImage",r),u.append("previewImageType",r.type),u.append("title",d.name),u.append("authorName",d.authorName),u.append("githubHandle",d.githubHandle),u.append("name",d.name),u.append("description",d.description),u.append("twitterHandle",d.twitterHandle),u.append("website",d.website),fetch("".concat("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries","/submit"),{method:"post",body:u}).then((e=>e.ok?e.json().then((e=>{let{url:t}=e;localStorage.removeItem(jh),a({url:t,authorName:d.authorName,items:g})})):e.json().catch((()=>{throw new Error(e.statusText||"something went wrong")})).then((t=>{throw new Error(t.message||e.statusText||"something went wrong")}))),(e=>{console.error(e),s(e),p(!1)})).catch((e=>{console.error(e),s(e),p(!1)}))},children:[(0,x.jsxs)("div",{className:"publish-library-note",children:[b("publishDialog.noteDescription.pre"),(0,x.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteDescription.link")})," ",b("publishDialog.noteDescription.post")]}),(0,x.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteGuidelines.pre"),(0,x.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteGuidelines.link")}),b("publishDialog.noteGuidelines.post")]}),(0,x.jsx)("div",{className:"publish-library-note",children:b("publishDialog.noteItems")}),(()=>{const e=[];return g.forEach(((t,n)=>{e.push((0,x.jsx)("div",{className:"single-library-item-wrapper",children:(0,x.jsx)(Ch,{libItem:t,appState:i,index:n,onChange:(e,t)=>{const n=g.slice();n[t].name=e,m(n)},onRemove:c})},n))})),(0,x.jsx)("div",{className:"selected-library-items",children:e})})(),(0,x.jsxs)("div",{className:"publish-library__fields",children:[(0,x.jsxs)("label",{children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.libraryName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",name:"name",required:!0,value:d.name,onChange:f,placeholder:b("publishDialog.placeholder.libraryName")})]}),(0,x.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.libraryDesc")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("textarea",{name:"description",rows:4,required:!0,value:d.description,onChange:f,placeholder:b("publishDialog.placeholder.libraryDesc")})]}),(0,x.jsxs)("label",{children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.authorName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",name:"authorName",required:!0,value:d.authorName,onChange:f,placeholder:b("publishDialog.placeholder.authorName")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.githubUsername")}),(0,x.jsx)("input",{type:"text",name:"githubHandle",value:d.githubHandle,onChange:f,placeholder:b("publishDialog.placeholder.githubHandle")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.twitterUsername")}),(0,x.jsx)("input",{type:"text",name:"twitterHandle",value:d.twitterHandle,onChange:f,placeholder:b("publishDialog.placeholder.twitterHandle")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.website")}),(0,x.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:b("publishDialog.errors.website"),value:d.website,onChange:f,placeholder:b("publishDialog.placeholder.website")})]}),(0,x.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteLicense.pre"),(0,x.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteLicense.link")}),b("publishDialog.noteLicense.post")]})]}),(0,x.jsxs)("div",{className:"publish-library__buttons",children:[(0,x.jsx)(Za,{type:"button",title:b("buttons.cancel"),"aria-label":b("buttons.cancel"),label:b("buttons.cancel"),onClick:v,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,x.jsx)(Za,{type:"submit",title:b("buttons.submit"),"aria-label":b("buttons.submit"),label:b("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:h})]})]}):(0,x.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:b("publishDialog.atleastOneLibItem")})})};n(4406);var Th=n(2891);n(694);const Oh=(0,x.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,x.jsx)("path",{d:"M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z",style:{stroke:"#fff",strokeWidth:140},transform:"translate(0 64)"})}),Lh=e=>{let{id:t,elements:n,files:i,isPending:a,onClick:s,selected:l,onToggle:c}=e;const d=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=d.current;if(e)return(async()=>{if(!n)return;const t=await bd(n,{exportBackground:!1,viewBackgroundColor:rt.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=Gh(),g=a&&(0,x.jsx)("div",{className:"library-unit__adder",children:Oh});return(0,x.jsxs)("div",{className:ye("library-unit",{"library-unit__active":n,"library-unit--hover":n&&u,"library-unit--selected":l}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,x.jsx)("div",{className:ye("library-unit__dragger",{"library-unit__pulse":!!a}),ref:d,draggable:!!n,onClick:n||a?e=>{t&&e.shiftKey?c(t,e):s()}:void 0,onDragStart:e=>{h(!1),e.dataTransfer.setData(o.LO.excalidrawlib,JSON.stringify(n))}}),g,t&&n&&(u||p||l)&&(0,x.jsx)(Yd,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const Ah=e=>{let{libraryItems:t,onRemoveFromLibrary:n,onAddToLibrary:i,onInsertShape:a,pendingElements:s,theme:l,setAppState:c,libraryReturnUrl:d,library:u,files:h,id:p,selectedItems:g,onToggle:m,onPublish:f,resetLibrary:v}=e;const y=(0,r.useCallback)((()=>{const e=g.length?b("alerts.removeItemsFromsLibrary",{count:g.length}):b("alerts.resetLibrary"),t=g.length?b("confirmDialog.removeItemsFromLib"):b("confirmDialog.resetLibrary");return(0,x.jsx)(Xl,{onConfirm:()=>{g.length?n():v(),k(!1)},onCancel:()=>{k(!1)},title:t,children:(0,x.jsx)("p",{children:e})})}),[g,n,v]),[w,k]=(0,r.useState)(!1),_=Gh(),E=_?4:6,S=d||window.location.origin+window.location.pathname,C=g.some((e=>{var n;return"published"===(null===(n=t.find((t=>t.id===e)))||void 0===n?void 0:n.status)})),j=e=>{var t,n,r,i,o;return(0,x.jsx)(qd,{children:(0,x.jsx)(Lh,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:h,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||(()=>{}),id:(null===(i=e.item)||void 0===i?void 0:i.id)||null,selected:!(null===(o=e.item)||void 0===o||!o.id)&&g.includes(e.item.id),onToggle:(e,t)=>{m(e,t)}})},e.key)},I=e=>{const t=e.map((e=>e.id?j({item:e,onClick:()=>a(e.elements),key:e.id}):j({key:"__pending__item__",item:e,onClick:()=>i(s)})));let n=(0,Th.chunk)(t,E);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(E-e.length).fill(null).map(((e,t)=>j({key:"empty_".concat(t),item:null}))))),(0,x.jsx)(Zd,{align:"center",gap:1,children:e},t))))},M=t.filter((e=>"published"===e.status)),T=[...s.length?[{id:null,elements:s}]:[],...t.filter((e=>"published"!==e.status))];return(0,x.jsxs)("div",{className:"library-menu-items-container",children:[w&&y(),(0,x.jsxs)("div",{className:"layer-ui__library-header",children:[(()=>{const e=!!g.length,n=e?t.filter((e=>g.includes(e.id))):t,r=b(e?"buttons.remove":"buttons.resetLibrary");return(0,x.jsxs)("div",{className:"library-actions",children:[(!e||!_)&&(0,x.jsx)(Za,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:ns,onClick:()=>{(async e=>{const t=await Uc({description:"Excalidraw library files"});await e.importLibrary(t)})(u).then((()=>{c({isLibraryOpen:!1}),c({isLibraryOpen:!0})})).catch(In).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:ls,onClick:async()=>{(async e=>{const t={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:e},n=JSON.stringify(t,null,2);await Vc(new Blob([n],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(In).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--export",children:g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})},"export"),(0,x.jsx)(Za,{type:"button",title:r,"aria-label":r,icon:is,onClick:()=>k(!0),className:"library-actions--remove",children:g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})},"reset")]}),e&&!C&&(0,x.jsx)(Wl,{label:b("hints.publishLibrary"),children:(0,x.jsxs)(Za,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:ll,className:"library-actions--publish",onClick:f,children:[!_&&(0,x.jsx)("label",{children:b("buttons.publishLibrary")}),g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})]})})]})})(),(0,x.jsx)("a",{href:"".concat("https://libraries.excalidraw.com","?target=").concat(window.name||"_blank","&referrer=").concat(S,"&useHash=true&token=").concat(p,"&theme=").concat(l,"&version=").concat(o.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:b("labels.libraries")})]},"library-header"),(0,x.jsxs)(qd,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"separator",children:b("labels.personalLib")}),I(T)]}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"separator",children:[b("labels.excalidrawLib")," "]}),I(M)]})]})]})},Ph=(e,t)=>e.filter((e=>t.includes(e.id))),Dh=e=>{let{onClose:t,onInsertShape:n,pendingElements:i,onAddToLibrary:a,theme:s,setAppState:l,files:c,libraryReturnUrl:d,focusContainer:u,library:h,id:p,appState:g}=e;const m=(0,r.useRef)(null);((e,t)=>{(0,r.useEffect)((()=>{const n=n=>{e.current&&(n.target instanceof Element&&(e.current.contains(n.target)||!document.body.contains(n.target))||t(n))};return document.addEventListener("pointerdown",n,!1),()=>{document.removeEventListener("pointerdown",n)}}),[e,t])})(m,(e=>{e.target.closest(".ToolIcon__library")||t()})),(0,r.useEffect)((()=>{const e=e=>{e.key===Ht&&t()};return document.addEventListener(o.Ks.KEYDOWN,e),()=>{document.removeEventListener(o.Ks.KEYDOWN,e)}}),[t]);const[f,v]=(0,r.useState)([]),[y,w]=(0,r.useState)("preloading"),[k,_]=(0,r.useState)([]),[E,S]=(0,r.useState)(!1),[C,j]=(0,r.useState)(null),I=(0,r.useRef)(null);(0,r.useEffect)((()=>(Promise.race([new Promise((e=>{I.current=window.setTimeout((()=>{e("loading")}),100)})),h.loadLibrary().then((e=>{v(e),w("ready")}))]).then((e=>{"loading"===e&&w("loading")})),()=>{clearTimeout(I.current)})),[h]);const M=(0,r.useCallback)((async()=>{const e=await h.loadLibrary(),t=e.filter((e=>!k.includes(e.id)));h.saveLibrary(t).catch((t=>{v(e),l({errorMessage:b("alerts.errorRemovingFromLibrary")})})),_([]),v(t)}),[h,l,k,_]),T=(0,r.useCallback)((()=>{h.resetLibrary(),v([]),u()}),[h,u]),O=(0,r.useCallback)((async e=>{if(e.some((e=>"image"===e.type)))return l({errorMessage:"Support for adding images to the library coming soon!"});const t=await h.loadLibrary(),n=[{status:"unpublished",elements:e,id:Gr(),created:Date.now()},...t];a(),h.saveLibrary(n).catch((e=>{v(t),l({errorMessage:b("alerts.errorAddingToLibrary")})})),v(n)}),[a,h,l]),L=(0,r.useCallback)((()=>(0,x.jsxs)(Zl,{onCloseRequest:()=>j(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,x.jsxs)("p",{children:[b("publishSuccessDialog.content",{authorName:C.authorName})," ",(0,x.jsx)("a",{href:null==C?void 0:C.url,target:"_blank",rel:"noopener noreferrer",children:b("publishSuccessDialog.link")})]}),(0,x.jsx)(Za,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>j(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[j,C]),A=(0,r.useCallback)((e=>{S(!1),j({url:e.url,authorName:e.authorName});const t=f.slice();t.forEach((e=>{k.includes(e.id)&&(e.status="published")})),h.saveLibrary(t),v(t)}),[S,j,f,k,h]),[P,D]=(0,r.useState)(null);return"preloading"===y?null:(0,x.jsxs)(Kl,{padding:1,ref:m,className:"layer-ui__library",children:[E&&(0,x.jsx)(Mh,{onClose:()=>S(!1),libraryItems:Ph(f,k),appState:g,onSuccess:A,onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(f),onRemove:e=>_(k.filter((t=>t!==e)))}),C&&L(),"loading"===y?(0,x.jsx)("div",{className:"layer-ui__library-message",children:b("labels.libraryLoadingMessage")}):(0,x.jsx)(Ah,{libraryItems:f,onRemoveFromLibrary:M,onAddToLibrary:O,onInsertShape:n,pendingElements:i,setAppState:l,libraryReturnUrl:d,library:h,theme:s,files:c,id:p,selectedItems:k,onToggle:(e,t)=>{if(!k.includes(e)){if(t.shiftKey&&P){const t=f.findIndex((e=>e.id===P)),n=f.findIndex((t=>t.id===e));if(-1===t||-1===n)return void _([...k,e]);const r=Ln(k),i=f.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);_(i)}else _([...k,e]);D(e)}else D(null),_(k.filter((t=>t!==e)))},onPublish:()=>S(!0),resetLibrary:T})]})};n(3336),n(276);var zh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Nh=e=>{let{actionManager:t,appState:n,files:i,setAppState:a,canvas:s,elements:l,onCollabButtonClick:c,onLockToggle:d,onInsertElements:u,zenModeEnabled:h,showExitZenModeBtn:p,showThemeBtn:g,toggleZenMode:m,isCollaborating:f,renderTopRightUI:y,renderCustomFooter:w,viewModeEnabled:k,libraryReturnUrl:_,UIOptions:E,focusContainer:S,library:C,id:j,onImageAction:I}=e;const M=Gh(),T=()=>E.canvasActions.export?(0,x.jsx)(kh,{elements:l,appState:n,files:i,actionManager:t,exportOpts:E.canvasActions.export,canvas:s}):null,O=()=>{if(!E.canvasActions.saveAsImage)return null;const e=e=>async t=>{const r=await Gd(e,t,n,i,{exportBackground:n.exportBackground,name:n.name,viewBackgroundColor:n.viewBackgroundColor}).catch(In).catch((e=>{console.error(e),a({errorMessage:e.message})}));n.exportEmbedScene&&r&&Qc(r)&&a({fileHandle:r})};return(0,x.jsx)(Qu,{elements:l,appState:n,files:i,actionManager:t,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},L=()=>(0,x.jsx)("div",{style:{width:".625em"}}),A=(0,r.useCallback)((()=>{!!document.querySelector(".Dialog")||a({isLibraryOpen:!1})}),[a]),P=(0,r.useCallback)((()=>{a({selectedElementIds:{},selectedGroupIds:{}})}),[a]),D=n.isLibraryOpen?(0,x.jsx)(Dh,{pendingElements:Ta(l,n,!0),onClose:A,onInsertShape:u,onAddToLibrary:P,setAppState:a,libraryReturnUrl:_,focusContainer:S,library:C,theme:n.theme,files:i,id:j,appState:n}):null,z=(0,x.jsxs)(x.Fragment,{children:[n.isLoading&&(0,x.jsx)(v,{}),n.errorMessage&&(0,x.jsx)(Yu,{message:n.errorMessage,onClose:()=>a({errorMessage:null})}),n.showHelpDialog&&(0,x.jsx)(vh,{onClose:()=>{a({showHelpDialog:!1})}}),n.pasteDialog.shown&&(0,x.jsx)(uh,{setAppState:a,appState:n,onInsertChart:u,onClose:()=>a({pasteDialog:{shown:!1,data:null}})})]});return M?(0,x.jsxs)(x.Fragment,{children:[z,(0,x.jsx)(ch,{appState:n,elements:l,actionManager:t,libraryMenu:D,renderJSONExportDialog:T,renderImageExportDialog:O,setAppState:a,onCollabButtonClick:c,onLockToggle:d,canvas:s,isCollaborating:f,renderCustomFooter:w,viewModeEnabled:k,showThemeBtn:g,onImageAction:I,renderTopRightUI:y})]}):(0,x.jsxs)("div",{className:ye("layer-ui__wrapper",{"disable-pointerEvents":n.draggingElement||n.resizingElement||n.editingElement&&!Ee(n.editingElement)}),children:[z,(()=>{const e=wa(n,l);return(0,x.jsx)(eh,{side:"top",children:(0,x.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,x.jsxs)(qd,{gap:4,className:ye({"disable-pointerEvents":h}),children:[k?(0,x.jsx)(oh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{padding:2,style:{zIndex:1},children:(0,x.jsx)(qd,{gap:4,children:(0,x.jsxs)(Zd,{gap:1,justifyContent:"space-between",children:[T(),O()]})})})}):(0,x.jsx)(oh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{padding:2,style:{zIndex:1},children:(0,x.jsxs)(qd,{gap:4,children:[(0,x.jsxs)(Zd,{gap:1,justifyContent:"space-between",children:[t.renderAction("clearCanvas"),(0,x.jsx)(L,{}),t.renderAction("loadScene"),T(),O(),(0,x.jsx)(L,{}),c&&(0,x.jsx)(Gu,{isCollaborating:f,collaboratorCount:n.collaborators.size,onClick:c})]}),(0,x.jsx)(Ku,{actionManager:t,appState:n,setAppState:a,showThemeBtn:g}),n.fileHandle&&(0,x.jsx)(x.Fragment,{children:t.renderAction("saveToActiveFile")})]})})}),e&&(0,x.jsx)(oh,{heading:"selectedShapeActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(n.height-(n.fileHandle?248:200),"px")},children:(0,x.jsx)(Uu,{appState:n,elements:l,renderAction:t.renderAction,elementType:n.elementType})})})]}),!k&&(0,x.jsx)(oh,{heading:"shapes",children:e=>(0,x.jsxs)(qd,{gap:4,align:"start",children:[(0,x.jsxs)(Zd,{gap:1,className:ye("App-toolbar-container",{"zen-mode":h}),children:[(0,x.jsx)(rh,{zenModeEnabled:h,checked:n.elementLocked,onChange:d,title:b("toolBar.lock")}),(0,x.jsxs)(Kl,{padding:1,className:ye("App-toolbar",{"zen-mode":h}),children:[(0,x.jsx)(th,{appState:n,elements:l,isMobile:M}),e,(0,x.jsx)(Zd,{gap:1,children:(0,x.jsx)(Vu,{canvas:s,elementType:n.elementType,setAppState:a,onImageAction:e=>{let{pointerType:t}=e;I({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,x.jsx)(lh,{appState:n,setAppState:a})]}),D]})}),(0,x.jsxs)("div",{className:ye("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":h}),children:[(0,x.jsx)(ah,{children:n.collaborators.size>0&&Array.from(n.collaborators).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[n,r]=e;return(0,x.jsx)(Wl,{label:r.username||"Unknown user",children:t.renderAction("goToCollaborator",{id:n})},n)}))}),null==y?void 0:y(M,n)]})]})})})(),(0,x.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":h}),children:(0,x.jsx)(qd,{gap:2,children:(0,x.jsxs)(oh,{heading:"canvasActions",children:[(0,x.jsx)(Kl,{padding:1,children:(0,x.jsx)(Wu,{renderAction:t.renderAction,zoom:n.zoom})}),!k&&(0,x.jsxs)("div",{className:ye("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":h}),children:[t.renderAction("undo",{size:"small"}),t.renderAction("redo",{size:"small"})]})]})})}),(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":h}),children:null==w?void 0:w(!1,n)}),(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":h}),children:t.renderAction("toggleShortcuts")}),(0,x.jsx)("button",{className:ye("disable-zen-mode",{"disable-zen-mode--visible":p}),onClick:m,children:b("buttons.exitZenMode")})]}),n.scrolledOutside&&(0,x.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{a(Object.assign({},Aa(l,n)))},children:b("buttons.scrollBackToContent")})]})},Rh=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return zh(e,["suggestedBindings","startBoundElement"])},r=n(e.appState),i=n(t.appState),o=Object.keys(r);return e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&o.every((e=>r[e]===i[e]))},Hh=i().memo(Nh,Rh);n(1528);const Bh=e=>{var t;const n=Gh(),r=Qe(e.elements),i=Oa(e.elements,e.appState),o=Qe(i);return n&&e.appState.openMenu?null:(0,x.jsx)("div",{className:"Stats",children:(0,x.jsxs)(Kl,{padding:2,children:[(0,x.jsx)("div",{className:"close",onClick:e.onClose,children:Ms}),(0,x.jsx)("h3",{children:b("stats.title")}),(0,x.jsx)("table",{children:(0,x.jsxs)("tbody",{children:[(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.scene")})}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.elements")}),(0,x.jsx)("td",{children:e.elements.length})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.width")}),(0,x.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.height")}),(0,x.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===i.length&&(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.element")})}),i.length>1&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.selected")})}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.elements")}),(0,x.jsx)("td",{children:i.length})]})]}),i.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:"x"}),(0,x.jsx)("td",{children:Math.round(o[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:"y"}),(0,x.jsx)("td",{children:Math.round(o[1])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.width")}),(0,x.jsx)("td",{children:Math.round(o[2]-o[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.height")}),(0,x.jsx)("td",{children:Math.round(o[3]-o[1])})]})]}),1===i.length&&(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.angle")}),(0,x.jsx)("td",{children:"".concat(Math.round(180*i[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})};n(9757);const Fh=e=>{let{message:t,clearToast:n}=e;const i=(0,r.useRef)(0),a=(0,r.useCallback)((()=>i.current=window.setTimeout((()=>n()),o.Lg)),[n]);return(0,r.useEffect)((()=>(a(),()=>clearTimeout(i.current))),[a,t]),(0,x.jsx)("div",{className:"Toast",onMouseEnter:()=>clearTimeout(null==i?void 0:i.current),onMouseLeave:a,children:(0,x.jsx)("p",{className:"Toast__message",children:t})})},Uh=dl({name:"viewMode",perform(e,t){return nc("view","mode","view"),{appState:Object.assign(Object.assign({},t),{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.viewModeEnabled,contextItemLabel:"labels.viewMode",keyTest:e=>!e[zt]&&e.altKey&&e.code===Mt});var Vh=n(200),Wh=n.n(Vh);const Kh=i().createContext(!1),Gh=()=>(0,r.useContext)(Kh),Yh=i().createContext({container:null,id:null}),Zh=()=>(0,r.useContext)(Yh);let qh=!1,Xh=0,$h=0,Jh=0,Qh=!1,ep=!1,tp=!1,np={horizontal:null,vertical:null},rp=0,ip=!1,op=null;const ap={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class sp extends i().Component{constructor(e){super(e),lp.call(this);const t=Pn(),{excalidrawRef:n,viewModeEnabled:r=!1,zenModeEnabled:i=!1,gridModeEnabled:a=!1,theme:s=t.theme,name:l=t.name}=e;if(this.state=Object.assign(Object.assign(Object.assign(Object.assign({},t),{theme:s,isLoading:!0}),this.getCanvasOffsets()),{viewModeEnabled:r,zenModeEnabled:i,gridSize:a?o.k:null,name:l,width:window.innerWidth,height:window.innerHeight}),this.id=we(),n){var c;const e="current"in n&&(null===(c=n.current)||void 0===c?void 0:c.readyPromise)||(()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n})(),t={ready:!0,readyPromise:e,updateScene:this.updateScene,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,refresh:this.refresh,importLibrary:this.importLibraryFromUrl,setToastMessage:this.setToastMessage,id:this.id};"function"==typeof n?n(t):n.current=t,e.resolve(t)}var d;this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.scene=new ir,this.library=new Tu(this),this.history=new Du,this.actionManager=new Mu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(cl),this.actionManager.registerAction((d=this.history,{name:"undo",perform:(e,t)=>Iu(e,t,(()=>d.undoOnce())),keyTest:e=>e[zt]&&e.key.toLowerCase()===rn&&!e.shiftKey,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,x.jsx)(Za,{type:"button",icon:ps,"aria-label":b("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1})),this.actionManager.registerAction((e=>({name:"redo",perform:(t,n)=>Iu(t,n,(()=>e.redoOnce())),keyTest:e=>e[zt]&&e.shiftKey&&e.key.toLowerCase()===rn||lt&&e.ctrlKey&&!e.shiftKey&&e.key===nn,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,x.jsx)(Za,{type:"button",icon:gs,"aria-label":b("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1}))(this.history))}renderCanvas(){const e=window.devicePixelRatio,{width:t,height:n,viewModeEnabled:r}=this.state,i=t*e,a=n*e;return r?(0,x.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n,cursor:o.oc.GRAB},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:b("labels.drawingCanvas")}):(0,x.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:b("labels.drawingCanvas")})}render(){var e,t;const{zenModeEnabled:n,viewModeEnabled:r}=this.state,{onCollabButtonClick:i,renderTopRightUI:o,renderFooter:a,renderCustomStats:s}=this.props;return(0,x.jsx)("div",{className:ye("excalidraw excalidraw-container",{"excalidraw--view-mode":r,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,x.jsx)(Yh.Provider,{value:this.excalidrawContainerValue,children:(0,x.jsxs)(Kh.Provider,{value:this.isMobile,children:[(0,x.jsx)(Hh,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:i,onLockToggle:this.toggleLock,onInsertElements:e=>this.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null}),zenModeEnabled:n,toggleZenMode:this.toggleZenMode,langCode:m().code,isCollaborating:this.props.isCollaborating||!1,renderTopRightUI:o,renderCustomFooter:a,viewModeEnabled:r,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&n,showThemeBtn:void 0===(null===(t=this.props)||void 0===t?void 0:t.theme)&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id,onImageAction:this.onImageAction}),(0,x.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,x.jsx)("div",{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&(0,x.jsx)(Bh,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:s}),null!==this.state.toastMessage&&(0,x.jsx)(Fh,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,x.jsx)("main",{children:this.renderCanvas()})]})})})}async componentDidMount(){var e,t,n=this;if(this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"===o.Vi.TEST||"production"===o.Vi.DEVELOPMENT){this.setState.bind(this);Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:function(){return n.setState(...arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})}if(this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current)this.resizeObserver=new ResizeObserver((()=>{const{width:e,height:t}=this.excalidrawContainerRef.current.getBoundingClientRect();this.isMobile=e<o.kV||t<o.Yx&&e<o.sS,this.updateDOMRect()})),null===(t=this.resizeObserver)||void 0===t||t.observe(this.excalidrawContainerRef.current);else if(window.matchMedia){const e=window.matchMedia("(max-width: ".concat(o.kV,"px), (max-height: ").concat(o.Yx,"px) and (max-width: ").concat(o.sS,"px)")),t=()=>this.isMobile=e.matches;e.addListener(t),this.detachIsMobileMqHandler=()=>e.removeListener(t)}new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene)}componentWillUnmount(){var e;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),clearTimeout(rp),rp=0}removeEventListeners(){var e,t;document.removeEventListener(o.Ks.POINTER_UP,this.removePointer),document.removeEventListener(o.Ks.COPY,this.onCopy),document.removeEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(o.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(o.Ks.SCROLL,this.onScroll),document.removeEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(o.Ks.KEYUP,this.onKeyUp),window.removeEventListener(o.Ks.RESIZE,this.onResize,!1),window.removeEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(o.Ks.BLUR,this.onBlur,!1),window.removeEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),window.removeEventListener(o.Ks.DROP,this.disableEvent,!1),document.removeEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),null===(t=this.detachIsMobileMqHandler)||void 0===t||t.call(this)}addEventListeners(){var e,t;this.removeEventListeners(),document.addEventListener(o.Ks.POINTER_UP,this.removePointer),document.addEventListener(o.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(o.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition),null===(e=document.fonts)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"loadingdone",this.onFontLoaded),document.addEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(o.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=(e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;const{overflowY:e}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&("auto"===e||"scroll"===e))return t;t=t.parentElement}return document})(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(o.Ks.SCROLL,this.onScroll)),window.addEventListener(o.Ks.RESIZE,this.onResize,!1),window.addEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(o.Ks.BLUR,this.onBlur,!1),window.addEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),window.addEventListener(o.Ks.DROP,this.disableEvent,!1))}componentDidUpdate(e,t){var n;e.langCode!==this.props.langCode&&this.updateLanguage(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),e.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?o.k:null}),this.props.name&&e.name!==this.props.name&&this.setState({name:this.props.name}),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.classList.toggle("theme--dark","dark"===this.state.theme),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout((()=>{this.actionManager.executeAction(Ql)}));const{multiElement:r}=t;t.elementType!==this.state.elementType&&null!=r&&Po(this.state)&&Me(r)&&Ho(r,this.state,this.scene,jn(Lo.getPointAtIndexGlobalCoordinates(r,-1)));const i={},a={},s={},l={},c={};this.state.collaborators.forEach(((e,t)=>{if(e.selectedElementIds)for(const n of Object.keys(e.selectedElementIds))n in s||(s[n]=[]),s[n].push(t);e.pointer&&(e.username&&(l[t]=e.username),e.userState&&(c[t]=e.userState),a[t]=_n({sceneX:e.pointer.x,sceneY:e.pointer.y},this.state),i[t]=e.button)}));const d=this.scene.getElements().filter((e=>(!_e(e)||!this.state.pendingImageElement||e.id!==this.state.pendingImageElement.id)&&(!this.state.editingElement||"text"!==this.state.editingElement.type||e.id!==this.state.editingElement.id))),{atLeastOneVisibleElement:u,scrollBars:h}=cc(d,this.state,this.state.selectionElement,window.devicePixelRatio,this.rc,this.canvas,{scrollX:this.state.scrollX,scrollY:this.state.scrollY,viewBackgroundColor:this.state.viewBackgroundColor,zoom:this.state.zoom,remotePointerViewportCoords:a,remotePointerButton:i,remoteSelectedElementIds:s,remotePointerUsernames:l,remotePointerUserStates:c,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile});h&&(np=h);const p=!Ee(this.state.editingElement)&&(!u&&d.length>0);var g,m;(this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(m=this.props).onChange)||void 0===g||g.call(m,this.scene.getElementsIncludingDeleted(),this.state,this.files))}static resetTapTwice(){qh=!1}addTextFromPaste(e){const{x:t,y:n}=kn({clientX:$h,clientY:Jh},this.state),r=ui({x:t,y:n,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,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:o.hs});this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),r]),this.setState({selectedElementIds:{[r.id]:!0}}),this.history.resumeRecording()}selectShapeTool(e){var t;Qh||vn(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),Ie(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}handleTextWysiwyg(e,t){var n=this;let{isExistingElement:r=!1}=t;const i=function(t,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n.scene.replaceAllElements([...n.scene.getElementsIncludingDeleted().map((n=>n.id===e.id&&Ee(n)?hi(n,{text:t,isDeleted:i,originalText:r},o):n))])};ya({id:e.id,appState:this.state,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=_n({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft*(2-this.state.zoom.value),r-this.state.offsetTop*(2-this.state.zoom.value)]},getSceneCoords:(e,t)=>{const{x:n,y:r}=kn({clientX:e,clientY:t},this.state);return[n+this.state.offsetLeft*(2/this.state.zoom.value-1),r+this.state.offsetTop*(2/this.state.zoom.value-1)]},onChange:Tn((t=>{i(t,t,!1,!e.containerId),Ea(e)&&Yo(e)})),onSubmit:Tn((t=>{let{text:n,viaKeyboard:o,originalText:a}=t;const s=!n.trim();if(i(n,a,s,!0),!s&&o){const t=e.containerId?e.containerId:e.id;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[t]:!0})})))}s&&oa(this.scene.getElements(),[e]),s&&!r||this.history.resumeRecording(),this.setState({draggingElement:null,editingElement:null}),this.state.elementLocked&&vn(this.canvas,this.state.elementType),this.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current}),this.deselectElements(),i(e.text,e.originalText)}deselectElements(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}getTextElementAtPosition(e,t){const n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&Ee(n)&&!n.isDeleted?n:null}getElementAtPosition(e,t,n){const r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement);if(r.length>1){if(null!=n&&n.preferSelected)for(let e=r.length-1;e>-1;e--)if(this.state.selectedElementIds[r[e].id])return r[e];const i=r[r.length-1];return Yi(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}getElementsAtPosition(e,t){return((e,t)=>e.filter((e=>!e.isDeleted&&t(e))))(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.scene.getElements():this.scene.getElements().filter((e=>!(Ee(e)&&e.containerId))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return qi(t,e)?Xi(e,o,i):Zi(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==op&&op(e)}updateGestureOnPointerDown(e){ap.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===ap.pointers.size&&(ap.lastCenter=Ou(ap.pointers),ap.initialScale=this.state.zoom.value,ap.initialDistance=Lu(Array.from(ap.pointers.values())))}initialPointerDownState(e){const t=kn(e,this.state),n=Ta(this.scene.getElements(),this.state),[r,i,o,a]=Qe(n);return{origin:t,withCmdOrCtrl:e[zt],originInGrid:jn(Ve(t.x,t.y,this.state.gridSize)),scrollbars:Ia(np,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Object.assign({},t),originalElements:this.scene.getElements().reduce(((e,t)=>(e.set(t.id,gi(t)),e)),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(o+r)/2,y:(a+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n),hasHitElementInside:!1},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(e,t){if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;tp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=Tn((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=Tn((()=>{tp=!1,vn(this.canvas,this.state.elementType),op=null,this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,n),window.removeEventListener(o.Ks.POINTER_UP,r)}));return op=r,window.addEventListener(o.Ks.POINTER_MOVE,n),window.addEventListener(o.Ks.POINTER_UP,r),!0}isASelectedElement(e){return null!=e&&this.state.selectedElementIds[e.id]}isHittingCommonBoundingBoxOfSelectedElements(e,t){if(t.length<2)return!1;const n=10/this.state.zoom.value,[r,i,o,a]=Qe(t);return e.x>r-n&&e.x<o+n&&e.y>i-n&&e.y<a+n}onKeyDownFromPointerDownHandler(e){return Tn((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return Tn((t=>{t.key===Dt&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return Tn((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=jn(((e,t,n)=>{const[r,i]=Qe(e);return[t-r,n-i]})(Ta(this.scene.getElements(),this.state),e.origin.x,e.origin.y)));if(!(t.target instanceof HTMLElement))return;if(this.handlePointerMoveOverScrollbars(t,e))return;const i=kn(t,this.state),[a,s]=Ve(i.x,i.y,this.state.gridSize);if(!e.drag.hasOccurred&&("arrow"===this.state.elementType||"line"===this.state.elementType)&&Ne(i.x,i.y,e.origin.x,e.origin.y)<o.f)return;if(e.resize.isResizing&&(e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeHandleResize(e,t)))return!0;if(this.state.editingLinearElement){if(Lo.handlePointDragging(this.state,(e=>this.setState(e)),i.x,i.y,((e,t)=>{this.maybeSuggestBindingsForLinearElementAtCoords(e,t)})))return e.lastCoords.x=i.x,void(e.lastCoords.y=i.y)}if((e.hit.allHitElements.some((e=>this.isASelectedElement(e)))||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&(!this.state.editingLinearElement||!t.shiftKey)&&(!this.state.editingLinearElement||(null===(n=this.state.editingLinearElement)||void 0===n?void 0:n.elementId)!==(null===(r=e.hit.element)||void 0===r?void 0:r.id)||e.hit.hasHitElementInside)){e.drag.hasOccurred=!0;const n=Ta(this.scene.getElements(),this.state);if(n.length>0&&!e.withCmdOrCtrl){const[r,o]=Ve(i.x-e.drag.offset.x,i.y-e.drag.offset.y,this.state.gridSize),[a,s]=[Math.abs(i.x-e.origin.x),Math.abs(i.y-e.origin.y)],l=t.shiftKey;if(function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;const[s,l]=Qe(t),c={x:n-s,y:r-l};t.forEach((n=>{if(fa(i,o,a,e,n,c),!n.groupIds.length){const t=br(n);if(t){const r=ir.getScene(n).getElement(t);fa(i,o,a,e,r,c)}}Yo(n,{simultaneouslyUpdated:t})}))}(e,n,r,o,l,a,s),this.maybeSuggestBindingForAll(n),t.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;const t=[],n=[],i=new Map,a=new Map,s=e.hit.element,l=this.scene.getElementsIncludingDeleted(),c=Ta(l,this.state,!0).map((e=>e.id));for(const d of l)if(c.includes(d.id)||d.id===(null==s?void 0:s.id)&&e.hit.wasAddedToSelection){const s=mi(this.state.editingGroupId,i,d),[l,c]=Ve(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,this.state.gridSize);Yr(s,{x:s.x+(l-r),y:s.y+(c-o)}),t.push(s),n.push(d),a.set(d.id,s.id)}else t.push(d);const d=[...t,...n];ar(t,n,a),ra(d,n,a,"duplicatesServeAsOld"),this.scene.replaceAllElements(d)}return}}const l=this.state.draggingElement;if(l){if("freedraw"===l.type){const e=l.points,n=i.x-l.x,r=i.y-l.y,o=l.simulatePressure?l.pressures:[...l.pressures,t.pressure];Yr(l,{points:[...e,[n,r]],pressures:o})}else if(je(l)){e.drag.hasOccurred=!0;const n=l.points;let r=a-l.x,o=s-l.y;ln(t)&&2===n.length&&({width:r,height:o}=$r(this.state.elementType,r,o)),1===n.length?Yr(l,{points:[...n,[r,o]]}):n.length>1&&Yr(l,{points:[...n.slice(0,-1),[r,o]]}),Me(l)&&this.maybeSuggestBindingsForLinearElementAtCoords(l,[i],this.state.startBoundElement)}else e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeDragNewGenericElement(e,t);if("selection"===this.state.elementType){e.boxSelection.hasOccurred=!0;const n=this.scene.getElements();if(t.shiftKey||this.state.editingLinearElement||!Ma(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>ri(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)Lo.handleBoxSelection(t,this.state,this.setState.bind(this));else{const t=((e,t)=>{const[n,r,i,o]=Ge(t);return e.filter((e=>{const[t,a,s,l]=Je(e);return"selection"!==e.type&&!Ae(e)&&n<=t&&r<=a&&i>=s&&o>=l}))})(n,l);this.setState((n=>ri(Object.assign(Object.assign({},n),{selectedElementIds:Object.assign(Object.assign(Object.assign({},n.selectedElementIds),t.reduce(((e,t)=>(e[t.id]=!0,e)),{})),e.hit.element?{[e.hit.element.id]:!t.length}:null)}),this.scene.getElements())))}}}}))}handlePointerMoveOverScrollbars(e,t){if(t.scrollbars.isOverHorizontal){const n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){const n=e.clientY,r=n-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-r/this.state.zoom.value}),t.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(e){return Tn((t=>{const{draggingElement:n,resizingElement:r,multiElement:i,elementType:a,elementLocked:s,isResizing:l,isRotating:c}=this.state;var d,u;if(this.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:i||Ee(this.state.editingElement)?this.state.editingElement:null}),this.savePointer(t.clientX,t.clientY,"up"),this.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(d=e.hit)||void 0===d||null===(u=d.element)||void 0===u?void 0:u.id)===this.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){const e=Lo.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(Ql);if(op=null,window.removeEventListener(o.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(o.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(o.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(o.Ks.KEYUP,e.eventListeners.onKeyUp),this.state.pendingImageElement&&this.setState({pendingImageElement:null}),"freedraw"===(null==n?void 0:n.type)){const e=kn(t,this.state),r=n.points;let i=e.x-n.x,o=e.y-n.y;i===r[0][0]&&o===r[0][1]&&(o+=1e-4,i+=1e-4);const a=n.simulatePressure?[]:[...n.pressures,t.pressure];return Yr(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(Ql)}if(_e(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(Ql)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(Ql)}return}if(je(n)){n.points.length>1&&this.history.resumeRecording();const r=kn(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(Po(this.state)&&Me(n)&&Ho(n,this.state,this.scene,r),this.setState({suggestedBindings:[],startBoundElement:null}),s?this.setState((e=>({draggingElement:null,selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))):(bn(this.canvas),this.setState((e=>({draggingElement:null,elementType:"selection",selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))))):(Yr(n,{points:[...n.points,[r.x-n.x,r.y-n.y]]}),this.setState({multiElement:n,editingElement:this.state.draggingElement})))}if("selection"!==a&&n&&Xr(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Yr(n,Jr(n)),r&&this.history.resumeRecording(),r&&Xr(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const h=e.hit.element;if(h&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!e.boxSelection.hasOccurred))if(t.shiftKey&&!this.state.editingLinearElement)if(this.state.selectedElementIds[h.id])if(ei(this.state,h)){const e=h.groupIds.flatMap((e=>oi(this.scene.getElements(),e))).map((e=>({[e.id]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{});this.setState((t=>({selectedGroupIds:Object.assign(Object.assign({},t.selectedElementIds),h.groupIds.map((e=>({[e]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),e)})))}else this.setState((e=>ri(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!1})}),this.scene.getElements())));else this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!0})})));else this.setState((e=>Object.assign({},ri(Object.assign(Object.assign({},e),{selectedElementIds:{[h.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(h&&Yi(h,this.state,e.origin.x,e.origin.y)||!h&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!s&&"freedraw"!==a&&n&&this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[n.id]:!0})}))),("selection"!==a||Ma(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||l||c)&&(Po(this.state)?No:Vo)(Ta(this.scene.getElements(),this.state)),s||"freedraw"===a?this.setState({draggingElement:null,suggestedBindings:[]}):(bn(this.canvas),this.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}))}maybeSuggestBindingForAll(e){const t=(e=>{const t=new Set(e.map((e=>{let{id:t}=e;return t})));return e.flatMap((e=>Me(e)?Jo(e).filter((e=>!t.has(e.id))):Oe(e)?ta(e).filter((e=>!t.has(e[0].id))):[]))})(e);this.setState({suggestedBindings:t})}clearSelection(e){this.setState((t=>({selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&ii(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Ua(this.scene.getElementsIncludingDeleted().filter((e=>!Ee(e))),e,t);if(a){const r=a.x+a.width/2,i=a.y+a.height/2;if(Math.hypot(e-r,t-i)<o.wZ){const{x:e,y:t}=_n({sceneX:r,sceneY:i},n);return{viewportX:e,viewportY:t,elementCenterX:r,elementCenterY:i}}}}getCanvasOffsets(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){const e=this.excalidrawContainerRef.current,{left:t,top:n}=e.getBoundingClientRect();return{offsetLeft:t,offsetTop:n}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){const e=d.find((e=>e.code===this.props.langCode))||c;await g(e),this.setAppState({})}}sp.defaultProps={UIOptions:o.cW};var lp=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=i().createRef(),this.files={},this.imageCache=new Map,this.focusContainer=()=>{var e;this.props.autoFocus&&(null===(e=this.excalidrawContainerRef.current)||void 0===e||e.focus())},this.getSceneElementsIncludingDeleted=()=>this.scene.getElementsIncludingDeleted(),this.getSceneElements=()=>this.scene.getElements(),this.syncActionResult=Tn((e=>{if(this.unmounted||!1===e)return;let t=null;if(e.elements&&(e.elements.forEach((e=>{var n;(null===(n=this.state.editingElement)||void 0===n?void 0:n.id)===e.id&&this.state.editingElement!==e&&Ea(e)&&(t=e)})),this.scene.replaceAllElements(e.elements),e.commitToHistory&&this.history.resumeRecording()),e.files&&(this.files=e.replaceFiles?e.files:Object.assign(Object.assign({},this.files),e.files),this.addNewImagesToImageCache()),e.appState||t){var n,r,i,a,s,l;e.commitToHistory&&this.history.resumeRecording();let c=(null==e||null===(n=e.appState)||void 0===n?void 0:n.viewModeEnabled)||!1,d=(null==e||null===(r=e.appState)||void 0===r?void 0:r.zenModeEnabled)||!1,u=(null==e||null===(i=e.appState)||void 0===i?void 0:i.gridSize)||null,h=(null==e||null===(a=e.appState)||void 0===a?void 0:a.theme)||o.C6.LIGHT,p=null!==(s=null==e||null===(l=e.appState)||void 0===l?void 0:l.name)&&void 0!==s?s:this.state.name;void 0!==this.props.viewModeEnabled&&(c=this.props.viewModeEnabled),void 0!==this.props.zenModeEnabled&&(d=this.props.zenModeEnabled),void 0!==this.props.gridModeEnabled&&(u=this.props.gridModeEnabled?o.k:null),void 0!==this.props.theme&&(h=this.props.theme),void 0!==this.props.name&&(p=this.props.name),this.setState((n=>{var r;return Object.assign(e.appState||{},{editingElement:t||(null===(r=e.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:c,zenModeEnabled:d,gridSize:u,theme:h,name:p})}),(()=>{e.syncHistory&&this.history.setCurrentState(this.state,this.scene.getElementsIncludingDeleted())}))}})),this.onBlur=Tn((()=>{Qh=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ee(e)&&Or(e)})),this.onSceneUpdated()},this.importLibraryFromUrl=async(e,t)=>{if(window.location.hash.includes(o.ah.addLibrary)){const e=new URLSearchParams(window.location.hash.slice(1));e.delete(o.ah.addLibrary),window.history.replaceState({},o.iC,"#".concat(e.toString()))}else if(window.location.search.includes(o.UO.addLibrary)){const e=new URLSearchParams(window.location.search);e.delete(o.UO.addLibrary),window.history.replaceState({},o.iC,"?".concat(e.toString()))}try{const n=await fetch(decodeURIComponent(e)),r=await n.blob(),i=JSON.parse(await r.text());if(!(e=>"object"==typeof e&&e&&e.type===o.r8.excalidrawLibrary&&(1===e.version||2===e.version))(i))throw new Error;(t===this.id||window.confirm(b("alerts.confirmAddLibrary",{numShapes:(i.libraryItems||i.library||[]).length})))&&(await this.library.importLibrary(r,"published"),this.state.isLibraryOpen&&this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0}))}catch(e){window.alert(b("alerts.errorLoadingLibrary")),console.error(e)}finally{this.focusContainer()}},this.resetHistory=()=>{this.history.clear()},this.resetScene=Tn((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},Pn()),{isLoading:(null==e||!e.resetLoadingState)&&t.isLoading,theme:this.state.theme}))),this.resetHistory()})),this.initializeScene=async()=>{var e;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer((async e=>{if(!e.files.length)return;const t=e.files[0],n=await t.getFile();n.handle=t,td(n,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))})),this.state.isLoading||this.setState({isLoading:!0});let t=null;try{var n;t=await this.props.initialData||null,null!==(n=t)&&void 0!==n&&n.libraryItems&&(this.libraryItemsFromStorage=Xc(t.libraryItems,"unpublished"))}catch(e){console.error(e),t={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const r=qc(t,null,null);r.appState=Object.assign(Object.assign({},r.appState),{elementType:"image"===r.appState.elementType?"selection":r.appState.elementType,isLoading:!1}),null!==(e=t)&&void 0!==e&&e.scrollToContent&&(r.appState=Object.assign(Object.assign({},r.appState),Aa(r.elements,Object.assign(Object.assign({},r.appState),{width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})))),this.resetHistory(),this.syncActionResult(Object.assign(Object.assign({},r),{commitToHistory:!0}));const i=new URLSearchParams(window.location.hash.slice(1)).get(o.ah.addLibrary)||new URLSearchParams(window.location.search).get(o.UO.addLibrary);i&&await this.importLibraryFromUrl(i)},this.onResize=Tn((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>Or(e))),this.setState({})})),this.onScroll=mn((()=>{const{offsetTop:e,offsetLeft:t}=this.getCanvasOffsets();this.setState((n=>n.offsetLeft===t&&n.offsetTop===e?null:{offsetTop:e,offsetLeft:t}))}),o.HM),this.onCut=Tn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!hn(e.target)&&(this.cutAll(),e.preventDefault())})),this.onCopy=Tn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!hn(e.target)&&(this.copyAll(),e.preventDefault())})),this.cutAll=()=>{this.copyAll(),this.actionManager.executeAction(hl)},this.copyAll=()=>{Bd(this.scene.getElements(),this.state,this.files)},this.onTapStart=e=>{if(!qh)return qh=!0,clearTimeout(Xh),void(Xh=window.setTimeout(sp.resetTapTwice,o.Gj));if(qh&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),qh=!1,clearTimeout(Xh)}e.preventDefault(),2===e.touches.length&&this.setState({selectedElementIds:{}})},this.onTapEnd=e=>{e.touches.length>0&&this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds})},this.pasteFromClipboard=Tn((async e=>{var t,n;const r=document.activeElement;if(!(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(r)))return;const i=document.elementFromPoint($h,Jh);if(e&&(!(i instanceof HTMLCanvasElement)||hn(r)))return;let o=null==e||null===(n=e.clipboardData)||void 0===n?void 0:n.files[0];const a=await Vd(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=sd(e))}if(ed(o)){const{x:e,y:t}=kn({clientX:$h,clientY:Jh},this.state),n=this.createImageElement({sceneX:e,sceneY:t});return this.insertImageElement(n,o),this.initializeImageDimensions(n),void this.setState({selectedElementIds:{[n.id]:!0}})}if(this.props.onPaste)try{if(!1===await this.props.onPaste(a,e))return}catch(e){console.error(e)}a.errorMessage?this.setState({errorMessage:a.errorMessage}):a.spreadsheet?this.setState({pasteDialog:{data:a.spreadsheet,shown:!0}}):a.elements?this.addElementsFromPasteOrLibrary({elements:a.elements,files:a.files||null,position:"cursor"}):a.text&&this.addTextFromPaste(a.text),this.selectShapeTool("selection"),null==e||e.preventDefault()})),this.addElementsFromPasteOrLibrary=e=>{const t=Yc(e.elements,null),[n,r,i,o]=Qe(t),a=fn(n,i)/2,s=fn(r,o)/2,l="object"==typeof e.position?e.position.clientX:"cursor"===e.position?$h:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?Jh:this.state.height/2+this.state.offsetTop,{x:d,y:u}=kn({clientX:l,clientY:c},this.state),h=d-a,p=u-s,g=new Map,[m,f]=Ve(h,p,this.state.gridSize),b=new Map,x=t.map((e=>{const t=mi(this.state.editingGroupId,g,e,{x:e.x+m-n,y:e.y+f-r});return b.set(e.id,t.id),t}));ar(x,t,b);const v=[...this.scene.getElementsIncludingDeleted(),...x];ra(v,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(v),this.history.resumeRecording(),this.setState(ri(Object.assign(Object.assign({},this.state),{isLibraryOpen:!1,selectedElementIds:x.reduce(((e,t)=>(Ee(t)&&!t.containerId&&(e[t.id]=!0),e)),{}),selectedGroupIds:{}}),this.scene.getElements()),(()=>{e.files&&this.addNewImagesToImageCache()})),this.selectShapeTool("selection")},this.setAppState=e=>{this.setState(e)},this.removePointer=e=>{"touch"===e.pointerType&&rp&&(clearTimeout(rp),rp=0,ip=!1),ap.pointers.delete(e.pointerId)},this.toggleLock=()=>{this.setState((e=>({elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType})))},this.toggleZenMode=()=>{this.actionManager.executeAction(Cu)},this.toggleStats=()=>{this.state.showStats||nc("dialog","stats"),this.actionManager.executeAction(ju)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},Aa(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=()=>{this.setState({toastMessage:null})},this.setToastMessage=e=>{this.setState({toastMessage:e})},this.restoreFileFromShare=async()=>{try{const e=await caches.open("web-share-target"),t=await e.match("shared-file");if(t){const n=await t.blob();this.loadFileToCanvas(n),await e.delete("shared-file"),window.history.replaceState(null,o.iC,window.location.pathname)}}catch(e){this.setState({errorMessage:e.message})}},this.addFiles=Tn((e=>{const t=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map);this.files=Object.assign(Object.assign({},this.files),Object.fromEntries(t)),this.scene.getElements().forEach((e=>{ke(e)&&t.has(e.fileId)&&(this.imageCache.delete(e.fileId),Or(e),qr(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=Tn((e=>{e.commitToHistory&&this.history.resumeRecording(),e.appState&&this.setState(e.appState),e.elements&&this.scene.replaceAllElements(e.elements),e.collaborators&&this.setState({collaborators:e.collaborators})})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=Tn((e=>{$h=e.clientX,Jh=e.clientY})),this.onKeyDown=Tn((e=>{var t;if(("Proxy"in window&&(!e.shiftKey&&/^[A-Z]$/.test(e.key)||e.shiftKey&&/^[a-z]$/.test(e.key))&&(e=new Proxy(e,{get(t,n){const r=t[n];return"function"==typeof r?r.bind(t):"key"===n?e.shiftKey?t.key.toUpperCase():t.key.toLowerCase():r}})),!(hn(e.target)&&e.key!==Ht||on(e.key)&&(t=e.target,t instanceof HTMLElement&&"wysiwyg"===t.dataset.type||t instanceof HTMLBRElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)))&&(e.key===Bt&&this.setState({showHelpDialog:!0}),!this.actionManager.handleKeyDown(e)&&!this.state.viewModeEnabled)){if(e[zt]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),e.code===vt&&this.setState({isLibraryOpen:!this.state.isLibraryOpen}),on(e.key)){const t=this.state.gridSize&&(e.shiftKey?o.$e:this.state.gridSize)||(e.shiftKey?o.Iw:o.$e),n=this.scene.getElements().filter((e=>this.state.selectedElementIds[e.id]));let r=0,i=0;e.key===Ot?r=-t:e.key===Lt?r=t:e.key===At?i=-t:e.key===Tt&&(i=t),n.forEach((e=>{Yr(e,{x:e.x+r,y:e.y+i}),Yo(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===Rt){const t=Ta(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new Lo(t[0],this.scene)}));else if(1===t.length&&!je(t[0])){const n=t[0];return this.startTextEditing({sceneX:n.x+n.width/2,sceneY:n.y+n.height/2,shouldBind:!0}),void e.preventDefault()}}else if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&null===this.state.draggingElement){const t=(e=>{const t=zu.find(((t,n)=>e===(n+1).toString()||t.key&&("string"==typeof t.key?t.key===e:t.key.includes(e))));return(null==t?void 0:t.value)||null})(e.key);t?this.selectShapeTool(t):e.key===Xt&&this.toggleLock()}if(e.key===Ft&&0===ap.pointers.size&&(Qh=!0,xn(this.canvas,o.oc.GRABBING)),e.key===Gt||e.key===Jt){const t=Ta(this.scene.getElements(),this.state);if("selection"===this.state.elementType&&!t.length)return;e.key===Gt&&(Pa(this.state.elementType)||t.some((e=>Pa(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Jt&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=Tn((e=>{if(e.key===Ft&&(this.state.viewModeEnabled?xn(this.canvas,o.oc.GRAB):"selection"===this.state.elementType?bn(this.canvas):(vn(this.canvas,this.state.elementType),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),Qh=!1),e[zt]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),on(e.key)){const e=Ta(this.scene.getElements(),this.state);Po(this.state)?No(e):Vo(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=Tn((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),ap.initialScale=this.state.zoom.value})),this.onGestureChange=Tn((e=>{if(e.preventDefault(),2===ap.pointers.size)return;const t=ap.initialScale;t&&this.setState((n=>{let{zoom:r,offsetLeft:i,offsetTop:o}=n;return{zoom:Va(Wa(t*e.scale),r,{left:i,top:o},{x:$h,y:Jh})}}))})),this.onGestureEnd=Tn((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),ap.initialScale=null})),this.startTextEditing=e=>{var t;let{sceneX:n,sceneY:r,shouldBind:i,insertAtParentCenter:a=!0}=e;const s=a&&this.getTextWysiwygSnappedToCenterPosition(n,r,this.state,this.canvas,window.devicePixelRatio),l=i||s?Ua(this.scene.getElements(),n,r,"text"):null;let c=this.getTextElementAtPosition(n,r);if(l){const e=br(l);e&&(c=this.scene.getElement(e))}if(!c&&l){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=mr(gn(e)),i=(d=gn(e),dr(d)+2*o.tr),a=Math.max(l.height,i),s=Math.max(l.width,t);Yr(l,{height:a,width:s}),n=l.x+s/2,r=l.y+a/2}var d;const u=c||ui({x:s?s.elementCenterX:n,y:s?s.elementCenterY:r,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,strokeSharpness:this.state.currentItemStrokeSharpness,text:"",fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:s?"center":this.state.currentItemTextAlign,verticalAlign:s?"middle":o.hs,containerId:null!==(t=null==l?void 0:l.id)&&void 0!==t?t:void 0});this.setState({editingElement:u}),c?s&&"center"===u.textAlign||Yr(u,{verticalAlign:o.hs}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),u]),s||Yr(u,{y:u.y-u.baseline/2})),this.setState({editingElement:u}),this.handleTextWysiwyg(u,{isExistingElement:!!c})},this.handleCanvasDoubleClick=e=>{if(this.state.multiElement)return;if("selection"!==this.state.elementType)return;const t=Ta(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))return void(this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new Lo(t[0],this.scene)})));bn(this.canvas);let{x:n,y:r}=kn(e,this.state);if(ni(this.state).length>0){const e=this.getElementAtPosition(n,r),t=e&&((e,t)=>e.groupIds.find((e=>t[e])))(e,this.state.selectedGroupIds);if(t)return void this.setState((n=>ri(Object.assign(Object.assign({},n),{editingGroupId:t,selectedElementIds:{[e.id]:!0},selectedGroupIds:{}}),this.scene.getElements())))}if(bn(this.canvas),!e[zt]&&!this.state.viewModeEnabled){const t=Ta(this.scene.getElements(),this.state);if(1===t.length){const e=t[0];Le(e)&&(n=e.x+e.width/2,r=e.y+e.height/2)}this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey})}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),ap.pointers.has(e.pointerId)&&ap.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=ap.initialScale;if(2===ap.pointers.size&&ap.lastCenter&&t&&ap.initialDistance){const e=Ou(ap.pointers),n=e.x-ap.lastCenter.x,r=e.y-ap.lastCenter.y;ap.lastCenter=e;const i=Lu(Array.from(ap.pointers.values()))/ap.initialDistance;this.setState((o=>{let{zoom:a,scrollX:s,scrollY:l,offsetLeft:c,offsetTop:d}=o;return{scrollX:s+n/a.value,scrollY:l+r/a.value,zoom:Va(Wa(t*i),a,{left:c,top:d},e),shouldCacheIgnoreZoom:!0}})),this.resetShouldCacheIgnoreZoomDebounced()}else ap.lastCenter=ap.initialDistance=ap.initialScale=null;if(Qh||ep||tp)return;const n=Ia(np,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?bn(this.canvas):vn(this.canvas,this.state.elementType));const r=kn(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=Lo.handlePointerMove(e,i,a,this.state.editingLinearElement,this.state.gridSize);t!==this.state.editingLinearElement&&this.setState({editingLinearElement:t}),null!=t.lastUncommittedPoint?this.maybeSuggestBindingAtCursor(r):this.setState({suggestedBindings:[]})}if(Te(this.state.elementType)){const{draggingElement:e}=this.state;Me(e)?this.maybeSuggestBindingsForLinearElementAtCoords(e,[r],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(r)}if(this.state.multiElement){const{multiElement:e}=this.state,{x:t,y:n}=e,{points:r,lastCommittedPoint:s}=e,l=r[r.length-1];return vn(this.canvas,this.state.elementType),void(l===s?Ne(i-t,a-n,l[0],l[1])>=o.qx?Yr(e,{points:[...r,[i-t,a-n]]}):xn(this.canvas,o.oc.POINTER):r.length>2&&s&&Ne(i-t,a-n,s[0],s[1])<o.qx?(xn(this.canvas,o.oc.POINTER),Yr(e,{points:r.slice(0,-1)})):(Re(r,this.state.zoom.value)&&xn(this.canvas,o.oc.POINTER),Yr(e,{points:[...r.slice(0,-1),[i-t,a-n]]})))}if(Boolean(e.buttons)||"selection"!==this.state.elementType&&"text"!==this.state.elementType)return;const s=this.scene.getElements(),l=Ta(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=Mo(Qe(l),i,a,this.state.zoom,e.pointerType);if(t)return void xn(this.canvas,Oo({transformHandleType:t}))}}else{const t=Io(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void xn(this.canvas,Oo(t))}const c=this.getElementAtPosition(r.x,r.y);if("text"===this.state.elementType)xn(this.canvas,Ee(c)?o.oc.TEXT:o.oc.CROSSHAIR);else if(this.state.viewModeEnabled)xn(this.canvas,o.oc.GRAB);else if(n)xn(this.canvas,o.oc.AUTO);else if(this.state.editingLinearElement){const e=Lo.getElement(this.state.editingLinearElement.elementId);e&&Zi(e,this.state,[r.x,r.y])?xn(this.canvas,o.oc.MOVE):xn(this.canvas,o.oc.AUTO)}else e[zt]||!c&&!this.isHittingCommonBoundingBoxOfSelectedElements(r,l)?xn(this.canvas,o.oc.AUTO):xn(this.canvas,o.oc.MOVE)},this.handleTouchMove=e=>{ip=!0},this.handleCanvasPointerDown=e=>{const t=document.getSelection();if(null!=t&&t.anchorNode&&t.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(e),this.maybeCleanupAfterMissingPointerUp(e),ep)return;if(this.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),this.savePointer(e.clientX,e.clientY,"down"),this.handleCanvasPanUsingWheelOrSpaceDrag(e))return;if(e.button!==o.Oh.MAIN&&e.button!==o.Oh.TOUCH)return;if(this.updateGestureOnPointerDown(e),ap.pointers.size>1)return;const n=this.initialPointerDownState(e);if(this.handleDraggingScrollBar(e,n))return;if(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(e),this.handleSelectionOnPointerDown(e,n))return;if("text"===this.state.elementType)return void this.handleTextOnPointerDown(e,n);if("arrow"===this.state.elementType||"line"===this.state.elementType)this.handleLinearElementOnPointerDown(e,this.state.elementType,n);else if("image"===this.state.elementType){if(xn(this.canvas,o.oc.CROSSHAIR),!this.state.pendingImageElement)return;this.setState({draggingElement:this.state.pendingImageElement,editingElement:this.state.pendingImageElement,pendingImageElement:null,multiElement:null});const{x:t,y:n}=kn(e,this.state);Yr(this.state.pendingImageElement,{x:t,y:n})}else"freedraw"===this.state.elementType?this.handleFreeDrawElementOnPointerDown(e,this.state.elementType,n):this.createGenericElementOnPointerDown(this.state.elementType,n);const r=this.onPointerMoveFromPointerDownHandler(n),i=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);op=i,this.state.viewModeEnabled||(window.addEventListener(o.Ks.POINTER_MOVE,r),window.addEventListener(o.Ks.POINTER_UP,i),window.addEventListener(o.Ks.KEYDOWN,a),window.addEventListener(o.Ks.KEYUP,s),n.eventListeners.onMove=r,n.eventListeners.onUp=i,n.eventListeners.onKeyUp=s,n.eventListeners.onKeyDown=a)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=e=>{"touch"===e.pointerType&&(ip=!1,rp?ip=!0:rp=window.setTimeout((()=>{rp=0,ip||this.handleCanvasContextMenu(e)}),o.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(0!==ap.pointers.size||!(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&Qh||this.state.viewModeEnabled))return!1;ep=!0;let t=!1;const n=/Linux/.test(window.navigator.platform);xn(this.canvas,o.oc.GRABBING);let{clientX:r,clientY:i}=e;const a=Tn((e=>{const a=r-e.clientX,s=i-e.clientY;if(r=e.clientX,i=e.clientY,n&&!t&&(Math.abs(a)>1||Math.abs(s)>1)){t=!0;const e=t=>{document.body.removeEventListener(o.Ks.PASTE,e),t.stopPropagation()},n=()=>{setTimeout((()=>{document.body.removeEventListener(o.Ks.PASTE,e),window.removeEventListener(o.Ks.POINTER_UP,n)}),100)};document.body.addEventListener(o.Ks.PASTE,e),window.addEventListener(o.Ks.POINTER_UP,n)}this.setState({scrollX:this.state.scrollX-a/this.state.zoom.value,scrollY:this.state.scrollY-s/this.state.zoom.value})})),s=Tn(op=()=>{op=null,ep=!1,Qh||(this.state.viewModeEnabled?xn(this.canvas,o.oc.GRAB):vn(this.canvas,this.state.elementType)),this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,a),window.removeEventListener(o.Ks.POINTER_UP,s),window.removeEventListener(o.Ks.BLUR,s)});return window.addEventListener(o.Ks.BLUR,s),window.addEventListener(o.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(o.Ks.POINTER_UP,s),!0},this.clearSelectionIfNotUsingSelection=()=>{"selection"!==this.state.elementType&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=(e,t)=>{if("selection"===this.state.elementType){const r=this.scene.getElements(),i=Ta(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=Mo(Qe(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=Io(r,this.state,t.origin.x,t.origin.y,this.state.zoom,e.pointerType);null!=n&&(this.setState({resizingElement:n.element}),t.resize.handleType=n.transformHandleType)}if(t.resize.handleType)xn(this.canvas,Oo({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=jn(((e,t,n,r)=>{const[i,o,a,s]=1===t.length?Ge(t[0]):Qe(t),l=(i+a)/2,c=(o+s)/2,d=1===t.length?t[0].angle:0;switch([n,r]=Pe(n,r,l,c,-d),e){case"n":return Pe(n-(i+a)/2,r-o,0,0,d);case"s":return Pe(n-(i+a)/2,r-s,0,0,d);case"w":return Pe(n-i,r-(o+s)/2,0,0,d);case"e":return Pe(n-a,r-(o+s)/2,0,0,d);case"nw":return Pe(n-i,r-o,0,0,d);case"ne":return Pe(n-a,r-o,0,0,d);case"sw":return Pe(n-i,r-s,0,0,d);case"se":return Pe(n-a,r-s,0,0,d);default:return[0,0]}})(t.resize.handleType,i,t.origin.x,t.origin.y)),1===i.length&&je(i[0])&&2===i[0].points.length&&(t.resize.arrowDirection=((e,t)=>{const[,[n,r]]=t.points;return"nw"===e&&(n<0||r<0)||"ne"===e&&n>=0||"sw"===e&&n<=0||"se"===e&&(n>0||r>0)?"end":"origin"})(t.resize.handleType,i[0]));else{var n;if(this.state.editingLinearElement){const n=Lo.handlePointerDown(e,this.state,(e=>this.setState(e)),this.history,t.origin);if(n.hitElement&&(t.hit.element=n.hitElement),n.didAddPoint)return!0}t.hit.element=null!==(n=t.hit.element)&&void 0!==n?n:this.getElementAtPosition(t.origin.x,t.origin.y),t.hit.element&&(t.hit.hasHitElementInside=Zi(t.hit.element,this.state,[t.origin.x,t.origin.y])),t.hit.allHitElements=this.getElementsAtPosition(t.origin.x,t.origin.y);const r=t.hit.element,i=t.hit.allHitElements.some((e=>this.isASelectedElement(e)));if(null!==r&&i||e.shiftKey||t.hit.hasHitCommonBoundingBoxOfSelectedElements||this.clearSelection(r),this.state.editingLinearElement)this.setState({selectedElementIds:{[this.state.editingLinearElement.elementId]:!0}});else if(null!=r){if(e[zt])return this.state.selectedElementIds[r.id]||(t.hit.wasAddedToSelection=!0),this.setState((e=>{return Object.assign(Object.assign({},(t=e,n=r,Object.assign(Object.assign({},t),{editingGroupId:n.groupIds.length?n.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[n.id]:!0}}))),{previousSelectedElementIds:this.state.selectedElementIds});var t,n})),!1;this.state.selectedElementIds[r.id]||(this.state.editingGroupId&&!ii(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>ri(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[r.id]:!0})}),this.scene.getElements()))),t.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1},this.handleTextOnPointerDown=(e,t)=>{if(Ee(this.state.editingElement))return;let n=t.origin.x,r=t.origin.y;const i=this.getElementAtPosition(n,r,{includeBoundTextElement:!0});Le(i)&&(n=i.x+i.width/2,r=i.y+i.height/2),this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey}),bn(this.canvas),this.state.elementLocked||this.setState({elementType:"selection"})},this.handleFreeDrawElementOnPointerDown=(e,t,n)=>{const[r,i]=Ve(n.origin.x,n.origin.y,null),o=(a={type:t,x:r,y:i,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,strokeSharpness:this.state.currentItemLinearStrokeSharpness,simulatePressure:.5===e.pressure},Object.assign(Object.assign({},li(a.type,a)),{points:a.points||[],pressures:[],simulatePressure:a.simulatePressure,lastCommittedPoint:null}));var a;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[o.id]:!1})})));const s=o.simulatePressure?o.pressures:[...o.pressures,e.pressure];Yr(o,{points:[[0,0]],pressures:s});const l=Ko(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),o]),this.setState({draggingElement:o,editingElement:o,startBoundElement:l,suggestedBindings:[]})},this.createImageElement=e=>{let{sceneX:t,sceneY:n}=e;const[r,i]=Ve(t,n,this.state.gridSize);var o;return o={type:"image",x:r,y:i,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,strokeSharpness:this.state.currentItemLinearStrokeSharpness},Object.assign(Object.assign({},li("image",o)),{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=(e,t,n)=>{if(this.state.multiElement){const{multiElement:e}=this.state;if("line"===e.type&&Re(e.points,this.state.zoom.value))return Yr(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(Ql);const{x:t,y:r,lastCommittedPoint:i}=e;if(e.points.length>1&&i&&Ne(n.origin.x-t,n.origin.y-r,i[0],i[1])<o.qx)return void this.actionManager.executeAction(Ql);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Yr(e,{lastCommittedPoint:e.points[e.points.length-1]}),xn(this.canvas,o.oc.POINTER)}else{const[e,r]=Ve(n.origin.x,n.origin.y,this.state.gridSize),{currentItemStartArrowhead:i,currentItemEndArrowhead:o}=this.state,[a,s]="arrow"===t?[i,o]:[null,null],l=pi({type:t,x:e,y:r,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,strokeSharpness:this.state.currentItemLinearStrokeSharpness,startArrowhead:a,endArrowhead:s});this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[l.id]:!1})}))),Yr(l,{points:[...l.points,[0,0]]});const c=Ko(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),l]),this.setState({draggingElement:l,editingElement:l,startBoundElement:c,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=(e,t)=>{const[n,r]=Ve(t.origin.x,t.origin.y,this.state.gridSize),i=ci({type:e,x:n,y:r,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,strokeSharpness:this.state.currentItemStrokeSharpness});"selection"===i.type?this.setState({selectionElement:i,draggingElement:i}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),i]),this.setState({multiElement:null,draggingElement:i,editingElement:i}))},this.initializeImage=async e=>{var t,n,r;let{imageFile:i,imageElement:a,showCursorImagePreview:s=!1}=e;if(!ed(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(xn(this.canvas,"wait"),l===o.LO.svg)try{i=sd(await(async e=>{const t=(new DOMParser).parseFromString(e,o.LO.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||"svg"!==(null==(r=n)?void 0:r.nodeName.toLowerCase()))throw new Error(b("errors.invalidSVGString"));return n.hasAttribute("xmlns")||n.setAttribute("xmlns",o.hR),n.outerHTML;var r})(await i.text()),i.name)}catch(e){throw console.warn(e),new Error(b("errors.svgImageInsertError"))}const c=await((null===(t=(n=this.props).generateIdForFile)||void 0===t?void 0:t.call(n,i))||id(i));if(!c)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(b("errors.imageInsertError"));const d=this.files[c];if(null==d||!d.dataURL){try{i=await ad(i,{maxWidthOrHeight:o.h6})}catch(e){console.error("error trying to resing image file on insertion",e)}if(i.size>o.$n)throw new Error(b("errors.fileTooBig",{maxSize:"".concat(Math.trunc(o.$n/1024/1024),"MB")}))}if(s){var u;const e=null===(u=this.files[c])||void 0===u?void 0:u.dataURL,t=e&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.indexOf(","),r=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],o=new ArrayBuffer(r.length),a=new Uint8Array(o);for(let e=0;e<r.length;e++)a[e]=r.charCodeAt(e);return new File([o],t,{type:i})}(e);this.setImagePreviewCursor(t||i)}const h=(null===(r=this.files[c])||void 0===r?void 0:r.dataURL)||await od(i),p=Yr(a,{fileId:c},!1);return new Promise((async(e,t)=>{try{var n,r;this.files=Object.assign(Object.assign({},this.files),{[c]:{mimeType:l,id:c,dataURL:h,created:Date.now()}});const t=this.imageCache.get(c);t||(this.addNewImagesToImageCache(),await this.updateImageCache([p])),(null==t?void 0:t.image)instanceof Promise&&await t.image,(null===(n=this.state.pendingImageElement)||void 0===n?void 0:n.id)!==p.id&&(null===(r=this.state.draggingElement)||void 0===r?void 0:r.id)!==p.id&&this.initializeImageDimensions(p,!0),e(p)}catch(e){console.error(e),t(new Error(b("errors.imageInsertError")))}finally{s||bn(this.canvas)}}))},this.insertImageElement=async(e,t,n)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),e]);try{await this.initializeImage({imageFile:t,imageElement:e,showCursorImagePreview:n})}catch(t){Yr(e,{isDeleted:!0}),this.actionManager.executeAction(Ql),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await ad(e,{maxWidthOrHeight:96});let n=await od(t);if(e.type===o.LO.svg){const e=await hd(n);let t=Math.min(e.height,96),r=t*(e.width/e.height);r>96&&(r=96,t=r*(e.height/e.width));const i=document.createElement("canvas");i.height=t,i.width=r;i.getContext("2d").drawImage(e,0,0,r,t),n=i.toDataURL(o.LO.svg)}this.state.pendingImageElement&&xn(this.canvas,"url(".concat(n,") 4 4, auto"))},this.onImageAction=async function(){let{insertOnCanvasDirectly:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{insertOnCanvasDirectly:!1};try{const n=e.state.width/2+e.state.offsetLeft,r=e.state.height/2+e.state.offsetTop,{x:i,y:o}=kn({clientX:n,clientY:r},e.state),a=await Uc({description:"Image",extensions:["jpg","png","svg","gif"]}),s=e.createImageElement({sceneX:i,sceneY:o});t?(e.insertImageElement(s,a),e.initializeImageDimensions(s),e.setState({selectedElementIds:{[s.id]:!0}},(()=>{e.actionManager.executeAction(Ql)}))):e.setState({pendingImageElement:s},(()=>{e.insertImageElement(s,a,!0)}))}catch(t){"AbortError"!==t.name?console.error(t):console.warn(t),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(()=>{e.actionManager.executeAction(Ql)}))}},this.initializeImageDimensions=function(t){var n;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=ke(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!i||i instanceof Promise){if(t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=100/e.state.zoom.value;Yr(t,{x:t.x-n/2,y:t.y-n/2,width:n,height:n})}}else if(r||t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=Math.max(e.state.height-120,160),r=Math.min(n,Math.floor(.5*e.state.height)/e.state.zoom.value),o=Math.min(i.naturalHeight,r),a=o*(i.naturalWidth/i.naturalHeight),s=t.x+t.width/2-a/2,l=t.y+t.height/2-o/2;Yr(t,{x:s,y:l,width:a,height:o})}},this.updateImageCache=async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const{updatedFiles:r,erroredFiles:i}=await pd({imageCache:e.imageCache,fileIds:t.map((e=>e.fileId)),files:n});if(r.size||i.size)for(const e of t)r.has(e.fileId)&&Or(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>ke(e)&&i.has(e.fileId)?Zr(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gd(e.scene.getElements()),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const r=t.filter((t=>!t.isDeleted&&!e.imageCache.has(t.fileId)));if(r.length){const{updatedFiles:t}=await e.updateImageCache(r,n);t.size&&e.scene.informMutation()}},this.scheduleImageRefresh=Wh()((()=>{this.addNewImagesToImageCache()}),o.LL),this.updateBindingEnabledOnPointerMove=e=>{const t=(e=>!e[zt])(e);this.state.isBindingEnabled!==t&&this.setState({isBindingEnabled:t})},this.maybeSuggestBindingAtCursor=e=>{const t=Ko(e,this.scene);this.setState({suggestedBindings:null!=t?[t]:[]})},this.maybeSuggestBindingsForLinearElementAtCoords=(e,t,n)=>{if(!t.length)return;const r=t.reduce(((t,r)=>{const i=Ko(r,this.scene);return null==i||Uo(e,null==n?void 0:n.id,i)||t.push(i),t}),[]);this.setState({suggestedBindings:r})},this.handleCanvasRef=e=>{var t,n,r;null!==e?(this.canvas=e,this.rc=xe.canvas(this.canvas),this.canvas.addEventListener(o.Ks.WHEEL,this.handleWheel,{passive:!1}),this.canvas.addEventListener(o.Ks.TOUCH_START,this.onTapStart),this.canvas.addEventListener(o.Ks.TOUCH_END,this.onTapEnd)):(null===(t=this.canvas)||void 0===t||t.removeEventListener(o.Ks.WHEEL,this.handleWheel),null===(n=this.canvas)||void 0===n||n.removeEventListener(o.Ks.TOUCH_START,this.onTapStart),null===(r=this.canvas)||void 0===r||r.removeEventListener(o.Ks.TOUCH_END,this.onTapEnd))},this.handleAppOnDrop=async e=>{var t,n;try{const t=e.dataTransfer.files[0];if(ed(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(Hc)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await td(t,this.state,this.scene.getElementsIncludingDeleted());return void this.syncActionResult(Object.assign(Object.assign({},n),{appState:Object.assign(Object.assign({},n.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))}catch(e){if("EncodingError"!==e.name)throw e}const{x:n,y:r}=kn(e,this.state),i=this.createImageElement({sceneX:n,sceneY:r});return this.insertImageElement(i,t),this.initializeImageDimensions(i),void this.setState({selectedElementIds:{[i.id]:!0}})}}catch(e){return this.setState({isLoading:!1,errorMessage:e.message})}const r=e.dataTransfer.getData(o.LO.excalidrawlib);if(""!==r)return void this.addElementsFromPasteOrLibrary({elements:JSON.parse(r),position:e,files:null});const i=null===(t=e.dataTransfer)||void 0===t?void 0:t.files[0];if((null==i?void 0:i.type)===o.LO.excalidrawlib||null!=i&&null!==(n=i.name)&&void 0!==n&&n.endsWith(".excalidrawlib"))this.library.importLibrary(i).then((()=>{this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0})})).catch((e=>this.setState({isLoading:!1,errorMessage:e.message})));else{if(this.setState({isLoading:!0}),Hc)try{const t=e.dataTransfer.items[0];i.handle=await t.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}await this.loadFileToCanvas(i)}},this.loadFileToCanvas=e=>{td(e,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))},this.handleCanvasContextMenu=e=>{e.preventDefault();const{x:t,y:n}=kn(e,this.state),r=this.getElementAtPosition(t,n,{preferSelected:!0}),i=r?"element":"canvas",o=this.excalidrawContainerRef.current,{top:a,left:s}=o.getBoundingClientRect(),l=e.clientX-s,c=e.clientY-a;r&&!this.state.selectedElementIds[r.id]?this.setState({selectedElementIds:{[r.id]:!0}},(()=>{this._openContextMenu({top:c,left:l},i)})):this._openContextMenu({top:c,left:l},i)},this.maybeDragNewGenericElement=(e,t)=>{const n=this.state.draggingElement,r=e.lastCoords;if(n)if("selection"===n.type)ba(n,this.state.elementType,e.origin.x,e.origin.y,r.x,r.y,fn(e.origin.x,r.x),fn(e.origin.y,r.y),sn(t),an(t));else{var i;const[o,a]=Ve(r.x,r.y,this.state.gridSize),s=ke(n)&&(null===(i=this.imageCache.get(n.fileId))||void 0===i?void 0:i.image),l=!s||s instanceof Promise?null:s.width/s.height;ba(n,this.state.elementType,e.originInGrid.x,e.originInGrid.y,o,a,fn(e.originInGrid.x,o),fn(e.originInGrid.y,a),_e(n)?!sn(t):sn(t),an(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Ta(this.scene.getElements(),this.state),r=e.resize.handleType;this.setState({isResizing:r&&"rotation"!==r,isRotating:"rotation"===r});const i=e.lastCoords,[o,a]=Ve(i.x-e.resize.offset.x,i.y-e.resize.offset.y,this.state.gridSize);return!!((e,t,n,r,i,o,a,s,l,c,d)=>{if(1===n.length){const[c]=n;return"rotation"===t?(la(c,s,l,i),Yo(c)):!je(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ee(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&pa(e.originalElements.get(c.id),a,c,t,o,s,l):(ha(c,t,o,s,l),Yo(c)):ca(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return ma(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return ga(n,t,s,l),sr(n,t),!0}return!1})(e,r,n,e.resize.arrowDirection,ln(t),an(t),1===n.length&&_e(n[0])?!sn(t):sn(t),o,a,e.resize.center.x,e.resize.center.y)&&(this.maybeSuggestBindingForAll(n),!0)},this._openContextMenu=(e,t)=>{let{left:n,top:r}=e;const i=ru.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=iu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=mu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=fu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l="separator",c=this.scene.getElements(),d=[];if(Hd&&c.length>0&&d.push(Eu),Rd&&c.length>0&&d.push(_u),"canvas"===t){const e=[...d,void 0===this.props.gridModeEnabled&&Su,void 0===this.props.zenModeEnabled&&Cu,void 0===this.props.viewModeEnabled&&Uh,ju];this.state.viewModeEnabled?Fu.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}):Fu.push({options:[this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&navigator.clipboard&&l,Hd&&c.length>0&&Eu,Rd&&c.length>0&&_u,(Hd&&c.length>0||Rd&&c.length>0)&&l,jl,l,void 0===this.props.gridModeEnabled&&Su,void 0===this.props.zenModeEnabled&&Cu,void 0===this.props.viewModeEnabled&&Uh,ju],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current})}else"element"===t&&(this.state.viewModeEnabled?Fu.push({options:[navigator.clipboard&&wu,...d],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}):Fu.push({options:[this.isMobile&&ku,this.isMobile&&navigator.clipboard&&wu,this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&l,...d,l,Qd,eu,l,i&&ru,o&&iu,(i||o)&&l,au,l,_l,El,Sl,Cl,l,a&&mu,s&&fu,(a||s)&&l,Il,hl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}))},this.handleWheel=Tn((e=>{if(e.preventDefault(),ep)return;const{deltaX:t,deltaY:n}=e,{selectedElementIds:r,previousSelectedElementIds:i}=this.state;if(e.metaKey||e.ctrlKey){const e=Math.sign(n),t=10;let a=Math.abs(n);a>t&&(a=t),a*=e,0!==Object.keys(i).length&&setTimeout((()=>{this.setState({selectedElementIds:i,previousSelectedElementIds:{}})}),1e3);let s=this.state.zoom.value-a/100;return s+=Math.log10(Math.max(1,this.state.zoom.value))*-e,s=Math.round(s*o.V4*100)/(100*o.V4),this.setState((e=>{let{zoom:t,offsetLeft:n,offsetTop:o}=e;return{zoom:Va(Wa(s),t,{left:n,top:o},{x:$h,y:Jh}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(r).length?r:i,shouldCacheIgnoreZoom:!0}})),void this.resetShouldCacheIgnoreZoomDebounced()}e.shiftKey?this.setState((e=>{let{zoom:r,scrollX:i}=e;return{scrollX:i-(n||t)/r.value}})):this.setState((e=>{let{zoom:r,scrollX:i,scrollY:o}=e;return{scrollX:i-t/r.value,scrollY:o-n/r.value}}))})),this.savePointer=(e,t,n)=>{var r,i;if(!e||!t)return;const o=kn({clientX:e,clientY:t},this.state);isNaN(o.x)||isNaN(o.y),null===(r=(i=this.props).onPointerUpdate)||void 0===r||r.call(i,{pointer:o,button:n,pointersMap:ap.pointers})},this.resetShouldCacheIgnoreZoomDebounced=mn((()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=e=>{var t;if(null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current){const t=this.excalidrawContainerRef.current,{width:n,height:r,left:i,top:o}=t.getBoundingClientRect(),{width:a,height:s,offsetTop:l,offsetLeft:c}=this.state;if(n===a&&r===s&&i===c&&o===l)return void(e&&e());this.setState({width:n,height:r,offsetLeft:i,offsetTop:o},(()=>{e&&e()}))}},this.refresh=()=>{this.setState(Object.assign({},this.getCanvasOffsets()))}};"production"!==o.Vi.TEST&&"production"!==o.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app.scene.getElementsIncludingDeleted()},set(e){return this.app.scene.replaceAllElements(e)}}}));const cp=sp;n(4285),n(3313);var dp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const up=e=>{var t;const{onChange:n,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:l,onPointerUpdate:d,renderTopRightUI:u,renderFooter:h,langCode:p=c.code,viewModeEnabled:g,zenModeEnabled:m,gridModeEnabled:f,libraryReturnUrl:b,theme:v,name:w,renderCustomStats:k,onPaste:_,detectScroll:E=!0,handleKeyboardGlobally:S=!1,onLibraryChange:C,autoFocus:j=!1,generateIdForFile:I}=e,M=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,T={canvasActions:Object.assign(Object.assign({},o.cW.canvasActions),M)};var O,L;null!=M&&M.export&&(T.canvasActions.export.saveFileToDisk=null!==(O=null===(L=M.export)||void 0===L?void 0:L.saveFileToDisk)&&void 0!==O?O:o.cW.canvasActions.export.saveFileToDisk);return(0,r.useEffect)((()=>{const e=e=>{"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),()=>{document.removeEventListener("touchmove",e)}}),[]),(0,x.jsx)(y,{langCode:p,children:(0,x.jsx)(cp,{onChange:n,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:l,onPointerUpdate:d,renderTopRightUI:u,renderFooter:h,langCode:p,viewModeEnabled:g,zenModeEnabled:m,gridModeEnabled:f,libraryReturnUrl:b,theme:v,name:w,renderCustomStats:k,UIOptions:T,onPaste:_,detectScroll:E,handleKeyboardGlobally:S,onLibraryChange:C,autoFocus:j,generateIdForFile:I})})},hp=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=dp(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=dp(t,["initialData","UIOptions"]),l=Object.keys(r),c=Object.keys(a);if(l.length!==c.length)return!1;const d=l.every((e=>{if("canvasActions"===e){Object.keys(r.canvasActions).every((e=>{var t,n,i,o;return"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=a&&null!==(n=a.canvasActions)&&void 0!==n&&n.export?r.canvasActions.export.saveFileToDisk===a.canvasActions.export.saveFileToDisk:(null==r||null===(i=r.canvasActions)||void 0===i?void 0:i[e])===(null==a||null===(o=a.canvasActions)||void 0===o?void 0:o[e])}))}return!0})),u=Object.keys(e),h=Object.keys(t);return d&&u.length===h.length&&u.every((e=>i[e]===s[e]))},pp=(0,r.forwardRef)(((e,t)=>(0,x.jsx)(up,Object.assign(Object.assign({},e),{excalidrawRef:t})))),gp=i().memo(pp,hp);n(8336);const mp=gp},9669:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},1639:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},3147:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Cascadia.woff2"},3940:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Virgil.woff2"},9787:t=>{"use strict";t.exports=e},5156:e=>{"use strict";e.exports=t},1463:e=>{"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library"},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save to current file","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG."},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point(s),\\nCtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to edit (hold SHIFT to select multiple),\\nor hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library","bindTextToElement":"Press enter to add text"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version.","shareTitle":"Join a live collaboration session on Excalidraw"},"errorDialog":{"title":"Error"},"exportDialog":{"disk_title":"Save to disk","disk_details":"Export the scene data to a file from which you can import later.","disk_button":"Save to file","link_title":"Shareable link","link_details":"Export as a read-only link.","link_button":"Export to Link","excalidrawplus_description":"Save the scene to your Excalidraw+ workspace.","excalidrawplus_button":"Export","excalidrawplus_exportError":"Couldn\'t export to Excalidraw+ at this moment..."},"helpDialog":{"blog":"Read our blog","click":"click","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')},4451:e=>{"use strict";e.exports=JSON.parse('{"ar-SA":86,"bg-BG":59,"bn-BD":0,"ca-ES":78,"cs-CZ":25,"da-DK":17,"de-DE":100,"el-GR":88,"en":100,"es-ES":88,"fa-IR":66,"fi-FI":100,"fr-FR":100,"he-IL":84,"hi-IN":58,"hu-HU":52,"id-ID":100,"it-IT":100,"ja-JP":99,"kab-KAB":82,"kk-KZ":24,"ko-KR":58,"lv-LV":100,"my-MM":49,"nb-NO":100,"nl-NL":93,"nn-NO":87,"oc-FR":99,"pa-IN":84,"pl-PL":97,"pt-BR":99,"pt-PT":87,"ro-RO":100,"ru-RU":86,"si-LK":9,"sk-SK":99,"sv-SE":99,"ta-IN":98,"tr-TR":78,"uk-UA":85,"zh-CN":92,"zh-HK":29,"zh-TW":100}')}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,l),n.loaded=!0,n.exports}return l.m=a,l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);l.r(i);var o={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,l.d(i,o),i},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,n)=>(l.f[n](e,t),t)),[])),l.u=e=>"excalidraw-assets/"+{9:"i18n-zh-HK-json",43:"i18n-de-DE-json",58:"i18n-si-LK-json",60:"i18n-ko-KR-json",62:"i18n-zh-TW-json",137:"i18n-ja-JP-json",149:"i18n-pt-PT-json",164:"i18n-kab-KAB-json",196:"i18n-nl-NL-json",213:"i18n-tr-TR-json",242:"i18n-my-MM-json",246:"i18n-nb-NO-json",262:"i18n-he-IL-json",280:"i18n-pa-IN-json",304:"i18n-zh-CN-json",317:"i18n-es-ES-json",351:"i18n-ca-ES-json",364:"i18n-fr-FR-json",381:"i18n-pt-BR-json",384:"i18n-bg-BG-json",387:"i18n-cs-CZ-json",395:"i18n-ta-IN-json",401:"i18n-sk-SK-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",499:"image",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",565:"i18n-oc-FR-json",583:"i18n-uk-UA-json",603:"i18n-bn-BD-json",617:"i18n-da-DK-json",649:"i18n-kk-KZ-json",661:"i18n-hu-HU-json",698:"i18n-sv-SE-json",710:"i18n-fa-IR-json",736:"vendor",752:"i18n-ro-RO-json",852:"i18n-pl-PL-json",869:"i18n-ru-RU-json",899:"i18n-lv-LV-json",920:"i18n-nn-NO-json",933:"i18n-hi-IN-json"}[e]+"-"+{9:"f82802143c7042511410",43:"e676479528793fb9755f",58:"c5e207625d8f7a06eb15",60:"fc3ee48a144b19bcca0d",62:"79c634b00f4602a2d9a6",137:"c6208f4ec6ec8d61df2f",149:"73605e7eed8d224609aa",164:"7aaa4a5ea8484b941af2",196:"be44386cc68047e2da24",213:"17f1500f11b6e08b677b",242:"6d186d192f0024208fe2",246:"a8b16b7360f5df195438",262:"dfc95883bf533087b673",280:"319132bcecbfaf90ef79",304:"a13fbd80677ff3f0122c",317:"2996f978aa8d44a1bc72",351:"93b7462bd1d0fe76d2b5",364:"f470b9806c21d127df35",381:"ad09ed1c16a3d2b6d4b8",384:"eb8b237a2970da7034ad",387:"1244df10086a058f2d41",395:"f20bc85c68e334566d53",401:"0261a2d60b0803cc8354",465:"1cd7244d3b42597e1555",472:"bb5e3af1d7bb005f0c7d",491:"43b313d6c7c52122220b",499:"87e58979d258cd38208c",526:"cef06f766f46d7ab798a",558:"6fcb7979cd290e0e51d9",565:"ad1cdc3ba675116187a4",583:"4798e5a14cecdddbfb50",603:"87d5cd14de43ad6ec162",617:"85af69d03d5a188d4d3e",649:"654dee98c29976300a26",661:"dbaf9c47430503d4a710",698:"4b274bae10479b585716",710:"84150b1f61e3d7a0afcf",736:"8698157b56eb5e0ee549",752:"b48f7b508a0884880f63",852:"2df7909ca92201d653d7",869:"cd5378c60549c20232c7",899:"bfb22930b5a31d1f92ee",920:"074a3f14a8e56d66eeb7",933:"07d3a348a9723eeb51a3"}[e]+".js",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},o="Excalidraw:",l.l=(e,t,n,r)=>{if(i[e])i[e].push(t);else{var a,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+n){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",o+n),a.src=e),i[e]=[t];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),l.p="",(()=>{l.b=document.baseURI||self.location.href;var e={388:0};l.f.j=(t,n)=>{var r=l.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,i)=>r=e[t]=[n,i]));n.push(r[2]=i);var o=l.p+l.u(t),a=new Error;l.l(o,(n=>{if(l.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,s]=n,c=0;if(o.some((t=>0!==e[t]))){for(r in a)l.o(a,r)&&(l.m[r]=a[r]);if(s)s(l)}for(t&&t(n);c<o.length;c++)i=o[c],l.o(e,i)&&e[i]&&e[i][0](),e[o[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),l(2254)})()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return function(){var n,r,o,i,a={7945:function(e,t,n){e.exports=n(1602)},200:function(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt,s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=s||u||Function("return this")(),f=Object.prototype.toString,p=Math.max,h=Math.min,m=function(){return d.Date.now()};function g(e,t,n){var o,i,a,l,c,s,u=0,d=!1,f=!1,g=!0;if("function"!=typeof e)throw new TypeError(r);function y(t){var n=o,r=i;return o=i=void 0,u=t,l=e.apply(r,n)}function x(e){return u=e,c=setTimeout(k,t),d?y(e):l}function w(e){var n=e-s;return void 0===s||n>=t||n<0||f&&e-u>=a}function k(){var e=m();if(w(e))return _(e);c=setTimeout(k,function(e){var n=t-(e-s);return f?h(n,a-(e-u)):n}(e))}function _(e){return c=void 0,g&&o?y(e):(o=i=void 0,l)}function S(){var e=m(),n=w(e);if(o=arguments,i=this,s=e,n){if(void 0===c)return x(s);if(f)return c=setTimeout(k,t),y(s)}return void 0===c&&(c=setTimeout(k,t)),l}return t=b(t)||0,v(n)&&(d=!!n.leading,a=(f="maxWait"in n)?p(b(n.maxWait)||0,t):a,g="trailing"in n?!!n.trailing:g),S.cancel=function(){void 0!==c&&clearTimeout(c),u=0,o=s=i=c=void 0},S.flush=function(){return void 0===c?l:_(m())},S}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return v(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),g(e,t,{leading:o,maxWait:t,trailing:i})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var o,i="Expected a function",a="__lodash_hash_undefined__",l="__lodash_placeholder__",c=16,s=32,u=64,d=128,f=256,p=1/0,h=9007199254740991,m=NaN,g=4294967295,v=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",s],["partialRight",u],["rearg",f]],b="[object Arguments]",y="[object Array]",x="[object Boolean]",w="[object Date]",k="[object Error]",_="[object Function]",S="[object GeneratorFunction]",E="[object Map]",j="[object Number]",C="[object Object]",O="[object Promise]",I="[object RegExp]",M="[object Set]",T="[object String]",A="[object Symbol]",P="[object WeakMap]",L="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",z="[object Float64Array]",N="[object Int8Array]",B="[object Int16Array]",H="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",W="[object Uint16Array]",K="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(Y.source),$=RegExp(q.source),Q=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(oe.source),ae=/^\s+/,le=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,xe=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",je="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Me="['’]",Te="[\\ud800-\\udfff]",Ae="["+Ie+"]",Pe="["+Se+"]",Le="\\d+",De="[\\u2700-\\u27bf]",Re="["+je+"]",ze="[^\\ud800-\\udfff"+Ie+Le+Ee+je+Ce+"]",Ne="\\ud83c[\\udffb-\\udfff]",Be="[^\\ud800-\\udfff]",He="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ce+"]",We="(?:"+Re+"|"+ze+")",Ke="(?:"+Ue+"|"+ze+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ze="(?:"+Pe+"|"+Ne+")"+"?",Ye="[\\ufe0e\\ufe0f]?",qe=Ye+Ze+("(?:\\u200d(?:"+[Be,He,Fe].join("|")+")"+Ye+Ze+")*"),Xe="(?:"+[De,He,Fe].join("|")+")"+qe,$e="(?:"+[Be+Pe+"?",Pe,He,Fe,Te].join("|")+")",Qe=RegExp(Me,"g"),Je=RegExp(Pe,"g"),et=RegExp(Ne+"(?="+Ne+")|"+$e+qe,"g"),tt=RegExp([Ue+"?"+Re+"+"+Ve+"(?="+[Ae,Ue,"$"].join("|")+")",Ke+"+"+Ge+"(?="+[Ae,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+Ve,Ue+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,Xe].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Se+Oe+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],it=-1,at={};at[R]=at[z]=at[N]=at[B]=at[H]=at[F]=at[U]=at[W]=at[K]=!0,at[b]=at[y]=at[L]=at[x]=at[D]=at[w]=at[k]=at[_]=at[E]=at[j]=at[C]=at[I]=at[M]=at[T]=at[P]=!1;var lt={};lt[b]=lt[y]=lt[L]=lt[D]=lt[x]=lt[w]=lt[R]=lt[z]=lt[N]=lt[B]=lt[H]=lt[E]=lt[j]=lt[C]=lt[I]=lt[M]=lt[T]=lt[A]=lt[F]=lt[U]=lt[W]=lt[K]=!0,lt[k]=lt[_]=lt[P]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,ut=parseInt,dt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ft||Function("return this")(),ht=t&&!t.nodeType&&t,mt=ht&&e&&!e.nodeType&&e,gt=mt&&mt.exports===ht,vt=gt&&dt.process,bt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),yt=bt&&bt.isArrayBuffer,xt=bt&&bt.isDate,wt=bt&&bt.isMap,kt=bt&&bt.isRegExp,_t=bt&&bt.isSet,St=bt&&bt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function jt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Mt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Tt(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function At(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function Lt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Dt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Rt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function zt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Nt=Vt("length");function Bt(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}function Ht(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Ft(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):Ht(e,Wt,n)}function Ut(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Wt(e){return e!=e}function Kt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:m}function Vt(e){return function(t){return null==t?o:t[e]}}function Gt(e){return function(t){return null==e?o:e[t]}}function Zt(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}function Yt(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,mn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Qt(e,t){return Pt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Gt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),on=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+ct[e]}function ln(e){return nt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function un(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];a!==t&&a!==l||(e[n]=l,i[o++]=n)}return i}function dn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function fn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return ln(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Nt(e)}function hn(e){return ln(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&le.test(e.charAt(t)););return t}var gn=Gt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var vn=function e(t){var n,r=(t=null==t?pt:vn.defaults(pt.Object(),t,vn.pick(pt,ot))).Array,le=t.Date,Se=t.Error,Ee=t.Function,je=t.Math,Ce=t.Object,Oe=t.RegExp,Ie=t.String,Me=t.TypeError,Te=r.prototype,Ae=Ee.prototype,Pe=Ce.prototype,Le=t["__core-js_shared__"],De=Ae.toString,Re=Pe.hasOwnProperty,ze=0,Ne=(n=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Be=Pe.toString,He=De.call(Ce),Fe=pt._,Ue=Oe("^"+De.call(Re).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=gt?t.Buffer:o,Ke=t.Symbol,Ve=t.Uint8Array,Ge=We?We.allocUnsafe:o,Ze=sn(Ce.getPrototypeOf,Ce),Ye=Ce.create,qe=Pe.propertyIsEnumerable,Xe=Te.splice,$e=Ke?Ke.isConcatSpreadable:o,et=Ke?Ke.iterator:o,nt=Ke?Ke.toStringTag:o,ct=function(){try{var e=hi(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),dt=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ft=le&&le.now!==pt.Date.now&&le.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=je.ceil,vt=je.floor,bt=Ce.getOwnPropertySymbols,Nt=We?We.isBuffer:o,Gt=t.isFinite,bn=Te.join,yn=sn(Ce.keys,Ce),xn=je.max,wn=je.min,kn=le.now,_n=t.parseInt,Sn=je.random,En=Te.reverse,jn=hi(t,"DataView"),Cn=hi(t,"Map"),On=hi(t,"Promise"),In=hi(t,"Set"),Mn=hi(t,"WeakMap"),Tn=hi(Ce,"create"),An=Mn&&new Mn,Pn={},Ln=Fi(jn),Dn=Fi(Cn),Rn=Fi(On),zn=Fi(In),Nn=Fi(Mn),Bn=Ke?Ke.prototype:o,Hn=Bn?Bn.valueOf:o,Fn=Bn?Bn.toString:o;function Un(e){if(ol(e)&&!Za(e)&&!(e instanceof Gn)){if(e instanceof Vn)return e;if(Re.call(e,"__wrapped__"))return Ui(e)}return new Vn(e)}var Wn=function(){function e(){}return function(t){if(!rl(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Kn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Yn(e);this.size=t.size}function Qn(e,t){var n=Za(e),r=!n&&Ga(e),o=!n&&!r&&$a(e),i=!n&&!r&&!o&&fl(e),a=n||r||o||i,l=a?qt(e.length,Ie):[],c=l.length;for(var s in e)!t&&!Re.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||wi(s,c))||l.push(s);return l}function Jn(e){var t=e.length;return t?e[Xr(0,t-1)]:o}function er(e,t){return Ni(Ao(e),sr(t,0,e.length))}function tr(e){return Ni(Ao(e))}function nr(e,t,n){(n!==o&&!Wa(e[t],n)||n===o&&!(t in e))&&lr(e,t,n)}function rr(e,t,n){var r=e[t];Re.call(e,t)&&Wa(r,n)&&(n!==o||t in e)||lr(e,t,n)}function or(e,t){for(var n=e.length;n--;)if(Wa(e[n][0],t))return n;return-1}function ir(e,t,n,r){return hr(e,(function(e,o,i){t(r,e,n(e),i)})),r}function ar(e,t){return e&&Po(t,Ll(t),e)}function lr(e,t,n){"__proto__"==t&&ct?ct(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function cr(e,t){for(var n=-1,i=t.length,a=r(i),l=null==e;++n<i;)a[n]=l?o:Il(e,t[n]);return a}function sr(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,a){var l,c=1&t,s=2&t,u=4&t;if(n&&(l=i?n(e,r,i,a):n(e)),l!==o)return l;if(!rl(e))return e;var d=Za(e);if(d){if(l=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Re.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Ao(e,l)}else{var f=vi(e),p=f==_||f==S;if($a(e))return jo(e,c);if(f==C||f==b||p&&!i){if(l=s||p?{}:yi(e),!c)return s?function(e,t){return Po(e,gi(e),t)}(e,function(e,t){return e&&Po(t,Dl(t),e)}(l,e)):function(e,t){return Po(e,mi(e),t)}(e,ar(l,e))}else{if(!lt[f])return i?e:{};l=function(e,t,n){var r=e.constructor;switch(t){case L:return Co(e);case x:case w:return new r(+e);case D:return function(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case R:case z:case N:case B:case H:case F:case U:case W:case K:return Oo(e,n);case E:case M:return new r;case j:case T:return new r(e);case I:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return o=e,Hn?Ce(Hn.call(o)):{}}var o}(e,f,c)}}a||(a=new $n);var h=a.get(e);if(h)return h;a.set(e,l),sl(e)?e.forEach((function(r){l.add(ur(r,t,n,r,e,a))})):il(e)&&e.forEach((function(r,o){l.set(o,ur(r,t,n,o,e,a))}));var m=d?o:(u?s?li:ai:s?Dl:Ll)(e);return Ct(m||e,(function(r,o){m&&(r=e[o=r]),rr(l,o,ur(r,t,n,o,e,a))})),l}function dr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var i=n[r],a=t[i],l=e[i];if(l===o&&!(i in e)||!a(l))return!1}return!0}function fr(e,t,n){if("function"!=typeof e)throw new Me(i);return Li((function(){e.apply(o,n)}),t)}function pr(e,t,n,r){var o=-1,i=Tt,a=!0,l=e.length,c=[],s=t.length;if(!l)return c;n&&(t=Pt(t,$t(n))),r?(i=At,a=!1):t.length>=200&&(i=Jt,a=!1,t=new Xn(t));e:for(;++o<l;){var u=e[o],d=null==n?u:n(u);if(u=r||0!==u?u:0,a&&d==d){for(var f=s;f--;)if(t[f]===d)continue e;c.push(u)}else i(t,d,r)||c.push(u)}return c}Un.templateSettings={escape:Q,evaluate:J,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Kn.prototype,Un.prototype.constructor=Un,Vn.prototype=Wn(Kn.prototype),Vn.prototype.constructor=Vn,Gn.prototype=Wn(Kn.prototype),Gn.prototype.constructor=Gn,Zn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},Zn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zn.prototype.get=function(e){var t=this.__data__;if(Tn){var n=t[e];return n===a?o:n}return Re.call(t,e)?t[e]:o},Zn.prototype.has=function(e){var t=this.__data__;return Tn?t[e]!==o:Re.call(t,e)},Zn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Tn&&t===o?a:t,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=or(t,e);return!(n<0)&&(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,!0)},Yn.prototype.get=function(e){var t=this.__data__,n=or(t,e);return n<0?o:t[n][1]},Yn.prototype.has=function(e){return or(this.__data__,e)>-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Zn,map:new(Cn||Yn),string:new Zn}},qn.prototype.delete=function(e){var t=fi(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return fi(this,e).get(e)},qn.prototype.has=function(e){return fi(this,e).has(e)},qn.prototype.set=function(e,t){var n=fi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,a),this},Xn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new Yn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var hr=Ro(kr),mr=Ro(_r,!0);function gr(e,t){var n=!0;return hr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],l=t(a);if(null!=l&&(c===o?l==l&&!dl(l):n(l,c)))var c=l,s=a}return s}function br(e,t){var n=[];return hr(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function yr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=xi),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?yr(l,t-1,n,r,o):Lt(o,l):r||(o[o.length]=l)}return o}var xr=zo(),wr=zo(!0);function kr(e,t){return e&&xr(e,t,Ll)}function _r(e,t){return e&&wr(e,t,Ll)}function Sr(e,t){return Mt(t,(function(t){return el(e[t])}))}function Er(e,t){for(var n=0,r=(t=ko(t,e)).length;null!=e&&n<r;)e=e[Hi(t[n++])];return n&&n==r?e:o}function jr(e,t,n){var r=t(e);return Za(e)?r:Lt(r,n(e))}function Cr(e){return null==e?e===o?"[object Undefined]":"[object Null]":nt&&nt in Ce(e)?function(e){var t=Re.call(e,nt),n=e[nt];try{e[nt]=o;var r=!0}catch(e){}var i=Be.call(e);r&&(t?e[nt]=n:delete e[nt]);return i}(e):function(e){return Be.call(e)}(e)}function Or(e,t){return e>t}function Ir(e,t){return null!=e&&Re.call(e,t)}function Mr(e,t){return null!=e&&t in Ce(e)}function Tr(e,t,n){for(var i=n?At:Tt,a=e[0].length,l=e.length,c=l,s=r(l),u=1/0,d=[];c--;){var f=e[c];c&&t&&(f=Pt(f,$t(t))),u=wn(f.length,u),s[c]=!n&&(t||a>=120&&f.length>=120)?new Xn(c&&f):o}f=e[0];var p=-1,h=s[0];e:for(;++p<a&&d.length<u;){var m=f[p],g=t?t(m):m;if(m=n||0!==m?m:0,!(h?Jt(h,g):i(d,g,n))){for(c=l;--c;){var v=s[c];if(!(v?Jt(v,g):i(e[c],g,n)))continue e}h&&h.push(g),d.push(m)}}return d}function Ar(e,t,n){var r=null==(e=Mi(e,t=ko(t,e)))?e:e[Hi(Ji(t))];return null==r?o:Et(r,e,n)}function Pr(e){return ol(e)&&Cr(e)==b}function Lr(e,t,n,r,i){return e===t||(null==e||null==t||!ol(e)&&!ol(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var l=Za(e),c=Za(t),s=l?y:vi(e),u=c?y:vi(t),d=(s=s==b?C:s)==C,f=(u=u==b?C:u)==C,p=s==u;if(p&&$a(e)){if(!$a(t))return!1;l=!0,d=!1}if(p&&!d)return a||(a=new $n),l||fl(e)?oi(e,t,n,r,i,a):function(e,t,n,r,o,i,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!i(new Ve(e),new Ve(t)));case x:case w:case j:return Wa(+e,+t);case k:return e.name==t.name&&e.message==t.message;case I:case T:return e==t+"";case E:var l=cn;case M:var c=1&r;if(l||(l=dn),e.size!=t.size&&!c)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var u=oi(l(e),l(t),r,o,i,a);return a.delete(e),u;case A:if(Hn)return Hn.call(e)==Hn.call(t)}return!1}(e,t,s,n,r,i,a);if(!(1&n)){var h=d&&Re.call(e,"__wrapped__"),m=f&&Re.call(t,"__wrapped__");if(h||m){var g=h?e.value():e,v=m?t.value():t;return a||(a=new $n),i(g,v,n,r,a)}}if(!p)return!1;return a||(a=new $n),function(e,t,n,r,i,a){var l=1&n,c=ai(e),s=c.length,u=ai(t).length;if(s!=u&&!l)return!1;var d=s;for(;d--;){var f=c[d];if(!(l?f in t:Re.call(t,f)))return!1}var p=a.get(e),h=a.get(t);if(p&&h)return p==t&&h==e;var m=!0;a.set(e,t),a.set(t,e);var g=l;for(;++d<s;){var v=e[f=c[d]],b=t[f];if(r)var y=l?r(b,v,f,t,e,a):r(v,b,f,e,t,a);if(!(y===o?v===b||i(v,b,n,r,a):y)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,i,a)}(e,t,n,r,Lr,i))}function Dr(e,t,n,r){var i=n.length,a=i,l=!r;if(null==e)return!a;for(e=Ce(e);i--;){var c=n[i];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<a;){var s=(c=n[i])[0],u=e[s],d=c[1];if(l&&c[2]){if(u===o&&!(s in e))return!1}else{var f=new $n;if(r)var p=r(u,d,s,e,t,f);if(!(p===o?Lr(d,u,3,r,f):p))return!1}}return!0}function Rr(e){return!(!rl(e)||(t=e,Ne&&Ne in t))&&(el(e)?Ue:be).test(Fi(e));var t}function zr(e){return"function"==typeof e?e:null==e?ac:"object"==typeof e?Za(e)?Wr(e[0],e[1]):Ur(e):mc(e)}function Nr(e){if(!ji(e))return yn(e);var t=[];for(var n in Ce(e))Re.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Br(e){if(!rl(e))return function(e){var t=[];if(null!=e)for(var n in Ce(e))t.push(n);return t}(e);var t=ji(e),n=[];for(var r in e)("constructor"!=r||!t&&Re.call(e,r))&&n.push(r);return n}function Hr(e,t){return e<t}function Fr(e,t){var n=-1,o=qa(e)?r(e.length):[];return hr(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}function Ur(e){var t=pi(e);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Wr(e,t){return _i(e)&&Ci(t)?Oi(Hi(e),t):function(n){var r=Il(n,e);return r===o&&r===t?Ml(n,e):Lr(t,r,3)}}function Kr(e,t,n,r,i){e!==t&&xr(t,(function(a,l){if(i||(i=new $n),rl(a))!function(e,t,n,r,i,a,l){var c=Ai(e,n),s=Ai(t,n),u=l.get(s);if(u)return void nr(e,n,u);var d=a?a(c,s,n+"",e,t,l):o,f=d===o;if(f){var p=Za(s),h=!p&&$a(s),m=!p&&!h&&fl(s);d=s,p||h||m?Za(c)?d=c:Xa(c)?d=Ao(c):h?(f=!1,d=jo(s,!0)):m?(f=!1,d=Oo(s,!0)):d=[]:ll(s)||Ga(s)?(d=c,Ga(c)?d=xl(c):rl(c)&&!el(c)||(d=yi(s))):f=!1}f&&(l.set(s,d),i(d,s,r,a,l),l.delete(s));nr(e,n,d)}(e,t,l,n,Kr,r,i);else{var c=r?r(Ai(e,l),a,l+"",e,t,i):o;c===o&&(c=a),nr(e,l,c)}}),Dl)}function Vr(e,t){var n=e.length;if(n)return wi(t+=t<0?n:0,n)?e[t]:o}function Gr(e,t,n){t=t.length?Pt(t,(function(e){return Za(e)?function(t){return Er(t,1===e.length?e[0]:e)}:e})):[ac];var r=-1;t=Pt(t,$t(di()));var o=Fr(e,(function(e,n,o){var i=Pt(t,(function(t){return t(e)}));return{criteria:i,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(o,(function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,l=n.length;for(;++r<a;){var c=Io(o[r],i[r]);if(c)return r>=l?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Zr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=Er(e,a);n(l,a)&&to(i,ko(a,e),l)}return i}function Yr(e,t,n,r){var o=r?Ut:Ft,i=-1,a=t.length,l=e;for(e===t&&(t=Ao(t)),n&&(l=Pt(e,$t(n)));++i<a;)for(var c=0,s=t[i],u=n?n(s):s;(c=o(l,u,c,r))>-1;)l!==e&&Xe.call(l,c,1),Xe.call(e,c,1);return e}function qr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):ho(e,o)}}return e}function Xr(e,t){return e+vt(Sn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=vt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Di(Ii(e,t,ac),e+"")}function Jr(e){return Jn(Wl(e))}function eo(e,t){var n=Wl(e);return Ni(n,sr(t,0,n.length))}function to(e,t,n,r){if(!rl(e))return e;for(var i=-1,a=(t=ko(t,e)).length,l=a-1,c=e;null!=c&&++i<a;){var s=Hi(t[i]),u=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(i!=l){var d=c[s];(u=r?r(d,s,c):o)===o&&(u=rl(d)?d:wi(t[i+1])?[]:{})}rr(c,s,u),c=c[s]}return e}var no=An?function(e,t){return An.set(e,t),e}:ac,ro=ct?function(e,t){return ct(e,"toString",{configurable:!0,enumerable:!1,value:rc(t),writable:!0})}:ac;function oo(e){return Ni(Wl(e))}function io(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function ao(e,t){var n;return hr(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}function lo(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!dl(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return co(e,t,ac,n)}function co(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var l=(t=n(t))!=t,c=null===t,s=dl(t),u=t===o;i<a;){var d=vt((i+a)/2),f=n(e[d]),p=f!==o,h=null===f,m=f==f,g=dl(f);if(l)var v=r||m;else v=u?m&&(r||p):c?m&&p&&(r||!h):s?m&&p&&!h&&(r||!g):!h&&!g&&(r?f<=t:f<t);v?i=d+1:a=d}return wn(a,4294967294)}function so(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],l=t?t(a):a;if(!n||!Wa(l,c)){var c=l;i[o++]=0===a?0:a}}return i}function uo(e){return"number"==typeof e?e:dl(e)?m:+e}function fo(e){if("string"==typeof e)return e;if(Za(e))return Pt(e,fo)+"";if(dl(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function po(e,t,n){var r=-1,o=Tt,i=e.length,a=!0,l=[],c=l;if(n)a=!1,o=At;else if(i>=200){var s=t?null:Qo(e);if(s)return dn(s);a=!1,o=Jt,c=new Xn}else c=t?[]:l;e:for(;++r<i;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,a&&d==d){for(var f=c.length;f--;)if(c[f]===d)continue e;t&&c.push(d),l.push(u)}else o(c,d,n)||(c!==l&&c.push(d),l.push(u))}return l}function ho(e,t){return null==(e=Mi(e,t=ko(t,e)))||delete e[Hi(Ji(t))]}function mo(e,t,n,r){return to(e,t,n(Er(e,t)),r)}function go(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?io(e,r?0:i,r?i+1:o):io(e,r?i+1:0,r?o:i)}function vo(e,t){var n=e;return n instanceof Gn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Lt([e],t.args))}),n)}function bo(e,t,n){var o=e.length;if(o<2)return o?po(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var l=e[i],c=-1;++c<o;)c!=i&&(a[i]=pr(a[i]||l,e[c],t,n));return po(yr(a,1),t,n)}function yo(e,t,n){for(var r=-1,i=e.length,a=t.length,l={};++r<i;){var c=r<a?t[r]:o;n(l,e[r],c)}return l}function xo(e){return Xa(e)?e:[]}function wo(e){return"function"==typeof e?e:ac}function ko(e,t){return Za(e)?e:_i(e,t)?[e]:Bi(wl(e))}var _o=Qr;function So(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:io(e,t,n)}var Eo=dt||function(e){return pt.clearTimeout(e)};function jo(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Co(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Oo(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Io(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=dl(e),l=t!==o,c=null===t,s=t==t,u=dl(t);if(!c&&!u&&!a&&e>t||a&&l&&s&&!c&&!u||r&&l&&s||!n&&s||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||c&&n&&i||!l&&i||!s)return-1}return 0}function Mo(e,t,n,o){for(var i=-1,a=e.length,l=n.length,c=-1,s=t.length,u=xn(a-l,0),d=r(s+u),f=!o;++c<s;)d[c]=t[c];for(;++i<l;)(f||i<a)&&(d[n[i]]=e[i]);for(;u--;)d[c++]=e[i++];return d}function To(e,t,n,o){for(var i=-1,a=e.length,l=-1,c=n.length,s=-1,u=t.length,d=xn(a-c,0),f=r(d+u),p=!o;++i<d;)f[i]=e[i];for(var h=i;++s<u;)f[h+s]=t[s];for(;++l<c;)(p||i<a)&&(f[h+n[l]]=e[i++]);return f}function Ao(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Po(e,t,n,r){var i=!n;n||(n={});for(var a=-1,l=t.length;++a<l;){var c=t[a],s=r?r(n[c],e[c],c,n,e):o;s===o&&(s=e[c]),i?lr(n,c,s):rr(n,c,s)}return n}function Lo(e,t){return function(n,r){var o=Za(n)?jt:ir,i=t?t():{};return o(n,e,di(r,2),i)}}function Do(e){return Qr((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,l=i>2?n[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,l&&ki(n[0],n[1],l)&&(a=i<3?o:a,i=1),t=Ce(t);++r<i;){var c=n[r];c&&e(t,c,r,a)}return t}))}function Ro(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Ce(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function zo(e){return function(t,n,r){for(var o=-1,i=Ce(t),a=r(t),l=a.length;l--;){var c=a[e?l:++o];if(!1===n(i[c],c,i))break}return t}}function No(e){return function(t){var n=ln(t=wl(t))?hn(t):o,r=n?n[0]:t.charAt(0),i=n?So(n,1).join(""):t.slice(1);return r[e]()+i}}function Bo(e){return function(t){return Dt(ec(Gl(t).replace(Qe,"")),e,"")}}function Ho(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Wn(e.prototype),r=e.apply(n,t);return rl(r)?r:n}}function Fo(e){return function(t,n,r){var i=Ce(t);if(!qa(t)){var a=di(n,3);t=Ll(t),n=function(e){return a(i[e],e,i)}}var l=e(t,n,r);return l>-1?i[a?t[l]:l]:o}}function Uo(e){return ii((function(t){var n=t.length,r=n,a=Vn.prototype.thru;for(e&&t.reverse();r--;){var l=t[r];if("function"!=typeof l)throw new Me(i);if(a&&!c&&"wrapper"==si(l))var c=new Vn([],!0)}for(r=c?r:n;++r<n;){var s=si(l=t[r]),u="wrapper"==s?ci(l):o;c=u&&Si(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[si(u[0])].apply(c,u[3]):1==l.length&&Si(l)?c[s]():c.thru(l)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&Za(r))return c.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}function Wo(e,t,n,i,a,l,c,s,u,f){var p=t&d,h=1&t,m=2&t,g=24&t,v=512&t,b=m?o:Ho(e);return function o(){for(var d=arguments.length,y=r(d),x=d;x--;)y[x]=arguments[x];if(g)var w=ui(o),k=nn(y,w);if(i&&(y=Mo(y,i,a,g)),l&&(y=To(y,l,c,g)),d-=k,g&&d<f){var _=un(y,w);return Xo(e,t,Wo,o.placeholder,n,y,_,s,u,f-d)}var S=h?n:this,E=m?S[e]:e;return d=y.length,s?y=Ti(y,s):v&&d>1&&y.reverse(),p&&u<d&&(y.length=u),this&&this!==pt&&this instanceof o&&(E=b||Ho(E)),E.apply(S,y)}}function Ko(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,o,i){t(r,n(e),o,i)})),r}(n,e,t(r),{})}}function Vo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=fo(n),r=fo(r)):(n=uo(n),r=uo(r)),i=e(n,r)}return i}}function Go(e){return ii((function(t){return t=Pt(t,$t(di())),Qr((function(n){var r=this;return e(t,(function(e){return Et(e,r,n)}))}))}))}function Zo(e,t){var n=(t=t===o?" ":fo(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,mt(e/pn(t)));return ln(t)?So(hn(r),0,e).join(""):r.slice(0,e)}function Yo(e){return function(t,n,i){return i&&"number"!=typeof i&&ki(t,n,i)&&(n=i=o),t=gl(t),n===o?(n=t,t=0):n=gl(n),function(e,t,n,o){for(var i=-1,a=xn(mt((t-e)/(n||1)),0),l=r(a);a--;)l[o?a:++i]=e,e+=n;return l}(t,n,i=i===o?t<n?1:-1:gl(i),e)}}function qo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=yl(t),n=yl(n)),e(t,n)}}function Xo(e,t,n,r,i,a,l,c,d,f){var p=8&t;t|=p?s:u,4&(t&=~(p?u:s))||(t&=-4);var h=[e,t,i,p?a:o,p?l:o,p?o:a,p?o:l,c,d,f],m=n.apply(o,h);return Si(e)&&Pi(m,h),m.placeholder=r,Ri(m,e,t)}function $o(e){var t=je[e];return function(e,n){if(e=yl(e),(n=null==n?0:wn(vl(n),292))&&Gt(e)){var r=(wl(e)+"e").split("e");return+((r=(wl(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Qo=In&&1/dn(new In([,-0]))[1]==p?function(e){return new In(e)}:dc;function Jo(e){return function(t){var n=vi(t);return n==E?cn(t):n==M?fn(t):function(e,t){return Pt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function ei(e,t,n,a,p,h,m,g){var v=2&t;if(!v&&"function"!=typeof e)throw new Me(i);var b=a?a.length:0;if(b||(t&=-97,a=p=o),m=m===o?m:xn(vl(m),0),g=g===o?g:vl(g),b-=p?p.length:0,t&u){var y=a,x=p;a=p=o}var w=v?o:ci(e),k=[e,t,n,a,p,y,x,h,m,g];if(w&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,a=r==d&&8==n||r==d&&n==f&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!a)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var s=e[3];e[3]=s?Mo(s,c,t[4]):c,e[4]=s?un(e[3],l):t[4]}(c=t[5])&&(s=e[5],e[5]=s?To(s,c,t[6]):c,e[6]=s?un(e[5],l):t[6]);(c=t[7])&&(e[7]=c);r&d&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(k,w),e=k[0],t=k[1],n=k[2],a=k[3],p=k[4],!(g=k[9]=k[9]===o?v?0:e.length:xn(k[9]-b,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==c?function(e,t,n){var i=Ho(e);return function a(){for(var l=arguments.length,c=r(l),s=l,u=ui(a);s--;)c[s]=arguments[s];var d=l<3&&c[0]!==u&&c[l-1]!==u?[]:un(c,u);return(l-=d.length)<n?Xo(e,t,Wo,a.placeholder,o,c,d,o,o,n-l):Et(this&&this!==pt&&this instanceof a?i:e,this,c)}}(e,t,g):t!=s&&33!=t||p.length?Wo.apply(o,k):function(e,t,n,o){var i=1&t,a=Ho(e);return function t(){for(var l=-1,c=arguments.length,s=-1,u=o.length,d=r(u+c),f=this&&this!==pt&&this instanceof t?a:e;++s<u;)d[s]=o[s];for(;c--;)d[s++]=arguments[++l];return Et(f,i?n:this,d)}}(e,t,n,a);else var _=function(e,t,n){var r=1&t,o=Ho(e);return function t(){return(this&&this!==pt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return Ri((w?no:Pi)(_,k),e,t)}function ti(e,t,n,r){return e===o||Wa(e,Pe[n])&&!Re.call(r,n)?t:e}function ni(e,t,n,r,i,a){return rl(e)&&rl(t)&&(a.set(t,e),Kr(e,t,o,ni,a),a.delete(t)),e}function ri(e){return ll(e)?o:e}function oi(e,t,n,r,i,a){var l=1&n,c=e.length,s=t.length;if(c!=s&&!(l&&s>c))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,h=2&n?new Xn:o;for(a.set(e,t),a.set(t,e);++f<c;){var m=e[f],g=t[f];if(r)var v=l?r(g,m,f,t,e,a):r(m,g,f,e,t,a);if(v!==o){if(v)continue;p=!1;break}if(h){if(!zt(t,(function(e,t){if(!Jt(h,t)&&(m===e||i(m,e,n,r,a)))return h.push(t)}))){p=!1;break}}else if(m!==g&&!i(m,g,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function ii(e){return Di(Ii(e,o,Yi),e+"")}function ai(e){return jr(e,Ll,mi)}function li(e){return jr(e,Dl,gi)}var ci=An?function(e){return An.get(e)}:dc;function si(e){for(var t=e.name+"",n=Pn[t],r=Re.call(Pn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ui(e){return(Re.call(Un,"placeholder")?Un:e).placeholder}function di(){var e=Un.iteratee||lc;return e=e===lc?zr:e,arguments.length?e(arguments[0],arguments[1]):e}function fi(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function pi(e){for(var t=Ll(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ci(o)]}return t}function hi(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return Rr(n)?n:o}var mi=bt?function(e){return null==e?[]:(e=Ce(e),Mt(bt(e),(function(t){return qe.call(e,t)})))}:bc,gi=bt?function(e){for(var t=[];e;)Lt(t,mi(e)),e=Ze(e);return t}:bc,vi=Cr;function bi(e,t,n){for(var r=-1,o=(t=ko(t,e)).length,i=!1;++r<o;){var a=Hi(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&nl(o)&&wi(a,o)&&(Za(e)||Ga(e))}function yi(e){return"function"!=typeof e.constructor||ji(e)?{}:Wn(Ze(e))}function xi(e){return Za(e)||Ga(e)||!!($e&&e&&e[$e])}function wi(e,t){var n=typeof e;return!!(t=null==t?h:t)&&("number"==n||"symbol"!=n&&xe.test(e))&&e>-1&&e%1==0&&e<t}function ki(e,t,n){if(!rl(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&wi(t,n.length):"string"==r&&t in n)&&Wa(n[t],e)}function _i(e,t){if(Za(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!dl(e))||(ne.test(e)||!te.test(e)||null!=t&&e in Ce(t))}function Si(e){var t=si(e),n=Un[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var r=ci(n);return!!r&&e===r[0]}(jn&&vi(new jn(new ArrayBuffer(1)))!=D||Cn&&vi(new Cn)!=E||On&&vi(On.resolve())!=O||In&&vi(new In)!=M||Mn&&vi(new Mn)!=P)&&(vi=function(e){var t=Cr(e),n=t==C?e.constructor:o,r=n?Fi(n):"";if(r)switch(r){case Ln:return D;case Dn:return E;case Rn:return O;case zn:return M;case Nn:return P}return t});var Ei=Le?el:yc;function ji(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function Ci(e){return e==e&&!rl(e)}function Oi(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==o||e in Ce(n)))}}function Ii(e,t,n){return t=xn(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=xn(o.length-t,0),l=r(a);++i<a;)l[i]=o[t+i];i=-1;for(var c=r(t+1);++i<t;)c[i]=o[i];return c[t]=n(l),Et(e,this,c)}}function Mi(e,t){return t.length<2?e:Er(e,io(t,0,-1))}function Ti(e,t){for(var n=e.length,r=wn(t.length,n),i=Ao(e);r--;){var a=t[r];e[r]=wi(a,n)?i[a]:o}return e}function Ai(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Pi=zi(no),Li=ht||function(e,t){return pt.setTimeout(e,t)},Di=zi(ro);function Ri(e,t,n){var r=t+"";return Di(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ce,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(v,(function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ue):[]}(r),n)))}function zi(e){var t=0,n=0;return function(){var r=kn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Ni(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=Xr(n,i),l=e[a];e[a]=e[n],e[n]=l}return e.length=t,e}var Bi=function(e){var t=za(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,o){t.push(r?o.replace(pe,"$1"):n||e)})),t}));function Hi(e){if("string"==typeof e||dl(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fi(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ui(e){if(e instanceof Gn)return e.clone();var t=new Vn(e.__wrapped__,e.__chain__);return t.__actions__=Ao(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Wi=Qr((function(e,t){return Xa(e)?pr(e,yr(t,1,Xa,!0)):[]})),Ki=Qr((function(e,t){var n=Ji(t);return Xa(n)&&(n=o),Xa(e)?pr(e,yr(t,1,Xa,!0),di(n,2)):[]})),Vi=Qr((function(e,t){var n=Ji(t);return Xa(n)&&(n=o),Xa(e)?pr(e,yr(t,1,Xa,!0),o,n):[]}));function Gi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vl(n);return o<0&&(o=xn(r+o,0)),Ht(e,di(t,3),o)}function Zi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=vl(n),i=n<0?xn(r+i,0):wn(i,r-1)),Ht(e,di(t,3),i,!0)}function Yi(e){return(null==e?0:e.length)?yr(e,1):[]}function qi(e){return e&&e.length?e[0]:o}var Xi=Qr((function(e){var t=Pt(e,xo);return t.length&&t[0]===e[0]?Tr(t):[]})),$i=Qr((function(e){var t=Ji(e),n=Pt(e,xo);return t===Ji(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Tr(n,di(t,2)):[]})),Qi=Qr((function(e){var t=Ji(e),n=Pt(e,xo);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Tr(n,o,t):[]}));function Ji(e){var t=null==e?0:e.length;return t?e[t-1]:o}var ea=Qr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Yr(e,t):e}var na=ii((function(e,t){var n=null==e?0:e.length,r=cr(e,t);return qr(e,Pt(t,(function(e){return wi(e,n)?+e:e})).sort(Io)),r}));function ra(e){return null==e?e:En.call(e)}var oa=Qr((function(e){return po(yr(e,1,Xa,!0))})),ia=Qr((function(e){var t=Ji(e);return Xa(t)&&(t=o),po(yr(e,1,Xa,!0),di(t,2))})),aa=Qr((function(e){var t=Ji(e);return t="function"==typeof t?t:o,po(yr(e,1,Xa,!0),o,t)}));function la(e){if(!e||!e.length)return[];var t=0;return e=Mt(e,(function(e){if(Xa(e))return t=xn(e.length,t),!0})),qt(t,(function(t){return Pt(e,Vt(t))}))}function ca(e,t){if(!e||!e.length)return[];var n=la(e);return null==t?n:Pt(n,(function(e){return Et(t,o,e)}))}var sa=Qr((function(e,t){return Xa(e)?pr(e,t):[]})),ua=Qr((function(e){return bo(Mt(e,Xa))})),da=Qr((function(e){var t=Ji(e);return Xa(t)&&(t=o),bo(Mt(e,Xa),di(t,2))})),fa=Qr((function(e){var t=Ji(e);return t="function"==typeof t?t:o,bo(Mt(e,Xa),o,t)})),pa=Qr(la);var ha=Qr((function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,ca(e,n)}));function ma(e){var t=Un(e);return t.__chain__=!0,t}function ga(e,t){return t(e)}var va=ii((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return cr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&wi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ga,args:[i],thisArg:o}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)}));var ba=Lo((function(e,t,n){Re.call(e,n)?++e[n]:lr(e,n,1)}));var ya=Fo(Gi),xa=Fo(Zi);function wa(e,t){return(Za(e)?Ct:hr)(e,di(t,3))}function ka(e,t){return(Za(e)?Ot:mr)(e,di(t,3))}var _a=Lo((function(e,t,n){Re.call(e,n)?e[n].push(t):lr(e,n,[t])}));var Sa=Qr((function(e,t,n){var o=-1,i="function"==typeof t,a=qa(e)?r(e.length):[];return hr(e,(function(e){a[++o]=i?Et(t,e,n):Ar(e,t,n)})),a})),Ea=Lo((function(e,t,n){lr(e,n,t)}));function ja(e,t){return(Za(e)?Pt:Fr)(e,di(t,3))}var Ca=Lo((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Oa=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ki(e,t[0],t[1])?t=[]:n>2&&ki(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,yr(t,1),[])})),Ia=ft||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,ei(e,d,o,o,o,o,t)}function Ta(e,t){var n;if("function"!=typeof t)throw new Me(i);return e=vl(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Aa=Qr((function(e,t,n){var r=1;if(n.length){var o=un(n,ui(Aa));r|=s}return ei(e,r,t,n,o)})),Pa=Qr((function(e,t,n){var r=3;if(n.length){var o=un(n,ui(Pa));r|=s}return ei(t,r,e,n,o)}));function La(e,t,n){var r,a,l,c,s,u,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Me(i);function m(t){var n=r,i=a;return r=a=o,d=t,c=e.apply(i,n)}function g(e){return d=e,s=Li(b,t),f?m(e):c}function v(e){var n=e-u;return u===o||n>=t||n<0||p&&e-d>=l}function b(){var e=Ia();if(v(e))return y(e);s=Li(b,function(e){var n=t-(e-u);return p?wn(n,l-(e-d)):n}(e))}function y(e){return s=o,h&&r?m(e):(r=a=o,c)}function x(){var e=Ia(),n=v(e);if(r=arguments,a=this,u=e,n){if(s===o)return g(u);if(p)return Eo(s),s=Li(b,t),m(u)}return s===o&&(s=Li(b,t)),c}return t=yl(t)||0,rl(n)&&(f=!!n.leading,l=(p="maxWait"in n)?xn(yl(n.maxWait)||0,t):l,h="trailing"in n?!!n.trailing:h),x.cancel=function(){s!==o&&Eo(s),d=0,r=u=a=s=o},x.flush=function(){return s===o?c:y(Ia())},x}var Da=Qr((function(e,t){return fr(e,1,t)})),Ra=Qr((function(e,t,n){return fr(e,yl(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(za.Cache||qn),n}function Na(e){if("function"!=typeof e)throw new Me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=qn;var Ba=_o((function(e,t){var n=(t=1==t.length&&Za(t[0])?Pt(t[0],$t(di())):Pt(yr(t,1),$t(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Et(e,this,r)}))})),Ha=Qr((function(e,t){var n=un(t,ui(Ha));return ei(e,s,o,t,n)})),Fa=Qr((function(e,t){var n=un(t,ui(Fa));return ei(e,u,o,t,n)})),Ua=ii((function(e,t){return ei(e,f,o,o,o,t)}));function Wa(e,t){return e===t||e!=e&&t!=t}var Ka=qo(Or),Va=qo((function(e,t){return e>=t})),Ga=Pr(function(){return arguments}())?Pr:function(e){return ol(e)&&Re.call(e,"callee")&&!qe.call(e,"callee")},Za=r.isArray,Ya=yt?$t(yt):function(e){return ol(e)&&Cr(e)==L};function qa(e){return null!=e&&nl(e.length)&&!el(e)}function Xa(e){return ol(e)&&qa(e)}var $a=Nt||yc,Qa=xt?$t(xt):function(e){return ol(e)&&Cr(e)==w};function Ja(e){if(!ol(e))return!1;var t=Cr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ll(e)}function el(e){if(!rl(e))return!1;var t=Cr(e);return t==_||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function tl(e){return"number"==typeof e&&e==vl(e)}function nl(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function rl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ol(e){return null!=e&&"object"==typeof e}var il=wt?$t(wt):function(e){return ol(e)&&vi(e)==E};function al(e){return"number"==typeof e||ol(e)&&Cr(e)==j}function ll(e){if(!ol(e)||Cr(e)!=C)return!1;var t=Ze(e);if(null===t)return!0;var n=Re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==He}var cl=kt?$t(kt):function(e){return ol(e)&&Cr(e)==I};var sl=_t?$t(_t):function(e){return ol(e)&&vi(e)==M};function ul(e){return"string"==typeof e||!Za(e)&&ol(e)&&Cr(e)==T}function dl(e){return"symbol"==typeof e||ol(e)&&Cr(e)==A}var fl=St?$t(St):function(e){return ol(e)&&nl(e.length)&&!!at[Cr(e)]};var pl=qo(Hr),hl=qo((function(e,t){return e<=t}));function ml(e){if(!e)return[];if(qa(e))return ul(e)?hn(e):Ao(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=vi(e);return(t==E?cn:t==M?dn:Wl)(e)}function gl(e){return e?(e=yl(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vl(e){var t=gl(e),n=t%1;return t==t?n?t-n:t:0}function bl(e){return e?sr(vl(e),0,g):0}function yl(e){if("number"==typeof e)return e;if(dl(e))return m;if(rl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=ve.test(e);return n||ye.test(e)?ut(e.slice(2),n?2:8):ge.test(e)?m:+e}function xl(e){return Po(e,Dl(e))}function wl(e){return null==e?"":fo(e)}var kl=Do((function(e,t){if(ji(t)||qa(t))Po(t,Ll(t),e);else for(var n in t)Re.call(t,n)&&rr(e,n,t[n])})),_l=Do((function(e,t){Po(t,Dl(t),e)})),Sl=Do((function(e,t,n,r){Po(t,Dl(t),e,r)})),El=Do((function(e,t,n,r){Po(t,Ll(t),e,r)})),jl=ii(cr);var Cl=Qr((function(e,t){e=Ce(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&ki(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],l=Dl(a),c=-1,s=l.length;++c<s;){var u=l[c],d=e[u];(d===o||Wa(d,Pe[u])&&!Re.call(e,u))&&(e[u]=a[u])}return e})),Ol=Qr((function(e){return e.push(o,ni),Et(zl,o,e)}));function Il(e,t,n){var r=null==e?o:Er(e,t);return r===o?n:r}function Ml(e,t){return null!=e&&bi(e,t,Mr)}var Tl=Ko((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),e[t]=n}),rc(ac)),Al=Ko((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),Re.call(e,t)?e[t].push(n):e[t]=[n]}),di),Pl=Qr(Ar);function Ll(e){return qa(e)?Qn(e):Nr(e)}function Dl(e){return qa(e)?Qn(e,!0):Br(e)}var Rl=Do((function(e,t,n){Kr(e,t,n)})),zl=Do((function(e,t,n,r){Kr(e,t,n,r)})),Nl=ii((function(e,t){var n={};if(null==e)return n;var r=!1;t=Pt(t,(function(t){return t=ko(t,e),r||(r=t.length>1),t})),Po(e,li(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)ho(n,t[o]);return n}));var Bl=ii((function(e,t){return null==e?{}:function(e,t){return Zr(e,t,(function(t,n){return Ml(e,n)}))}(e,t)}));function Hl(e,t){if(null==e)return{};var n=Pt(li(e),(function(e){return[e]}));return t=di(t),Zr(e,n,(function(e,n){return t(e,n[0])}))}var Fl=Jo(Ll),Ul=Jo(Dl);function Wl(e){return null==e?[]:Qt(e,Ll(e))}var Kl=Bo((function(e,t,n){return t=t.toLowerCase(),e+(n?Vl(t):t)}));function Vl(e){return Jl(wl(e).toLowerCase())}function Gl(e){return(e=wl(e))&&e.replace(we,rn).replace(Je,"")}var Zl=Bo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Yl=Bo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),ql=No("toLowerCase");var Xl=Bo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $l=Bo((function(e,t,n){return e+(n?" ":"")+Jl(t)}));var Ql=Bo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Jl=No("toUpperCase");function ec(e,t,n){return e=wl(e),(t=n?o:t)===o?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var tc=Qr((function(e,t){try{return Et(e,o,t)}catch(e){return Ja(e)?e:new Se(e)}})),nc=ii((function(e,t){return Ct(t,(function(t){t=Hi(t),lr(e,t,Aa(e[t],e))})),e}));function rc(e){return function(){return e}}var oc=Uo(),ic=Uo(!0);function ac(e){return e}function lc(e){return zr("function"==typeof e?e:ur(e,1))}var cc=Qr((function(e,t){return function(n){return Ar(n,e,t)}})),sc=Qr((function(e,t){return function(n){return Ar(e,n,t)}}));function uc(e,t,n){var r=Ll(t),o=Sr(t,r);null!=n||rl(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Sr(t,Ll(t)));var i=!(rl(n)&&"chain"in n&&!n.chain),a=el(e);return Ct(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Ao(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Lt([this.value()],arguments))})})),e}function dc(){}var fc=Go(Pt),pc=Go(It),hc=Go(zt);function mc(e){return _i(e)?Vt(Hi(e)):function(e){return function(t){return Er(t,e)}}(e)}var gc=Yo(),vc=Yo(!0);function bc(){return[]}function yc(){return!1}var xc=Vo((function(e,t){return e+t}),0),wc=$o("ceil"),kc=Vo((function(e,t){return e/t}),1),_c=$o("floor");var Sc,Ec=Vo((function(e,t){return e*t}),1),jc=$o("round"),Cc=Vo((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Me(i);return e=vl(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Ma,Un.assign=kl,Un.assignIn=_l,Un.assignInWith=Sl,Un.assignWith=El,Un.at=jl,Un.before=Ta,Un.bind=Aa,Un.bindAll=nc,Un.bindKey=Pa,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Za(e)?e:[e]},Un.chain=ma,Un.chunk=function(e,t,n){t=(n?ki(e,t,n):t===o)?1:xn(vl(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,l=0,c=r(mt(i/t));a<i;)c[l++]=io(e,a,a+=t);return c},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Lt(Za(n)?Ao(n):[n],yr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=di();return e=t?Pt(e,(function(e){if("function"!=typeof e[1])throw new Me(i);return[n(e[0]),e[1]]})):[],Qr((function(n){for(var r=-1;++r<t;){var o=e[r];if(Et(o[0],this,n))return Et(o[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=Ll(e);return function(n){return dr(n,e,t)}}(ur(e,1))},Un.constant=rc,Un.countBy=ba,Un.create=function(e,t){var n=Wn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var i=ei(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Un.curryRight=function e(t,n,r){var i=ei(t,c,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Un.debounce=La,Un.defaults=Cl,Un.defaultsDeep=Ol,Un.defer=Da,Un.delay=Ra,Un.difference=Wi,Un.differenceBy=Ki,Un.differenceWith=Vi,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?io(e,(t=n||t===o?1:vl(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?io(e,0,(t=r-(t=n||t===o?1:vl(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?go(e,di(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?go(e,di(t,3),!0):[]},Un.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ki(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=vl(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:vl(r))<0&&(r+=i),r=n>r?0:bl(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(Za(e)?Mt:br)(e,di(t,3))},Un.flatMap=function(e,t){return yr(ja(e,t),1)},Un.flatMapDeep=function(e,t){return yr(ja(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===o?1:vl(n),yr(ja(e,t),n)},Un.flatten=Yi,Un.flattenDeep=function(e){return(null==e?0:e.length)?yr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?yr(e,t=t===o?1:vl(t)):[]},Un.flip=function(e){return ei(e,512)},Un.flow=oc,Un.flowRight=ic,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Un.functions=function(e){return null==e?[]:Sr(e,Ll(e))},Un.functionsIn=function(e){return null==e?[]:Sr(e,Dl(e))},Un.groupBy=_a,Un.initial=function(e){return(null==e?0:e.length)?io(e,0,-1):[]},Un.intersection=Xi,Un.intersectionBy=$i,Un.intersectionWith=Qi,Un.invert=Tl,Un.invertBy=Al,Un.invokeMap=Sa,Un.iteratee=lc,Un.keyBy=Ea,Un.keys=Ll,Un.keysIn=Dl,Un.map=ja,Un.mapKeys=function(e,t){var n={};return t=di(t,3),kr(e,(function(e,r,o){lr(n,t(e,r,o),e)})),n},Un.mapValues=function(e,t){var n={};return t=di(t,3),kr(e,(function(e,r,o){lr(n,r,t(e,r,o))})),n},Un.matches=function(e){return Ur(ur(e,1))},Un.matchesProperty=function(e,t){return Wr(e,ur(t,1))},Un.memoize=za,Un.merge=Rl,Un.mergeWith=zl,Un.method=cc,Un.methodOf=sc,Un.mixin=uc,Un.negate=Na,Un.nthArg=function(e){return e=vl(e),Qr((function(t){return Vr(t,e)}))},Un.omit=Nl,Un.omitBy=function(e,t){return Hl(e,Na(di(t)))},Un.once=function(e){return Ta(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(Za(t)||(t=null==t?[]:[t]),Za(n=r?o:n)||(n=null==n?[]:[n]),Gr(e,t,n))},Un.over=fc,Un.overArgs=Ba,Un.overEvery=pc,Un.overSome=hc,Un.partial=Ha,Un.partialRight=Fa,Un.partition=Ca,Un.pick=Bl,Un.pickBy=Hl,Un.property=mc,Un.propertyOf=function(e){return function(t){return null==e?o:Er(e,t)}},Un.pull=ea,Un.pullAll=ta,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,di(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,o,n):e},Un.pullAt=na,Un.range=gc,Un.rangeRight=vc,Un.rearg=Ua,Un.reject=function(e,t){return(Za(e)?Mt:br)(e,Na(di(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=di(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return qr(e,o),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Me(i);return Qr(e,t=t===o?t:vl(t))},Un.reverse=ra,Un.sampleSize=function(e,t,n){return t=(n?ki(e,t,n):t===o)?1:vl(t),(Za(e)?er:eo)(e,t)},Un.set=function(e,t,n){return null==e?e:to(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:to(e,t,n,r)},Un.shuffle=function(e){return(Za(e)?tr:oo)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ki(e,t,n)?(t=0,n=r):(t=null==t?0:vl(t),n=n===o?r:vl(n)),io(e,t,n)):[]},Un.sortBy=Oa,Un.sortedUniq=function(e){return e&&e.length?so(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?so(e,di(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ki(e,t,n)&&(t=n=o),(n=n===o?g:n>>>0)?(e=wl(e))&&("string"==typeof t||null!=t&&!cl(t))&&!(t=fo(t))&&ln(e)?So(hn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Me(i);return t=null==t?0:xn(vl(t),0),Qr((function(n){var r=n[t],o=So(n,0,t);return r&&Lt(o,r),Et(e,this,o)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?io(e,0,(t=n||t===o?1:vl(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?io(e,(t=r-(t=n||t===o?1:vl(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?go(e,di(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?go(e,di(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Me(i);return rl(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),La(e,t,{leading:r,maxWait:t,trailing:o})},Un.thru=ga,Un.toArray=ml,Un.toPairs=Fl,Un.toPairsIn=Ul,Un.toPath=function(e){return Za(e)?Pt(e,Hi):dl(e)?[e]:Ao(Bi(wl(e)))},Un.toPlainObject=xl,Un.transform=function(e,t,n){var r=Za(e),o=r||$a(e)||fl(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rl(e)&&el(i)?Wn(Ze(e)):{}}return(o?Ct:kr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Un.unary=function(e){return Ma(e,1)},Un.union=oa,Un.unionBy=ia,Un.unionWith=aa,Un.uniq=function(e){return e&&e.length?po(e):[]},Un.uniqBy=function(e,t){return e&&e.length?po(e,di(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?po(e,o,t):[]},Un.unset=function(e,t){return null==e||ho(e,t)},Un.unzip=la,Un.unzipWith=ca,Un.update=function(e,t,n){return null==e?e:mo(e,t,wo(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:mo(e,t,wo(n),r)},Un.values=Wl,Un.valuesIn=function(e){return null==e?[]:Qt(e,Dl(e))},Un.without=sa,Un.words=ec,Un.wrap=function(e,t){return Ha(wo(t),e)},Un.xor=ua,Un.xorBy=da,Un.xorWith=fa,Un.zip=pa,Un.zipObject=function(e,t){return yo(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return yo(e||[],t||[],to)},Un.zipWith=ha,Un.entries=Fl,Un.entriesIn=Ul,Un.extend=_l,Un.extendWith=Sl,uc(Un,Un),Un.add=xc,Un.attempt=tc,Un.camelCase=Kl,Un.capitalize=Vl,Un.ceil=wc,Un.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=yl(n))==n?n:0),t!==o&&(t=(t=yl(t))==t?t:0),sr(yl(e),t,n)},Un.clone=function(e){return ur(e,4)},Un.cloneDeep=function(e){return ur(e,5)},Un.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:o)},Un.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:o)},Un.conformsTo=function(e,t){return null==t||dr(e,t,Ll(t))},Un.deburr=Gl,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=kc,Un.endsWith=function(e,t,n){e=wl(e),t=fo(t);var r=e.length,i=n=n===o?r:sr(vl(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Un.eq=Wa,Un.escape=function(e){return(e=wl(e))&&$.test(e)?e.replace(q,on):e},Un.escapeRegExp=function(e){return(e=wl(e))&&ie.test(e)?e.replace(oe,"\\$&"):e},Un.every=function(e,t,n){var r=Za(e)?It:gr;return n&&ki(e,t,n)&&(t=o),r(e,di(t,3))},Un.find=ya,Un.findIndex=Gi,Un.findKey=function(e,t){return Bt(e,di(t,3),kr)},Un.findLast=xa,Un.findLastIndex=Zi,Un.findLastKey=function(e,t){return Bt(e,di(t,3),_r)},Un.floor=_c,Un.forEach=wa,Un.forEachRight=ka,Un.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Dl)},Un.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Dl)},Un.forOwn=function(e,t){return e&&kr(e,di(t,3))},Un.forOwnRight=function(e,t){return e&&_r(e,di(t,3))},Un.get=Il,Un.gt=Ka,Un.gte=Va,Un.has=function(e,t){return null!=e&&bi(e,t,Ir)},Un.hasIn=Ml,Un.head=qi,Un.identity=ac,Un.includes=function(e,t,n,r){e=qa(e)?e:Wl(e),n=n&&!r?vl(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),ul(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Ft(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vl(n);return o<0&&(o=xn(r+o,0)),Ft(e,t,o)},Un.inRange=function(e,t,n){return t=gl(t),n===o?(n=t,t=0):n=gl(n),function(e,t,n){return e>=wn(t,n)&&e<xn(t,n)}(e=yl(e),t,n)},Un.invoke=Pl,Un.isArguments=Ga,Un.isArray=Za,Un.isArrayBuffer=Ya,Un.isArrayLike=qa,Un.isArrayLikeObject=Xa,Un.isBoolean=function(e){return!0===e||!1===e||ol(e)&&Cr(e)==x},Un.isBuffer=$a,Un.isDate=Qa,Un.isElement=function(e){return ol(e)&&1===e.nodeType&&!ll(e)},Un.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Za(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||fl(e)||Ga(e)))return!e.length;var t=vi(e);if(t==E||t==M)return!e.size;if(ji(e))return!Nr(e).length;for(var n in e)if(Re.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Lr(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?Lr(e,t,o,n):!!r},Un.isError=Ja,Un.isFinite=function(e){return"number"==typeof e&&Gt(e)},Un.isFunction=el,Un.isInteger=tl,Un.isLength=nl,Un.isMap=il,Un.isMatch=function(e,t){return e===t||Dr(e,t,pi(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,Dr(e,t,pi(t),n)},Un.isNaN=function(e){return al(e)&&e!=+e},Un.isNative=function(e){if(Ei(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=al,Un.isObject=rl,Un.isObjectLike=ol,Un.isPlainObject=ll,Un.isRegExp=cl,Un.isSafeInteger=function(e){return tl(e)&&e>=-9007199254740991&&e<=h},Un.isSet=sl,Un.isString=ul,Un.isSymbol=dl,Un.isTypedArray=fl,Un.isUndefined=function(e){return e===o},Un.isWeakMap=function(e){return ol(e)&&vi(e)==P},Un.isWeakSet=function(e){return ol(e)&&"[object WeakSet]"==Cr(e)},Un.join=function(e,t){return null==e?"":bn.call(e,t)},Un.kebabCase=Zl,Un.last=Ji,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=vl(n))<0?xn(r+i,0):wn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,Wt,i,!0)},Un.lowerCase=Yl,Un.lowerFirst=ql,Un.lt=pl,Un.lte=hl,Un.max=function(e){return e&&e.length?vr(e,ac,Or):o},Un.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Or):o},Un.mean=function(e){return Kt(e,ac)},Un.meanBy=function(e,t){return Kt(e,di(t,2))},Un.min=function(e){return e&&e.length?vr(e,ac,Hr):o},Un.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),Hr):o},Un.stubArray=bc,Un.stubFalse=yc,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=Ec,Un.nth=function(e,t){return e&&e.length?Vr(e,vl(t)):o},Un.noConflict=function(){return pt._===this&&(pt._=Fe),this},Un.noop=dc,Un.now=Ia,Un.pad=function(e,t,n){e=wl(e);var r=(t=vl(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Zo(vt(o),n)+e+Zo(mt(o),n)},Un.padEnd=function(e,t,n){e=wl(e);var r=(t=vl(t))?pn(e):0;return t&&r<t?e+Zo(t-r,n):e},Un.padStart=function(e,t,n){e=wl(e);var r=(t=vl(t))?pn(e):0;return t&&r<t?Zo(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(wl(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ki(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=gl(e),t===o?(t=e,e=0):t=gl(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=Sn();return wn(e+i*(t-e+st("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Un.reduce=function(e,t,n){var r=Za(e)?Dt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,hr)},Un.reduceRight=function(e,t,n){var r=Za(e)?Rt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,mr)},Un.repeat=function(e,t,n){return t=(n?ki(e,t,n):t===o)?1:vl(t),$r(wl(e),t)},Un.replace=function(){var e=arguments,t=wl(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,i=(t=ko(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[Hi(t[r])];a===o&&(r=i,a=n),e=el(a)?a.call(e):a}return e},Un.round=jc,Un.runInContext=e,Un.sample=function(e){return(Za(e)?Jn:Jr)(e)},Un.size=function(e){if(null==e)return 0;if(qa(e))return ul(e)?pn(e):e.length;var t=vi(e);return t==E||t==M?e.size:Nr(e).length},Un.snakeCase=Xl,Un.some=function(e,t,n){var r=Za(e)?zt:ao;return n&&ki(e,t,n)&&(t=o),r(e,di(t,3))},Un.sortedIndex=function(e,t){return lo(e,t)},Un.sortedIndexBy=function(e,t,n){return co(e,t,di(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=lo(e,t);if(r<n&&Wa(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return lo(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return co(e,t,di(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=lo(e,t,!0)-1;if(Wa(e[n],t))return n}return-1},Un.startCase=$l,Un.startsWith=function(e,t,n){return e=wl(e),n=null==n?0:sr(vl(n),0,e.length),t=fo(t),e.slice(n,n+t.length)==t},Un.subtract=Cc,Un.sum=function(e){return e&&e.length?Yt(e,ac):0},Un.sumBy=function(e,t){return e&&e.length?Yt(e,di(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ki(e,t,n)&&(t=o),e=wl(e),t=Sl({},t,r,ti);var i,a,l=Sl({},t.imports,r.imports,ti),c=Ll(l),s=Qt(l,c),u=0,d=t.interpolate||ke,f="__p += '",p=Oe((t.escape||ke).source+"|"+d.source+"|"+(d===ee?he:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),h="//# sourceURL="+(Re.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++it+"]")+"\n";e.replace(p,(function(t,n,r,o,l,c){return r||(r=o),f+=e.slice(u,c).replace(_e,an),n&&(i=!0,f+="' +\n__e("+n+") +\n'"),l&&(a=!0,f+="';\n"+l+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),f+="';\n";var m=Re.call(t,"variable")&&t.variable;if(m){if(fe.test(m))throw new Se("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(V,""):f).replace(G,"$1").replace(Z,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=tc((function(){return Ee(c,h+"return "+f).apply(o,s)}));if(g.source=f,Ja(g))throw g;return g},Un.times=function(e,t){if((e=vl(e))<1||e>h)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=qt(r,t);++n<e;)t(n);return o},Un.toFinite=gl,Un.toInteger=vl,Un.toLength=bl,Un.toLower=function(e){return wl(e).toLowerCase()},Un.toNumber=yl,Un.toSafeInteger=function(e){return e?sr(vl(e),-9007199254740991,h):0===e?e:0},Un.toString=wl,Un.toUpper=function(e){return wl(e).toUpperCase()},Un.trim=function(e,t,n){if((e=wl(e))&&(n||t===o))return Xt(e);if(!e||!(t=fo(t)))return e;var r=hn(e),i=hn(t);return So(r,en(r,i),tn(r,i)+1).join("")},Un.trimEnd=function(e,t,n){if((e=wl(e))&&(n||t===o))return e.slice(0,mn(e)+1);if(!e||!(t=fo(t)))return e;var r=hn(e);return So(r,0,tn(r,hn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=wl(e))&&(n||t===o))return e.replace(ae,"");if(!e||!(t=fo(t)))return e;var r=hn(e);return So(r,en(r,hn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(rl(t)){var i="separator"in t?t.separator:i;n="length"in t?vl(t.length):n,r="omission"in t?fo(t.omission):r}var a=(e=wl(e)).length;if(ln(e)){var l=hn(e);a=l.length}if(n>=a)return e;var c=n-pn(r);if(c<1)return r;var s=l?So(l,0,c).join(""):e.slice(0,c);if(i===o)return s+r;if(l&&(c+=s.length-c),cl(i)){if(e.slice(c).search(i)){var u,d=s;for(i.global||(i=Oe(i.source,wl(me.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var f=u.index;s=s.slice(0,f===o?c:f)}}else if(e.indexOf(fo(i),c)!=c){var p=s.lastIndexOf(i);p>-1&&(s=s.slice(0,p))}return s+r},Un.unescape=function(e){return(e=wl(e))&&X.test(e)?e.replace(Y,gn):e},Un.uniqueId=function(e){var t=++ze;return wl(e)+t},Un.upperCase=Ql,Un.upperFirst=Jl,Un.each=wa,Un.eachRight=ka,Un.first=qi,uc(Un,(Sc={},kr(Un,(function(e,t){Re.call(Un.prototype,t)||(Sc[t]=e)})),Sc),{chain:!1}),Un.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),Ct(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===o?1:xn(vl(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,g),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(ac)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Ar(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Na(di(e)))},Gn.prototype.slice=function(e,t){e=vl(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=vl(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(g)},kr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(Un.prototype[t]=function(){var t=this.__wrapped__,l=r?[1]:arguments,c=t instanceof Gn,s=l[0],u=c||Za(t),d=function(e){var t=i.apply(Un,Lt([e],l));return r&&f?t[0]:t};u&&n&&"function"==typeof s&&1!=s.length&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,h=a&&!f,m=c&&!p;if(!a&&u){t=m?t:new Gn(this);var g=e.apply(t,l);return g.__actions__.push({func:ga,args:[d],thisArg:o}),new Vn(g,f)}return h&&m?e.apply(this,l):(g=this.thru(d),h?r?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Za(o)?o:[],e)}return this[n]((function(n){return t.apply(Za(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";Re.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}})),Pn[Wo(o,2).name]=[{name:"wrapper",func:o}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Ao(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ao(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ao(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Za(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=xn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,l=i.end,c=l-a,s=r?l:a-1,u=this.__iteratees__,d=u.length,f=0,p=wn(c,this.__takeCount__);if(!n||!r&&o==c&&p==c)return vo(e,this.__actions__);var h=[];e:for(;c--&&f<p;){for(var m=-1,g=e[s+=t];++m<d;){var v=u[m],b=v.iteratee,y=v.type,x=b(g);if(2==y)g=x;else if(!x){if(1==y)continue e;break e}}h[f++]=g}return h},Un.prototype.at=va,Un.prototype.chain=function(){return ma(this)},Un.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===o&&(this.__values__=ml(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Kn;){var r=Ui(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:ga,args:[ra],thisArg:o}),new Vn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,et&&(Un.prototype[et]=function(){return this}),Un}();pt._=vn,(r=function(){return vn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)},4516:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,l,c=o(e),s=1;s<arguments.length;s++){for(var u in a=Object(arguments[s]))n.call(a,u)&&(c[u]=a[u]);if(t){l=t(a);for(var d=0;d<l.length;d++)r.call(a,l[d])&&(c[l[d]]=a[l[d]])}}return c}},6094:function(e,t,n){"use strict";n(4516);var r=n(9787),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,i={},s=null,u=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:s,ref:u,props:i,_owner:a.current}}t.jsx=s,t.jsxs=s},4512:function(e,t,n){"use strict";e.exports=n(6094)},1602:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r=d;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return M()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=E(a,n);if(l){if(l===m)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:f,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",m={};function g(){}function v(){}function b(){}var y={};y[i]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(I([])));w&&w!==n&&r.call(w,i)&&(y=w);var k=b.prototype=g.prototype=Object.create(y);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,a,l){var c=u(e[o],e,i);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(d).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function E(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=u(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:M}}function M(){return{value:t,done:!0}}return v.prototype=k.constructor=b,b.constructor=v,v.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},_(S.prototype),S.prototype[a]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(k),c(k,l,"Generator"),k[i]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},8336:function(e,t,n){var r=n(487),o=n(4295);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},554:function(e,t,n){var r=n(487),o=n(9135);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},2789:function(e,t,n){var r=n(487),o=n(3729);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},5080:function(e,t,n){var r=n(487),o=n(4241);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},7225:function(e,t,n){var r=n(487),o=n(6029);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},778:function(e,t,n){var r=n(487),o=n(9609);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4220:function(e,t,n){var r=n(487),o=n(2345);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4678:function(e,t,n){var r=n(487),o=n(9393);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1292:function(e,t,n){var r=n(487),o=n(6578);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},196:function(e,t,n){var r=n(487),o=n(9482);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},2205:function(e,t,n){var r=n(487),o=n(7955);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1310:function(e,t,n){var r=n(487),o=n(3195);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},3922:function(e,t,n){var r=n(487),o=n(2978);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},7096:function(e,t,n){var r=n(487),o=n(1587);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},7117:function(e,t,n){var r=n(487),o=n(9478);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1106:function(e,t,n){var r=n(487),o=n(7369);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},3336:function(e,t,n){var r=n(487),o=n(1434);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4406:function(e,t,n){var r=n(487),o=n(8923);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},6043:function(e,t,n){var r=n(487),o=n(5605);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},694:function(e,t,n){var r=n(487),o=n(5644);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},8328:function(e,t,n){var r=n(487),o=n(6843);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},8051:function(e,t,n){var r=n(487),o=n(8461);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4301:function(e,t,n){var r=n(487),o=n(9935);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9966:function(e,t,n){var r=n(487),o=n(532);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9295:function(e,t,n){var r=n(487),o=n(7589);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9781:function(e,t,n){var r=n(487),o=n(8465);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},371:function(e,t,n){var r=n(487),o=n(5892);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4623:function(e,t,n){var r=n(487),o=n(3874);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1528:function(e,t,n){var r=n(487),o=n(2681);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},518:function(e,t,n){var r=n(487),o=n(6759);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9757:function(e,t,n){var r=n(487),o=n(9650);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},5422:function(e,t,n){var r=n(487),o=n(2044);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},276:function(e,t,n){var r=n(487),o=n(9144);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},6781:function(e,t,n){var r=n(487),o=n(6626);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},580:function(e,t,n){var r=n(487),o=n(6359);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4285:function(e,t,n){var r=n(487),o=n(9915);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},3313:function(e,t,n){var r=n(487),o=n(9310);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},8635:function(e,t,n){var r=n(487),o=n(6464);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},487:function(e,t,n){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function l(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var i=e[o],c=t.base?i[0]+t.base:i[0],s=n[c]||0,u="".concat(c," ").concat(s);n[c]=s+1;var d=l(u),f={css:i[1],media:i[2],sourceMap:i[3]};-1!==d?(a[d].references++,a[d].updater(f)):a.push({identifier:u,updater:g(f,t),references:1}),r.push(u)}return r}function s(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function f(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function p(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,m=0;function g(e,t){var n,r,o;if(t.singleton){var i=m++;n=h||(h=s(t)),r=f.bind(null,n,i,!1),o=f.bind(null,n,i,!0)}else n=s(t),r=p.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=l(n[r]);a[o].references--}for(var i=c(e,t),s=0;s<n.length;s++){var u=l(n[s]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=i}}}},788:function(e,t,n){var r={"./ar-SA.json":[7822,558],"./bg-BG.json":[1203,384],"./bn-BD.json":[8525,603],"./ca-ES.json":[510,351],"./cs-CZ.json":[7605,387],"./da-DK.json":[2392,617],"./de-DE.json":[2853,43],"./el-GR.json":[9876,526],"./en.json":[1463],"./es-ES.json":[2264,317],"./eu-ES.json":[5658,431],"./fa-IR.json":[3747,710],"./fi-FI.json":[9490,472],"./fr-FR.json":[7830,364],"./he-IL.json":[1994,262],"./hi-IN.json":[4646,933],"./hu-HU.json":[6373,661],"./id-ID.json":[3247,491],"./it-IT.json":[3257,465],"./ja-JP.json":[198,137],"./kab-KAB.json":[228,164],"./kk-KZ.json":[8972,649],"./ko-KR.json":[7596,60],"./lt-LT.json":[3755,58],"./lv-LV.json":[2327,899],"./my-MM.json":[7704,242],"./nb-NO.json":[1167,246],"./nl-NL.json":[290,196],"./nn-NO.json":[4481,920],"./oc-FR.json":[2284,565],"./pa-IN.json":[6773,280],"./percentages.json":[4451],"./pl-PL.json":[3661,852],"./pt-BR.json":[8881,381],"./pt-PT.json":[5622,149],"./ro-RO.json":[2013,752],"./ru-RU.json":[2253,869],"./si-LK.json":[5497,90],"./sk-SK.json":[4570,401],"./sv-SE.json":[6006,698],"./ta-IN.json":[3952,395],"./tr-TR.json":[7315,213],"./uk-UA.json":[334,583],"./zh-CN.json":[1037,304],"./zh-HK.json":[5334,9],"./zh-TW.json":[931,62]};function o(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],o=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n.t(o,19)}))}o.keys=function(){return Object.keys(r)},o.id=788,e.exports=o},9713:function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},6479:function(e,t,n){var r=n(7316);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},7316:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},4295:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),c=n.n(l),s=new URL(n(3940),n.b),u=new URL(n(3147),n.b),d=a()(o()),f=c()(s),p=c()(u);d.push([e.id,'@font-face{font-family:"Virgil";src:url('+f+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+p+");font-display:swap}",""]),t.default=d},9135:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;-webkit-margin-end:.3em;margin-inline-end:.3em;-webkit-transform:scaleY(0.9);transform:scaleY(0.9)}",""]),t.default=a},3729:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500}",""]),t.default=a},4241:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]),t.default=a},6029:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]),t.default=a},9609:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]),t.default=a},2345:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),c=n.n(l),s=new URL(n(9669),n.b),u=a()(o()),d=c()(s);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+d+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;-webkit-padding-start:.5em;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]),t.default=u},9393:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]),t.default=a},6578:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;-webkit-margin-end:20px;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{-webkit-margin-end:0;margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]),t.default=a},9482:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]),t.default=a},7955:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),c=n.n(l),s=new URL(n(9669),n.b),u=a()(o()),d=c()(s);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+d+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{-webkit-filter:none;filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]),t.default=u},3195:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]),t.default=a},2978:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]),t.default=a},1587:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]),t.default=a},9478:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus-visible,.excalidraw .picker button:focus-visible{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus-visible svg,.excalidraw .picker button:focus-visible svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]),t.default=a},7369:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:var(--border-radius-lg);padding:calc(var(--padding)*var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]),t.default=a},1434:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(-76px, 0);transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(76px, 0);transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{-webkit-transform:translate(0, 92px);transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;-webkit-margin-end:1em;margin-inline-end:1em}",""]),t.default=a},8923:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-padding-end:18px;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .publish-library-success .Dialog__content{display:flex;flex-direction:column}.excalidraw .publish-library-success-close.ToolIcon_type_button{background-color:#228be6;align-self:flex-end}.excalidraw .publish-library-success-close.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library-success-close.ToolIcon_type_button .ToolIcon__icon{width:auto;font-size:1rem;color:#fff;padding:0 .5rem}",""]),t.default=a},5605:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]),t.default=a},5644:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{-webkit-filter:var(--theme-filter);filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__checkbox-container,.excalidraw .library-unit__checkbox-container:hover,.excalidraw .library-unit__checkbox-container:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:.5rem;position:absolute;left:2rem;bottom:2rem;cursor:pointer}.excalidraw .library-unit__checkbox-container input,.excalidraw .library-unit__checkbox-container:hover input,.excalidraw .library-unit__checkbox-container:active input{cursor:pointer}.excalidraw .library-unit__checkbox{position:absolute;left:2.3rem;bottom:2.3rem}.excalidraw .library-unit__checkbox .Checkbox-box{width:13px;height:13px;border-radius:2px;margin:.5em .5em .2em .2em;background-color:#d0ebff}.excalidraw .library-unit__checkbox.Checkbox:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__adder{-webkit-transform:scale(1);transform:scale(1);-webkit-animation:library-unit__adder-animation 1s ease-in infinite;animation:library-unit__adder-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:40%;top:40%;width:2rem;height:2rem;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit:hover .library-unit__adder{fill:#1c7ed6}.excalidraw .library-unit:active .library-unit__adder{-webkit-animation:none;animation:none;-webkit-transform:scale(0.8);transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@-webkit-keyframes library-unit__adder-animation{0%{-webkit-transform:scale(0.85);transform:scale(0.85)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.85);transform:scale(0.85)}}@keyframes library-unit__adder-animation{0%{-webkit-transform:scale(0.85);transform:scale(0.85)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.85);transform:scale(0.85)}}",""]),t.default=a},6843:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-animation:Modal__content_fade-in .1s ease-out .05s forwards;animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@-webkit-keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]),t.default=a},8461:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]),t.default=a},9935:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]),t.default=a},532:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]),t.default=a},7589:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]),t.default=a},8465:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]),t.default=a},5892:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{-webkit-animation:rotate 1.6s linear infinite;animation:rotate 1.6s linear infinite;-webkit-transform-origin:center center;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);-webkit-animation:dash 1.6s linear 0s infinite;animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]),t.default=a},3874:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]),t.default=a},2681:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]),t.default=a},6759:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]),t.default=a},9650:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{-webkit-animation:fade-in .5s;animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@-webkit-keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]),t.default=a},2044:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon{background-color:var(--button-gray-1)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:hover,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--border-radius-lg)}.excalidraw .ToolIcon__icon+.ToolIcon__label{-webkit-margin-start:0;margin-inline-start:0}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__label{display:flex;align-items:center;color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon__label .Spinner{margin-left:.6em}.excalidraw .ToolIcon_size_small .ToolIcon__icon{width:2rem;height:2rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:focus-visible,.excalidraw .Modal .ToolIcon_type_button:focus-visible,.excalidraw .ToolIcon_type_button:focus-visible{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_radio:focus-visible+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus-visible+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{background-color:var(--button-gray-1);width:2rem;height:2em}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:-8px;margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{-webkit-margin-end:0;margin-inline-end:0;top:60px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]),t.default=a},9144:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar-container .ToolIcon_type_floating:not(.is-mobile) .ToolIcon__icon{padding:1px;background-color:var(--island-bg-color);box-shadow:1px 3px 4px 0px rgba(0,0,0,.15);border-radius:50%;transition:box-shadow .5s ease,-webkit-transform .5s ease;transition:box-shadow .5s ease,transform .5s ease;transition:box-shadow .5s ease,transform .5s ease,-webkit-transform .5s ease}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:focus-within+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:focus-within+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock{-webkit-margin-end:var(--space-factor);margin-inline-end:var(--space-factor)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .App-toolbar-container .ToolIcon__library{-webkit-margin-start:var(--space-factor);margin-inline-start:var(--space-factor)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon__icon{box-shadow:none;-webkit-transform:scale(0.9);transform:scale(0.9)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon_type_checkbox:not(:checked):not(:hover):not(:active)+.ToolIcon__icon svg{fill:#adb5bd;color:#adb5bd}.excalidraw .App-toolbar{border-radius:var(--border-radius-lg);box-shadow:0 0 0 1px rgba(0,0,0,.01),1px 1px 5px rgba(0,0,0,.15)}.excalidraw .App-toolbar .ToolIcon:hover{--icon-fill-color: var(--color-primary-chubb);--keybinding-color: var(--color-primary-chubb)}.excalidraw .App-toolbar .ToolIcon:active{--icon-fill-color: #212529;--keybinding-color: #212529}.excalidraw .App-toolbar .ToolIcon .ToolIcon__icon{background:transparent;border-radius:var(--border-radius-lg)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar .ToolIcon .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar.zen-mode .ToolIcon__keybinding,.excalidraw .App-toolbar.zen-mode .HintViewer{display:none}.excalidraw.theme--dark .App-toolbar .ToolIcon:active{--icon-fill-color: #dee2e6;--keybinding-color: #dee2e6}",""]),t.default=a},6626:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]),t.default=a},6359:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor) var(--space-factor) var(--space-factor) var(--space-factor);display:flex;flex-wrap:wrap;justify-content:flex-end}.excalidraw .UserList:empty{display:none}.excalidraw .UserList>*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]),t.default=a},9915:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]),t.default=a},9310:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),c=n.n(l),s=new URL(n(7984),n.b),u=new URL(n(1639),n.b),d=a()(o()),f=c()(s),p=c()(u);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url("+f+");--focus-highlight-color: #a5d8ff;--icon-fill-color: #212529;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 12%);--space-factor: 0.25rem;--text-primary-color: #343a40;--color-primary: #6965db;--color-primary-chubb: #625ee0;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;--color-primary-light: #e2e1fc;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem}.excalidraw.theme--dark{background:#000}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url("+p+');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #4dabf7;--shadow-island: 1px 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da;--color-primary: #5650f0;--color-primary-chubb: #726dff;--color-primary-darker: #4b46d8;--color-primary-darkest: #3e39be;--color-primary-light: #3f3d64}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;-webkit-margin-end:8px;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button,.excalidraw .buttonList label{-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1);border:0;border-radius:var(--border-radius-md);margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus-visible,.excalidraw .buttonList label:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button:hover,.excalidraw .buttonList label:hover{background-color:var(--button-gray-2)}.excalidraw button:active,.excalidraw .buttonList label:active{background-color:var(--button-gray-3)}.excalidraw button:disabled,.excalidraw .buttonList label:disabled{cursor:not-allowed}.excalidraw .active,.excalidraw .buttonList label.active{background-color:var(--color-primary);--icon-fill-color: #ffffff}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--color-primary-darker)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--color-primary-darkest)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:35px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns:auto -webkit-max-content auto;grid-template-columns:auto max-content auto;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;-webkit-padding-start:.5rem;padding-inline-start:.5rem;-webkit-padding-end:1.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;-webkit-margin-end:8px;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;-webkit-transform:translateX(-50%);transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;-webkit-margin-start:.6em;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.excalidraw input[type=text],.excalidraw textarea:not(.excalidraw-wysiwyg){color:var(--text-primary-color);border:1.5px solid var(--input-border-color);padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw input[type=text]:not(:focus):hover,.excalidraw textarea:not(.excalidraw-wysiwyg):not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw input[type=text]:focus,.excalidraw textarea:not(.excalidraw-wysiwyg):focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]),t.default=d},6464:function(e,t,n){"use strict";n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"},t.default=a},3645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var c=this[l][0];null!=c&&(a[c]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1667:function(e){"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:function(e){"use strict";e.exports=function(e){return e[1]}},8288:function(e,t,n){"use strict";n.d(t,{iC:function(){return a},f:function(){return l},qx:function(){return c},Iw:function(){return s},$e:function(){return u},wZ:function(){return d},ay:function(){return f},oc:function(){return p},Oh:function(){return h},Ks:function(){return r},Vi:function(){return m},$C:function(){return g},ut:function(){return v},C6:function(){return b},_D:function(){return y},n5:function(){return x},rk:function(){return w},Hg:function(){return k},hs:function(){return _},k:function(){return S},LO:function(){return E},r8:function(){return j},pb:function(){return C},LL:function(){return O},Gj:function(){return I},nM:function(){return M},Lg:function(){return T},HM:function(){return A},V4:function(){return P},EH:function(){return L},ZF:function(){return D},UO:function(){return R},ah:function(){return z},cW:function(){return N},kV:function(){return B},sS:function(){return H},Yx:function(){return F},zK:function(){return U},ZB:function(){return W},qy:function(){return K},h6:function(){return V},jo:function(){return G},$n:function(){return Z},hR:function(){return Y},Kr:function(){return q},gK:function(){return X}});var r,o=n(8635),i=n.n(o),a="Excalidraw",l=10,c=8,s=5,u=1,d=30,f=Math.PI/12,p={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},h={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};!function(e){e.COPY="copy",e.PASTE="paste",e.CUT="cut",e.KEYDOWN="keydown",e.KEYUP="keyup",e.MOUSE_MOVE="mousemove",e.RESIZE="resize",e.UNLOAD="unload",e.FOCUS="focus",e.BLUR="blur",e.DRAG_OVER="dragover",e.DROP="drop",e.GESTURE_END="gestureend",e.BEFORE_UNLOAD="beforeunload",e.GESTURE_START="gesturestart",e.GESTURE_CHANGE="gesturechange",e.POINTER_MOVE="pointermove",e.POINTER_UP="pointerup",e.STATE_CHANGE="statechange",e.WHEEL="wheel",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.HASHCHANGE="hashchange",e.VISIBILITY_CHANGE="visibilitychange",e.SCROLL="scroll"}(r||(r={}));var m={TEST:"test",DEVELOPMENT:"development"},g={SHAPE_ACTIONS_MENU:"App-menu__left"},v={Virgil:1,Helvetica:2,Cascadia:3},b={LIGHT:"light",DARK:"dark"},y="Segoe UI Emoji",x=20,w=v.Virgil,k="left",_="top",S=20,E={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},j={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},C=window.location.origin,O=500,I=300,M=500,T=5e3,A=100,P=.1,L={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=i().themeFilter,R={addLibrary:"addLibrary"},z={addLibrary:"addLibrary"},N={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},B=730,H=1e3,F=500,U=2,W=[1,2,3],K=10,V=1440,G=[E.png,E.jpg,E.svg,E.gif],Z=2097152,Y="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},X=5},6210:function(e,t,n){"use strict";n.r(t),n.d(t,{FONT_FAMILY:function(){return s.ut},THEME:function(){return s.C6},bumpVersion:function(){return ro},default:function(){return Ym},defaultLang:function(){return y},exportToBlob:function(){return Hh},exportToCanvas:function(){return Bh},exportToSvg:function(){return Fh},getFreeDrawSvgPath:function(){return Gr},getNonDeletedElements:function(){return Hc},getSceneVersion:function(){return Bc},isInvisiblySmallElement:function(){return oo},isLinearElement:function(){return Ye},languages:function(){return x},loadFromBlob:function(){return ud},loadLibraryFromBlob:function(){return dd},mutateElement:function(){return to},newElementWith:function(){return no},restore:function(){return nd},restoreAppState:function(){return td},restoreElements:function(){return ed},serializeAsJSON:function(){return wd}});var r=n(6479),o=n.n(r),i=n(9713),a=n.n(i),l=n(9787),c=n.n(l),s=n(8288),u=JSON.parse('{"u2":"@zsviczian/excalidraw","i8":"0.10.0-fixjumpingtext-1"}');"production"!==s.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(u.u2,"@").concat(u.i8,"/dist/"));var d=n(8950);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var m=n(7945),g=n.n(m),v=n(1463),b=n(4451),y={code:"en",label:"English"},x=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"}].concat([y]).sort((function(e,t){return e.label>t.label?1:-1})).filter((function(e){return b[e.code]>=85})),w="__test__";"production"===s.Vi.DEVELOPMENT&&x.unshift({code:w,label:"test language"},{code:"".concat(w,".rtl"),label:"test language (rtl)",rtl:!0});var k=y,_={},S=function(){var e=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k=t,document.documentElement.dir=k.rtl?"rtl":"ltr",document.documentElement.lang=k.code,!t.code.startsWith(w)){e.next=7;break}_={},e.next=10;break;case 7:return e.next=9,n(788)("./".concat(k.code,".json"));case 9:_=e.sent;case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){return k},j=function(e,t){for(var n=0;n<t.length;++n){var r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},C=function(e,t){if(k.code.startsWith(w)){var n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"[[".concat(n,"]]")}var r=e.split("."),o=j(_,r)||j(v,r);if(void 0===o)throw new Error("Can't find translation for ".concat(e));if(t)for(var i in t)o=o.replace("{{".concat(i,"}}"),String(t[i]));return o},O=n(4512),I=function(){return(0,O.jsx)("div",{className:"LoadingMessage",children:(0,O.jsx)("span",{children:C("labels.loadingScene")})})},M=function(e){var t=h((0,l.useState)(!0),2),n=t[0],r=t[1];return(0,l.useEffect)((function(){var t=function(){var e=(0,d.Z)(g().mark((function e(){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(n);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=x.find((function(t){return t.code===e.langCode}))||y;t(),r(!1)}),[e.langCode]),n?(0,O.jsx)(I,{}):e.children};function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function A(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t,n){return t&&D(e.prototype,t),n&&D(e,n),e}function z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e,t){return N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},N(e,t)}function B(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&N(e,t)}function H(e,t){if(t&&("object"===T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return z(e)}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function U(e,t,n){if(e&&e.length){const[r,o]=t,i=Math.PI/180*n,a=Math.cos(i),l=Math.sin(i);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-o)*l+r,e[1]=(t-r)*l+(n-o)*a+o}))}}function W(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function K(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const o=[0,0];if(n)for(const t of e)U(t,o,n);const i=function(e,t){const n=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const o=[];for(const e of n)for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n[1]!==r[1]){const e=Math.min(n[1],r[1]);o.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(o.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!o.length)return r;let i=[],a=o[0].ymin;for(;i.length||o.length;){if(o.length){let e=-1;for(let t=0;t<o.length&&!(o[t].ymin>a);t++)e=t;o.splice(0,e+1).forEach((e=>{i.push({s:a,edge:e})}))}if(i=i.filter((e=>!(e.edge.ymax<=a))),i.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),i.length>1)for(let e=0;e<i.length;e+=2){const t=e+1;if(t>=i.length)break;const n=i[e].edge,o=i[t].edge;r.push([[Math.round(n.x),a],[Math.round(o.x),a]])}a+=t,i.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)U(t,o,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),U(r,t,n)}(i,o,-n)}return i}class V{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=K(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}class G extends V{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=K(e,Object.assign({},t,{hachureGap:n})),o=Math.PI/180*t.hachureAngle,i=[],a=.5*n*Math.cos(o),l=.5*n*Math.sin(o);for(const[e,t]of r)W([e,t])&&i.push([[e[0]-a,e[1]+l],[...t]],[[e[0]+a,e[1]-l],[...t]]);return{type:"fillSketch",ops:this.renderLines(i,t)}}}class Z extends V{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),o=this._fillPolygons(e,r);return n.ops=n.ops.concat(o.ops),n}}class Y{constructor(e){this.helper=e}fillPolygons(e,t){const n=K(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let o=t.fillWeight;o<0&&(o=t.strokeWidth/2);const i=r/4;for(const a of e){const e=W(a),l=e/r,c=Math.ceil(l)-1,s=e-c*r,u=(a[0][0]+a[1][0])/2-r/4,d=Math.min(a[0][1],a[1][1]);for(let e=0;e<c;e++){const a=d+s+e*r,l=u-i+2*Math.random()*i,c=a-i+2*Math.random()*i,f=this.helper.ellipse(l,c,o,o,t);n.push(...f.ops)}}return{type:"fillSketch",ops:n}}}class q{constructor(e){this.helper=e}fillPolygons(e,t){const n=K(e,t);return{type:"fillSketch",ops:this.dashedLine(n,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,o=[];return e.forEach((e=>{const i=W(e),a=Math.floor(i/(n+r)),l=(i+r-a*(n+r))/2;let c=e[0],s=e[1];c[0]>s[0]&&(c=e[1],s=e[0]);const u=Math.atan((s[1]-c[1])/(s[0]-c[0]));for(let e=0;e<a;e++){const i=e*(n+r),a=i+n,s=[c[0]+i*Math.cos(u)+l*Math.cos(u),c[1]+i*Math.sin(u)+l*Math.sin(u)],d=[c[0]+a*Math.cos(u)+l*Math.cos(u),c[1]+a*Math.sin(u)+l*Math.sin(u)];o.push(...this.helper.doubleLineOps(s[0],s[1],d[0],d[1],t))}})),o}}class X{constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,o=K(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(o,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const o=W(e),i=Math.round(o/(2*t));let a=e[0],l=e[1];a[0]>l[0]&&(a=e[1],l=e[0]);const c=Math.atan((l[1]-a[1])/(l[0]-a[0]));for(let e=0;e<i;e++){const o=2*e*t,i=2*(e+1)*t,l=Math.sqrt(2*Math.pow(t,2)),s=[a[0]+o*Math.cos(c),a[1]+o*Math.sin(c)],u=[a[0]+i*Math.cos(c),a[1]+i*Math.sin(c)],d=[s[0]+l*Math.cos(c+Math.PI/4),s[1]+l*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(s[0],s[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}}const $={};class Q{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const J={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function ee(e,t){return e.type===t}function te(e){const t=[],n=function(e){const t=new Array;for(;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e);let r="BOD",o=0,i=n[o];for(;!ee(i,2);){let a=0;const l=[];if("BOD"===r){if("M"!==i.text&&"m"!==i.text)return te("M0,0"+e);o++,a=J[i.text],r=i.text}else ee(i,1)?a=J[r]:(o++,a=J[i.text],r=i.text);if(!(o+a<n.length))throw new Error("Path data ended short");for(let e=o;e<o+a;e++){const t=n[e];if(!ee(t,1))throw new Error("Param not a number: "+r+","+t.text);l[l.length]=+t.text}if("number"!=typeof J[r])throw new Error("Bad segment: "+r);{const e={key:r,data:l};t.push(e),o+=a,i=n[o],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function ne(e){let t=0,n=0,r=0,o=0;const i=[];for(const{key:a,data:l}of e)switch(a){case"M":i.push({key:"M",data:[...l]}),[t,n]=l,[r,o]=l;break;case"m":t+=l[0],n+=l[1],i.push({key:"M",data:[t,n]}),r=t,o=n;break;case"L":i.push({key:"L",data:[...l]}),[t,n]=l;break;case"l":t+=l[0],n+=l[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...l]}),t=l[4],n=l[5];break;case"c":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":i.push({key:"Q",data:[...l]}),t=l[2],n=l[3];break;case"q":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":i.push({key:"A",data:[...l]}),t=l[5],n=l[6];break;case"a":t+=l[5],n+=l[6],i.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,n]});break;case"H":i.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...l]}),n=l[0];break;case"v":n+=l[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...l]}),t=l[2],n=l[3];break;case"s":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":i.push({key:"T",data:[...l]}),t=l[0],n=l[1];break;case"t":t+=l[0],n+=l[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=o}return i}function re(e){const t=[];let n="",r=0,o=0,i=0,a=0,l=0,c=0;for(const{key:s,data:u}of e){switch(s){case"M":t.push({key:"M",data:[...u]}),[r,o]=u,[i,a]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],o=u[5],l=u[2],c=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,o]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,o]});break;case"V":o=u[0],t.push({key:"L",data:[r,o]});break;case"S":{let e=0,i=0;"C"===n||"S"===n?(e=r+(r-l),i=o+(o-c)):(e=r,i=o),t.push({key:"C",data:[e,i,...u]}),l=u[0],c=u[1],r=u[2],o=u[3];break}case"T":{const[e,i]=u;let a=0,s=0;"Q"===n||"T"===n?(a=r+(r-l),s=o+(o-c)):(a=r,s=o);const d=r+2*(a-r)/3,f=o+2*(s-o)/3,p=e+2*(a-e)/3,h=i+2*(s-i)/3;t.push({key:"C",data:[d,f,p,h,e,i]}),l=a,c=s,r=e,o=i;break}case"Q":{const[e,n,i,a]=u,s=r+2*(e-r)/3,d=o+2*(n-o)/3,f=i+2*(e-i)/3,p=a+2*(n-a)/3;t.push({key:"C",data:[s,d,f,p,i,a]}),l=e,c=n,r=i,o=a;break}case"A":{const e=Math.abs(u[0]),n=Math.abs(u[1]),i=u[2],a=u[3],l=u[4],c=u[5],s=u[6];if(0===e||0===n)t.push({key:"C",data:[r,o,c,s,c,s]}),r=c,o=s;else if(r!==c||o!==s){ie(r,o,c,s,e,n,i,a,l).forEach((function(e){t.push({key:"C",data:e})})),r=c,o=s}break}case"Z":t.push({key:"Z",data:[]}),r=i,o=a}n=s}return t}function oe(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function ie(e,t,n,r,o,i,a,l,c,s){const u=(d=a,Math.PI*d/180);var d;let f=[],p=0,h=0,m=0,g=0;if(s)[p,h,m,g]=s;else{[e,t]=oe(e,t,-u),[n,r]=oe(n,r,-u);const a=(e-n)/2,s=(t-r)/2;let d=a*a/(o*o)+s*s/(i*i);d>1&&(d=Math.sqrt(d),o*=d,i*=d);const f=o*o,v=i*i,b=f*v-f*s*s-v*a*a,y=f*s*s+v*a*a,x=(l===c?-1:1)*Math.sqrt(Math.abs(b/y));m=x*o*s/i+(e+n)/2,g=x*-i*a/o+(t+r)/2,p=Math.asin(parseFloat(((t-g)/i).toFixed(9))),h=Math.asin(parseFloat(((r-g)/i).toFixed(9))),e<m&&(p=Math.PI-p),n<m&&(h=Math.PI-h),p<0&&(p=2*Math.PI+p),h<0&&(h=2*Math.PI+h),c&&p>h&&(p-=2*Math.PI),!c&&h>p&&(h-=2*Math.PI)}let v=h-p;if(Math.abs(v)>120*Math.PI/180){const e=h,t=n,l=r;h=c&&h>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=ie(n=m+o*Math.cos(h),r=g+i*Math.sin(h),t,l,o,i,a,0,c,[h,e,m,g])}v=h-p;const b=Math.cos(p),y=Math.sin(p),x=Math.cos(h),w=Math.sin(h),k=Math.tan(v/4),_=4/3*o*k,S=4/3*i*k,E=[e,t],j=[e+_*y,t-S*b],C=[n+_*w,r-S*x],O=[n,r];if(j[0]=2*E[0]-j[0],j[1]=2*E[1]-j[1],s)return[j,C,O].concat(f);{f=[j,C,O].concat(f);const e=[];for(let t=0;t<f.length;t+=3){const n=oe(f[t][0],f[t][1],u),r=oe(f[t+1][0],f[t+1][1],u),o=oe(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],o[0],o[1]])}return e}}const ae={randOffset:function(e,t){return be(e,t)},randOffsetWithRange:function(e,t,n){return ve(e,t,n)},ellipse:function(e,t,n,r,o){const i=de(n,r,o);return fe(e,t,o,i).opset},doubleLineOps:function(e,t,n,r,o){return ye(e,t,n,r,o,!0)}};function le(e,t,n,r,o){return{type:"path",ops:ye(e,t,n,r,o)}}function ce(e,t,n){const r=(e||[]).length;if(r>2){const o=[];for(let t=0;t<r-1;t++)o.push(...ye(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&o.push(...ye(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:o}}return 2===r?le(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function se(e,t,n,r,o){return function(e,t){return ce(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],o)}function ue(e,t){let n=we(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=we(e,1.5*(1+.22*t.roughness),function(e){const t=Object.assign({},e);t.randomizer=void 0,e.seed&&(t.seed=e.seed+1);return t}(t));n=n.concat(r)}return{type:"path",ops:n}}function de(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/o;let a=Math.abs(e/2),l=Math.abs(t/2);const c=1-n.curveFitting;return a+=be(a*c,n),l+=be(l*c,n),{increment:i,rx:a,ry:l}}function fe(e,t,n,r){const[o,i]=_e(r.increment,e,t,r.rx,r.ry,1,r.increment*ve(.1,ve(.4,1,n),n),n);let a=ke(o,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[o]=_e(r.increment,e,t,r.rx,r.ry,1.5,0,n),i=ke(o,null,n);a=a.concat(i)}return{estimatedPoints:i,opset:{type:"path",ops:a}}}function pe(e,t,n,r,o,i,a,l,c){const s=e,u=t;let d=Math.abs(n/2),f=Math.abs(r/2);d+=be(.01*d,c),f+=be(.01*f,c);let p=o,h=i;for(;p<0;)p+=2*Math.PI,h+=2*Math.PI;h-p>2*Math.PI&&(p=0,h=2*Math.PI);const m=2*Math.PI/c.curveStepCount,g=Math.min(m/2,(h-p)/2),v=Se(g,s,u,d,f,p,h,1,c);if(!c.disableMultiStroke){const e=Se(g,s,u,d,f,p,h,1.5,c);v.push(...e)}return a&&(l?v.push(...ye(s,u,s+d*Math.cos(p),u+f*Math.sin(p),c),...ye(s,u,s+d*Math.cos(h),u+f*Math.sin(h),c)):v.push({op:"lineTo",data:[s,u]},{op:"lineTo",data:[s+d*Math.cos(p),u+f*Math.sin(p)]})),{type:"path",ops:v}}function he(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,o=r.length;if(o>2){n.push({op:"move",data:[r[0][0]+be(e,t),r[0][1]+be(e,t)]});for(let i=1;i<o;i++)n.push({op:"lineTo",data:[r[i][0]+be(e,t),r[i][1]+be(e,t)]})}}return{type:"fillPath",ops:n}}function me(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!$[n])switch(n){case"zigzag":$[n]||($[n]=new G(t));break;case"cross-hatch":$[n]||($[n]=new Z(t));break;case"dots":$[n]||($[n]=new Y(t));break;case"dashed":$[n]||($[n]=new q(t));break;case"zigzag-line":$[n]||($[n]=new X(t));break;default:n="hachure",$[n]||($[n]=new V(t))}return $[n]}(t,ae).fillPolygons(e,t)}function ge(e){return e.randomizer||(e.randomizer=new Q(e.seed||0)),e.randomizer.next()}function ve(e,t,n,r=1){return n.roughness*r*(ge(n)*(t-e)+e)}function be(e,t,n=1){return ve(-e,e,t,n)}function ye(e,t,n,r,o,i=!1){const a=i?o.disableMultiStrokeFill:o.disableMultiStroke,l=xe(e,t,n,r,o,!0,!1);if(a)return l;const c=xe(e,t,n,r,o,!0,!0);return l.concat(c)}function xe(e,t,n,r,o,i,a){const l=Math.pow(e-n,2)+Math.pow(t-r,2),c=Math.sqrt(l);let s=1;s=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=o.maxRandomnessOffset||0;u*u*100>l&&(u=c/10);const d=u/2,f=.2+.2*ge(o);let p=o.bowing*o.maxRandomnessOffset*(r-t)/200,h=o.bowing*o.maxRandomnessOffset*(e-n)/200;p=be(p,o,s),h=be(h,o,s);const m=[],g=()=>be(d,o,s),v=()=>be(u,o,s),b=o.preserveVertices;return i&&(a?m.push({op:"move",data:[e+(b?0:g()),t+(b?0:g())]}):m.push({op:"move",data:[e+(b?0:be(u,o,s)),t+(b?0:be(u,o,s))]})),a?m.push({op:"bcurveTo",data:[p+e+(n-e)*f+g(),h+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),h+t+2*(r-t)*f+g(),n+(b?0:g()),r+(b?0:g())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*f+v(),h+t+(r-t)*f+v(),p+e+2*(n-e)*f+v(),h+t+2*(r-t)*f+v(),n+(b?0:v()),r+(b?0:v())]}),m}function we(e,t,n){const r=[];r.push([e[0][0]+be(t,n),e[0][1]+be(t,n)]),r.push([e[0][0]+be(t,n),e[0][1]+be(t,n)]);for(let o=1;o<e.length;o++)r.push([e[o][0]+be(t,n),e[o][1]+be(t,n)]),o===e.length-1&&r.push([e[o][0]+be(t,n),e[o][1]+be(t,n)]);return ke(r,null,n)}function ke(e,t,n){const r=e.length,o=[];if(r>3){const i=[],a=1-n.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];i[0]=[n[0],n[1]],i[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],i[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],i[3]=[e[t+1][0],e[t+1][1]],o.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;o.push({op:"lineTo",data:[t[0]+be(e,n),t[1]+be(e,n)]})}}else 3===r?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&o.push(...ye(e[0][0],e[0][1],e[1][0],e[1][1],n));return o}function _e(e,t,n,r,o,i,a,l){const c=[],s=[];if(0===l.roughness){e/=4,s.push([t+r*Math.cos(-e),n+o*Math.sin(-e)]);for(let i=0;i<=2*Math.PI;i+=e){const e=[t+r*Math.cos(i),n+o*Math.sin(i)];c.push(e),s.push(e)}s.push([t+r*Math.cos(0),n+o*Math.sin(0)]),s.push([t+r*Math.cos(e),n+o*Math.sin(e)])}else{const u=be(.5,l)-Math.PI/2;s.push([be(i,l)+t+.9*r*Math.cos(u-e),be(i,l)+n+.9*o*Math.sin(u-e)]);const d=2*Math.PI+u-.01;for(let a=u;a<d;a+=e){const e=[be(i,l)+t+r*Math.cos(a),be(i,l)+n+o*Math.sin(a)];c.push(e),s.push(e)}s.push([be(i,l)+t+r*Math.cos(u+2*Math.PI+.5*a),be(i,l)+n+o*Math.sin(u+2*Math.PI+.5*a)]),s.push([be(i,l)+t+.98*r*Math.cos(u+a),be(i,l)+n+.98*o*Math.sin(u+a)]),s.push([be(i,l)+t+.9*r*Math.cos(u+.5*a),be(i,l)+n+.9*o*Math.sin(u+.5*a)])}return[s,c]}function Se(e,t,n,r,o,i,a,l,c){const s=i+be(.1,c),u=[];u.push([be(l,c)+t+.9*r*Math.cos(s-e),be(l,c)+n+.9*o*Math.sin(s-e)]);for(let i=s;i<=a;i+=e)u.push([be(l,c)+t+r*Math.cos(i),be(l,c)+n+o*Math.sin(i)]);return u.push([t+r*Math.cos(a),n+o*Math.sin(a)]),u.push([t+r*Math.cos(a),n+o*Math.sin(a)]),ke(u,null,c)}function Ee(e,t,n,r,o,i,a,l){const c=[],s=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3];let u=[0,0];const d=l.disableMultiStroke?1:2,f=l.preserveVertices;for(let p=0;p<d;p++)0===p?c.push({op:"move",data:[a[0],a[1]]}):c.push({op:"move",data:[a[0]+(f?0:be(s[0],l)),a[1]+(f?0:be(s[0],l))]}),u=f?[o,i]:[o+be(s[p],l),i+be(s[p],l)],c.push({op:"bcurveTo",data:[e+be(s[p],l),t+be(s[p],l),n+be(s[p],l),r+be(s[p],l),u[0],u[1]]});return c}function je(e){return[...e]}function Ce(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function Oe(e,t,n){const r=Ce(t,n);if(0===r)return Ce(e,t);let o=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return o=Math.max(0,Math.min(1,o)),Ce(e,Ie(t,n,o))}function Ie(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Me(e,t,n,r){const o=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],o=e[t+2],i=e[t+3];let a=3*r[0]-2*n[0]-i[0];a*=a;let l=3*r[1]-2*n[1]-i[1];l*=l;let c=3*o[0]-2*i[0]-n[0];c*=c;let s=3*o[1]-2*i[1]-n[1];return s*=s,a<c&&(a=c),l<s&&(l=s),a+l}(e,t)<n){const n=e[t+0];if(o.length){(i=o[o.length-1],a=n,Math.sqrt(Ce(i,a)))>1&&o.push(n)}else o.push(n);o.push(e[t+3])}else{const r=.5,i=e[t+0],a=e[t+1],l=e[t+2],c=e[t+3],s=Ie(i,a,r),u=Ie(a,l,r),d=Ie(l,c,r),f=Ie(s,u,r),p=Ie(u,d,r),h=Ie(f,p,r);Me([i,s,f,h],0,n,o),Me([h,p,d,c],0,n,o)}var i,a;return o}function Te(e,t){return Ae(e,0,e.length,t)}function Ae(e,t,n,r,o){const i=o||[],a=e[t],l=e[n-1];let c=0,s=1;for(let r=t+1;r<n-1;++r){const t=Oe(e[r],a,l);t>c&&(c=t,s=r)}return Math.sqrt(c)>r?(Ae(e,t,s+1,r,i),Ae(e,s,n,r,i)):(i.length||i.push(a),i.push(l)),i}function Pe(e,t=.15,n){const r=[],o=(e.length-1)/3;for(let n=0;n<o;n++){Me(e,3*n,t,r)}return n&&n>0?Ae(r,0,r.length,n):r}const Le="none";class De{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,o){const i=this._o(o);return this._d("line",[le(e,t,n,r,i)],i)}rectangle(e,t,n,r,o){const i=this._o(o),a=[],l=se(e,t,n,r,i);if(i.fill){const o=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===i.fillStyle?a.push(he([o],i)):a.push(me([o],i))}return i.stroke!==Le&&a.push(l),this._d("rectangle",a,i)}ellipse(e,t,n,r,o){const i=this._o(o),a=[],l=de(n,r,i),c=fe(e,t,i,l);if(i.fill)if("solid"===i.fillStyle){const n=fe(e,t,i,l).opset;n.type="fillPath",a.push(n)}else a.push(me([c.estimatedPoints],i));return i.stroke!==Le&&a.push(c.opset),this._d("ellipse",a,i)}circle(e,t,n,r){const o=this.ellipse(e,t,n,n,r);return o.shape="circle",o}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[ce(e,!1,n)],n)}arc(e,t,n,r,o,i,a=!1,l){const c=this._o(l),s=[],u=pe(e,t,n,r,o,i,a,!0,c);if(a&&c.fill)if("solid"===c.fillStyle){const a=Object.assign({},c);a.disableMultiStroke=!0;const l=pe(e,t,n,r,o,i,!0,!1,a);l.type="fillPath",s.push(l)}else s.push(function(e,t,n,r,o,i,a){const l=e,c=t;let s=Math.abs(n/2),u=Math.abs(r/2);s+=be(.01*s,a),u+=be(.01*u,a);let d=o,f=i;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);const p=(f-d)/a.curveStepCount,h=[];for(let e=d;e<=f;e+=p)h.push([l+s*Math.cos(e),c+u*Math.sin(e)]);return h.push([l+s*Math.cos(f),c+u*Math.sin(f)]),h.push([l,c]),me([h],a)}(e,t,n,r,o,i,c));return c.stroke!==Le&&s.push(u),this._d("arc",s,c)}curve(e,t){const n=this._o(t),r=[],o=ue(e,n);if(n.fill&&n.fill!==Le&&e.length>=3){const t=function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(je(e[0]),je(e[1]),je(e[2]),je(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);const o=[],i=1-t;r.push(je(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];o[0]=[t[0],t[1]],o[1]=[t[0]+(i*n[e+1][0]-i*n[e-1][0])/6,t[1]+(i*n[e+1][1]-i*n[e-1][1])/6],o[2]=[n[e+1][0]+(i*n[e][0]-i*n[e+2][0])/6,n[e+1][1]+(i*n[e][1]-i*n[e+2][1])/6],o[3]=[n[e+1][0],n[e+1][1]],r.push(o[1],o[2],o[3])}}return r}(e),o=Pe(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(he([o],n)):r.push(me([o],n))}return n.stroke!==Le&&r.push(o),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],o=ce(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(he([e],n)):r.push(me([e],n))),n.stroke!==Le&&r.push(o),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=n.fill&&"transparent"!==n.fill&&n.fill!==Le,i=n.stroke!==Le,a=!!(n.simplification&&n.simplification<1),l=function(e,t,n){const r=re(ne(te(e))),o=[];let i=[],a=[0,0],l=[];const c=()=>{l.length>=4&&i.push(...Pe(l,t)),l=[]},s=()=>{c(),i.length&&(o.push(i),i=[])};for(const{key:e,data:t}of r)switch(e){case"M":s(),a=[t[0],t[1]],i.push(a);break;case"L":c(),i.push([t[0],t[1]]);break;case"C":if(!l.length){const e=i.length?i[i.length-1]:a;l.push([e[0],e[1]])}l.push([t[0],t[1]]),l.push([t[2],t[3]]),l.push([t[4],t[5]]);break;case"Z":c(),i.push([a[0],a[1]])}if(s(),!n)return o;const u=[];for(const e of o){const t=Te(e,n);t.length&&u.push(t)}return u}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return o&&("solid"===n.fillStyle?r.push(he(l,n)):r.push(me(l,n))),i&&(a?l.forEach((e=>{r.push(ce(e,!1,n))})):r.push(function(e,t){const n=re(ne(te(e))),r=[];let o=[0,0],i=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:a.map((r=>r+(n?0:be(e,t))))}),i=[a[0],a[1]],o=[a[0],a[1]];break}case"L":r.push(...ye(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[e,n,o,l,c,s]=a;r.push(...Ee(e,n,o,l,c,s,i,t)),i=[c,s];break}case"Z":r.push(...ye(i[0],i[1],o[0],o[1],t)),i=[o[0],o[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Le};break;case"fillPath":t={d:this.opsToPath(e),stroke:Le,strokeWidth:0,fill:n.fill||Le};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Le,strokeWidth:n,fill:Le}}}class Re{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new De(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,o=e.options.fixedDecimalPlaceDigits;for(const i of t)switch(i.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,i,o),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,i,o,t),r.restore();break}case"fillSketch":this.fillSketch(r,i,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const r of t.ops){const t="number"==typeof n&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i),i}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i),i}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i),i}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o),o}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,o,i,a=!1,l){const c=this.gen.arc(e,t,n,r,o,i,a,l);return this.draw(c),c}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const ze="http://www.w3.org/2000/svg";class Ne{constructor(e,t){this.svg=e,this.gen=new De(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,o=r.createElementNS(ze,"g"),i=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(ze,"path"),t.setAttribute("d",this.opsToPath(a,i)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(ze,"path"),t.setAttribute("d",this.opsToPath(a,i)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&o.appendChild(t)}return o}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const o=e.createElementNS(ze,"path");return o.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),o.setAttribute("stroke",n.fill||""),o.setAttribute("stroke-width",r+""),o.setAttribute("fill","none"),n.fillLineDash&&o.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i)}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i)}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i)}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,o,i,a=!1,l){const c=this.gen.arc(e,t,n,r,o,i,a,l);return this.draw(c)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}var Be={canvas:(e,t)=>new Re(e,t),svg:(e,t)=>new Ne(e,t),generator:e=>new De(e),newSeed:()=>De.newSeed()};function He(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=He(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Fe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=He(e))&&(r&&(r+=" "),r+=t);return r}let Ue=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};var We=function(e){return!!e&&"image"===e.type&&!!e.fileId},Ke=function(e){return!!e&&"image"===e.type},Ve=function(e){return null!=e&&"text"===e.type},Ge=function(e){return null!=e&&Ze(e.type)},Ze=function(e){return"freedraw"===e},Ye=function(e){return null!=e&&qe(e.type)},qe=function(e){return"arrow"===e||"line"===e},Xe=function(e){return null!=e&&$e(e.type)},$e=function(e){return"arrow"===e},Qe=function(e){return null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type||"text"===e.type&&!e.containerId)},Je=function(e){var t;return Qe(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((function(e){return"text"===e.type})))},et=function(e){return null!==e&&Ve(e)&&null!==e.containerId},tt=function(e,t,n,r,o){return[(e-n)*Math.cos(o)-(t-r)*Math.sin(o)+n,(e-n)*Math.sin(o)+(t-r)*Math.cos(o)+r]},nt=function(e,t,n){return tt(e[0],e[1],t[0],t[1],n)},rt=function(e,t,n,r,o,i,a,l){var c=Math.cos(r),s=Math.sin(r);return e.e&&e.w?t+=o+a:e.e?(t+=o*(1+c),n+=o*s,t+=a*(1-c),n+=a*-s):e.w&&(t+=o*(1-c),n+=o*-s,t+=a*(1+c),n+=a*s),e.n&&e.s?n+=i+l:e.n?(t+=i*s,n+=i*(1-c),t+=l*-s,n+=l*(1+c)):e.s&&(t+=i*-s,n+=i*(1+c),t+=l*s,n+=l*(1-c)),[t,n]},ot=function(e,t,n,r){var o=n-e,i=r-t;return Math.hypot(o,i)},it=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){var n=[e[0],e[e.length-1]],r=n[0],o=n[1],i=ot(r[0],r[1],o[0],o[1]);return i<=s.qx/t}return!1},at=function(e,t,n){var r=e.length;if(r<3)return!1;for(var o=[Number.MAX_SAFE_INTEGER,n],i=[t,n],a=0,l=0;l<r;l++){var c=e[l],s=e[(l+1)%r];if(st(c,s,i,o)){if(0===ct(c,i,s))return lt(c,i,s);a++}}return a%2==1},lt=function(e,t,n){return t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1])},ct=function(e,t,n){var r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},st=function(e,t,n,r){var o=ct(e,t,n),i=ct(e,t,r),a=ct(n,r,e),l=ct(n,r,t);return o!==i&&a!==l||(!(0!==o||!lt(e,n,t))||(!(0!==i||!lt(e,r,t))||(!(0!==a||!lt(n,e,r))||!(0!==l||!lt(n,t,r)))))},ut=function(e,t,n){return n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t]},dt=function(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{width:Math.max.apply(Math,A(t))-Math.min.apply(Math,A(t)),height:Math.max.apply(Math,A(n))-Math.min.apply(Math,A(n))}},ft=function(e,t,n){var r=n.map((function(t){return t[e]})),o=Math.max.apply(Math,A(r)),i=Math.min.apply(Math,A(r)),a=o-i,l=0===a?1:t/a,c=1/0,s=n.map((function(t){return t.map((function(t,n){if(n!==e)return t;var r=t*l;return c=Math.min(r,c),r}))}));if(2===s.length)return s;var u=i-c;return s.map((function(t){return t.map((function(t,n){return n===e?t+u:t}))}))};function pt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ht(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ht(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mt=function(e){return Ge(e)?yt(e):Ye(e)?xt(e):[e.x,e.y,e.x+e.width,e.y+e.height]},gt=function(e){var t,n=pt(e.sets);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("path"===r.type)return r.ops}}catch(e){n.e(e)}finally{n.f()}return e.sets[0].ops},vt=function(e,t){var n=[0,0],r=e.reduce((function(e,r){var o=r.op,i=r.data;if("move"===o)n=i;else if("bcurveTo"===o){var a=[i[0],i[1]],l=[i[2],i[3]],c=[i[4],i[5]],s=n;n=c;for(var u=function(e,t){return Math.pow(1-e,3)*c[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*a[t]+s[t]*Math.pow(e,3)},d=0;d<=1;){var f=u(d,0),p=u(d,1);if(t){var m=h(t(f,p),2);f=m[0],p=m[1]}e.minY=Math.min(e.minY,p),e.minX=Math.min(e.minX,f),e.maxX=Math.max(e.maxX,f),e.maxY=Math.max(e.maxY,p),d+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]},bt=function(e){var t,n=1/0,r=1/0,o=-1/0,i=-1/0,a=pt(e);try{for(a.s();!(t=a.n()).done;){var l=h(t.value,2),c=l[0],s=l[1];n=Math.min(n,c),r=Math.min(r,s),o=Math.max(o,c),i=Math.max(i,s)}}catch(e){a.e(e)}finally{a.f()}return[n,r,o,i]},yt=function(e){var t=h(bt(e.points),4),n=t[0],r=t[1],o=t[2],i=t[3];return[n+e.x,r+e.y,o+e.x,i+e.y]},xt=function(e){var t;if(e.points.length<2||!Dr(e)){var n=e.points.reduce((function(e,t){var n=h(t,2),r=n[0],o=n[1];return e.minY=Math.min(e.minY,o),e.minX=Math.min(e.minX,r),e.maxX=Math.max(e.maxX,r),e.maxY=Math.max(e.maxY,o),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),r=n.minX,o=n.minY,i=n.maxX,a=n.maxY;t=[r+e.x,o+e.y,i+e.x,a+e.y]}else{var l=Dr(e),c=gt(l[0]),s=h(vt(c),4),u=s[0],d=s[1],f=s[2],p=s[3];t=[u+e.x,d+e.y,f+e.x,p+e.y]}return t},wt=function(e){var t,n=h(mt(e),4),r=n[0],o=n[1],i=n[2],a=n[3],l=(r+i)/2,c=(o+a)/2;if(Ge(e)){var s=bt(e.points.map((function(t){var n=h(t,2),r=n[0],o=n[1];return tt(r,o,l-e.x,c-e.y,e.angle)}))),u=h(s,4),d=u[0],f=u[1],p=u[2],m=u[3];return[d+e.x,f+e.y,p+e.x,m+e.y]}if(Ye(e))t=function(e,t,n){if(e.points.length<2||!Dr(e)){var r=e.points.reduce((function(r,o){var i=h(o,2),a=i[0],l=i[1],c=h(tt(e.x+a,e.y+l,t,n,e.angle),2);return a=c[0],l=c[1],r.minY=Math.min(r.minY,l),r.minX=Math.min(r.minX,a),r.maxX=Math.max(r.maxX,a),r.maxY=Math.max(r.maxY,l),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]}var o=Dr(e),i=gt(o[0]);return vt(i,(function(r,o){return tt(e.x+r,e.y+o,t,n,e.angle)}))}(e,l,c);else if("diamond"===e.type){var g=h(tt(l,o,l,c,e.angle),2),v=g[0],b=g[1],y=h(tt(l,a,l,c,e.angle),2),x=y[0],w=y[1],k=h(tt(r,c,l,c,e.angle),2),_=k[0],S=k[1],E=h(tt(i,c,l,c,e.angle),2),j=E[0],C=E[1];t=[Math.min(v,x,_,j),Math.min(b,w,S,C),Math.max(v,x,_,j),Math.max(b,w,S,C)]}else if("ellipse"===e.type){var O=(i-r)/2,I=(a-o)/2,M=Math.cos(e.angle),T=Math.sin(e.angle),A=Math.hypot(O*M,I*T),P=Math.hypot(I*M,O*T);t=[l-A,c-P,l+A,c+P]}else{var L=h(tt(r,o,l,c,e.angle),2),D=L[0],R=L[1],z=h(tt(r,a,l,c,e.angle),2),N=z[0],B=z[1],H=h(tt(i,a,l,c,e.angle),2),F=H[0],U=H[1],W=h(tt(i,o,l,c,e.angle),2),K=W[0],V=W[1];t=[Math.min(D,N,F,K),Math.min(R,B,U,V),Math.max(D,N,F,K),Math.max(R,B,U,V)]}return t},kt=function(e){if(!e.length)return[0,0,0,0];var t=1/0,n=-1/0,r=1/0,o=-1/0;return e.forEach((function(e){var i=h(wt(e),4),a=i[0],l=i[1],c=i[2],s=i[3];t=Math.min(t,a),r=Math.min(r,l),n=Math.max(n,c),o=Math.max(o,s)})),[t,r,n,o]},_t=function(e,t,n){if(!Ye(e)&&!Ge(e))return[e.x,e.y,e.x+t,e.y+n];var r,o=ft(0,t,ft(1,n,e.points));if(Ge(e))r=bt(o);else{var i=Be.generator(),a="sharp"===e.strokeSharpness?i.linearPath(o,zr(e)):i.curve(o,zr(e)),l=gt(a);r=vt(l)}var c=h(r,4),s=c[0],u=c[1],d=c[2],f=c[3];return[s+e.x,u+e.y,d+e.x,f+e.y]},St=function(e,t,n){var r=Be.generator(),o="sharp"===n?r.linearPath(t,zr(e)):r.curve(t,zr(e)),i=gt(o),a=h(vt(i),4),l=a[0],c=a[1],s=a[2],u=a[3];return[l+e.x,c+e.y,s+e.x,u+e.y]},Et=function(e){var t=h(kt(e),4),n=t[0],r=t[1],o=t[2],i=t[3];return{minX:n,minY:r,maxX:o,maxY:i,width:o-n,height:i-r,midX:(n+o)/2,midY:(r+i)/2}},jt=JSON.parse('{"white":"#ffffff","black":"#000000","gray":["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],"red":["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],"pink":["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],"grape":["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],"violet":["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],"indigo":["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],"blue":["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],"cyan":["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],"teal":["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],"green":["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],"lime":["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],"yellow":["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],"orange":["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}'),Ct=function(e){return[jt.red[e],jt.pink[e],jt.grape[e],jt.violet[e],jt.indigo[e],jt.blue[e],jt.cyan[e],jt.teal[e],jt.green[e],jt.lime[e],jt.yellow[e],jt.orange[e]]},Ot={canvasBackground:[jt.white,jt.gray[0],jt.gray[1]].concat(A(Ct(0))),elementBackground:["transparent",jt.gray[4],jt.gray[6]].concat(A(Ct(6))),elementStroke:[jt.black,jt.gray[8],jt.gray[7]].concat(A(Ct(9)))},It=n(5156),Mt=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Tt=/^Win/.test(window.navigator.platform),At="Equal",Pt="Minus",Lt="NumpadAdd",Dt="NumpadSubtract",Rt="Numpad0",zt="BracketRight",Nt="BracketLeft",Bt="Digit1",Ht="Digit2",Ft="Quote",Ut="Digit0",Wt="Slash",Kt="KeyC",Vt="KeyD",Gt="KeyG",Zt="KeyF",Yt="KeyH",qt="KeyV",Xt="KeyX",$t="KeyZ",Qt="KeyR",Jt={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Mt?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",A:"a",D:"d",E:"e",G:"g",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z"},en=function(e){return e===Jt.ARROW_LEFT||e===Jt.ARROW_RIGHT||e===Jt.ARROW_DOWN||e===Jt.ARROW_UP},tn=function(e){return e.altKey},nn=function(e){return e.shiftKey},rn=function(e){return e.shiftKey},on=null,an=function(){if(on)return on;var e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),o="".concat(e.getHours()).padStart(2,"0"),i="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(o).concat(i)},ln=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},cn=function(e){return e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type)},sn=function(e){for(var t=e.fontFamily,n=0,r=Object.entries(s.ut);n<r.length;n++){var o=h(r[n],2),i=o[0];if(o[1]===t)return"".concat(i,", ").concat(s._D)}return s._D},un=function(e){var t=e.fontSize,n=e.fontFamily;return"".concat(t,"px ").concat(sn({fontFamily:n}))},dn=function(e,t){var n=0,r=null,o=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r=i,clearTimeout(n),n=window.setTimeout((function(){r=null,e.apply(void 0,i)}),t)};return o.flush=function(){if(clearTimeout(n),r){var t=r;r=null,e.apply(void 0,A(t))}},o.cancel=function(){r=null,clearTimeout(n)},o},fn=function(e,t){if(!e.length||t<1)return[];for(var n=0,r=0,o=Array(Math.ceil(e.length/t));n<e.length;)o[r++]=e.slice(n,n+=t);return o},pn=function(e,t){return Math.abs(e-t)},hn=function(e){e&&(e.style.cursor="")},mn=function(e,t){e&&(e.style.cursor=t)},gn=function(e,t){e&&("selection"===t?hn(e):"image"!==t&&(e.style.cursor=s.oc.CROSSHAIR))},vn=function(){var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},bn=function(e){return e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),Mt?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")},yn=function(e,t){var n=e.clientX,r=e.clientY,o=t.zoom,i=t.offsetLeft,a=t.offsetTop,l=t.scrollX,c=t.scrollY,s=1/o.value;return{x:(n-o.translation.x-i)*s-l,y:(r-o.translation.y-a)*s-c}},xn=function(e,t){var n=e.sceneX,r=e.sceneY,o=t.zoom,i=t.offsetLeft,a=t.offsetTop,l=t.scrollX,c=t.scrollY;return{x:(n+l)*o.value+o.translation.x+i,y:(r+c)*o.value+o.translation.y+a}},wn=function(e){return getComputedStyle(document.documentElement).getPropertyValue("--".concat(e))},kn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),_n=function(e){return kn.test(e)},Sn=function(e){var t=h(e,2);return{x:t[0],y:t[1]}},En=function(e){if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},jn=function(e){var t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===Ot.elementBackground[0]},Cn=function(e){return function(t){(0,It.unstable_batchedUpdates)(e,t)}},On=function(){return Mn()?1:Date.now()},In=function(e){return e.reduce((function(e,t){return e.set("string"==typeof t?t:t.id,t),e}),new Map)},Mn=function(){var e;return"undefined"!=typeof process&&"test"===(null===(e={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})||void 0===e?void 0:e.NODE_ENV)};function Tn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return An(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return An(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function An(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pn=s.ZB.includes(devicePixelRatio)?devicePixelRatio:1,Ln=function(){return{theme:s.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:s.rk,currentItemFontSize:s.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:jt.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:s.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:Pn,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(C("labels.untitled"),"-").concat(an()),openMenu:null,openPopup:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:jt.white,zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1,pendingImageElement:null}},Dn={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},elementLocked:{browser:!0,export:!1,server:!1},elementType:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1}},Rn=function(e,t){var n,r={},o=Tn(Object.keys(e));try{for(o.s();!(n=o.n()).done;){var i=n.value,a=Dn[i];if(null!=a&&a[t]){var l=e[i];r[i]=l}}}catch(e){o.e(e)}finally{o.f()}return r},zn=function(e){return Rn(e,"export")},Nn=function(e){return Rn(e,"server")};function Bn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function Hn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Fn(e,t){return[e[0]-t[0],e[1]-t[1]]}function Un(e,t){return[e[0]*t,e[1]*t]}function Wn(e){return[e[1],-e[0]]}function Kn(e,t){return e[0]*t[0]+e[1]*t[1]}function Vn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Gn(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Fn(e,t))}function Zn(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Yn(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function qn(e,t,n){let r=Math.sin(n),o=Math.cos(n),i=e[0]-t[0],a=e[1]-t[1],l=i*r+a*o;return[i*o-a*r+t[0],l+t[1]]}function Xn(e,t,n){return Hn(e,Un(Fn(t,e),n))}function $n(e,t,n){return Hn(e,Un(t,n))}var{min:Qn,PI:Jn}=Math,er=Jn+1e-4;function tr(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:o=.5,simulatePressure:i=!0,easing:a=(e=>e),start:l={},end:c={},last:s=!1}=t,{cap:u=!0,taper:d=0,easing:f=(e=>e*(2-e))}=l,{cap:p=!0,taper:h=0,easing:m=(e=>--e*e*e+1)}=c;if(0===e.length||n<=0)return[];let g,v=e[e.length-1].runningLength,b=Math.pow(n*r,2),y=[],x=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(i){let o=Qn(1,t.distance/n),i=Qn(1,1-o);r=Qn(1,e+.275*o*(i-e))}return(e+r)/2}),e[0].pressure),k=Bn(n,o,e[e.length-1].pressure,a),_=e[0].vector,S=e[0].point,E=S,j=S,C=E;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:l,vector:c,distance:s,runningLength:u}=e[t];if(t<e.length-1&&v-u<3)continue;if(o){if(i){let e=Qn(1,s/n),t=Qn(1,1-e);r=Qn(1,w+.275*e*(t-w))}k=Bn(n,o,r,a)}else k=n/2;void 0===g&&(g=k);let p=u<d?f(u/d):1,O=v-u<h?m((v-u)/h):1;if(k=Math.max(.01,k*Math.min(p,O)),t===e.length-1){let e=Un(Wn(c),k);y.push(Fn(l,e)),x.push(Hn(l,e));continue}let I=e[t+1].vector,M=Kn(c,I);if(M<0){let e=Un(Wn(_),k);for(let t=1/13,n=0;n<=1;n+=t)j=qn(Fn(l,e),l,er*n),y.push(j),C=qn(Hn(l,e),l,er*-n),x.push(C);S=j,E=C;continue}let T=Un(Wn(Xn(I,c,M)),k);j=Fn(l,T),(t<=1||Gn(S,j)>b)&&(y.push(j),S=j),C=Hn(l,T),(t<=1||Gn(E,C)>b)&&(x.push(C),E=C),w=r,_=c}let O=e[0].point.slice(0,2),I=e.length>1?e[e.length-1].point.slice(0,2):Hn(e[0].point,[1,1]),M=[],T=[];if(1===e.length){if(!d&&!h||s){let e=$n(O,Zn(Wn(Fn(O,I))),-(g||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(qn(e,O,2*er*r));return t}}else{if(!(d||h&&1===e.length))if(u)for(let e=1/13,t=e;t<=1;t+=e){let e=qn(x[0],O,er*t);M.push(e)}else{let e=Fn(y[0],x[0]),t=Un(e,.5),n=Un(e,.51);M.push(Fn(O,t),Fn(O,n),Hn(O,n),Hn(O,t))}let t=Wn(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(h||d&&1===e.length)T.push(I);else if(p){let e=$n(I,t,k);for(let t=1/29,n=t;n<1;n+=t)T.push(qn(e,I,3*er*n))}else T.push(Hn(I,Un(t,k)),Hn(I,Un(t,.99*k)),Fn(I,Un(t,.99*k)),Fn(I,Un(t,k)))}return y.concat(T,x.reverse(),M)}(function(e,t={}){var n;let{streamline:r=.5,size:o=16,last:i=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),l=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===l.length){let e=l[1];l=l.slice(0,-1);for(let t=1;t<5;t++)l.push(Xn(l[0],e,t/4))}1===l.length&&(l=[...l,[...Hn(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,u=0,d=c[0],f=l.length-1;for(let e=1;e<l.length;e++){let t=i&&e===f?l[e].slice(0,2):Xn(d.point,l[e],a);if(Vn(d.point,t))continue;let n=Yn(t,d.point);if(u+=n,e<f&&!s){if(u<o)continue;s=!0}d={point:t,pressure:l[e][2]>=0?l[e][2]:.5,vector:Zn(Fn(d.point,t)),distance:n,runningLength:u},c.push(d)}return c[0].vector=(null==(n=c[1])?void 0:n.vector)||[0,0],c}(e,t),t)}var nr=function(e){return"string"==typeof e},rr=function(){function e(){L(this,e),this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}return R(e,[{key:"getElementsIncludingDeleted",value:function(){return this.elements}},{key:"getElements",value:function(){return this.nonDeletedElements}},{key:"getElement",value:function(e){return this.elementsMap.get(e)||null}},{key:"getNonDeletedElement",value:function(e){var t=this.getElement(e);return t&&Fc(t)?t:null}},{key:"getNonDeletedElements",value:function(e){var t=this,n=[];return e.forEach((function(e){var r=t.getNonDeletedElement(e);null!=r&&n.push(r)})),n}},{key:"replaceAllElements",value:function(t){var n=this;this.elements=t,this.elementsMap.clear(),t.forEach((function(t){n.elementsMap.set(t.id,t),e.mapElementToScene(t,n)})),this.nonDeletedElements=Hc(this.elements),this.informMutation()}},{key:"informMutation",value:function(){for(var e=0,t=Array.from(this.callbacks);e<t.length;e++){(0,t[e])()}}},{key:"addCallback",value:function(e){var t=this;if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),function(){if(!t.callbacks.has(e))throw new Error;t.callbacks.delete(e)}}},{key:"destroy",value:function(){var t=this;e.sceneMapById.forEach((function(n,r){n===t&&e.sceneMapById.delete(r)})),this.callbacks.clear()}}],[{key:"mapElementToScene",value:function(e,t){nr(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}},{key:"getScene",value:function(e){return nr(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}}]),e}();rr.sceneMapByElement=new WeakMap,rr.sceneMapById=new Map;var or,ir,ar=rr,lr=function(e,t,n){var r=t?t.width-2*s.gK:void 0,o=e.text;t&&(o=hr(e.originalText,un(e),t.width));var i=ur(e.originalText,un(e),r),a=e.y;if(t){a=t.y+t.height/2-i.height/2;var l=t.height;i.height>t.height-2*s.gK&&(l=i.height+2*s.gK,a=t.y+l/2-i.height/2),to(t,{height:l})}to(e,{width:i.width,height:i.height,baseline:i.baseline,y:a,text:o})},cr=function(e,t,n){var r=In(e);t.forEach((function(e){var t=n.get(e.id),o=br(e);if(o){var i,a=n.get(o);to(r.get(t),{boundElements:null===(i=e.boundElements)||void 0===i?void 0:i.concat({type:"text",id:a})}),to(r.get(a),{containerId:t})}}))},sr=function(e,t){e.forEach((function(e){var n=br(e);if(n){var r=ar.getScene(e).getElement(n);if(r&&r.text){if(!e)return;var o=r.text,i=r.height,a=e.height,l=r.baseline;if("n"!==t&&"s"!==t){o&&(o=hr(r.originalText,un(r),e.width));var c=ur(o,un(r),e.width);i=c.height,l=c.baseline}if(i>e.height-2*s.gK){var u=(a=i+2*s.gK)-e.height,d="ne"===t||"nw"===t||"n"===t?e.y-u:e.y;to(e,{height:a,y:d})}var f=e.y+a/2-i/2;to(r,{text:o,width:e.width-2*s.gK,height:i,x:e.x+s.gK,y:f,baseline:l})}}}))},ur=function(e,t,n){e=e.split("\n").map((function(e){return e||" "})).join("\n");var r=document.createElement("div");if(r.style.position="absolute",r.style.whiteSpace="pre",r.style.font=t,r.style.minHeight="1em",n){var o=fr(t);r.style.width="".concat(String(n),"px"),r.style.maxWidth="".concat(String(n),"px"),r.style.overflow="hidden",r.style.wordBreak="break-word",r.style.lineHeight="".concat(String(o),"px"),r.style.whiteSpace="pre-wrap"}document.body.appendChild(r),r.innerText=e;var i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",r.appendChild(i);var a=i.offsetTop+i.offsetHeight,l=r.offsetWidth,c=r.offsetHeight;return document.body.removeChild(r),{width:l,height:c,baseline:a}},dr="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),fr=function(e){return ur(dr,e,null).height},pr=function(e,t){or||(or=document.createElement("canvas"));var n=or.getContext("2d");n.font=t;var r=n.measureText(e);return Mn()?10*r.width:r.width},hr=function(e,t,n){var r=n-2*s.gK,o=[],i=e.split("\n"),a=pr(" ",t);return i.forEach((function(e){var n=e.split(" ");if(1===n.length&&""===n[0])o.push(n[0]);else{for(var i="",l=0,c=0;c<n.length;){if(pr(n[c],t)>=r){for(i&&o.push(i),i="",l=0;n[c].length>0;){var s=n[c][0],u=mr.calculate(s,t);l+=u,n[c]=n[c].slice(1),l>=r?(" "===i.slice(-1)&&(i=i.slice(0,-1)),o.push(i),i=s,(l=u)===r&&(i="",l=0)):i+=s}l+a>=r?(o.push(i),i="",l=0):(i+=" ",l+=a),c++}else{for(;l<r&&c<n.length;){var d=n[c];if((l=pr(i+d,t))>=r){o.push(i),l=0,i="";break}if(c++,i+="".concat(d," "),l+a>=r){o.push(i.slice(0,-1)),i="",l=0;break}}l===r&&(i="",l=0)}}i&&(" "===i.slice(-1)&&(i=i.slice(0,-1)),o.push(i))}})),o.join("\n")},mr=(ir={},{calculate:function(e,t){var n=e.charCodeAt(0);if(ir[t]||(ir[t]=[]),!ir[t][n]){var r=pr(e,t);ir[t][n]=r}return ir[t][n]},getCache:function(e){return ir[e]}}),gr=function(e){var t=vr(e);return 0===t?ur(dr.split("").join("\n"),e).width+2*s.gK:t+2*s.gK},vr=function(e){var t=mr.getCache(e);if(!t)return 0;var n=t.filter((function(e){return void 0!==e}));return Math.min.apply(Math,A(n))},br=function(e){var t,n;return null==e||null===(t=e.boundElements)||void 0===t||null===(n=t.filter((function(e){return"text"===e.type}))[0])||void 0===n?void 0:n.id},yr=function(e){if(!e)return null;var t,n=br(e);return n&&(null===(t=ar.getScene(e))||void 0===t?void 0:t.getElement(n))||null},xr=function(e){return e&&e.containerId&&(null===(t=ar.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t};function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _r="invert(100%) hue-rotate(180deg) saturate(1.25)",Sr=Ln(),Er=function(e,t){return We(e)&&!t.imageCache.has(e.fileId)},jr=function(e,t){var n;return"dark"===t.theme&&We(e)&&!Er(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==s.LO.svg},Cr=function(e){return[8,8+e]},Or=function(e){return[1.5,6+e]},Ir=function(e){return"freedraw"===e.type?12*e.strokeWidth:20},Mr=document.createElement("img");Mr.src="data:".concat(s.LO.svg,",").concat(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 Tr=document.createElement("img");Tr.src="data:".concat(s.LO.svg,",").concat(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 Ar=function(e,t,n,r){switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(Dr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",Dr(e).forEach((function(e){t.draw(e)}));break;case"freedraw":n.save(),n.fillStyle=e.strokeColor;var o=function(e){return Kr.get(e)}(e);n.fillStyle=e.strokeColor,n.fill(o),n.restore();break;case"image":var i,a=We(e)?null===(i=r.imageCache.get(e.fileId))||void 0===i?void 0:i.image:void 0;null==a||a instanceof Promise?function(e,t,n){t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);var r=Math.min(e.width,e.height),o=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?Tr:Mr,e.width/2-o/2,e.height/2-o/2,o,o)}(e,n,r.zoom.value):n.drawImage(a,0,0,e.width,e.height);break;default:if(!Ve(e))throw new Error("Unimplemented type ".concat(e.type));var l=_n(e.text),c=l&&!n.canvas.isConnected;c&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",l?"rtl":"ltr"),n.save(),n.font=un(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;for(var s=e.text.replace(/\r\n?/g,"\n").split("\n"),u=e.containerId?fr(un(e)):e.height/s.length,d=e.height-e.baseline,f="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,p=0;p<s.length;p++)n.fillText(s[p],f,(p+1)*u-d);n.restore(),c&&n.canvas.remove()}n.globalAlpha=1},Pr=new WeakMap,Lr=new WeakMap,Dr=function(e){return Lr.get(e)},Rr=function(e){return Lr.delete(e)},zr=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?Cr(e.strokeWidth):"dotted"===e.strokeStyle?Or(e.strokeWidth):void 0,disableMultiStroke:"solid"!==e.strokeStyle,strokeWidth:"solid"!==e.strokeStyle?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:4*e.strokeWidth,roughness:e.roughness,stroke:e.strokeColor,preserveVertices:t};switch(e.type){case"rectangle":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":return it(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"freedraw":case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},Nr=function(e,t){var n=Lr.get(e)||null;if(!n){switch(Pr.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){var r=e.width,o=e.height,i=.25*Math.min(r,o);n=t.path("M ".concat(i," 0 L ").concat(r-i," 0 Q ").concat(r," 0, ").concat(r," ").concat(i," L ").concat(r," ").concat(o-i," Q ").concat(r," ").concat(o,", ").concat(r-i," ").concat(o," L ").concat(i," ").concat(o," Q 0 ").concat(o,", 0 ").concat(o-i," L 0 ").concat(i," Q 0 0, ").concat(i," 0"),zr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,zr(e));break;case"diamond":var a=function(e){var t=Math.floor(e.width/2)+1,n=e.width,r=Math.floor(e.height/2)+1;return[t,0,n,r,t,e.height,0,r]}(e),l=h(a,8),c=l[0],s=l[1],u=l[2],d=l[3],f=l[4],p=l[5],m=l[6],g=l[7];n="round"===e.strokeSharpness?t.path("M ".concat(c+.25*(u-c)," ").concat(s+.25*(d-s)," L ").concat(u-.25*(u-c)," ").concat(d-.25*(d-s)," \n C ").concat(u," ").concat(d,", ").concat(u," ").concat(d,", ").concat(u-.25*(u-f)," ").concat(d+.25*(p-d)," \n L ").concat(f+.25*(u-f)," ").concat(p-.25*(p-d)," \n C ").concat(f," ").concat(p,", ").concat(f," ").concat(p,", ").concat(f-.25*(f-m)," ").concat(p-.25*(p-g)," \n L ").concat(m+.25*(f-m)," ").concat(g+.25*(p-g)," \n C ").concat(m," ").concat(g,", ").concat(m," ").concat(g,", ").concat(m+.25*(c-m)," ").concat(g-.25*(g-s)," \n L ").concat(c-.25*(c-m)," ").concat(s+.25*(g-s)," \n C ").concat(c," ").concat(s,", ").concat(c," ").concat(s,", ").concat(c+.25*(u-c)," ").concat(s+.25*(d-s)),zr(e,!0)):t.polygon([[c,s],[u,d],[f,p],[m,g]],zr(e));break;case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,zr(e));break;case"line":case"arrow":var v=zr(e),b=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?v.fill?[t.polygon(b,v)]:[t.linearPath(b,v)]:[t.curve(b,v)],"arrow"===e.type){var y=e.startArrowhead,x=void 0===y?null:y,w=e.endArrowhead,k=void 0===w?"arrow":w,_=function(e,n,r,o){var i=function(e,t,n,r){var o=gt(t[0]);if(o.length<1)return null;var i="start"===n?1:o.length-1,a=o[i].data,l=[a[4],a[5]],c=[a[2],a[3]],s=[a[0],a[1]],u=o[i-1],d=[0,0];"move"===u.op?d=u.data:"bcurveTo"===u.op&&(d=[u.data[4],u.data[5]]);var f=function(e,t){return Math.pow(1-e,3)*l[t]+3*e*Math.pow(1-e,2)*c[t]+3*Math.pow(e,2)*(1-e)*s[t]+d[t]*Math.pow(e,3)},p=h("start"===n?d:l,2),m=p[0],g=p[1],v=[f(.3,0),f(.3,1)],b=v[0],y=v[1],x=Math.hypot(m-b,g-y),w=(m-b)/x,k=(g-y)/x,_={arrow:30,bar:15,dot:15,triangle:15}[r],S=0;if("arrow"===r){var E=h(e.points[e.points.length-1],2),j=E[0],C=E[1],O=h(e.points.length>1?e.points[e.points.length-2]:[0,0],2),I=O[0],M=O[1];S=Math.hypot(j-I,C-M)}else for(var T=0;T<e.points.length;T++){var A=h(e.points[T-1]||[0,0],2),P=A[0],L=A[1],D=h(e.points[T],2),R=D[0],z=D[1];S+=Math.hypot(R-P,z-L)}var N=Math.min(_,S/2),B=m-w*N,H=g-k*N;if("dot"===r)return[m,g,Math.hypot(H-g,B-m)+e.strokeWidth];var F={arrow:20,bar:90,triangle:25}[r],U=h(tt(B,H,m,g,-F*Math.PI/180),2),W=U[0],K=U[1],V=h(tt(B,H,m,g,F*Math.PI/180),2);return[m,g,W,K,V[0],V[1]]}(e,n,r,o);if(null===i)return[];if("dot"===o){var a=h(i,3),l=a[0],c=a[1],s=a[2];return[t.circle(l,c,s,kr(kr({},v),{},{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){var u=h(i,6),d=u[0],f=u[1],p=u[2],m=u[3],g=u[4],b=u[5];return delete v.strokeLineDash,[t.polygon([[d,f],[p,m],[g,b],[d,f]],kr(kr({},v),{},{fill:e.strokeColor,fillStyle:"solid"}))]}var y=h(i,6),x=y[0],w=y[1],k=y[2],_=y[3],S=y[4],E=y[5];if("dotted"===e.strokeStyle){var j=Or(e.strokeWidth-1);v.strokeLineDash=[j[0],j[1]-1]}else delete v.strokeLineDash;return[t.line(k,_,x,w,v),t.line(S,E,x,w,v)]};if(null!==x){var S,E=_(e,n,"start",x);(S=n).push.apply(S,A(E))}if(null!==k){var j,C=_(e,n,"end",k);(j=n).push.apply(j,A(C))}}break;case"freedraw":Vr(e),n=[];break;case"text":case"image":n=[]}Lr.set(e,n)}},Br=function(e,t){var n=t?t.zoom:Sr.zoom,r=Pr.get(e),o=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||o||r.theme!==t.theme){var i=function(e,t,n){var r=document.createElement("canvas"),o=r.getContext("2d"),i=Ir(e),a=0,l=0;if(Ye(e)||Ge(e)){var c=h(mt(e),4),s=c[0],u=c[1],d=c[2],f=c[3];r.width=pn(s,d)*window.devicePixelRatio*t.value+i*t.value*2,r.height=pn(u,f)*window.devicePixelRatio*t.value+i*t.value*2,a=e.x>s?pn(e.x,s)*window.devicePixelRatio*t.value:0,l=e.y>u?pn(e.y,u)*window.devicePixelRatio*t.value:0,o.translate(a,l)}else r.width=e.width*window.devicePixelRatio*t.value+i*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+i*t.value*2;o.save(),o.translate(i*t.value,i*t.value),o.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);var p=Be.canvas(r);return jr(e,n)&&(o.filter=_r),Ar(e,p,o,n),o.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:l}}(e,n,t);return Pr.set(e,i),i}return r},Hr=function(e,t,n,r){var o=e.element,i=Ir(o),a=h(mt(o),4),l=a[0],c=a[1],s=a[2],u=a[3];Ge(o)&&(l=Math.floor(l),s=Math.ceil(s),c=Math.floor(c),u=Math.ceil(u));var d=((l+s)/2+r.scrollX)*window.devicePixelRatio,f=((c+u)/2+r.scrollY)*window.devicePixelRatio,p=Er(o,r),m="scale"in e.element&&!p?e.element.scale[0]:1,g="scale"in e.element&&!p?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*m,1/window.devicePixelRatio*g),n.translate(d*m,f*g),n.rotate(o.angle*m*g),n.drawImage(e.canvas,-(s-l)/2*window.devicePixelRatio-i*e.canvasZoom/e.canvasZoom,-(u-c)/2*window.devicePixelRatio-i*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},Fr=function(e,t,n,r){var o=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(Nr(e,o),r.isExporting){var i=Br(e,r);Hr(i,0,n,r)}else{var a=h(mt(e),4),l=a[0],c=a[1],s=a[2],u=a[3],d=(l+s)/2+r.scrollX,f=(c+u)/2+r.scrollY,p=(s-l)/2-(e.x-l),m=(u-c)/2-(e.y-c);n.save(),n.translate(d,f),n.rotate(e.angle),n.translate(-p,-m),Ar(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Nr(e,o),r.isExporting){var g=h(mt(e),4),v=g[0],b=g[1],y=g[2],x=g[3],w=(v+y)/2+r.scrollX,k=(b+x)/2+r.scrollY,_=(y-v)/2-(e.x-v),S=(x-b)/2-(e.y-b);n.save(),n.translate(w,k),n.rotate(e.angle),n.translate(-_,-S),jr(e,r)&&(n.filter="none"),Ar(e,t,n,r),n.restore()}else{var E=Br(e,r);Hr(E,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Ur=function(e,t,n){if(void 0===n)return e.draw(t);var r={sets:t.sets,shape:t.shape,options:kr(kr({},t.options),{},{fixedDecimalPlaceDigits:n})};return e.draw(r)},Wr=function(e,t,n,r,o,i,a){var l=h(mt(e),4),c=l[0],u=l[1],d=l[2],f=l[3],p=(d-c)/2-(e.x-c),m=(f-u)/2-(e.y-u),g=180*e.angle/Math.PI,v=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":Nr(e,v);var b=Ur(t,Dr(e),s.zK),y=e.opacity/100;1!==y&&(b.setAttribute("stroke-opacity","".concat(y)),b.setAttribute("fill-opacity","".concat(y))),b.setAttribute("stroke-linecap","round"),b.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")")),n.appendChild(b);break;case"line":case"arrow":Nr(e,v);var x=n.ownerDocument.createElementNS(s.hR,"g"),w=e.opacity/100;x.setAttribute("stroke-linecap","round"),Dr(e).forEach((function(n){var r=Ur(t,n,s.zK);1!==w&&(r.setAttribute("stroke-opacity","".concat(w)),r.setAttribute("fill-opacity","".concat(w))),r.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")")),"line"===e.type&&it(e.points)&&"transparent"!==e.backgroundColor&&r.setAttribute("fill-rule","evenodd"),x.appendChild(r)})),n.appendChild(x);break;case"freedraw":Vr(e);var k=e.opacity/100,_=n.ownerDocument.createElementNS(s.hR,"g");1!==k&&(_.setAttribute("stroke-opacity","".concat(k)),_.setAttribute("fill-opacity","".concat(k))),_.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")"));var S=n.ownerDocument.createElementNS(s.hR,"path");_.setAttribute("stroke","none"),_.setAttribute("fill",e.strokeColor),S.setAttribute("d",Gr(e)),_.appendChild(S),n.appendChild(_);break;case"image":var E=We(e)&&r[e.fileId];if(E){var j="image-".concat(E.id),C=n.querySelector("#".concat(j));if(!C){(C=n.ownerDocument.createElementNS(s.hR,"symbol")).id=j;var O=n.ownerDocument.createElementNS(s.hR,"image");O.setAttribute("width","100%"),O.setAttribute("height","100%"),O.setAttribute("href",E.dataURL),C.appendChild(O),n.prepend(C)}var I=n.ownerDocument.createElementNS(s.hR,"use");I.setAttribute("href","#".concat(j)),a&&E.mimeType!==s.LO.svg&&I.setAttribute("filter",_r),I.setAttribute("width","".concat(Math.round(e.width))),I.setAttribute("height","".concat(Math.round(e.height))),I.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")")),n.appendChild(I)}break;default:if(!Ve(e))throw new Error("Unimplemented type ".concat(e.type));var M=e.opacity/100,T=n.ownerDocument.createElementNS(s.hR,"g");1!==M&&(T.setAttribute("stroke-opacity","".concat(M)),T.setAttribute("fill-opacity","".concat(M))),T.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")"));for(var A=e.text.replace(/\r\n?/g,"\n").split("\n"),P=e.height/A.length,L=e.height-e.baseline,D="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,R=_n(e.text)?"rtl":"ltr",z="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===R?"end":"start",N=0;N<A.length;N++){var B=n.ownerDocument.createElementNS(s.hR,"text");B.textContent=A[N],B.setAttribute("x","".concat(D)),B.setAttribute("y","".concat((N+1)*P-L)),B.setAttribute("font-family",sn(e)),B.setAttribute("font-size","".concat(e.fontSize,"px")),B.setAttribute("fill",e.strokeColor),B.setAttribute("text-anchor",z),B.setAttribute("style","white-space: pre;"),B.setAttribute("direction",R),T.appendChild(B)}n.appendChild(T)}},Kr=new WeakMap([]);function Vr(e){var t=Gr(e),n=new Path2D(t);return Kr.set(e,n),n}function Gr(e){var t=e.simulatePressure?e.points:e.points.length?e.points.map((function(t,n){var r=h(t,2);return[r[0],r[1],e.pressures[n]]})):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:function(e){return Math.sin(e*Math.PI/2)},last:!!e.lastCommittedPoint};return function(e){if(!e.length)return"";var t=e.length-1;return e.reduce((function(e,n,r,o){return r===t?e.push(n,Zr(n,o[0]),"L",o[0],"Z"):e.push(n,Zr(n,o[r+1])),e}),["M",e[0],"Q"]).join(" ").replace(Yr,"$1")}(tr(t,n))}function Zr(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var Yr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;var qr=new Q(Date.now()),Xr=0,$r=function(){return Math.floor(qr.next()*Math.pow(2,31))},Qr=function(){return Mn()?"id".concat(Xr++):Ue()};function Jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function eo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jr(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var to=function(e,t){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!1,i=t,a=i.points,l=i.fileId;for(var c in void 0!==a&&(t=eo(eo({},dt(a)),t)),t){var s=t[c];if(void 0!==s){if(e[c]===s&&("object"!==T(s)||null===s||"groupIds"===c||"scale"===c))continue;if("scale"===c){var u=e[c],d=s;if(u[0]===d[0]&&u[1]===d[1])continue}else if("points"===c){var f=e[c],p=s;if(f.length===p.length){for(var h=!1,m=f.length;--m;){var g=f[m],v=p[m];if(g[0]!==v[0]||g[1]!==v[1]){h=!0;break}}if(!h)continue}}e[c]=s,o=!0}}if(!o)return e;(void 0===t.height&&void 0===t.width&&void 0===l&&void 0===a||Rr(e),e.version++,e.versionNonce=$r(),e.updated=On(),r)&&(null===(n=ar.getScene(e))||void 0===n||n.informMutation());return e},no=function(e,t){var n=!1;for(var r in t){var o=t[r];if(void 0!==o){if(e[r]===o&&("object"!==T(o)||null===o))continue;n=!0}}return n?eo(eo(eo({},e),t),{},{updated:On(),version:e.version+1,versionNonce:$r()}):e},ro=function(e,t){return e.version=(null!=t?t:e.version)+1,e.versionNonce=$r(),e.updated=On(),e},oo=function(e){return Ye(e)||Ge(e)?e.points.length<2:0===e.width&&0===e.height},io=function(e,t,n){var r=Math.abs(t),o=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){var i=Math.round(Math.atan(o/r)/s.ay)*s.ay;0===i?n=0:i===Math.PI/2?t=0:n=Math.round(r*Math.tan(i))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},ao=function(e){var t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){var n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){var r=Math.abs(e.height);t.height=r,t.y=e.y-r}return t};function lo(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function co(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return so(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return so(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function so(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var po=function(e,t,n){var r=n.filter((function(t){return t.groupIds.includes(e)}));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?fo(fo({},t),{},{selectedGroupIds:fo(fo({},t.selectedGroupIds),{},P({},e,!1)),editingGroupId:null}):t:fo(fo({},t),{},{selectedGroupIds:fo(fo({},t.selectedGroupIds),{},P({},e,!0)),selectedElementIds:fo(fo({},t.selectedElementIds),Object.fromEntries(r.map((function(e){return[e.id,!0]}))))})},ho=function(e,t){return null!=mo(e,t)},mo=function(e,t){return t.groupIds.filter((function(t){return t!==e.editingGroupId})).find((function(t){return e.selectedGroupIds[t]}))},go=function(e){return Object.entries(e.selectedGroupIds).filter((function(e){var t=h(e,2);t[0];return t[1]})).map((function(e){var t=h(e,2),n=t[0];t[1];return n}))},vo=function(e,t){var n=fo(fo({},e),{},{selectedGroupIds:{}}),r=Yc(t,e);if(!r.length)return fo(fo({},n),{},{editingGroupId:null});var o,i=co(r);try{for(i.s();!(o=i.n()).done;){var a=o.value.groupIds;if(e.editingGroupId){var l=a.indexOf(e.editingGroupId);l>-1&&(a=a.slice(0,l))}if(a.length>0){var c=a[a.length-1];n=po(c,n,t)}}}catch(e){i.e(e)}finally{i.f()}return n},bo=function(e,t){return e.groupIds.includes(t)},yo=function(e,t){return e.filter((function(e){return bo(e,t)}))},xo=function(e,t,n){var r=A(e),o=n?r.indexOf(n):-1,i=o>-1?o:r.length;return r.splice(i,0,t),r},wo=function(e){var t=new Map;return e.forEach((function(e){var n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[],o=br(e);if(o){var i=ar.getScene(e).getElement(o);r.push(i)}t.set(n,[].concat(A(r),[e]))})),Array.from(t.values())},ko=["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements"];function _o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function So(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_o(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Eo=function(e,t){var n,r,o=t.x,i=t.y,a=t.strokeColor,l=t.backgroundColor,c=t.fillStyle,s=t.strokeWidth,u=t.strokeStyle,d=t.roughness,f=t.opacity,p=t.width,h=void 0===p?0:p,m=t.height,g=void 0===m?0:m,v=t.angle,b=void 0===v?0:v,y=t.groupIds,x=void 0===y?[]:y,w=t.strokeSharpness,k=t.boundElements,_=void 0===k?null:k,S=lo(t,ko);return{id:S.id||Qr(),type:e,x:o,y:i,width:h,height:g,angle:b,strokeColor:a,backgroundColor:l,fillStyle:c,strokeWidth:s,strokeStyle:u,roughness:d,opacity:f,groupIds:x,strokeSharpness:w,seed:null!==(n=S.seed)&&void 0!==n?n:$r(),version:S.version||1,versionNonce:null!==(r=S.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:_,updated:On()}},jo=function(e){return Eo(e.type,e)},Co=function(e,t){return{x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}},Oo=function(e){var t=ur(e.text,un(e)),n=Co(e,t);return no(So(So({},Eo("text",e)),{},{text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,textAlign:e.textAlign,verticalAlign:e.verticalAlign,x:e.x-n.x,y:e.y-n.y,width:t.width,height:t.height,baseline:t.baseline,containerId:e.containerId||null,originalText:e.text}),{})},Io=function(e,t){var n=t.text,r=t.isDeleted,o=t.originalText,i=xr(e);i&&(n=hr(n,un(e),i.width));var a=function(e,t){var n=null,r=xr(e);r&&(n=r.width-2*s.gK);var o,i,a=ur(t,un(e),n),l=a.width,c=a.height,u=a.baseline,d=e.textAlign,f=e.verticalAlign;if("center"!==d||"middle"!==f||e.containerId){var p=h(mt(e),4),m=p[0],g=p[1],v=p[2],b=p[3],y=h(_t(e,l,c),4),x=(m-y[0])/2,w=(g-y[1])/2,k=(v-y[2])/2,_=(b-y[3])/2,S=h(rt({s:!0,e:"center"===d||"left"===d,w:"center"===d||"right"===d},e.x,e.y,e.angle,x,w,k,_),2);o=S[0],i=S[1]}else{var E=ur(e.text,un(e),n),j=Co(e,{width:l-E.width,height:c-E.height});o=e.x-j.x,i=e.y-j.y}if(et(e)){var C=xr(e),O=C.height,I=C.width;c>O-2*s.gK&&(O=c+2*s.gK),l>I-2*s.gK&&(I=l+2*s.gK),O===C.height&&I===C.width||to(C,{height:O,width:I})}return{width:l,height:c,x:Number.isFinite(o)?o:e.x,y:Number.isFinite(i)?i:e.y,baseline:u}}(e,n);return no(e,So({text:n,originalText:o,isDeleted:null!=r?r:e.isDeleted},a))},Mo=function(e){return So(So({},Eo(e.type,e)),{},{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead})},To=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==t||"object"!==T(t))return t;if("[object Object]"===Object.prototype.toString.call(t)){var r="function"==typeof t.constructor?Object.create(Object.getPrototypeOf(t)):{};for(var o in t)if(t.hasOwnProperty(o)){if(0===n&&("shape"===o||"canvas"===o))continue;r[o]=e(t[o],n+1)}return r}if(Array.isArray(t)){for(var i=t.length,a=new Array(i);i--;)a[i]=e(t[i],n+1);return a}return t},Ao=function(e,t,n,r){var o,i,a=To(n);Mn()?(a.id="".concat(a.id,"_copy"),null!==(o=window.h)&&void 0!==o&&null!==(i=o.app)&&void 0!==i&&i.getSceneElementsIncludingDeleted().find((function(e){return e.id===a.id}))&&(a.id+="_copy")):a.id=Qr();return a.updated=On(),a.seed=$r(),a.groupIds=function(e,t,n){for(var r=A(e),o=t?e.indexOf(t):-1,i=o>-1?o:e.length,a=0;a<i;a++)r[a]=n(r[a]);return r}(a.groupIds,e,(function(e){return t.has(e)||t.set(e,Qr()),t.get(e)})),r&&(a=Object.assign(a,r)),a},Po={mouse:8,pen:16,touch:28},Lo={e:!0,s:!0,n:!0,w:!0},Do={e:!0,s:!0,n:!0,w:!0},Ro={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},zo={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},No=function(e,t,n,r,o,i,a){var l=h(tt(e+n/2,t+r/2,o,i,a),2);return[l[0]-n/2,l[1]-r/2,n,r]},Bo=function(e,t,n,r){var o=h(e,4),i=o[0],a=o[1],l=o[2],c=o[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u=Po[r],d=u/n.value,f=u/n.value,p=u/n.value,m=u/n.value,g=l-i,v=c-a,b=(i+l)/2,y=(a+c)/2,x=4/n.value,w=(u-8)/(2*n.value),k={nw:s.nw?void 0:No(i-x-p+w,a-x-m+w,d,f,b,y,t),ne:s.ne?void 0:No(l+x-w,a-x-m+w,d,f,b,y,t),sw:s.sw?void 0:No(i-x-p+w,c+x-w,d,f,b,y,t),se:s.se?void 0:No(l+x-w,c+x-w,d,f,b,y,t),rotation:s.rotation?void 0:No(i+g/2-d/2,a-x-m+w-16/n.value,d,f,b,y,t)},_=5*Po.mouse/n.value;return Math.abs(g)>_&&(s.n||(k.n=No(i+g/2-d/2,a-x-m+w,d,f,b,y,t)),s.s||(k.s=No(i+g/2-d/2,c+x-w,d,f,b,y,t))),Math.abs(v)>_&&(s.w||(k.w=No(i-x-p+w,a+v/2-f/2,d,f,b,y,t)),s.e||(k.e=No(l+x-w,a+v/2-f/2,d,f,b,y,t))),k},Ho=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"freedraw"===e.type){if(2===e.points.length){var o=h(e.points,2),i=o[1];0===i[0]||0===i[1]?r=zo:i[0]>0&&i[1]<0?r=Ro:i[0]>0&&i[1]>0?r=zo:i[0]<0&&i[1]>0?r=Ro:i[0]<0&&i[1]<0&&(r=zo)}}else Ve(e)&&(r=Do);return Bo(mt(e),e.angle,t,n,r)},Fo=function(e,t){return[0,0,0,0,t,e,1,0]},Uo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Wo=function(e){return[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]]},Ko=function(e,t){return Qo(t)?[e[0]-t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3],e[4]-t[4],e[5]-t[5],e[6]-t[6],e[7]-t[7]]},Vo=function(e,t){return Qo(t)?[e[0]*t,e[1]*t,e[2]*t,e[3]*t,e[4]*t,e[5]*t,e[6]*t,e[7]*t]:[Go(e,t),t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[7]*e[3]+t[0]*e[4]+t[6]*e[5]-t[5]*e[6]+t[3]*e[7],t[5]*e[0]-t[3]*e[1]+t[7]*e[2]+t[1]*e[3]-t[6]*e[4]+t[0]*e[5]+t[4]*e[6]+t[2]*e[7],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]+t[0]*e[7]]},Go=function(e,t){return t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6]},Zo=function(e,t){return[Yo(e,t),e[1]*t[7]+e[4]*t[5]-e[5]*t[4]+e[7]*t[1],e[2]*t[7]-e[4]*t[6]+e[6]*t[4]+e[7]*t[2],e[3]*t[7]+e[5]*t[6]-e[6]*t[5]+e[7]*t[3],e[4]*t[7]+e[7]*t[4],e[5]*t[7]+e[7]*t[5],e[6]*t[7]+e[7]*t[6],e[7]*t[7]]},Yo=function(e,t){return e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0]},qo=function(e){return Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6]))},Xo=function(e){var t=qo(e);if(0===t||1===t)return e;var n=e[6]<0?-1:1;return Vo(e,n/t)},$o=function(e){var t=function(e){return Math.sqrt(Math.abs(e[7]*e[7]-e[5]*e[5]-e[4]*e[4]+e[1]*e[1]))}(e);return 0===t||1===t?e:Vo(e,1/t)},Qo=function(e){return"number"==typeof e},Jo=(Uo(1,1),Uo(1,2),Uo(1,3),Uo(1,4),Uo(1,5),Uo(1,6),Uo(1,7),function(e,t,n){return Xo([0,n,e,t,0,0,0,0])}),ei=function(e,t){return Xo(Zo(t,e))},ti=function(e,t){return function(e,t){return[t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[7]*e[3]+t[0]*e[4]+t[3]*e[7],t[5]*e[0]+t[7]*e[2]+t[0]*e[5]+t[2]*e[7],t[6]*e[0]+t[0]*e[6],t[7]*e[0]+t[0]*e[7]]}(e,t)},ni=function(e){var t=h(e,2),n=t[0];return[0,0,0,0,t[1],n,1,0]},ri=function(e){return[e[5],e[4]]},oi=function(e,t){return Xo(function(e,t){return[t[0]*e[0],t[1]*e[0]+t[0]*e[1],t[2]*e[0]+t[0]*e[2],t[3]*e[0]+t[0]*e[3],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[0]*e[4],t[5]*e[0]-t[3]*e[1]+t[1]*e[3]+t[0]*e[5],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]]}(e,t))},ii=function(e,t){return qo(Zo(e,t))},ai=function(e,t){return Yo(e,t)},li=function(e){return[0,0,0,0,e[4],e[5],0,0]},ci=function(e,t){return function(e,t){return Qo(t)?[e[0]+t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]+t[0],e[1]+t[1],e[2]+t[2],e[3]+t[3],e[4]+t[4],e[5]+t[5],e[6]+t[6],e[7]+t[7]]}(Vo(e,Math.sin(t/2)),Math.cos(t/2))},si=function(e,t){return Xo(Vo(Vo(e,t),Wo(e)))};function ui(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return di(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return di(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function di(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fi=function(e,t,n,r){var o=10/t.zoom.value,i=[n,r];return mi(t,e)?gi(e,i,o):hi(e,t,i)},pi=function(e,t,n,r){var o=10/t.zoom.value;return!hi(e,t,[n,r])&&gi(e,[n,r],o)},hi=function(e,t,n){var r=10/t.zoom.value,o=Ve(e)?wi:function(e){if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;var t=!jn(e.backgroundColor)||Je(e);return"line"===e.type?t&&it(e.points):t||Ke(e)}(e)?ki:_i;return yi({element:e,point:n,threshold:r,check:o})},mi=function(e,t){return e.selectedElementIds[t.id]},gi=function(e,t,n){var r=h(t,2),o=r[0],i=r[1],a=h(mt(e),4),l=a[0],c=a[1],s=a[2],u=a[3],d=h(tt(o,i,(l+s)/2,(c+u)/2,-e.angle),2),f=d[0],p=d[1];return f>l-n&&f<s+n&&p>c-n&&p<u+n},vi=function(e,t){var n=t.x,r=t.y,o=bi(e,e.width,e.height);return yi({element:e,point:[n,r],threshold:o,check:Si})},bi=function(e,t,n){var r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},yi=function(e){switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":var t=xi(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(Ei(e.element,e.point),e.threshold)&&Ii(e.element,e.point,e.threshold);case"arrow":case"line":return Mi(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},xi=function(e,t){switch(e.type){case"rectangle":case"image":case"text":return Ei(e,t);case"diamond":return ji(e,t);case"ellipse":return Ci(e,t)}},wi=function(e,t){return e<0},ki=function(e,t){return e<t},_i=function(e,t){return Math.abs(e)<t},Si=function(e,t){return 0<=e&&e<t},Ei=function(e,t){var n=h(Ti(e,t),4),r=n[1],o=n[2],i=n[3];return Math.max(ai(r,Jo(0,1,-i)),ai(r,Jo(1,0,-o)))},ji=function(e,t){var n=h(Ti(e,t),4),r=n[1],o=n[2],i=n[3],a=Jo(i,o,-i*o);return ai(r,a)},Ci=function(e,t){var n=h(Oi(e,t),2),r=n[0],o=n[1];return-function(e){return Math.sign(e[1])}(o)*ai(r,o)},Oi=function(e,t){var n=h(Ti(e,t),4),r=n[1],o=n[2],i=n[3],a=h(ri(r),2),l=a[0],c=a[1],s=.707,u=.707,d=o,f=i;[0,1,2,3].forEach((function(e){var t=d*s,n=f*u,r=(d*d-f*f)*Math.pow(s,3)/d,o=(f*f-d*d)*Math.pow(u,3)/f,i=t-r,a=n-o,p=l-r,h=c-o,m=Math.hypot(a,i),g=Math.hypot(h,p);s=Math.min(1,Math.max(0,(p*m/g+r)/d)),u=Math.min(1,Math.max(0,(h*m/g+o)/f));var v=Math.hypot(u,s);s/=v,u/=v}));var p,m=Fo(d*s,f*u);return[r,ti(ei(r,p=m),p)]},Ii=function(e,t,n){var r,o;if(0===e.angle)r=t[0]-e.x,o=t[1]-e.y;else{var i=h(mt(e),4),a=i[0],l=i[1],c=i[2],s=i[3],u=nt(t,[a+(c-a)/2,l+(s-l)/2],-e.angle);r=u[0]-e.x,o=u[1]-e.y}var d,f=h(e.points,2),p=f[0],m=f[1];if(ot(p[0],p[1],r,o)<n||ot(m[0],m[1],r,o)<n)return!0;for(var g=0;g<e.points.length;g++){var v=[m[0]-p[0],m[1]-p[1]],b=Math.hypot(v[1],v[0]),y=[v[0]/b,v[1]/b],x=[r-p[0],o-p[1]],w=(x[0]*y[0]+x[1]*y[1])/Math.hypot(y[1],y[0]);d=[p[0]+y[0]*w,p[1]+y[1]*w];var k=ot(d[0],d[1],p[0],p[1]),_=ot(d[0],d[1],m[0],m[1]);if(d=_<k&&k>b?m:k<_&&_>b?p:d,Math.hypot(o-d[1],r-d[0])<n)return!0;p=m,m=e.points[g+1]}return!1},Mi=function(e){var t=e.element,n=e.threshold;if(!Dr(t))return!1;var r=h(Ti(e.element,e.point),4),o=r[0],i=r[1],a=r[2],l=r[3],c=Jo(0,1,-l),s=Jo(1,0,-a);if(!ki(ai(i,c),n)||!ki(ai(i,s),n))return!1;var u=h(ri(o),2),d=u[0],f=u[1],p=Dr(t);if(e.check===ki&&p.some((function(e){return Wi(e,d,f,t.strokeSharpness)})))return!0;return p.some((function(e){return Ki(e,d,f,n)}))},Ti=function(e,t){var n=ni(t),r=mt(e),o=Pi(r),i=ci(o,e.angle),a=si(i,n),l=function(e){return[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0]}(Ko(a,li(o))),c=function(e,t){return[0,0,0,0,t,e,0,0]}(e.x,e.y),s=Ko(a,c),u=h(r,4),d=u[0],f=u[1];return[s,l,(u[2]-d)/2,(u[3]-f)/2]},Ai=function(e){var t=mt(e),n=Pi(t),r=ci(n,e.angle),o=Wo(function(e){return[1,0,0,0,-.5*e[5],.5*e[4],0,0]}(li(n)));return Vo(o,r)},Pi=function(e){var t=h(e,4),n=t[0],r=t[1],o=t[2],i=t[3];return Fo((n+o)/2,(r+i)/2)},Li=function(e,t,n){var r=Ai(e),o=si(r,ni(t)),i=si(r,ni(n)),a=ei(o,i),l=e.height/e.width,c=e.width/2,s=e.height/2,u=a[2],d=a[3],f=a[1],p=Math.abs(d),h=Math.abs(u);switch(e.type){case"rectangle":case"image":case"text":return f/(c*(h+l*p));case"diamond":return p<h?f/(h*c):f/(p*s);case"ellipse":return f/(c*Math.sqrt(Math.pow(u,2)+Math.pow(l,2)*Math.pow(d,2)))}},Di=function(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":var i=Ri(e);r=i.flatMap((function(e,n){var r=[e,i[(n+1)%4]];return zi(t,Ni(r,o))})).concat(i.flatMap((function(e){return Hi(e,o,t)})));break;case"ellipse":r=Bi(e,o,t)}if(r.length<2)return[];var a=r.sort((function(e,t){return ii(e,n)-ii(t,n)}));return[a[0],a[a.length-1]]},Ri=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[Fo(n,r),Fo(n,-r),Fo(-n,-r),Fo(-n,r)];case"diamond":return[Fo(0,r),Fo(n,0),Fo(0,-r),Fo(-n,0)]}},zi=function(e,t){var n=h(t,2),r=n[0],o=n[1];return ai(r,e)*ai(o,e)>=0?[]:[oi(e,ei(r,o))]},Ni=function(e,t){var n=h(e,2),r=n[0],o=n[1],i=function(e,t){var n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]}(function(e,t){return $o([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0])}(r,o),t);return[si(i,r),si(i,o)]},Bi=function(e,t,n){var r=e.width/2+t,o=e.height/2+t,i=n[2],a=n[3],l=n[1],c=r*r*i*i+o*o*a*a,s=c-l*l;if(0===c||s<=0)return[];var u=Math.sqrt(s),d=-r*r*i*l,f=-o*o*a*l;return[Fo((d+r*o*a*u)/c,(f-r*o*i*u)/c),Fo((d-r*o*a*u)/c,(f+r*o*i*u)/c)]},Hi=function(e,t,n){if(0===t)return 0===ai(n,e)?[e]:[];var r=n[2],o=n[3],i=n[1],a=h(ri(e),2),l=a[0],c=a[1],s=r*r+o*o,u=t*t*s-Math.pow(r*l+o*c+i,2);if(0===s||u<=0)return[];var d=Math.sqrt(u),f=l*o*o-c*r*o-r*i,p=c*r*r-l*r*o-o*i;return[Fo((f+o*d)/s,(p-r*d)/s),Fo((f-o*d)/s,(p+r*d)/s)]},Fi=function(e,t,n){var r=Math.abs(t),o=e.width*r/2,i=e.height*r/2,a=Math.sign(t),l=h(ri(n),2),c=l[0],s=l[1],u=0===s?1e-4:s,d=Math.pow(c,2)*Math.pow(i,2)+Math.pow(u,2)*Math.pow(o,2),f=(-c*Math.pow(i,2)+a*u*Math.sqrt(Math.max(0,d-Math.pow(o,2)*Math.pow(i,2))))/d,p=(-f*c-1)/u,m=-Math.pow(o,2)*f/(Math.pow(p,2)*Math.pow(i,2)+Math.pow(f,2)*Math.pow(o,2));return Fo(m,(-f*m-1)/p)},Ui=function(e,t,n){var r=Math.abs(t),o=Math.sign(t),i=Ri(e,r),a=0,l=null;return i.forEach((function(e){var t=o*ei(n,e)[1];t>a&&(a=t,l=e)})),l},Wi=function(e,t,n,r){var o,i=[],a=!1,l=ui(gt(e));try{for(l.s();!(o=l.n()).done;){var c=o.value;"move"===c.op?(a=!a)&&i.push([c.data[0],c.data[1]]):"bcurveTo"===c.op&&a&&(i.push([c.data[0],c.data[1]]),i.push([c.data[2],c.data[3]]),i.push([c.data[4],c.data[5]]))}}catch(e){l.e(e)}finally{l.f()}if(i.length>=4){if("sharp"===r)return at(i,t,n);var s=Pe(i,10,5);return at(s,t,n)}return!1},Ki=function(e,t,n,r){var o=gt(e),i=[0,0];return o.some((function(e,o){var a=e.op,l=e.data;if("move"===a)i=l;else if("bcurveTo"===a){var c=[l[0],l[1]],s=[l[2],l[3]],u=[l[4],l[5]],d=i;i=u;var f=function(e,t,n,r,o,i){for(var a=h(o,2),l=a[0],c=a[1],s=function(o,i){return Math.pow(1-o,3)*r[i]+3*o*Math.pow(1-o,2)*n[i]+3*Math.pow(o,2)*(1-o)*t[i]+e[i]*Math.pow(o,3)},u=0;u<=1;){var d=s(u,0),f=s(u,1);if(Math.sqrt(Math.pow(d-l,2)+Math.pow(f-c,2))<i)return!0;u+=.01}return!1}(d,c,s,u,[t,n],r);return f}return!1}))},Vi=["rotation"],Gi=function(e,t,n){return t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3]},Zi=function(e,t,n,r,o,i){return e.reduce((function(e,a){if(e)return e;var l=function(e,t,n,r,o,i){if(!t.selectedElementIds[e.id])return!1;var a=Ho(e,o,i),l=a.rotation,c=lo(a,Vi);if(l&&Gi(l,n,r))return"rotation";var s=Object.keys(c).filter((function(e){var t=c[e];return!!t&&Gi(t,n,r)}));return s.length>0&&s[0]}(a,t,n,r,o,i);return l?{element:a,transformHandleType:l}:null}),null)},Yi=function(e,t,n,r,o){var i=h(e,4),a=i[0],l=i[1],c=i[2],s=i[3],u=Bo([a,l,c,s],0,r,o,Lo);return Object.keys(u).find((function(e){var r=u[e];return r&&Gi(r,t,n)}))||!1},qi=["ns","nesw","ew","nwse"],Xi=function(e){var t=e.element,n=e.transformHandleType,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1,o=null;switch(n){case"n":case"s":o="ns";break;case"w":case"e":o="ew";break;case"nw":case"se":o=r?"nesw":"nwse";break;case"ne":case"sw":o=r?"nwse":"nesw";break;case"rotation":return"grab"}return o&&t&&(o=function(e,t){var n=qi.indexOf(e);if(n>=0){var r=Math.round(t/(Math.PI/4));e=qi[(n+r)%qi.length]}return e}(o,t.angle)),o?"".concat(o,"-resize"):""};function $i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Qi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qi(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Qi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ji(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ji(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ji(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ta=function(){function e(t,n){L(this,e),this.elementId=t.id,ar.mapElementToScene(this.elementId,n),e.normalizePoints(t),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1}}return R(e,null,[{key:"getElement",value:function(e){var t,n=null===(t=ar.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null}},{key:"handleBoxSelection",value:function(t,n,r){var o;if(!n.editingLinearElement||"selection"!==(null===(o=n.draggingElement)||void 0===o?void 0:o.type))return!1;var i=n.editingLinearElement,a=i.selectedPointsIndices,l=i.elementId,c=e.getElement(l);if(!c)return!1;var s=h(mt(n.draggingElement),4),u=s[0],d=s[1],f=s[2],p=s[3],m=e.getPointsGlobalCoordinates(c).reduce((function(e,n,r){return(n[0]>=u&&n[0]<=f&&n[1]>=d&&n[1]<=p||t.shiftKey&&null!=a&&a.includes(r))&&e.push(r),e}),[]);r({editingLinearElement:ea(ea({},i),{},{selectedPointsIndices:m.length?m:null})})}},{key:"handlePointDragging",value:function(t,n,r,o,i){if(!t.editingLinearElement)return!1;var a=t.editingLinearElement,l=a.selectedPointsIndices,c=a.elementId,s=a.isDragging,u=e.getElement(c);if(!u)return!1;var d=u.points[a.pointerDownState.lastClickedPoint];if(l&&d){!1===s&&n({editingLinearElement:ea(ea({},a),{},{isDragging:!0})});var f=e.createPointAt(u,r-a.pointerOffset.x,o-a.pointerOffset.y,t.gridSize),p=f[0]-d[0],h=f[1]-d[1];if(e.movePoints(u,l.map((function(n){return{index:n,point:n===a.pointerDownState.lastClickedPoint?e.createPointAt(u,r-a.pointerOffset.x,o-a.pointerOffset.y,t.gridSize):[u.points[n][0]+p,u.points[n][1]+h],isDragging:n===a.pointerDownState.lastClickedPoint}}))),Xe(u)){var m=[];0===l[0]&&m.push(Sn(e.getPointGlobalCoordinates(u,u.points[0])));var g=l[l.length-1];g===u.points.length-1&&m.push(Sn(e.getPointGlobalCoordinates(u,u.points[g]))),m.length&&i(u,m)}return!0}return!1}},{key:"handlePointerUp",value:function(t,n,r){var o,i=n.elementId,a=n.selectedPointsIndices,l=n.isDragging,c=n.pointerDownState,s=e.getElement(i);if(!s)return n;var u={};if(l&&a){var d,f=$i(a);try{for(f.s();!(d=f.n()).done;){var p=d.value;if(0===p||p===s.points.length-1){it(s.points,r.zoom.value)&&e.movePoints(s,[{index:p,point:0===p?s.points[s.points.length-1]:s.points[0]}]);var h=oa(r)?ma(Sn(e.getPointAtIndexGlobalCoordinates(s,p)),ar.getScene(s)):null;u[0===p?"startBindingElement":"endBindingElement"]=h}}}catch(e){f.e(e)}finally{f.f()}}return ea(ea(ea({},n),u),{},{selectedPointsIndices:l||t.shiftKey?!l&&t.shiftKey&&null!==(o=c.prevSelectedPointsIndices)&&void 0!==o&&o.includes(c.lastClickedPoint)?a&&a.filter((function(e){return e!==c.lastClickedPoint})):a:null!=a&&a.includes(c.lastClickedPoint)?[c.lastClickedPoint]:a,isDragging:!1,pointerOffset:{x:0,y:0}})}},{key:"handlePointerDown",value:function(t,n,r,o,i){var a,l={didAddPoint:!1,hitElement:null};if(!n.editingLinearElement)return l;var c=n.editingLinearElement.elementId,s=e.getElement(c);if(!s)return l;if(t.altKey)return null==n.editingLinearElement.lastUncommittedPoint&&to(s,{points:[].concat(A(s.points),[e.createPointAt(s,i.x,i.y,n.gridSize)])}),o.resumeRecording(),r({editingLinearElement:ea(ea({},n.editingLinearElement),{},{pointerDownState:{prevSelectedPointsIndices:n.editingLinearElement.selectedPointsIndices,lastClickedPoint:-1},selectedPointsIndices:[s.points.length-1],lastUncommittedPoint:null,endBindingElement:ma(i,ar.getScene(s))})}),l.didAddPoint=!0,l;var u=e.getPointIndexUnderCursor(s,n.zoom,i.x,i.y);if(u>-1)l.hitElement=s;else{var d=n.editingLinearElement,f=d.startBindingElement,p=d.endBindingElement;oa(n)&&Xe(s)&&ia(s,f,p)}var m=h(mt(s),4),g=m[0],v=m[1],b=(g+m[2])/2,y=(v+m[3])/2,x=u>-1&&tt(s.x+s.points[u][0],s.y+s.points[u][1],b,y,s.angle),w=u>-1||t.shiftKey?t.shiftKey||null!==(a=n.editingLinearElement.selectedPointsIndices)&&void 0!==a&&a.includes(u)?na([].concat(A(n.editingLinearElement.selectedPointsIndices||[]),[u])):[u]:null;return r({editingLinearElement:ea(ea({},n.editingLinearElement),{},{pointerDownState:{prevSelectedPointsIndices:n.editingLinearElement.selectedPointsIndices,lastClickedPoint:u},selectedPointsIndices:w,pointerOffset:x?{x:i.x-x[0],y:i.y-x[1]}:{x:0,y:0}})}),l}},{key:"handlePointerMove",value:function(t,n,r,o,i){var a=o.elementId,l=o.lastUncommittedPoint,c=e.getElement(a);if(!c)return o;var s=c.points,u=s[s.length-1];if(!t.altKey)return u===l&&e.deletePoints(c,[s.length-1]),ea(ea({},o),{},{lastUncommittedPoint:null});var d=e.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,i);return u===l?e.movePoints(c,[{index:c.points.length-1,point:d}]):e.addPoints(c,[{point:d}]),ea(ea({},o),{},{lastUncommittedPoint:c.points[c.points.length-1]})}},{key:"getPointGlobalCoordinates",value:function(e,t){var n=h(mt(e),4),r=n[0],o=n[1],i=(r+n[2])/2,a=(o+n[3])/2,l=e.x,c=e.y,s=h(tt(l+t[0],c+t[1],i,a,e.angle),2);return[l=s[0],c=s[1]]}},{key:"getPointsGlobalCoordinates",value:function(e){var t=h(mt(e),4),n=t[0],r=t[1],o=t[2],i=t[3],a=(n+o)/2,l=(r+i)/2;return e.points.map((function(t){var n=e.x,r=e.y,o=h(tt(n+t[0],r+t[1],a,l,e.angle),2);return[n=o[0],r=o[1]]}))}},{key:"getPointAtIndexGlobalCoordinates",value:function(e,t){var n=t<0?e.points.length+t:t,r=h(mt(e),4),o=r[0],i=r[1],a=(o+r[2])/2,l=(i+r[3])/2,c=e.points[n],s=e.x,u=e.y;return tt(s+c[0],u+c[1],a,l,e.angle)}},{key:"pointFromAbsoluteCoords",value:function(e,t){var n=h(mt(e),4),r=n[0],o=n[1],i=(r+n[2])/2,a=(o+n[3])/2,l=h(tt(t[0],t[1],i,a,-e.angle),2),c=l[0],s=l[1];return[c-e.x,s-e.y]}},{key:"getPointIndexUnderCursor",value:function(e,t,n,r){for(var o=this.getPointsGlobalCoordinates(e),i=o.length;--i>-1;){var a=o[i];if(ot(n,r,a[0],a[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return i}return-1}},{key:"createPointAt",value:function(e,t,n,r){var o=ut(t,n,r),i=h(mt(e),4),a=i[0],l=i[1],c=(a+i[2])/2,s=(l+i[3])/2,u=h(tt(o[0],o[1],c,s,-e.angle),2),d=u[0],f=u[1];return[d-e.x,f-e.y]}},{key:"getNormalizedPoints",value:function(e){var t=e.points,n=t[0][0],r=t[0][1];return{points:t.map((function(e,t){return[e[0]-n,e[1]-r]})),x:e.x+n,y:e.y+r}}},{key:"normalizePoints",value:function(t){to(t,e.getNormalizedPoints(t))}},{key:"duplicateSelectedPoints",value:function(t){if(!t.editingLinearElement)return!1;var n=t.editingLinearElement,r=n.selectedPointsIndices,o=n.elementId,i=e.getElement(o);if(!i||null===r)return!1;var a=i.points,l=[],c=!1,s=-1,u=a.reduce((function(e,t,n){if(++s,e.push(t),r.includes(n)){var o=a[n+1];o||(c=!0),e.push(o?[(t[0]+o[0])/2,(t[1]+o[1])/2]:[t[0],t[1]]),l.push(s+1),++s}return e}),[]);if(to(i,{points:u}),c){var d=i.points[i.points.length-1];e.movePoints(i,[{index:i.points.length-1,point:[d[0]+30,d[1]+30]}])}return{appState:ea(ea({},t),{},{editingLinearElement:ea(ea({},t.editingLinearElement),{},{selectedPointsIndices:l})})}}},{key:"deletePoints",value:function(t,n){var r=0,o=0;if(n.includes(0)){var i=t.points.find((function(e,t){return!n.includes(t)}));i&&(r=i[0],o=i[1])}var a=t.points.reduce((function(e,t,i){return n.includes(i)||e.push(e.length?[t[0]-r,t[1]-o]:[0,0]),e}),[]);e._updatePoints(t,a,r,o)}},{key:"addPoints",value:function(t,n){var r=[].concat(A(t.points),A(n.map((function(e){return e.point}))));e._updatePoints(t,r,0,0)}},{key:"movePoints",value:function(t,n,r){var o=t.points,i=0,a=0,l=n.find((function(e){return 0===e.index}));l&&(i=l.point[0]-o[l.index][0],a=l.point[1]-o[l.index][1]);var c=o.map((function(e,t){var r=n.find((function(e){return e.index===t}));if(r){if(l)return e;var c=r.point[0]-o[r.index][0],s=r.point[1]-o[r.index][1];return[e[0]+c,e[1]+s]}return i||a?[e[0]-i,e[1]-a]:e}));e._updatePoints(t,c,i,a,r)}},{key:"_updatePoints",value:function(e,t,n,r,o){var i=St(e,t,e.strokeSharpness||"round"),a=St(e,e.points,e.strokeSharpness||"round"),l=(i[0]+i[2])/2,c=(i[1]+i[3])/2,s=(a[0]+a[2])/2,u=(a[1]+a[3])/2,d=tt(n,r,s-l,u-c,e.angle);to(e,ea(ea({},o),{},{points:t,x:e.x+d[0],y:e.y+d[1]}))}}]),e}();ta.POINT_HANDLE_SIZE=20;var na=function(e){var t=A(new Set(e.filter((function(e){return null!==e&&-1!==e}))));return t=t.sort((function(e,t){return e-t})),t.length?t:null};function ra(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var oa=function(e){return e.isBindingEnabled},ia=function(e,t,n){var r=new Set,o=new Set;aa(e,t,n,"start",r,o),aa(e,n,t,"end",r,o);var i=Array.from(o).filter((function(e){return!r.has(e)}));ar.getScene(e).getNonDeletedElements(i).forEach((function(t){var n;to(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((function(t){return"arrow"!==t.type||t.id!==e.id}))})}))},aa=function(e,t,n,r,o,i){if("keep"!==t)if(null!=t)null!=n&&("keep"===n?da(e,t,r):"start"!==r&&n.id===t.id)||(ua(e,t,r),o.add(t.id));else{var a=ha(e,r);null!=a&&i.add(a)}},la=function(e){e.forEach((function(e){Xe(e)?ia(e,_a(e,"start"),_a(e,"end")):Qe(e)&&ca(e)}))},ca=function(e){Ea(e).forEach((function(t){var n=h(t,2),r=n[0],o=n[1];return ia(r,"end"===o?"keep":e,"start"===o?"keep":e)}))},sa=function(e,t,n,r){null!=t.startBoundElement&&ua(e,t.startBoundElement,"start");var o=ma(r,n);null==o||da(e,o,"end")||ua(e,o,"end")},ua=function(e,t,n){to(e,P({},"start"===n?"startBinding":"endBinding",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ra(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({elementId:t.id},ga(e,t,n)))),In(t.boundElements||[]).has(e.id)||to(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},da=function(e,t,n){var r=e["start"===n?"endBinding":"startBinding"];return fa(e,null==r?void 0:r.elementId,t)},fa=function(e,t,n){return t===n.id&&e.points.length<3},pa=function(e){e.forEach((function(e){Xe(e)&&ia(e,null,null)}))},ha=function(e,t){var n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(to(e,P({},n,null)),r.elementId)},ma=function(e,t){return kc(t.getElements(),(function(t){return Qe(t)&&vi(t,e)}))},ga=function(e,t,n){var r="start"===n?-1:1,o=-1===r?0:e.points.length-1,i=o-r,a=ta.getPointAtIndexGlobalCoordinates(e,o),l=ta.getPointAtIndexGlobalCoordinates(e,i);return{focus:Li(t,l,a),gap:Math.max(1,xi(t,a))}},va=function(e,t){var n,r=(null!==(n=e.boundElements)&&void 0!==n?n:[]).filter((function(e){return"arrow"===e.type}));if(0!==r.length){var o=null!=t?t:{},i=o.newSize,a=o.simultaneouslyUpdated,l=ya(a);ar.getScene(e).getNonDeletedElements(r.map((function(e){return e.id}))).forEach((function(t){if(Ye(t)){var n=e;if(ba(t,n)){var r=wa(n,t.startBinding,i),o=wa(n,t.endBinding,i);l.has(t.id)?to(t,{startBinding:r,endBinding:o}):(xa(t,"start",r,e),xa(t,"end",o,e))}}}))}},ba=function(e,t){var n,r;return(null===(n=e.startBinding)||void 0===n?void 0:n.elementId)===t.id||(null===(r=e.endBinding)||void 0===r?void 0:r.elementId)===t.id},ya=function(e){return new Set((e||[]).map((function(e){return e.id})))},xa=function(e,t,n,r){if(!(null==n||n.elementId!==r.id&&e.points.length>2)){var o=ar.getScene(e).getElement(n.elementId);if(null!=o){var i,a="start"===t?-1:1,l=-1===a?0:e.points.length-1,c=l-a,s=ta.getPointAtIndexGlobalCoordinates(e,c),u=function(e,t,n){if(0===t){var r=mt(e),o=Pi(r);return ri(o)}var i,a=Ai(e),l=si(a,ni(n)),c=Wo(a);switch(e.type){case"rectangle":case"image":case"text":case"diamond":i=Ui(e,t,l);break;case"ellipse":i=Fi(e,t,l)}return ri(si(c,i))}(o,n.focus,s);if(0===n.gap)i=u;else{var d=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=Ai(e),i=si(o,ni(t)),a=si(o,ni(n)),l=ei(i,a),c=Wo(o);return Di(e,l,i,r).map((function(e){return ri(si(c,e))}))}(o,s,u,n.gap);i=0===d.length?u:d[0]}ta.movePoints(e,[{index:l,point:ta.pointFromAbsoluteCoords(e,i)}],P({},"start"===t?"startBinding":"endBinding",n))}}},wa=function(e,t,n){if(null==t||null==n)return t;var r=t.gap,o=t.focus,i=t.elementId,a=n.width,l=n.height,c=e.width,s=e.height;return{elementId:i,gap:Math.max(1,Math.min(bi(e,a,l),r*(a<l?a/c:l/s))),focus:o}},ka=function(e){return[_a(e,"start"),_a(e,"end")].filter((function(e){return null!=e}))},_a=function(e,t){return ma(Sa(e,t),ar.getScene(e))},Sa=function(e,t){var n="start"===t?0:-1;return Sn(ta.getPointAtIndexGlobalCoordinates(e,n))},Ea=function(e){return ar.getScene(e).getElements().map((function(t){if(!Xe(t))return null;var n=ja(t,"start",e),r=ja(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((function(e){return null!=e}))},ja=function(e,t,n){return null==e["start"===t?"startBinding":"endBinding"]&&!da(e,n,t)&&vi(n,Sa(e,t))},Ca=function(e,t,n,r){var o=new Set,i=new Set,a="duplicatesServeAsOld"===r;t.forEach((function(e){var t=e.boundElements;if(null!=t&&t.length>0&&(t.forEach((function(e){a&&!n.has(e.id)&&o.add(e.id)})),i.add(n.get(e.id))),Xe(e)){if(null!=e.startBinding){var r=e.startBinding.elementId;a&&!n.has(r)&&i.add(r)}if(null!=e.endBinding){var l=e.endBinding.elementId;a&&!n.has(l)&&i.add(l)}null==e.startBinding&&null==e.endBinding||o.add(n.get(e.id))}})),e.filter((function(e){var t=e.id;return o.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;to(e,{startBinding:Oa(t,n),endBinding:Oa(r,n)})})),e.filter((function(e){var t=e.id;return i.has(t)})).forEach((function(e){var t=e.boundElements;null!=t&&t.length>0&&to(e,{boundElements:t.map((function(e){return n.has(e.id)?{id:n.get(e.id),type:e.type}:e}))})}))},Oa=function(e,t){var n;if(null==e)return null;var r=e.elementId;return{focus:e.focus,gap:e.gap,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},Ia=function(e,t){var n=new Set(t.map((function(e){return e.id}))),r=new Set;t.forEach((function(e){var t;Qe(e)&&(null===(t=e.boundElements)||void 0===t||t.forEach((function(e){n.has(e.id)||r.add(e.id)})))})),e.filter((function(e){var t=e.id;return r.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;to(e,{startBinding:Ma(t,n),endBinding:Ma(r,n)})}))},Ma=function(e,t){return null==e||t.has(e.elementId)?null:e};function Ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Aa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pa=function(e){return e>=2*Math.PI?e-2*Math.PI:e},La=function(e,t,n,r){var o=h(mt(e),4),i=o[0],a=o[1],l=(i+o[2])/2,c=(a+o[3])/2,u=5*Math.PI/2+Math.atan2(n-c,t-l);r&&(u+=s.ay/2,u-=u%s.ay),u=Pa(u),to(e,{angle:u});var d=br(e);if(d){var f=ar.getScene(e).getElement(d);to(f,{angle:u})}},Da=function(e,t,n,r,o){var i=h(mt(e),4),a=i[0],l=i[1],c=i[2],s=i[3],u=h(tt(r,o,(a+c)/2,(l+s)/2,-e.angle),2),d=u[0],f=u[1],p=h("end"===t?[d-e.x,f-e.y]:[e.x+e.points[1][0]-d,e.y+e.points[1][1]-f],2),m=p[0],g=p[1];if(n){var v=function(e,t,n,r){var o=io.apply(void 0,[e].concat(A(tt(t,n,0,0,r))));return tt(o.width,o.height,0,0,-r)}(e.type,m,g,e.angle),b=h(v,2);m=b[0],g=b[1]}var y=h(rt("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-m)/2,(e.points[1][1]-g)/2),2),x=y[0],w=y[1];to(e,{x:x,y:w,points:[[0,0],[m,g]]})},Ra=function(e,t,n){return Ye(e)||Ge(e)?{points:ft(0,t,ft(1,n,e.points))}:{}},za=function(e,t,n){var r=e.fontSize*(t/e.width);if(r<1)return null;var o=ur(e.text,un({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:o.baseline+(n-o.height)}},Na=function(e,t,n,r,o){var i,a=h(mt(e),4),l=a[0],c=a[1],s=a[2],u=a[3],d=h(tt(r,o,(l+s)/2,(c+u)/2,-e.angle),2),f=d[0],p=d[1];switch(t){case"se":i=Math.max((f-l)/(s-l),(p-c)/(u-c));break;case"nw":i=Math.max((s-f)/(s-l),(u-p)/(u-c));break;case"ne":i=Math.max((f-l)/(s-l),(u-p)/(u-c));break;case"sw":i=Math.max((s-f)/(s-l),(p-c)/(u-c))}if(i>0){var m=e.width*i,g=e.height*i,v=za(e,m,g);if(null===v)return;var b=h(_t(e,m,g),4),y=(l-b[0])/2,x=(c-b[1])/2,w=(s-b[2])/2,k=(u-b[3])/2,_=rt(function(e,t){return{n:/^(n|ne|nw)$/.test(e)||t&&/^(s|se|sw)$/.test(e),s:/^(s|se|sw)$/.test(e)||t&&/^(n|ne|nw)$/.test(e),w:/^(w|nw|sw)$/.test(e)||t&&/^(e|ne|se)$/.test(e),e:/^(e|ne|se)$/.test(e)||t&&/^(w|nw|sw)$/.test(e)}}(t,n),e.x,e.y,e.angle,y,x,w,k),S=h(_,2),E=S[0],j=S[1];to(e,{fontSize:v.size,width:m,height:g,baseline:v.baseline,x:E,y:j})}},Ba=function(e,t,n,r,o,i,a){var l=h(_t(e,e.width,e.height),4),c=[l[0],l[1]],s=[l[2],l[3]],u=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}(c,s),d=nt([i,a],u,-e.angle),f=h(_t(n,n.width,n.height),4),p=f[0],m=f[1],g=f[2],v=f[3],b=br(n),y=g-p,x=v-m,w=(s[0]-c[0])/y,k=(s[1]-c[1])/x;r.includes("e")&&(w=(d[0]-c[0])/y),r.includes("s")&&(k=(d[1]-c[1])/x),r.includes("w")&&(w=(s[0]-d[0])/y),r.includes("n")&&(k=(s[1]-d[1])/x);var _=e.width,S=e.height,E=n.width*w,j=n.height*k;if(o&&(E=2*E-_,j=2*j-S),t){var C=Math.abs(E)/_,O=Math.abs(j)/S;if(1===r.length&&(j*=C,E*=O),2===r.length){var I=Math.max(C,O);E=_*I*Math.sign(E),j=S*I*Math.sign(j)}}var M=h(_t(e,E,j),4),T=M[0],P=M[1],L=M[2]-T,D=M[3]-P;if(!(L<0||D<0)||!b){var R=[].concat(c);if(["n","w","nw"].includes(r)&&(R=[s[0]-Math.abs(L),s[1]-Math.abs(D)]),"ne"===r){var z=[c[0],s[1]];R=[z[0],z[1]-Math.abs(D)]}if("sw"===r){var N=[s[0],c[1]];R=[N[0]-Math.abs(L),N[1]]}t&&(["s","n"].includes(r)&&(R[0]=u[0]-L/2),["e","w"].includes(r)&&(R[1]=u[1]-D/2)),E<0&&(r.includes("e")&&(R[0]-=Math.abs(L)),r.includes("w")&&(R[0]+=Math.abs(L))),j<0&&(r.includes("s")&&(R[1]-=Math.abs(D)),r.includes("n")&&(R[1]+=Math.abs(D))),o&&(R[0]=u[0]-Math.abs(L)/2,R[1]=u[1]-Math.abs(D)/2);var B=e.angle,H=nt(R,u,B),F=[R[0]+Math.abs(L)/2,R[1]+Math.abs(D)/2],U=nt(F,u,B);R=nt(H,U,-B);var W=Ra(e,E,j),K=A(R);K[0]+=e.x-T,K[1]+=e.y-P;var V=Aa({width:Math.abs(E),height:Math.abs(j),x:K[0],y:K[1]},W);"scale"in n&&"scale"in e&&to(n,{scale:[(Math.sign(w)||e.scale[0])*e.scale[0],(Math.sign(k)||e.scale[1])*e.scale[1]]});var G=0,Z=yr(n);Z&&(G=gr(un(Z))),V.width>=G&&0!==V.height&&Number.isFinite(V.x)&&Number.isFinite(V.y)&&(va(n,{newSize:{width:V.width,height:V.height}}),to(n,V),sr([n],r))}},Ha=function(e,t,n,r){var o,i,a=h(kt(e),4),l=a[0],c=a[1],s=a[2],u=a[3];switch(t){case"se":o=Math.max((n-l)/(s-l),(r-c)/(u-c)),i=function(e,t,n){var r=h(t,2),i=r[0],a=r[1],s=h(n,2),u=s[0],d=s[1];return{x:e.x+(i-l)*(o-1)+i-u,y:e.y+(a-c)*(o-1)+a-d}};break;case"nw":o=Math.max((s-n)/(s-l),(u-r)/(u-c)),i=function(e,t,n){var r=h(t,4),i=r[2],a=r[3],l=h(n,4),c=l[2],d=l[3];return{x:e.x-(s-i)*(o-1)+i-c,y:e.y-(u-a)*(o-1)+a-d}};break;case"ne":o=Math.max((n-l)/(s-l),(u-r)/(u-c)),i=function(e,t,n){var r=h(t,4),i=r[0],a=r[3],c=h(n,4),s=c[0],d=c[3];return{x:e.x+(i-l)*(o-1)+i-s,y:e.y-(u-a)*(o-1)+a-d}};break;case"sw":o=Math.max((s-n)/(s-l),(r-c)/(u-c)),i=function(e,t,n){var r=h(t,3),i=r[1],a=r[2],l=h(n,3),u=l[1],d=l[2];return{x:e.x-(s-a)*(o-1)+a-d,y:e.y+(i-c)*(o-1)+i-u}}}if(o>0){var d=e.reduce((function(t,n){if(!t)return t;var r=n.width*o,a=n.height*o,l={};if(Ve(n)){var c=za(n,r,a);if(null===c)return null;l={fontSize:c.size,baseline:c.baseline}}var s=mt(n),u=Ra(n,r,a);va(n,{newSize:{width:r,height:a},simultaneouslyUpdated:e});var d=_t(Aa(Aa({},n),u),r,a),f=i(n,s,d),p=f.x,h=f.y;return[].concat(A(t),[Aa(Aa({width:r,height:a,x:p,y:h},u),l)])}),[]);d&&e.forEach((function(e,t){to(e,d[t])}))}},Fa=function(e,t,n,r,o,i,a){var l=5*Math.PI/2+Math.atan2(r-a,n-i);o&&(l+=s.ay/2,l-=l%s.ay),t.forEach((function(t,n){var r,o,c=h(mt(t),4),s=c[0],u=c[1],d=(s+c[2])/2,f=(u+c[3])/2,p=null!==(r=null===(o=e.originalElements.get(t.id))||void 0===o?void 0:o.angle)&&void 0!==r?r:t.angle,m=h(tt(d,f,i,a,l+p-t.angle),2),g=m[0],v=m[1];to(t,{x:t.x+(g-d),y:t.y+(v-f),angle:Pa(l+p)});var b=br(t);if(b){var y=ar.getScene(t).getElement(b);to(y,{x:y.x+(g-d),y:y.y+(v-f),angle:Pa(l+p)})}}))},Ua=function(e,t,n,r,o,i){var a,l;if(e){var c=e&&t<n,s=e&&t>n,u=r.originalElements.get(o.id);a=c&&u?u.x:o.x+i.x,l=s&&u?u.y:o.y+i.y}else a=o.x+i.x,l=o.y+i.y;to(o,{x:a,y:l})},Wa=function(e,t,n,r,o,i,a,l,c,s,u){if(c)if(u)l=a/u;else{var d=io(t,a,i<r?-l:l);a=d.width,(l=d.height)<0&&(l=-l)}var f=o<n?n-a:n,p=i<r?r-l:r;s&&(f=n-(a+=a)/2,p=r-(l+=l)/2),0!==a&&0!==l&&to(e,{x:f,y:p,width:a,height:l})},Ka=function(e){var t=e.options,n=e.value,r=e.onChange,o=e.group;return(0,O.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((function(e){return(0,O.jsxs)("label",{className:Fe({active:n===e.value}),title:e.text,children:[(0,O.jsx)("input",{type:"radio",name:o,onChange:function(){return r(e.value)},checked:n===e.value}),e.icon]},e.text)}))})},Va=(n(4301),function(e){var t=e.children,n=e.left,r=e.top,o=e.onCloseRequest,i=e.fitInViewport,a=void 0!==i&&i,c=(0,l.useRef)(null);return(0,l.useLayoutEffect)((function(){if(a&&c.current){var e=c.current,t=e.getBoundingClientRect(),n=t.x,r=t.y,o=t.width,i=t.height,l=window.innerWidth;n+o>l&&(e.style.left="".concat(l-o,"px"));var s=window.innerHeight;r+i>s&&(e.style.top="".concat(s-i,"px"))}}),[a]),(0,l.useEffect)((function(){if(o){var e=function(e){var t;null!==(t=c.current)&&void 0!==t&&t.contains(e.target)||(0,It.unstable_batchedUpdates)((function(){return o(e)}))};return document.addEventListener("pointerdown",e,!1),function(){return document.removeEventListener("pointerdown",e,!1)}}}),[o]),(0,O.jsx)("div",{className:"popover",style:{top:r,left:n},ref:c,children:t})}),Ga=(n(4220),function(e){var t=(new Option).style;return t.color=e,!!t.color}),Za=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Ya=function(e){var t=e.colors,n=e.color,r=e.onChange,o=e.onClose,i=e.label,a=e.showInput,l=void 0===a||a,s=e.type,u=c().useRef(),d=c().useRef(),f=c().useRef(),p=c().useRef();c().useEffect((function(){d.current?d.current.focus():p.current?p.current.focus():f.current&&f.current.focus()}),[]);return(0,O.jsxs)("div",{className:"color-picker color-picker-type-".concat(s),role:"dialog","aria-modal":"true","aria-label":C("labels.colorPicker"),onKeyDown:function(e){if(e.key===Jt.TAB){var t,n=document.activeElement;if(e.shiftKey){if(n===u.current)null===(t=p.current)||void 0===t||t.focus(),e.preventDefault()}else if(n===p.current){var r;null===(r=u.current)||void 0===r||r.focus(),e.preventDefault()}}else if(en(e.key)){var i=document.activeElement,a=E().rtl,c=Array.prototype.indexOf.call(f.current.children,i);if(-1!==c){var s=f.current.children.length-(l?1:0),d=e.key===(a?Jt.ARROW_LEFT:Jt.ARROW_RIGHT)?(c+1)%s:e.key===(a?Jt.ARROW_RIGHT:Jt.ARROW_LEFT)?(s+c-1)%s:e.key===Jt.ARROW_DOWN?(c+5)%s:e.key===Jt.ARROW_UP?(s+c-5)%s:c;f.current.children[d].focus()}e.preventDefault()}else if(Za.includes(e.key.toLowerCase())&&!cn(e.target)){var h=Za.indexOf(e.key.toLowerCase());f.current.children[h].focus(),e.preventDefault()}else e.key!==Jt.ESCAPE&&e.key!==Jt.ENTER||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,O.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,O.jsx)("div",{className:"color-picker-triangle"}),(0,O.jsxs)("div",{className:"color-picker-content",ref:function(e){e&&(f.current=e)},tabIndex:0,children:[t.map((function(e,t){var o=e.replace("#","");return(0,O.jsxs)("button",{className:"color-picker-swatch",onClick:function(t){t.currentTarget.focus(),r(e)},title:"".concat(C("colors.".concat(o))).concat(jn(e)?"":" (".concat(e,")")," — ").concat(Za[t].toUpperCase()),"aria-label":C("colors.".concat(o)),"aria-keyshortcuts":Za[t],style:{color:e},ref:function(r){r&&0===t&&(u.current=r),r&&e===n&&(d.current=r)},onFocus:function(){r(e)},children:[jn(e)?(0,O.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,O.jsx)("span",{className:"color-picker-keybinding",children:Za[t]})]},e)})),l&&(0,O.jsx)(qa,{color:n,label:i,onChange:function(e){r(e)},ref:p})]})]})},qa=c().forwardRef((function(e,t){var n=e.color,r=e.onChange,o=e.label,i=h(c().useState(n),2),a=i[0],l=i[1],s=c().useRef(null);c().useEffect((function(){l(n)}),[n]),c().useImperativeHandle(t,(function(){return s.current}));var u=c().useCallback((function(e){var t=e.toLowerCase(),n=function(e){return jn(e)||Ga(e)?e:Ga("#".concat(e))?"#".concat(e):null}(t);n&&r(n),l(t)}),[r]);return(0,O.jsxs)("label",{className:"color-input-container",children:[(0,O.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,O.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:function(e){return u(e.target.value)},value:(a||"").replace(/^#/,""),onBlur:function(){return l(n)},ref:s})]})})),Xa=function(e){var t=e.type,n=e.color,r=e.onChange,o=e.label,i=e.isActive,a=e.setActive,l=c().useRef(null);return(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"color-picker-control-container",children:[(0,O.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:function(){return a(!i)},ref:l}),(0,O.jsx)(qa,{color:n,label:o,onChange:function(e){r(e)}})]}),(0,O.jsx)(c().Suspense,{fallback:"",children:i?(0,O.jsx)(Va,{onCloseRequest:function(e){return e.target!==l.current&&a(!1)},children:(0,O.jsx)(Ya,{colors:Ot[t],color:n||null,onChange:function(e){r(e)},onClose:function(){var e;a(!1),null===(e=l.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})}):null})]})};n(7117);function $a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$a(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ja(e){var t=e.options,n=e.value,r=e.label,o=e.onChange,i=e.onClose,a=c().useRef(),l=c().useRef(),s=c().useRef(null);c().useEffect((function(){l.current?l.current.focus():s.current&&s.current.focus()}),[]);return(0,O.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:function(e){var n=t.find((function(t){return t.keyBinding===e.key.toLowerCase()}));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===Jt.TAB)setTimeout((function(){l.current!==document.activeElement&&i()}),0);else if(en(e.key)){var r=document.activeElement,o=E().rtl,a=Array.prototype.indexOf.call(s.current.children,r);if(-1!==a){var c=t.length,u=a;switch(e.key){case o?Jt.ARROW_LEFT:Jt.ARROW_RIGHT:case Jt.ARROW_DOWN:u=(a+1)%c;break;case o?Jt.ARROW_RIGHT:Jt.ARROW_LEFT:case Jt.ARROW_UP:u=(c+a-1)%c}s.current.children[u].focus()}e.preventDefault()}else e.key!==Jt.ESCAPE&&e.key!==Jt.ENTER||(e.preventDefault(),i());else{var d=t.indexOf(n);s.current.children[d].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,O.jsx)("div",{className:"picker-content",ref:s,children:t.map((function(e,t){return(0,O.jsxs)("button",{className:"picker-option",onClick:function(t){t.currentTarget.focus(),o(e.value)},title:"".concat(e.text," — ").concat(e.keyBinding.toUpperCase()),"aria-label":e.text||"none","aria-keyshortcuts":e.keyBinding,ref:function(r){r&&0===t&&(a.current=r),r&&e.value===n&&(l.current=r)},onFocus:function(){o(e.value)},children:[e.icon,(0,O.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)}))})})}function el(e){var t,n=e.value,r=e.label,o=e.options,i=e.onChange,a=e.group,l=void 0===a?"":a,s=h(c().useState(!1),2),u=s[0],d=s[1],f=c().useRef(null),p=E().rtl;return(0,O.jsxs)("label",{className:"picker-container",children:[(0,O.jsx)("button",{name:l,className:u?"active":"","aria-label":r,onClick:function(){return d(!u)},ref:f,children:null===(t=o.find((function(e){return e.value===n})))||void 0===t?void 0:t.icon}),(0,O.jsx)(c().Suspense,{fallback:"",children:u?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Va,Qa(Qa({onCloseRequest:function(e){return e.target!==f.current&&d(!1)}},p?{right:5.5}:{left:-5.5}),{},{children:(0,O.jsx)(Ja,{options:o,value:n,label:r,onChange:i,onClose:function(){var e;d(!1),null===(e=f.current)||void 0===e||e.focus()}})})),(0,O.jsx)("div",{className:"picker-triangle"})]}):null})]})}var tl=function(e){return e===s.C6.LIGHT?jt.orange[4]:jt.orange[9]},nl=function(e){return e===s.C6.LIGHT?jt.white:"#1e1e1e"},rl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512,n="number"==typeof t?{width:t}:t,r=n.width,o=void 0===r?512:r,i=n.height,a=void 0===i?o:i,l=n.mirror,c=n.style;return(0,O.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(o," ").concat(a),className:Fe({"rtl-mirror":l}),style:c,children:"string"==typeof e?(0,O.jsx)("path",{fill:"currentColor",d:e}):e})},ol=rl((0,O.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),il=rl("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",{mirror:!0}),al=rl("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}),ll=rl("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}),cl=rl("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),sl=rl("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}),ul=rl("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),dl=rl("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"),fl=rl("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),pl=rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"}),(0,O.jsx)("path",{d:"M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"})]}),{width:576,height:512,mirror:!0}),hl=rl("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}),ml=rl("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}),gl=rl("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}),vl=rl("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"),bl=rl("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"),yl=rl("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",{mirror:!0}),xl=rl("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",{mirror:!0}),wl=rl("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}),kl=(rl("M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",{width:24,height:24}),rl("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}),rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{stroke:"currentColor",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,O.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}),rl((0,O.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}),c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,O.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),_l=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:tl(t),stroke:tl(t),strokeWidth:"2"}),(0,O.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),Sl=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,O.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),El=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:tl(t),stroke:tl(t),strokeWidth:"2"}),(0,O.jsx)("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),jl=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,O.jsx)("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Cl=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,O.jsx)("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ol=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,O.jsx)("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24})})),Il=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,O.jsx)("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24})})),Ml=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,O.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24})})),Tl=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,O.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:tl(t),stroke:tl(t),strokeWidth:"2"})]}),{width:24})})),Al=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",fill:tl(t),stroke:tl(t),strokeWidth:"2"}),(0,O.jsx)("path",{d:"M 2,12 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),Pl=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",fill:tl(t),stroke:tl(t),strokeWidth:"2"}),(0,O.jsx)("path",{d:"M 12,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),Ll=rl("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",{width:640,height:512,mirror:!0}),Dl=(rl("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"),rl("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"),rl("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",{width:352,height:512})),Rl=rl("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),zl=rl("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}),Nl=(rl("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}),rl("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})),Bl=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,O.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,O.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,O.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,O.jsxs)("g",{fill:nl(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,O.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Hl=c().memo((function(e){var t=e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,O.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,O.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,O.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,O.jsxs)("g",{fill:nl(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,O.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,O.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Fl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),Ul=c().memo((function(e){e.theme;return rl((0,O.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,O.jsx)("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),(0,O.jsx)("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})]}),{width:40,height:20})})),Wl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),Kl=c().memo((function(e){e.theme;var t=e.strokeWidth;return rl((0,O.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:t,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),Vl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Gl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Zl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M6 10H36",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Yl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ql=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Xl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),$l=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ql=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Jl=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),ec=c().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return rl((0,O.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,O.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,O.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),tc=c().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return rl((0,O.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,O.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,O.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),nc=c().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return rl((0,O.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,O.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),rc=c().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return rl((0,O.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,O.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,O.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),oc=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),{width:47,height:77})})),ic=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"}),{width:77,height:75})})),ac=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"}),{width:45,height:75})})),lc=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"}),{width:120,height:75})})),cc=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"}),{width:448,height:512})})),sc=c().memo((function(e){e.theme;return rl((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"}),(0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"})]}),{width:70,height:78})})),uc=c().memo((function(e){e.theme;return rl((0,O.jsx)(O.Fragment,{children:(0,O.jsx)("path",{fill:"var(--icon-fill-color)",d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),{width:640,height:512})})),dc=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),fc=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z",fill:"var(--icon-fill-color)"}),{width:448,height:512})})),pc=c().memo((function(e){e.theme;return rl((0,O.jsx)("path",{d:"M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),hc=rl((0,O.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}),mc=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e},gc=function(e){return"image"!==e},vc=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e},bc=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e},yc=function(e){return"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e},xc=function(e){return"text"===e},wc=function(e){return"arrow"===e},kc=function(e,t){for(var n=null,r=e.length-1;r>=0;--r){var o=e[r];if(!o.isDeleted&&t(o)){n=o;break}}return n},_c=function(e,t){return e.filter((function(e){return!e.isDeleted&&t(e)}))},Sc=function(e,t,n){for(var r=null,o=e.length-1;o>=0;--o)if(!e[o].isDeleted){var i=h(mt(e[o]),4),a=i[0],l=i[1],c=i[2],s=i[3];if(a<t&&t<c&&l<n&&n<s){r=e[o];break}}return r},Ec=[],jc=function(e){return Ec=Ec.concat(e),e};function Cc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cc(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ic=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=In(Yc(e,t,r));return e.map((function(e){var r;return o.get(e.id)||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e}))},Mc=function(e,t,n,r){var o,i,a=t.editingElement,l=Hc(e);return null!==(o=null!==(i=a&&n(a))&&void 0!==i?i:Gc(l,t)?Zc(l,t,n):r)&&void 0!==o?o:null},Tc=function(e,t,n){var r=new Set;return{elements:Ic(e,t,(function(e){if(Ve(e)){var t=n(e);r.add(t);var o=no(e,{fontSize:t});return lr(o,xr(e)),i=e,o=et(a=o)?a:to(a,{x:"left"===i.textAlign?i.x:i.x+(i.width-a.width)/("center"===i.textAlign?2:1),y:i.y+(i.height-a.height)/2},!1)}var i,a;return e}),!0),appState:Oc(Oc({},t),{},{currentItemFontSize:1===r.size?A(r)[0]:t.currentItemFontSize}),commitToHistory:!0}},Ac=(jc({name:"changeStrokeColor",perform:function(e,t,n){return Oc(Oc({},n.currentItemStrokeColor&&{elements:Ic(e,t,(function(e){return gc(e.type)?no(e,{strokeColor:n.currentItemStrokeColor}):e}),!0)}),{},{appState:Oc(Oc({},t),n),commitToHistory:!!n.currentItemStrokeColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("h3",{"aria-hidden":"true",children:C("labels.stroke")}),(0,O.jsx)(Xa,{type:"elementStroke",label:C("labels.stroke"),color:Mc(t,n,(function(e){return e.strokeColor}),n.currentItemStrokeColor),onChange:function(e){return r({currentItemStrokeColor:e})},isActive:"strokeColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"strokeColorPicker":null})}})]})}}),jc({name:"changeBackgroundColor",perform:function(e,t,n){return Oc(Oc({},n.currentItemBackgroundColor&&{elements:Ic(e,t,(function(e){return no(e,{backgroundColor:n.currentItemBackgroundColor})}))}),{},{appState:Oc(Oc({},t),n),commitToHistory:!!n.currentItemBackgroundColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("h3",{"aria-hidden":"true",children:C("labels.background")}),(0,O.jsx)(Xa,{type:"elementBackground",label:C("labels.background"),color:Mc(t,n,(function(e){return e.backgroundColor}),n.currentItemBackgroundColor),onChange:function(e){return r({currentItemBackgroundColor:e})},isActive:"backgroundColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"backgroundColorPicker":null})}})]})}}),jc({name:"changeFillStyle",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){return no(e,{fillStyle:n})})),appState:Oc(Oc({},t),{},{currentItemFillStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.fill")}),(0,O.jsx)(Ka,{options:[{value:"hachure",text:C("labels.hachure"),icon:(0,O.jsx)(Fl,{theme:n.theme})},{value:"cross-hatch",text:C("labels.crossHatch"),icon:(0,O.jsx)(Ul,{theme:n.theme})},{value:"solid",text:C("labels.solid"),icon:(0,O.jsx)(Wl,{theme:n.theme})}],group:"fill",value:Mc(t,n,(function(e){return e.fillStyle}),n.currentItemFillStyle),onChange:function(e){r(e)}})]})}}),jc({name:"changeStrokeWidth",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){return no(e,{strokeWidth:n})})),appState:Oc(Oc({},t),{},{currentItemStrokeWidth:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.strokeWidth")}),(0,O.jsx)(Ka,{group:"stroke-width",options:[{value:1,text:C("labels.thin"),icon:(0,O.jsx)(Kl,{theme:n.theme,strokeWidth:2})},{value:2,text:C("labels.bold"),icon:(0,O.jsx)(Kl,{theme:n.theme,strokeWidth:6})},{value:4,text:C("labels.extraBold"),icon:(0,O.jsx)(Kl,{theme:n.theme,strokeWidth:10})}],value:Mc(t,n,(function(e){return e.strokeWidth}),n.currentItemStrokeWidth),onChange:function(e){return r(e)}})]})}}),jc({name:"changeSloppiness",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){return no(e,{seed:$r(),roughness:n})})),appState:Oc(Oc({},t),{},{currentItemRoughness:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.sloppiness")}),(0,O.jsx)(Ka,{group:"sloppiness",options:[{value:0,text:C("labels.architect"),icon:(0,O.jsx)(Yl,{theme:n.theme})},{value:1,text:C("labels.artist"),icon:(0,O.jsx)(ql,{theme:n.theme})},{value:2,text:C("labels.cartoonist"),icon:(0,O.jsx)(Xl,{theme:n.theme})}],value:Mc(t,n,(function(e){return e.roughness}),n.currentItemRoughness),onChange:function(e){return r(e)}})]})}}),jc({name:"changeStrokeStyle",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){return no(e,{strokeStyle:n})})),appState:Oc(Oc({},t),{},{currentItemStrokeStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.strokeStyle")}),(0,O.jsx)(Ka,{group:"strokeStyle",options:[{value:"solid",text:C("labels.strokeStyle_solid"),icon:(0,O.jsx)(Vl,{theme:n.theme})},{value:"dashed",text:C("labels.strokeStyle_dashed"),icon:(0,O.jsx)(Gl,{theme:n.theme})},{value:"dotted",text:C("labels.strokeStyle_dotted"),icon:(0,O.jsx)(Zl,{theme:n.theme})}],value:Mc(t,n,(function(e){return e.strokeStyle}),n.currentItemStrokeStyle),onChange:function(e){return r(e)}})]})}}),jc({name:"changeOpacity",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){return no(e,{opacity:n})})),appState:Oc(Oc({},t),{},{currentItemOpacity:n}),commitToHistory:!0}},PanelComponent:function(e){var t,n=e.elements,r=e.appState,o=e.updateData;return(0,O.jsxs)("label",{className:"control-label",children:[C("labels.opacity"),(0,O.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:function(e){return o(+e.target.value)},onWheel:function(e){e.stopPropagation();var t=+e.target.value;e.deltaY<0&&t<100?o(t+10):e.deltaY>0&&t>0&&o(t-10)},value:null!==(t=Mc(n,r,(function(e){return e.opacity}),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),jc({name:"changeFontSize",perform:function(e,t,n){return Tc(e,t,(function(){return n}))},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.fontSize")}),(0,O.jsx)(Ka,{group:"font-size",options:[{value:16,text:C("labels.small"),icon:(0,O.jsx)(oc,{theme:n.theme})},{value:20,text:C("labels.medium"),icon:(0,O.jsx)(ic,{theme:n.theme})},{value:28,text:C("labels.large"),icon:(0,O.jsx)(ac,{theme:n.theme})},{value:36,text:C("labels.veryLarge"),icon:(0,O.jsx)(lc,{theme:n.theme})}],value:Mc(t,n,(function(e){if(Ve(e))return e.fontSize;var t=yr(e);return t?t.fontSize:null}),n.currentItemFontSize||s.n5),onChange:function(e){return r(e)}})]})}}),jc({name:"decreaseFontSize",perform:function(e,t,n){return Tc(e,t,(function(e){return Math.round(1/1.1*e.fontSize)}))},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Jt.CHEVRON_LEFT||e.key===Jt.COMMA)}})),Pc=jc({name:"increaseFontSize",perform:function(e,t,n){return Tc(e,t,(function(e){return Math.round(1.1*e.fontSize)}))},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Jt.CHEVRON_RIGHT||e.key===Jt.PERIOD)}}),Lc=(jc({name:"changeFontFamily",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){if(Ve(e)){var t=no(e,{fontFamily:n});return lr(t,xr(e)),t}return e}),!0),appState:Oc(Oc({},t),{},{currentItemFontFamily:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=[{value:s.ut.Virgil,text:C("labels.handDrawn"),icon:(0,O.jsx)(cc,{theme:n.theme})},{value:s.ut.Helvetica,text:C("labels.normal"),icon:(0,O.jsx)(sc,{theme:n.theme})},{value:s.ut.Cascadia,text:C("labels.code"),icon:(0,O.jsx)(uc,{theme:n.theme})}];return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.fontFamily")}),(0,O.jsx)(Ka,{group:"font-family",options:o,value:Mc(t,n,(function(e){if(Ve(e))return e.fontFamily;var t=yr(e);return t?t.fontFamily:null}),n.currentItemFontFamily||s.rk),onChange:function(e){return r(e)}})]})}}),jc({name:"changeTextAlign",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){if(Ve(e)){var t=no(e,{textAlign:n});return lr(t,xr(e)),t}return e}),!0),appState:Oc(Oc({},t),{},{currentItemTextAlign:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.textAlign")}),(0,O.jsx)(Ka,{group:"text-align",options:[{value:"left",text:C("labels.left"),icon:(0,O.jsx)(dc,{theme:n.theme})},{value:"center",text:C("labels.center"),icon:(0,O.jsx)(fc,{theme:n.theme})},{value:"right",text:C("labels.right"),icon:(0,O.jsx)(pc,{theme:n.theme})}],value:Mc(t,n,(function(e){if(Ve(e))return e.textAlign;var t=yr(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:function(e){return r(e)}})]})}}),jc({name:"changeSharpness",perform:function(e,t,n){var r=qc(Hc(e),t),o=r.length?r.every((function(e){return!Ye(e)})):!qe(t.elementType),i=r.length?r.every(Ye):qe(t.elementType);return{elements:Ic(e,t,(function(e){return no(e,{strokeSharpness:n})})),appState:Oc(Oc({},t),{},{currentItemStrokeSharpness:o?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:i?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.edges")}),(0,O.jsx)(Ka,{group:"edges",options:[{value:"sharp",text:C("labels.sharp"),icon:(0,O.jsx)($l,{theme:n.theme})},{value:"round",text:C("labels.round"),icon:(0,O.jsx)(Ql,{theme:n.theme})}],value:Mc(t,n,(function(e){return e.strokeSharpness}),yc(n.elementType)&&(qe(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:function(e){return r(e)}})]})}}),jc({name:"changeArrowhead",perform:function(e,t,n){return{elements:Ic(e,t,(function(e){if(Ye(e)){var t=n.position,r=n.type;if("start"===t)return no(e,{startArrowhead:r});if("end"===t)return no(e,{endArrowhead:r})}return e})),appState:Oc(Oc({},t),{},P({},"start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead",n.type)),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=E().rtl;return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.arrowheads")}),(0,O.jsxs)("div",{className:"iconSelectList",children:[(0,O.jsx)(el,{label:"arrowhead_start",options:[{value:null,text:C("labels.arrowhead_none"),icon:(0,O.jsx)(Jl,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:C("labels.arrowhead_arrow"),icon:(0,O.jsx)(ec,{theme:n.theme,flip:!o}),keyBinding:"w"},{value:"bar",text:C("labels.arrowhead_bar"),icon:(0,O.jsx)(nc,{theme:n.theme,flip:!o}),keyBinding:"e"},{value:"dot",text:C("labels.arrowhead_dot"),icon:(0,O.jsx)(tc,{theme:n.theme,flip:!o}),keyBinding:"r"},{value:"triangle",text:C("labels.arrowhead_triangle"),icon:(0,O.jsx)(rc,{theme:n.theme,flip:!o}),keyBinding:"t"}],value:Mc(t,n,(function(e){return Ye(e)&&wc(e.type)?e.startArrowhead:n.currentItemStartArrowhead}),n.currentItemStartArrowhead),onChange:function(e){return r({position:"start",type:e})}}),(0,O.jsx)(el,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:C("labels.arrowhead_none"),keyBinding:"q",icon:(0,O.jsx)(Jl,{theme:n.theme})},{value:"arrow",text:C("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,O.jsx)(ec,{theme:n.theme,flip:o})},{value:"bar",text:C("labels.arrowhead_bar"),keyBinding:"e",icon:(0,O.jsx)(nc,{theme:n.theme,flip:o})},{value:"dot",text:C("labels.arrowhead_dot"),keyBinding:"r",icon:(0,O.jsx)(tc,{theme:n.theme,flip:o})},{value:"triangle",text:C("labels.arrowhead_triangle"),icon:(0,O.jsx)(rc,{theme:n.theme,flip:o}),keyBinding:"t"}],value:Mc(t,n,(function(e){return Ye(e)&&wc(e.type)?e.endArrowhead:n.currentItemEndArrowhead}),n.currentItemEndArrowhead),onChange:function(e){return r({position:"end",type:e})}})]})]})}}),function(e,t,n,r,o,i){var a=r.zoom,l=180*n/Math.PI,c=e*(a.value-1)/2,s=t*(a.value-1)/2;return e>o&&1!==a.value&&(c=o*(a.value-1)/2),t>i&&1!==a.value&&(s=i*(a.value-1)/2),"translate(".concat(c,"px, ").concat(s,"px) scale(").concat(a.value,") rotate(").concat(l,"deg)")}),Dc=function(e){var t,n=e.id,r=e.appState,o=e.onChange,i=e.onSubmit,a=e.getViewportCoords,l=e.element,c=e.canvas,u=e.excalidrawContainer,d=e.app,f=fr(un(l)),p=function(){var e,o=null===(e=ar.getScene(l))||void 0===e?void 0:e.getElement(n);if(o&&Ve(o)){var i=o.x,c=o.y,d=xr(o),p=o.width,g=o.height,v=o.width,b=o.height;if(d&&o.containerId){var y=function(e,t){var n=t.style.fontFamily.replaceAll('"',"");return sn({fontFamily:e.fontFamily})!==n||"".concat(e.fontSize,"px")!==t.style.fontSize}(o,m),x=Number(m.style.height.slice(0,-2));if(x>0&&(b=x),y&&(f=fr(un(o)),t=d.height,b=o.height),t||(t=d.height),p=d.width-2*s.gK,g=d.height-2*s.gK,v=p,i=d.x+s.gK,b>g){var w=Math.min(b-g,f);return void to(d,{height:d.height+w})}if(d.height>t&&b<g){var k=Math.min(g-b,f);to(d,{height:d.height-k})}else c=d.y+d.height/2-b/2}var _=h(a(i,c),2),S=_[0],E=_[1],j=o.textAlign;m.value=o.originalText;var C=o.originalText.split("\n"),O=o.containerId?f:o.height/C.length;d||(p=(r.width-S-8)/r.zoom.value-Number(getComputedStyle(null==u?void 0:u.parentNode).marginRight.slice(0,-2)));var I=(r.height-E)/r.zoom.value,M=d?d.angle:o.angle;Object.assign(m.style,{font:un(o),lineHeight:"".concat(O,"px"),width:"".concat(v,"px"),height:"".concat(b,"px"),left:"".concat(S,"px"),top:"".concat(E,"px"),transform:Lc(v,b,M,r,p,I),textAlign:j,color:o.strokeColor,opacity:o.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(p,"px"),maxHeight:"".concat(I,"px")}),Mn()&&(m.style.fontFamily=sn(o)),to(o,{x:i,y:c})}},m=document.createElement("textarea");m.dir="auto",m.tabIndex=0,m.dataset.type="wysiwyg",m.wrap="off",m.classList.add("excalidraw-wysiwyg");var g="pre",v="normal";et(l)&&(g="pre-wrap",v="break-word"),Object.assign(m.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:v,whiteSpace:g,overflowWrap:"break-word"}),p(),o&&(m.oninput=function(){var e=m.scrollHeight/f;if(et(l)&&e>1){var t="auto";if(2===e){var n=xr(l);1===hr(m.value,un(l),n.width).split("\n").length&&(t="".concat(m.scrollHeight/2,"px"))}m.style.height=t,m.style.height="".concat(m.scrollHeight,"px")}o(m.value.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n"))}),m.onkeydown=function(e){if(e.stopPropagation(),Ac.keyTest(e))d.actionManager.executeAction(Ac);else if(Pc.keyTest(e))d.actionManager.executeAction(Pc);else if(e.key===Jt.ESCAPE)e.preventDefault(),S=!0,E();else if(e.key===Jt.ENTER&&e[Jt.CTRL_OR_CMD]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;S=!0,E()}else(e.key===Jt.TAB||e[Jt.CTRL_OR_CMD]&&(e.code===Nt||e.code===zt))&&(e.preventDefault(),e.shiftKey||e.code===Nt?w():x(),m.dispatchEvent(new Event("input")))};var b=" ".repeat(4),y=new RegExp("^ {1,".concat(4,"}")),x=function(){var e=m.selectionStart,t=m.selectionEnd,n=k(),r=m.value;n.forEach((function(e){var t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(b).concat(n)})),m.value=r,m.selectionStart=e+4,m.selectionEnd=t+4*n.length},w=function(){var e=m.selectionStart,t=m.selectionEnd,n=k(),r=[],o=m.value;n.forEach((function(e){var t=o.slice(e,e+4).match(y);if(t){var n=o.slice(0,e),i=o.slice(e+t[0].length);o="".concat(n).concat(i),r.push(e)}})),m.value=o,r.length&&(e>r[r.length-1]?m.selectionStart=Math.max(e-4,r[r.length-1]):m.selectionStart=e,m.selectionEnd=Math.max(m.selectionStart,t-4*r.length))},k=function(){var e=m.selectionStart,t=m.selectionEnd,n=m.value,r=n.slice(0,e).match(/[^\n]*$/)[0].length;return e-=r,n.slice(e,t).split("\n").reduce((function(t,n,r,o){return t.concat(r?t[r-1]+o[r-1].length+1:e)}),[]).reverse()},_=function(e){e.preventDefault(),e.stopPropagation()},S=!1,E=function(){var e;j();var t=null===(e=ar.getScene(l))||void 0===e?void 0:e.getElement(l.id);if(t){var n=m.value,r=xr(t);if(r)if(n=t.text,m.value){var o=br(r);o&&o===l.id||to(r,{boundElements:(r.boundElements||[]).concat({type:"text",id:l.id})})}else{var a;to(r,{boundElements:null===(a=r.boundElements)||void 0===a?void 0:a.filter((function(e){return!Ve(e)}))})}i({text:n,viaKeyboard:S,originalText:m.value})}},j=function(){M||(M=!0,m.onblur=null,m.oninput=null,m.onkeydown=null,T&&T.disconnect(),window.removeEventListener("resize",p),window.removeEventListener("wheel",_,!0),window.removeEventListener("pointerdown",O),window.removeEventListener("pointerup",C),window.removeEventListener("blur",E),I(),m.remove())},C=function e(t){window.removeEventListener("pointerup",e);var n=null==t?void 0:t.target,r=n instanceof HTMLInputElement&&n.closest(".color-picker-input")&&cn(n);setTimeout((function(){m.onblur=E,n&&r&&(n.onblur=function(){m.focus()}),r||m.focus()}))},O=function(e){var t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&cn(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(s.$C.SHAPE_ACTIONS_MENU))&&!cn(e.target)||t)&&(m.onblur=null,window.addEventListener("pointerup",C),window.addEventListener("blur",E))},I=ar.getScene(l).addCallback((function(){var e;p(),!(null===(e=document.activeElement)||void 0===e||!e.closest(".color-picker-input"))||m.focus()})),M=!1;m.select(),C();var T=null;c&&"ResizeObserver"in window?(T=new window.ResizeObserver((function(){p()}))).observe(c):window.addEventListener("resize",p),window.addEventListener("pointerdown",O),window.addEventListener("wheel",_,{passive:!1,capture:!0}),null==u||u.querySelector(".excalidraw-textEditorContainer").appendChild(m)},Rc=function(e,t){return Boolean(!e.viewModeEnabled&&(e.editingElement||Yc(t,e).length||"selection"!==e.elementType))};function zc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zc(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Bc=function(e){return e.reduce((function(e,t){return e+t.version}),0)},Hc=function(e){return e.filter((function(e){return!e.isDeleted}))},Fc=function(e){return!e.isDeleted},Uc=function(e){return Hc(e).map((function(e){return qe(e.type)?Nc(Nc({},e),{},{lastCommittedPoint:null}):e}))},Wc=function(e){return Uc(e)},Kc=function(e){return Uc(e)},Vc=function(e,t,n){var r=h([e.horizontal,e.vertical].map((function(e){return null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height})),2),o=r[0],i=r[1];return{isOverEither:o||i,isOverHorizontal:o,isOverVertical:i}},Gc=function(e,t){return e.some((function(e){return t.selectedElementIds[e.id]}))},Zc=function(e,t,n){var r=Array.from(new Set(Yc(e,t).map((function(e){return n(e)}))));return 1===r.length?r[0]:null},Yc=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((function(e){return t.selectedElementIds[e.id]||n&&et(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null}))},qc=function(e,t){return t.editingElement?[t.editingElement]:Yc(e,t,!0)},Xc=function(e){var t=e.scenePoint,n=e.viewportDimensions,r=e.zoom;return{scrollX:n.width/2*(1/r.value)-t.x-r.translation.x*(1/r.value),scrollY:n.height/2*(1/r.value)-t.y-r.translation.y*(1/r.value)}},$c=function(e,t,n){if(!(e=function(e){return e.filter((function(e){return!e.isDeleted&&!oo(e)}))}(e)).length)return{scrollX:0,scrollY:0};var r=h(kt(e),4),o=r[0],i=r[1],a=r[2],l=r[3];if(function(e,t,n){var r=h(n,4),o=r[0],i=r[1],a=r[2],l=r[3],c=xn({sceneX:o,sceneY:i},e),s=c.x,u=c.y,d=xn({sceneX:a,sceneY:l},e),f=d.x,p=d.y;return f-s>e.width||p-u>e.height}(t,0,[o,i,a,l])){var c=function(e,t){if(!e.length)return[0,0,0,0];var n=1/0,r=e[0];return e.forEach((function(e){var o=h(wt(e),4),i=o[0],a=o[1],l=o[2],c=o[3],s=ot((i+l)/2,(a+c)/2,t.x,t.y);s<n&&(n=s,r=e)})),wt(r)}(e,yn({clientX:t.scrollX,clientY:t.scrollY},t)),s=h(c,4);o=s[0],i=s[1],a=s[2],l=s[3]}return Xc({scenePoint:{x:(o+a)/2,y:(i+l)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},Qc=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:e,translation:{x:r.x-n.left-(r.x-n.left-t.translation.x)*(e/t.value),y:r.y-n.top-(r.y-n.top-t.translation.y)*(e/t.value)}}},Jc=function(e){var t=parseFloat(e.toFixed(2));return Math.max(.1,Math.min(t,30))};n(5422);function es(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function ts(e,t,n){return ts=es()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&N(o,n.prototype),o},ts.apply(null,arguments)}function ns(e){var t="function"==typeof Map?new Map:void 0;return ns=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ts(e,arguments,F(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),N(r,e)},ns(e)}function rs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=F(e);if(t){var o=F(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H(this,n)}}var os=function(e){B(n,e);var t=rs(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";return L(this,n),(e=t.call(this)).name=o,e.message=r,e}return R(n)}(ns(Error)),is=function(e){B(n,e);var t=rs(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted";return L(this,n),t.call(this,e,"AbortError")}return R(n)}(ns(DOMException)),as=(n(371),function(e){var t=e.size,n=void 0===t?"1em":t,r=e.circleWidth,o=void 0===r?8:r;return(0,O.jsx)("div",{className:"Spinner",children:(0,O.jsx)("svg",{viewBox:"0 0 100 100",style:{width:n,height:n},children:(0,O.jsx)("circle",{cx:"50",cy:"50",r:50-o/2,strokeWidth:o,fill:"none",strokeMiterlimit:"10"})})})}),ls=c().forwardRef((function(e,t){var n=Sm().id,r=c().useRef(null);c().useImperativeHandle(t,(function(){return r.current}));var o="ToolIcon_size_".concat(e.size),i=h((0,l.useState)(!1),2),a=i[0],s=i[1],u=(0,l.useRef)(!0),f=function(){var t=(0,d.Z)(g().mark((function t(n){var r,o;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o="onClick"in e&&(null===(r=e.onClick)||void 0===r?void 0:r.call(e,n)))||!("then"in o)){t.next=18;break}return t.prev=2,s(!0),t.next=6,o;case 6:t.next=15;break;case 8:if(t.prev=8,t.t0=t.catch(2),t.t0 instanceof is){t.next=14;break}throw t.t0;case 14:console.warn(t.t0);case 15:return t.prev=15,u.current&&s(!1),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,8,15,18]])})));return function(e){return t.apply(this,arguments)}}();(0,l.useEffect)((function(){return function(){u.current=!1}}),[]);var p=(0,l.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){var m="icon"===e.type?"button":e.type;return(0,O.jsxs)("button",{className:Fe("ToolIcon_type_button",o,e.className,e.visible&&!e.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!e.hidden,"ToolIcon--selected":e.selected,"ToolIcon--plain":"icon"===e.type}),"data-testid":e["data-testid"],hidden:e.hidden,title:e.title,"aria-label":e["aria-label"],type:m,onClick:f,ref:r,disabled:a||e.isLoading,children:[(e.icon||e.label)&&(0,O.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,O.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,O.jsx)(as,{})]}),e.showAriaLabel&&(0,O.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",a&&(0,O.jsx)(as,{})]}),e.children]})}return(0,O.jsxs)("label",{className:Fe("ToolIcon",e.className),title:e.title,onPointerDown:function(e){p.current=e.pointerType||null},onPointerUp:function(){requestAnimationFrame((function(){p.current=null}))},children:[(0,O.jsx)("input",{className:"ToolIcon_type_radio ".concat(o),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:"".concat(n,"-").concat(e.id),onChange:function(){var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:p.current})},checked:e.checked,ref:r}),(0,O.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,O.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));function cs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cs(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ls.defaultProps={visible:!0,className:"",size:"medium"};var us=function(e,t){if(e.editingGroupId){var n=yo(Hc(t),e.editingGroupId);if(n.length)return ss(ss({},e),{},{selectedElementIds:P({},n[0].id,!0)})}return e},ds=jc({name:"deleteSelectedElements",perform:function(e,t){if(t.editingLinearElement){var n=t.editingLinearElement,r=n.elementId,o=n.selectedPointsIndices,i=n.startBindingElement,a=n.endBindingElement,l=ta.getElement(r);if(!l)return!1;if(null==o||l.points.length<2){var c=e.filter((function(e){return e.id!==l.id}));return{elements:c,appState:ss(ss({},us(t,c)),{},{editingLinearElement:null}),commitToHistory:!1}}var s={startBindingElement:null!=o&&o.includes(0)?null:i,endBindingElement:null!=o&&o.includes(l.points.length-1)?null:a};return ta.deletePoints(l,o),{elements:e,appState:ss(ss({},t),{},{editingLinearElement:ss(ss(ss({},t.editingLinearElement),s),{},{selectedPointsIndices:(null==o?void 0:o[0])>0?[o[0]-1]:[0]})}),commitToHistory:!0}}var u=function(e,t){return{elements:e.map((function(e){return t.selectedElementIds[e.id]||et(e)&&t.selectedElementIds[e.containerId]?no(e,{isDeleted:!0}):e})),appState:ss(ss({},t),{},{selectedElementIds:{}})}}(e,t),d=u.elements,f=u.appState;return Ia(d,e.filter((function(e){var n=e.id;return t.selectedElementIds[n]}))),{elements:d,appState:ss(ss({},f=us(f,d)),{},{elementType:"selection",multiElement:null}),commitToHistory:Gc(Hc(e),t)}},contextItemLabel:"labels.delete",keyTest:function(e){return e.key===Jt.BACKSPACE||e.key===Jt.DELETE},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{type:"button",icon:ul,title:C("labels.delete"),"aria-label":C("labels.delete"),onClick:function(){return r(null)},visible:Gc(Hc(t),n)})}}),fs=function(e,t){for(var n=[],r=[],o=null,i=-1,a=In(Yc(e,t,!0));++i<e.length;)a.get(e[i].id)?(r.length&&(n=n.concat(r),r=[]),n.push(i),o=i+1):e[i].isDeleted&&o===i?(o=i+1,r.push(i)):r=[];return n},ps=function(e,t,n){if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);var r=ar.getScene(e).getElement(e.containerId);if(r)return t.indexOf(r)}else{var o,i,a=null===(o=e.boundElements)||void 0===o||null===(i=o.find((function(e){return"arrow"!==e.type})))||void 0===i?void 0:i.id;if(a){if("left"===n)return t.indexOf(e);var l=ar.getScene(e).getElement(a);if(l)return t.indexOf(l)}}},hs=function(e,t,n,r){var o,i=t[n],a=function(t){return!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId))},l="left"===r?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length-1,Math.max(n,0)))+1;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,a,Math.max(0,n-1)):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length,Math.max(n,0)))-1;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,a,n+1),c=t[l];if(!c)return-1;if(e.editingGroupId){var s;if((null==i?void 0:i.groupIds.join(""))===(null==c?void 0:c.groupIds.join("")))return null!==(s=ps(c,t,r))&&void 0!==s?s:l;if(null==c||!c.groupIds.includes(e.editingGroupId))return-1}if(!c.groupIds.length)return null!==(o=ps(c,t,r))&&void 0!==o?o:l;var u=e.editingGroupId?c.groupIds[c.groupIds.indexOf(e.editingGroupId)-1]:c.groupIds[c.groupIds.length-1],d=yo(t,u);return d.length?"left"===r?t.indexOf(d[0]):t.indexOf(d[d.length-1]):l},ms=function(e,t){return t.reduce((function(t,n){var r=e[n];return t[r.id]=r,t}),{})},gs=function(e,t,n){var r,o,i=fs(t,e),a=ms(t,i),l=(o=0,(r=i).reduce((function(e,t,n){return n>0&&r[n-1]!==t-1&&(o=++o),(e[o]||(e[o]=[])).push(t),e}),[]));return"right"===n&&(l=l.reverse()),l.forEach((function(r,o){var i=r[0],a=r[r.length-1],l="left"===n?i:a,c=hs(e,t,l,n);if(-1!==c&&l!==c){var s="left"===n?t.slice(0,c):t.slice(0,i),u=t.slice(i,a+1),d="left"===n?t.slice(c,i):t.slice(a+1,c+1),f="left"===n?t.slice(a+1):t.slice(c+1);t="left"===n?[].concat(A(s),A(u),A(d),A(f)):[].concat(A(s),A(d),A(u),A(f))}})),t.map((function(e){return a[e.id]?ro(e):e}))},vs=function(e,t,n){var r,o,i=fs(e,t),a=ms(e,i),l=[];if("left"===n){if(t.editingGroupId){var c=yo(e,t.editingGroupId);if(!c.length)return e;r=e.indexOf(c[0])}else r=0;o=i[i.length-1]}else{if(t.editingGroupId){var s=yo(e,t.editingGroupId);if(!s.length)return e;o=e.indexOf(s[s.length-1])}else o=e.length-1;r=i[0]}for(var u=r;u<o+1;u++)i.includes(u)||l.push(e[u]);var d=Object.values(a).map((function(e){return ro(e)})),f=e.slice(0,r),p=e.slice(o+1);return"left"===n?[].concat(A(f),A(d),l,A(p)):[].concat(A(f),l,A(d),A(p))},bs=function(e,t){return gs(t,e,"left")},ys=function(e,t){return gs(t,e,"right")},xs=function(e,t){return vs(e,t,"left")},ws=function(e,t){return vs(e,t,"right")},ks=jc({name:"sendBackward",perform:function(e,t){return{elements:bs(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Nt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,O.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(C("labels.sendBackward")," — ").concat(bn("CtrlOrCmd+[")),children:(0,O.jsx)(_l,{theme:n.theme})})}}),_s=jc({name:"bringForward",perform:function(e,t){return{elements:ys(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&!e.shiftKey&&e.code===zt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,O.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(C("labels.bringForward")," — ").concat(bn("CtrlOrCmd+]")),children:(0,O.jsx)(kl,{theme:n.theme})})}}),Ss=jc({name:"sendToBack",perform:function(e,t){return{elements:xs(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendToBack",keyTest:function(e){return Mt?e[Jt.CTRL_OR_CMD]&&e.altKey&&e.code===Nt:e[Jt.CTRL_OR_CMD]&&e.shiftKey&&e.code===Nt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,O.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(C("labels.sendToBack")," — ").concat(bn(Mt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,O.jsx)(El,{theme:n.theme})})}}),Es=jc({name:"bringToFront",perform:function(e,t){return{elements:ws(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringToFront",keyTest:function(e){return Mt?e[Jt.CTRL_OR_CMD]&&e.altKey&&e.code===zt:e[Jt.CTRL_OR_CMD]&&e.shiftKey&&e.code===zt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,O.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(e){return t(null)},title:"".concat(C("labels.bringToFront")," — ").concat(bn(Mt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,O.jsx)(Sl,{theme:n.theme})})}});function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Os=jc({name:"selectAll",perform:function(e,t){return!t.editingLinearElement&&{appState:vo(Cs(Cs({},t),{},{editingGroupId:null,selectedElementIds:e.reduce((function(e,t){return t.isDeleted||Ve(t)&&t.containerId||(e[t.id]=!0),e}),{})}),Hc(e)),commitToHistory:!0}},contextItemLabel:"labels.selectAll",keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.key===Jt.A}});function Is(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ms(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Is(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ts=jc({name:"duplicateSelection",perform:function(e,t){if(t.editingLinearElement){var n=ta.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Ms(Ms({},As(e,t)),{},{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.key===Jt.D},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{type:"button",icon:zl,title:"".concat(C("labels.duplicateSelection")," — ").concat(bn("CtrlOrCmd+D")),"aria-label":C("labels.duplicateSelection"),onClick:function(){return r(null)},visible:Gc(Hc(t),n)})}}),As=function(e,t){for(var n=new Map,r=[],o=[],i=new Map,a=function(e){var a=Ao(t.editingGroupId,n,e,{x:e.x+s.k/2,y:e.y+s.k/2});return i.set(e.id,a.id),o.push(e),r.push(a),a},l=[],c=0,u=In(Yc(e,t,!0));c<e.length;){var d=e[c];if(u.get(d.id)){if(d.groupIds.length){var f=mo(t,d);if(f){var p=yo(e,f);l.push.apply(l,A(p).concat(A(p.map((function(e){return a(e)}))))),c+=p.length;continue}}l.push(d,a(d))}else l.push(d);c++}return cr(l,o,i),Ca(l,o,i),{elements:l,appState:vo(Ms(Ms({},t),{},{selectedGroupIds:{},selectedElementIds:r.reduce((function(e,t){return et(t)||(e[t.id]=!0),e}),{})}),Hc(l))}},Ps=function(e){var t=e.title||("dark"===e.value?C("buttons.lightMode"):C("buttons.darkMode"));return(0,O.jsx)(ls,{type:"icon",icon:e.value===s.C6.LIGHT?Ls.MOON:Ls.SUN,title:t,"aria-label":t,onClick:function(){return e.onChange(e.value===s.C6.DARK?s.C6.LIGHT:s.C6.DARK)},"data-testid":"toggle-dark-mode"})},Ls={SUN:(0,O.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,O.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,O.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,O.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"})})},Ds=(n(6781),function(){var e=document.querySelector(".excalidraw-tooltip");if(e)return e;var t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t}),Rs=function(e){var t=e.children,n=e.label,r=e.long,o=void 0!==r&&r,i=e.style;return(0,l.useEffect)((function(){return function(){return Ds().classList.remove("excalidraw-tooltip--visible")}}),[]),(0,O.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:function(e){return function(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;var o=e.getBoundingClientRect(),i=o.x,a=o.bottom,l=o.top,c=o.width,s=t.getBoundingClientRect(),u=s.width,d=s.height,f=window.innerWidth,p=i+c/2-u/2,h=p+u>=f?p+u-f:0,m=a+5,g=m+d>=window.innerHeight?a-l+d+10:0;Object.assign(t.style,{top:"".concat(m-g,"px"),left:"".concat(p-h,"px")})}(e.currentTarget,Ds(),n,o)},onPointerLeave:function(){return Ds().classList.remove("excalidraw-tooltip--visible")},style:i,children:t})};n(196),n(1106);function zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ns(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zs(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Bs=c().forwardRef((function(e,t){var n=e.children,r=e.padding,o=e.className,i=e.style;return(0,O.jsx)("div",{className:Fe("Island",o),style:Ns({"--padding":r},i),ref:t,children:n})})),Hs=(n(8328),function(e){var t=e.theme,n=void 0===t?s.C6.LIGHT:t,r=e.closeOnClickOutside,o=void 0===r||r,i=Fs(n);if(!i)return null;return(0,It.createPortal)((0,O.jsxs)("div",{className:Fe("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:function(t){t.key===Jt.ESCAPE&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,O.jsx)("div",{className:"Modal__background",onClick:o?e.onCloseRequest:void 0}),(0,O.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),i)}),Fs=function(e){var t=h((0,l.useState)(null),2),n=t[0],r=t[1],o=km(),i=(0,l.useRef)(o);i.current=o;var a=Sm().container;return(0,l.useLayoutEffect)((function(){n&&n.classList.toggle("excalidraw--mobile",o)}),[n,o]),(0,l.useLayoutEffect)((function(){var t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,n=document.createElement("div");return n.classList.add("excalidraw","excalidraw-modal-container"),n.classList.toggle("excalidraw--mobile",i.current),t&&(n.classList.add("theme--dark"),n.classList.add("theme--dark-background-none")),document.body.appendChild(n),r(n),function(){document.body.removeChild(n)}}),[a,e]),n},Us=function(e){var t=function(){var e=h((0,l.useState)(null),2),t=e[0],n=e[1];return[t,(0,l.useCallback)((function(e){return n(e)}),[])]}(),n=h(t,2),r=n[0],o=n[1],i=h((0,l.useState)(document.activeElement),1)[0],a=Sm().id;(0,l.useEffect)((function(){if(r){var t=c(r);t.length>0&&!1!==e.autofocus&&(t[1]||t[0]).focus();var n=function(e){if(e.key===Jt.TAB){var t=c(r),n=document.activeElement,o=t.findIndex((function(e){return e===n}));0===o&&e.shiftKey?(t[t.length-1].focus(),e.preventDefault()):o!==t.length-1||e.shiftKey||(t[0].focus(),e.preventDefault())}};return r.addEventListener("keydown",n),function(){return r.removeEventListener("keydown",n)}}}),[r,e.autofocus]);var c=function(e){var t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=function(){i.focus(),e.onCloseRequest()};return(0,O.jsx)(Hs,{className:Fe("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,O.jsxs)(Bs,{ref:o,children:[(0,O.jsxs)("h2",{id:"".concat(a,"-dialog-title"),className:"Dialog__title",children:[(0,O.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,O.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":C("buttons.close"),children:km()?Rl:Dl})]}),(0,O.jsx)("div",{className:"Dialog__content",children:e.children})]})})},Ws=(n(4678),["onConfirm","onCancel","children","confirmText","cancelText","className"]);function Ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ks(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Gs=function(e){var t=e.onConfirm,n=e.onCancel,r=e.children,o=e.confirmText,i=void 0===o?C("buttons.confirm"):o,a=e.cancelText,l=void 0===a?C("buttons.cancel"):a,c=e.className,s=void 0===c?"":c,u=lo(e,Ws);return(0,O.jsxs)(Us,Vs(Vs({onCloseRequest:n,small:!0},u),{},{className:"confirm-dialog ".concat(s),children:[r,(0,O.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,O.jsx)(ls,{type:"button",title:l,"aria-label":l,label:l,onClick:n,className:"confirm-dialog--cancel"}),(0,O.jsx)(ls,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},Zs=function(e){var t=e.onConfirm,n=h((0,l.useState)(!1),2),r=n[0],o=n[1],i=function(){o(!r)};return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(ls,{type:"button",icon:ul,title:C("buttons.clearReset"),"aria-label":C("buttons.clearReset"),showAriaLabel:km(),onClick:i,"data-testid":"clear-canvas-button"}),r&&(0,O.jsx)(Gs,{onConfirm:function(){t(),i()},onCancel:i,title:C("clearCanvasDialog.title"),children:(0,O.jsxs)("p",{className:"clear-canvas__content",children:[" ",C("alerts.clearReset")]})})]})};function Ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ys(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}jc({name:"changeViewBackgroundColor",perform:function(e,t,n){return{appState:qs(qs({},t),n),commitToHistory:!!n.viewBackgroundColor}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,O.jsx)("div",{style:{position:"relative"},children:(0,O.jsx)(Xa,{label:C("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:function(e){return n({viewBackgroundColor:e})},isActive:"canvasColorPicker"===t.openPopup,setActive:function(e){return n({openPopup:e?"canvasColorPicker":null})},"data-testid":"canvas-background-picker"})})}}),jc({name:"clearCanvas",perform:function(e,t,n,r){return r.imageCache.clear(),{elements:e.map((function(e){return no(e,{isDeleted:!0})})),appState:qs(qs({},Ln()),{},{files:{},theme:t.theme,elementLocked:t.elementLocked,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog}),commitToHistory:!0}},PanelComponent:function(e){var t=e.updateData;return(0,O.jsx)(Zs,{onConfirm:t})}}),jc({name:"zoomIn",perform:function(e,t){var n=Qc(Jc(t.zoom.value+s.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:qs(qs({},t),{},{zoom:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,O.jsx)(ls,{type:"button",icon:ml,title:"".concat(C("buttons.zoomIn")," — ").concat(bn("CtrlOrCmd++")),"aria-label":C("buttons.zoomIn"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===At||e.code===Lt)&&(e[Jt.CTRL_OR_CMD]||e.shiftKey)}}),jc({name:"zoomOut",perform:function(e,t){var n=Qc(Jc(t.zoom.value-s.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:qs(qs({},t),{},{zoom:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,O.jsx)(ls,{type:"button",icon:gl,title:"".concat(C("buttons.zoomOut")," — ").concat(bn("CtrlOrCmd+-")),"aria-label":C("buttons.zoomOut"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===Pt||e.code===Dt)&&(e[Jt.CTRL_OR_CMD]||e.shiftKey)}}),jc({name:"resetZoom",perform:function(e,t){return{appState:qs(qs({},t),{},{zoom:Qc(1,t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2})}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,O.jsx)(Rs,{label:C("buttons.resetZoom"),style:{height:"100%"},children:(0,O.jsxs)(ls,{type:"button",className:"reset-zoom-button",title:C("buttons.resetZoom"),"aria-label":C("buttons.resetZoom"),onClick:function(){t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:function(e){return(e.code===Ut||e.code===Rt)&&(e[Jt.CTRL_OR_CMD]||e.shiftKey)}});var Xs=function(e,t,n){var r=Hc(e),o=Yc(r,t),i=n&&o.length>0?kt(o):kt(r),a=function(e,t){var n=h(e,4),r=n[0],o=n[1],i=n[2],a=n[3],l=i-r,c=t.width/l,u=a-o,d=t.height/u,f=Math.min(c,d),p=Math.floor(f/s.V4)*s.V4;return Math.min(Math.max(p,s.V4),1)}(i,{width:t.width,height:t.height}),l=Qc(a,t.zoom,{left:t.offsetLeft,top:t.offsetTop}),c=h(i,4),u=c[0],d=c[1],f=(u+c[2])/2,p=(d+c[3])/2;return{appState:qs(qs(qs({},t),Xc({scenePoint:{x:f,y:p},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{},{zoom:l}),commitToHistory:!1}};jc({name:"zoomToSelection",perform:function(e,t){return Xs(e,t,!0)},keyTest:function(e){return e.code===Ht&&e.shiftKey&&!e.altKey&&!e[Jt.CTRL_OR_CMD]}}),jc({name:"zoomToFit",perform:function(e,t){return Xs(e,t,!1)},keyTest:function(e){return e.code===Bt&&e.shiftKey&&!e.altKey&&!e[Jt.CTRL_OR_CMD]}}),jc({name:"toggleTheme",perform:function(e,t,n){return{appState:qs(qs({},t),{},{theme:n||(t.theme===s.C6.LIGHT?s.C6.DARK:s.C6.LIGHT)}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,O.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,O.jsx)(Ps,{value:t.theme,onChange:function(e){n(e)}})})},keyTest:function(e){return e.altKey&&e.shiftKey&&e.code===Vt}});function $s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$s(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Js,eu,tu,nu=jc({name:"finalize",perform:function(e,t,n,r){var o,i=r.canvas,a=r.focusContainer;if(t.editingLinearElement){var l=t.editingLinearElement,c=l.elementId,s=l.startBindingElement,u=l.endBindingElement,d=ta.getElement(c);if(d)return Xe(d)&&ia(d,s,u),{elements:d.points.length<2||oo(d)?e.filter((function(e){return e.id!==d.id})):void 0,appState:Qs(Qs({},t),{},{editingLinearElement:null}),commitToHistory:!0}}var f=e;t.pendingImageElement&&to(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();var p=t.multiElement?t.multiElement:"freedraw"===(null===(o=t.editingElement)||void 0===o?void 0:o.type)?t.editingElement:null;if(p){if("freedraw"!==p.type&&"touch"!==t.lastPointerDownWith){var m=p.points,g=p.lastCommittedPoint;g&&m[m.length-1]===g||to(p,{points:p.points.slice(0,-1)})}oo(p)&&(f=f.slice(0,-1));var v=it(p.points,t.zoom.value);if(("line"===p.type||"freedraw"===p.type)&&v){var b=p.points,y=b[0];to(p,{points:b.map((function(e,t){return t===b.length-1?[y[0],y[1]]:e}))})}if(Xe(p)&&!v&&p.points.length>1){var x=h(ta.getPointAtIndexGlobalCoordinates(p,-1),2),w=x[0],k=x[1];sa(p,t,ar.getScene(p),{x:w,y:k})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[p.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&p||hn(i),{elements:f,appState:Qs(Qs({},t),{},{elementType:(t.elementLocked||"freedraw"===t.elementType)&&p?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:p&&!t.elementLocked&&"freedraw"!==t.elementType?Qs(Qs({},t.selectedElementIds),{},P({},p.id,!0)):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:function(e,t){return e.key===Jt.ESCAPE&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Jt.ESCAPE||e.key===Jt.ENTER)&&null!==t.multiElement},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,O.jsx)(ls,{type:"button",icon:vl,title:C("buttons.done"),"aria-label":C("buttons.done"),onClick:n,visible:null!=t.multiElement})}}),ru="undefined"!=typeof process&&null!==(Js={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==Js&&Js.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?function(e,t,n,r){window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(eu={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==eu&&eu.JEST_WORKER_ID,function(e,t,n,r){}),ou=(n(518),n(9966),function(e){var t=Sm().id,n=h((0,l.useState)(e.value),2),r=n[0],o=n[1];return(0,O.jsxs)("div",{className:"ProjectName",children:[(0,O.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,O.jsx)("input",{type:"text",className:"TextInput",onBlur:function(t){!function(e){for(var t=e.parentElement;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}}(t.target);var n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:function(e){if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:r,onChange:function(e){return o(e.target.value)}}):(0,O.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})}),iu=function(e,t){if(null!=t&&t.collaborators){var n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}var r=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),o=Ot.elementBackground.slice(1),i=Ot.elementStroke.slice(1);return{background:o[r%o.length],stroke:i[r%i.length]}};function au(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return lu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lu(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function lu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(tu||(tu={}));var cu=function(){var e=document.createElement("canvas").getContext("2d");if(!e)return!1;return e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0]}(),su=function(e,t,n,r,o,i,a,l){var c=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(i,a),e.rotate(l),c&&e.fillRect(t-i,n-a,r,o),e.strokeRect(t-i,n-a,r,o),e.restore()},uu=function(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},du=function(e,t,n,r,o,i,a){if(null===i)return{atLeastOneVisibleElement:!1};var l=a.renderScrollbars,c=void 0===l||l,u=a.renderSelection,d=void 0===u||u,f=a.renderGrid,p=void 0===f||f,m=a.isExporting,g=i.getContext("2d");g.setTransform(1,0,0,1,0,0),g.save(),g.scale(r,r);var v=i.width/r,b=i.height/r;(m&&"dark"===a.theme&&(g.filter=s.ZF),"string"==typeof a.viewBackgroundColor)?(("transparent"===a.viewBackgroundColor||5===a.viewBackgroundColor.length||9===a.viewBackgroundColor.length||/(hsla|rgba)\(/.test(a.viewBackgroundColor))&&g.clearRect(0,0,v,b),g.save(),g.fillStyle=a.viewBackgroundColor,g.fillRect(0,0,v,b),g.restore()):g.clearRect(0,0,v,b);var y=a.zoom.translation.x,x=a.zoom.translation.y;g.save(),g.translate(y,x),g.scale(a.zoom.value,a.zoom.value),p&&t.gridSize&&function(e,t,n,r,o,i){e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(var a=n;a<n+o+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+i+2*t);for(var l=r;l<r+i+2*t;l+=t)e.moveTo(n-t,l),e.lineTo(n+o+2*t,l);e.stroke(),e.restore()}(g,t.gridSize,-Math.ceil(y/a.zoom.value/t.gridSize)*t.gridSize+a.scrollX%t.gridSize,-Math.ceil(x/a.zoom.value/t.gridSize)*t.gridSize+a.scrollY%t.gridSize,v/a.zoom.value,b/a.zoom.value);var w,k=e.filter((function(e){return vu(e,v,b,{zoom:a.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:a.scrollX,scrollY:a.scrollY})}));if(k.forEach((function(e){try{Fr(e,o,g,a)}catch(e){console.error(e)}})),t.editingLinearElement){var _=ta.getElement(t.editingLinearElement.elementId);_&&function(e,t,n,r){e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,ta.getPointsGlobalCoordinates(r).forEach((function(r,o){var i,a;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=null!==(i=t.editingLinearElement)&&void 0!==i&&null!==(a=i.selectedPointsIndices)&&void 0!==a&&a.includes(o)?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";var l=ta.POINT_HANDLE_SIZE;uu(e,r[0],r[1],l/2/n.zoom.value)})),e.restore()}(g,t,a,_)}if(n)try{Fr(n,o,g,a)}catch(e){console.error(e)}if(oa(t)&&t.suggestedBindings.filter((function(e){return null!=e})).forEach((function(e){hu(g,a,e)})),d&&!t.multiElement&&!t.editingLinearElement){var S,j=e.reduce((function(e,n){var r=[];if(t.selectedElementIds[n.id]&&!ho(t,n)&&r.push(jt.black),a.remoteSelectedElementIds[n.id]&&r.push.apply(r,A(a.remoteSelectedElementIds[n.id].map((function(e){return iu(e,t).background})))),r.length){var o=h(mt(n),4),i=o[0],l=o[1],c=o[2],s=o[3];e.push({angle:n.angle,elementX1:i,elementY1:l,elementX2:c,elementY2:s,selectionColors:r})}return e}),[]),C=function(t){var n=yo(e,t),r=h(kt(n),4),o=r[0],i=r[1],a=r[2],l=r[3];j.push({angle:0,elementX1:o,elementX2:a,elementY1:i,elementY2:l,selectionColors:[jt.black]})},O=au(go(t));try{for(O.s();!(S=O.n()).done;){C(S.value)}}catch(e){O.e(e)}finally{O.f()}t.editingGroupId&&C(t.editingGroupId),j.forEach((function(e){return pu(g,a,e)}));var I=Yc(e,t);if(g.save(),g.translate(a.scrollX,a.scrollY),1===I.length){g.fillStyle=jt.white;var M=Ho(I[0],a.zoom,"mouse");t.viewModeEnabled||fu(g,a,M,I[0].angle)}else if(I.length>1&&!t.isRotating){var T=4/a.zoom.value;g.fillStyle=jt.white;var P=h(kt(I),4),L=P[0],D=P[1],R=P[2],z=P[3],N=g.getLineDash();g.setLineDash([2/a.zoom.value]);var B=g.lineWidth;g.lineWidth=1/a.zoom.value,su(g,L-T,D-T,R-L+2*T,z-D+2*T,(L+R)/2,(D+z)/2,0),g.lineWidth=B,g.setLineDash(N);var H=Bo([L,D,R,z],0,a.zoom,"mouse",Lo);fu(g,a,H,0)}g.restore()}for(var F in g.restore(),a.remotePointerViewportCoords){var U=a.remotePointerViewportCoords[F],W=U.x,K=U.y;W-=t.offsetLeft,K-=t.offsetTop;var V=W<0||W>v-9||K<0||K>b-14;W=Math.max(W,0),W=Math.min(W,v-9),K=Math.max(K,0),K=Math.min(K,b-14);var G=iu(F,t),Z=G.background,Y=G.stroke;g.save(),g.strokeStyle=Y,g.fillStyle=Z;var q=a.remotePointerUserStates[F];(V||q===tu.AWAY)&&(g.globalAlpha=.48),a.remotePointerButton&&"down"===a.remotePointerButton[F]&&(g.beginPath(),g.arc(W,K,15,0,2*Math.PI,!1),g.lineWidth=3,g.strokeStyle="#ffffff88",g.stroke(),g.closePath(),g.beginPath(),g.arc(W,K,15,0,2*Math.PI,!1),g.lineWidth=1,g.strokeStyle=Y,g.stroke(),g.closePath()),g.beginPath(),g.moveTo(W,K),g.lineTo(W+1,K+14),g.lineTo(W+4,K+9),g.lineTo(W+9,K+10),g.lineTo(W,K),g.fill(),g.stroke();var X=a.remotePointerUsernames[F],$="";q===tu.AWAY?$=cu?"⚫️":" (".concat(tu.AWAY,")"):q===tu.IDLE?$=cu?"💤":" (".concat(tu.IDLE,")"):q===tu.ACTIVE&&($=cu?"🟢":"");var Q="".concat(X?"".concat(X," "):"").concat($);if(!V&&Q){var J=W+9,ee=K+14,te=g.measureText(Q),ne=te.actualBoundingBoxDescent+te.actualBoundingBoxAscent;g.fillStyle=Y,g.fillRect(J-1,ee-1,te.width+8+2,ne+8+2),g.fillStyle=Z,g.fillRect(J,ee,te.width+8,ne+8),g.fillStyle=jt.white,g.fillText(Q,J+4,ee+4+te.actualBoundingBoxAscent)}g.restore(),g.closePath()}return c&&(w=function(e,t,n,r){var o=r.scrollX,i=r.scrollY,a=r.zoom;if(0===e.length)return{horizontal:null,vertical:null};var l=h(kt(e),4),c=l[0],s=l[1],u=l[2],d=l[3],f=t/a.value,p=n/a.value,m=t-f,g=n-p,v={top:parseInt(wn("sat")),bottom:parseInt(wn("sab")),left:parseInt(wn("sal")),right:parseInt(wn("sar"))},b=E().rtl,y=m/2-o+v.left,x=g/2-i+v.top,w=y+f-v.right,k=x+p-v.bottom,_=Math.min(c,y),S=Math.min(s,x),j=Math.max(u,w),C=Math.max(d,k);return{horizontal:y===_&&w===j?null:{x:Math.max(v.left,4)+(y-_)/(j-_)*t,y:n-6-Math.max(4,v.bottom),width:(w-y)/(j-_)*t-Math.max(8,v.left+v.right),height:6},vertical:x===S&&k===C?null:{x:b?Math.max(v.left,4):t-6-Math.max(v.right,4),y:(x-S)/(C-S)*n+Math.max(v.top,4),width:6,height:(k-x)/(C-S)*n-Math.max(8,v.top+v.bottom)}}}(e,v,b,a),g.save(),g.fillStyle="rgba(0,0,0,0.3)",g.strokeStyle="rgba(255,255,255,0.8)",[w.horizontal,w.vertical].forEach((function(e){e&&function(e,t,n,r,o,i){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+o-i),e.quadraticCurveTo(t+r,n+o,t+r-i,n+o),e.lineTo(t+i,n+o),e.quadraticCurveTo(t,n+o,t,n+o-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),e.fill(),e.stroke()}(g,e.x,e.y,e.width,e.height,3)})),g.restore()),g.restore(),{atLeastOneVisibleElement:k.length>0,scrollBars:w}},fu=function(e,t,n,r){Object.keys(n).forEach((function(o){var i=n[o];void 0!==i&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===o?uu(e,i[0]+i[2]/2,i[1]+i[3]/2,i[2]/2):su(e,i[0],i[1],i[2],i[3],i[0]+i[2]/2,i[1]+i[3]/2,r,!0),e.restore())}))},pu=function(e,t,n){var r=n.angle,o=n.elementX1,i=n.elementY1,a=n.elementX2,l=n.elementY2,c=n.selectionColors,s=a-o,u=l-i,d=4/t.zoom.value,f=8/t.zoom.value,p=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;for(var h=c.length,m=0;m<h;++m)e.strokeStyle=c[m],e.setLineDash([f,p+(f+p)*(h-1)]),e.lineDashOffset=(f+p)*m,su(e,o-d,i-d,s+2*d,u+2*d,o+s/2,i+u/2,r);e.restore()},hu=function(e,t,n){var r=Array.isArray(n)?gu:mu;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},mu=function(e,t){var n=h(mt(t),4),r=n[0],o=n[1],i=n[2]-r,a=n[3]-o,l=bi(t,i,a);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;var c=2+l/2;switch(t.type){case"rectangle":case"text":case"image":su(e,r-c,o-c,i+2*c,a+2*c,r+i/2,o+a/2,t.angle);break;case"diamond":var s=Math.hypot(i,a);!function(e,t,n,r,o,i){e.save(),e.translate(r,o),e.rotate(i),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()}(e,i+2*(c*s/a),a+2*(c*s/i),r+i/2,o+a/2,t.angle);break;case"ellipse":!function(e,t,n,r,o,i){e.beginPath(),e.ellipse(r,o,t/2,n/2,i,0,2*Math.PI),e.stroke()}(e,i+2*c,a+2*c,r+i/2,o+a/2,t.angle)}},gu=function(e,t){var n=h(t,3),r=n[0],o=n[1],i=n[2],a=bi(i,i.width,i.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",("both"===o?[0,-1]:"start"===o?[0]:[-1]).forEach((function(t){var n=h(ta.getPointAtIndexGlobalCoordinates(r,t),2),o=n[0],i=n[1];uu(e,o,i,a)}))},vu=function(e,t,n,r){var o=h(wt(e),4),i=o[0],a=o[1],l=o[2],c=o[3],s=yn({clientX:r.offsetLeft,clientY:r.offsetTop},r),u=yn({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return s.x<=l&&s.y<=c&&u.x>=i&&u.y>=a},bu=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=o.offsetX,a=void 0===i?0:i,l=o.offsetY,c=void 0===l?0:l,s=o.exportWithDarkMode,u=void 0!==s&&s;n&&e.forEach((function(e){if(!e.isDeleted)try{Wr(e,t,n,r,e.x+a,e.y+c,u)}catch(e){console.error(e)}}))},yu=Object.defineProperty,xu=(e,t)=>()=>(e&&(t=e(e=0)),t),wu=(e,t)=>{for(var n in(e=>{yu(e,"__esModule",{value:!0})})(e),t)yu(e,n,{get:t[n],enumerable:!0})},ku={};wu(ku,{default:()=>_u});var _u,Su=xu((()=>{_u=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise(((t,n)=>{let r=document.createElement("input");r.type="file";let o=[...e.map((e=>e.mimeTypes||[])).join(),e.map((e=>e.extensions||[])).join()].join();r.multiple=e[0].multiple||!1,r.accept=o||"";let i=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(i,(()=>a(n)),r);r.addEventListener("change",(()=>{i(r.multiple?Array.from(r.files):r.files[0])})),r.click()})))})),Eu={};wu(Eu,{default:()=>Cu});var ju,Cu,Ou=xu((()=>{ju=async e=>{let t=await e.getFile();return t.handle=e,t},Cu=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach(((e,n)=>{t[n]={description:e.description||"",accept:{}},e.mimeTypes?e.mimeTypes.map((r=>{t[n].accept[r]=e.extensions||[]})):t[n].accept["*/*"]=e.extensions||[]}));let n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(ju));return e[0].multiple?r:r[0]}})),Iu={};wu(Iu,{default:()=>Mu});var Mu,Tu=xu((()=>{Mu=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise(((t,n)=>{let r=document.createElement("input");r.type="file",r.webkitdirectory=!0;let o=e=>{"function"==typeof i&&i(),t(e)},i=e[0].legacySetup&&e[0].legacySetup(o,(()=>i(n)),r);r.addEventListener("change",(()=>{let t=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter((t=>t.webkitRelativePath.split("/").every((t=>!e[0].skipDirectory({name:t,kind:"directory"})))))):t=t.filter((e=>2===e.webkitRelativePath.split("/").length)),o(t)})),r.click()})))})),Au={};wu(Au,{default:()=>Lu});var Pu,Lu,Du=xu((()=>{Pu=async(e,t,n=e.name,r)=>{let o=[],i=[];for await(let a of e.values()){let l=`${n}/${a.name}`;"file"===a.kind?i.push(a.getFile().then((t=>(t.directoryHandle=e,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>l}))))):"directory"===a.kind&&t&&(!r||!r(a))&&o.push(Pu(a,t,l,r))}return[...(await Promise.all(o)).flat(),...await Promise.all(i)]},Lu=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return Pu(t,e.recursive,void 0,e.skipDirectory)}})),Ru={};wu(Ru,{default:()=>zu});var zu,Nu=xu((()=>{zu=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement("a"),r=e;"body"in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then((({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()}))}()}),o=new Response(r);return n.releaseLock(),new Blob([await o.blob()],{type:t})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(r);let o=()=>{"function"==typeof i&&i()},i=t.legacySetup&&t.legacySetup(o,(()=>i(reject)),n);return n.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(n.href)),3e4),o()})),n.click(),null}})),Bu={};wu(Bu,{default:()=>Hu});var Hu,Fu=xu((()=>{Hu=async(e,t=[{}],n=null,r=!1)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let o=[];if(t.forEach(((t,n)=>{o[n]={description:t.description||"",accept:{}},t.mimeTypes?(0===n&&(e.type?t.mimeTypes.push(e.type):e.headers&&e.headers.get("content-type")&&t.mimeTypes.push(e.headers.get("content-type"))),t.mimeTypes.map((e=>{o[n].accept[e]=t.extensions||[]}))):e.type&&(o[n].accept[e.type]=t.extensions||[])})),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let i=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:o,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1}),a=await i.createWritable();return"stream"in e?(await e.stream().pipeTo(a),i):"body"in e?(await e.body.pipeTo(a),i):(await a.write(blob),await a.close(),i)}})),Uu=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),Wu=Uu?Promise.resolve().then((()=>(Ou(),Eu))):Promise.resolve().then((()=>(Su(),ku)));Uu?Promise.resolve().then((()=>(Du(),Au))):Promise.resolve().then((()=>(Tu(),Iu)));var Ku=Uu?Promise.resolve().then((()=>(Fu(),Bu))):Promise.resolve().then((()=>(Nu(),Ru)));var Vu=function(e){var t,n,r,o=null===(t=e.extensions)||void 0===t?void 0:t.reduce((function(e,t){return e.push(s.LO[t]),e}),[]),i=null===(n=e.extensions)||void 0===n?void 0:n.reduce((function(e,t){return"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))}),[]);return async function(...e){return(await Wu).default(...e)}({description:e.description,extensions:i,mimeTypes:o,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:function(t,n,r){var o=dn(n,500),i=function(){a(),document.addEventListener(s.Ks.KEYUP,o),document.addEventListener(s.Ks.POINTER_UP,o),o()},a=function(){var n;if(null!==(n=r.files)&&void 0!==n&&n.length){var o=e.multiple?A(r.files):r.files[0];t(o)}};requestAnimationFrame((function(){window.addEventListener(s.Ks.FOCUS,i)}));var l=window.setInterval((function(){a()}),500);return function(e){clearInterval(l),o.cancel(),window.removeEventListener(s.Ks.FOCUS,i),document.removeEventListener(s.Ks.KEYUP,o),document.removeEventListener(s.Ks.POINTER_UP,o),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new is))}}})},Gu=function(e,t){return async function(...e){return(await Ku).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle)};function Zu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Yu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yu(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Yu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qu(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $u={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Qu=function(e,t){var n,r,o,i,a,l,c,s,u,d,f,p,h,m={type:t.type||e.type,version:e.version||1,versionNonce:null!==(n=e.versionNonce)&&void 0!==n?n:0,isDeleted:null!==(r=e.isDeleted)&&void 0!==r&&r,id:e.id||Qr(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(o=e.strokeStyle)&&void 0!==o?o:"solid",roughness:null!==(i=e.roughness)&&void 0!==i?i:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(l=t.x)&&void 0!==l?l:e.x)&&void 0!==a?a:0,y:null!==(c=null!==(s=t.y)&&void 0!==s?s:e.y)&&void 0!==c?c:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(u=e.seed)&&void 0!==u?u:1,groupIds:null!==(d=e.groupIds)&&void 0!==d?d:[],strokeSharpness:null!==(f=e.strokeSharpness)&&void 0!==f?f:qe(e.type)?"round":"sharp",boundElements:e.boundElementIds?e.boundElementIds.map((function(e){return{type:"arrow",id:e}})):null!==(p=e.boundElements)&&void 0!==p?p:[],updated:null!==(h=e.updated)&&void 0!==h?h:On()};return Xu(Xu(Xu({},m),ao(m)),t)},Ju=function(e){var t,n,r;switch(e.type){case"text":var o=e.fontSize,i=e.fontFamily;if("font"in e){var a=h(e.font.split(" "),2),l=a[0],c=a[1];o=parseInt(l,10),r=c,i=Object.keys(s.ut).includes(r)?s.ut[r]:s.rk}return Qu(e,{fontSize:o,fontFamily:i,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||s.Hg,verticalAlign:e.verticalAlign||s.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:e.originalText||e.text});case"freedraw":return Qu(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Qu(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":var u=e.startArrowhead,d=void 0===u?null:u,f=e.endArrowhead,p=void 0===f?"arrow"===e.type?"arrow":null:f,m=e.x,g=e.y,v=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;if(0!==v[0][0]||0!==v[0][1]){var b=ta.getNormalizedPoints(e);v=b.points,m=b.x,g=b.y}return Qu(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:d,endArrowhead:p,points:v,x:m,y:g});case"ellipse":case"rectangle":case"diamond":return Qu(e,{})}},ed=function(e,t){var n=t?In(t):null;return(e||[]).reduce((function(e,t){if("selection"!==t.type&&!oo(t)){var r=Ju(t);if(r){var o=null==n?void 0:n.get(t.id);o&&o.version>r.version&&(r=ro(r,o.version)),e.push(r)}}return e}),[])},td=function(e,t){e=e||{};var n,r=Ln(),o={},i=Zu(Object.entries(r));try{for(i.s();!(n=i.n()).done;){var a=h(n.value,2),l=a[0],c=a[1],s=e[l],u=t?t[l]:void 0;o[l]=void 0!==s?s:void 0!==u?u:c}}catch(e){i.e(e)}finally{i.f()}return Xu(Xu({},o),{},{elementType:$u[o.elementType]?o.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:r.zoom.translation}:e.zoom||r.zoom})},nd=function(e,t,n){return{elements:ed(null==e?void 0:e.elements,n),appState:td(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}},rd=function(e,t){var n,r=[],o=Zu(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(Array.isArray(i))r.push({status:t,elements:i,id:Qr(),created:Date.now()});else{var a=i;r.push(Xu(Xu({},a),{},{id:a.id||Qr(),status:a.status||t,created:a.created||Date.now()}))}}}catch(e){o.e(e)}finally{o.f()}return r};function od(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function id(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?od(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):od(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ad=function(){var e=(0,d.Z)(g().mark((function e(t){var r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type!==s.LO.png){e.next=18;break}return e.prev=1,e.next=4,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 4:return e.next=6,e.sent.decodePngMetadata(t);case 6:return e.abrupt("return",e.sent);case 9:if(e.prev=9,e.t0=e.catch(1),"INVALID"!==e.t0.message){e.next=15;break}throw new DOMException(C("alerts.imageDoesNotContainScene"),"EncodingError");case 15:throw new DOMException(C("alerts.cannotRestoreFromImage"),"EncodingError");case 16:e.next=43;break;case 18:if(!("text"in Blob)){e.next=24;break}return e.next=21,t.text();case 21:r=e.sent,e.next=27;break;case 24:return e.next=26,new Promise((function(e){var n=new FileReader;n.readAsText(t,"utf8"),n.onloadend=function(){n.readyState===FileReader.DONE&&e(n.result)}}));case 26:r=e.sent;case 27:if(t.type!==s.LO.svg){e.next=43;break}return e.prev=28,e.next=31,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 31:return e.next=33,e.sent.decodeSvgMetadata({svg:r});case 33:return e.abrupt("return",e.sent);case 36:if(e.prev=36,e.t1=e.catch(28),"INVALID"!==e.t1.message){e.next=42;break}throw new DOMException(C("alerts.imageDoesNotContainScene"),"EncodingError");case 42:throw new DOMException(C("alerts.cannotRestoreFromImage"),"EncodingError");case 43:return e.abrupt("return",r);case 44:case"end":return e.stop()}}),e,null,[[1,9],[28,36]])})));return function(t){return e.apply(this,arguments)}}(),ld=function(e){var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},cd=function(e){var t=ld(e);return"png"===t||"svg"===t},sd=function(e){var t=(e||{}).type;return!!t&&s.jo.includes(t)},ud=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ad(t);case 2:if(o=e.sent,e.prev=3,i=JSON.parse(o),Sd(i)){e.next=7;break}throw new Error(C("alerts.couldNotLoadInvalidFile"));case 7:return a=nd({elements:Kc(i.elements||[]),appState:id(id({theme:null==n?void 0:n.theme,fileHandle:t.handle||null},zn(i.appState||{})),n?$c(i.elements||[],n):{}),files:i.files},n,r),e.abrupt("return",a);case 11:throw e.prev=11,e.t0=e.catch(3),console.error(e.t0.message),new Error(C("alerts.couldNotLoadInvalidFile"));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t,n,r){return e.apply(this,arguments)}}(),dd=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ad(t);case 2:if(n=e.sent,(r=JSON.parse(n)).type===s.r8.excalidrawLibrary){e.next=6;break}throw new Error(C("alerts.couldNotLoadInvalidFile"));case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fd=function(){var e=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){try{t.toBlob((function(t){if(!t)return n(new os(C("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));e(t)}))}catch(e){n(e)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pd=function(){var e=(0,d.Z)(g().mark((function e(t){var n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=window.crypto.subtle,e.next=4,t.arrayBuffer();case 4:return e.t1=e.sent,e.next=7,e.t0.digest.call(e.t0,"SHA-1",e.t1);case 7:return n=e.sent,e.abrupt("return",(r=new Uint8Array(n),Array.from(r).map((function(e){return"0".concat(e.toString(16)).slice(-2)})).join("")));case 11:return e.prev=11,e.t2=e.catch(0),console.error(e.t2),e.abrupt("return",Ue(40));case 15:case"end":return e.stop()}var r}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}(),hd=function(){var e=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new FileReader;r.onload=function(){var t=r.result;e(t)},r.onerror=function(e){return n(e)},r.readAsDataURL(t)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),md=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.indexOf(","),r=atob(e.slice(n+1)),o=e.slice(0,n).split(":")[1].split(";")[0],i=new ArrayBuffer(r.length),a=new Uint8Array(i),l=0;l<r.length;l++)a[l]=r.charCodeAt(l);return new File([i],t,{type:o})},gd=function(){var e=(0,d.Z)(g().mark((function e(t,r){var o,i,a,l,c,u;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type!==s.LO.svg){e.next=2;break}return e.abrupt("return",t);case 2:return e.next=4,Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((function(e){return e.default})),n.e(736).then(n.bind(n,100)).then((function(e){return e.default}))]);case 4:if(o=e.sent,i=h(o,2),a=i[0],l=i[1],c=l({pica:a({features:["js","wasm"]})}),r.outputType&&(u=r.outputType,c._create_blob=function(e){return this.pica.toBlob(e.out_canvas,u,.8).then((function(t){return e.out_blob=t,e}))}),sd(t)){e.next=12;break}throw new Error(C("errors.unsupportedFileType"));case 12:return e.t0=File,e.next=15,c.toBlob(t,{max:r.maxWidthOrHeight});case 15:return e.t1=e.sent,e.t2=[e.t1],e.t3=t.name,e.t4={type:r.outputType||t.type},e.abrupt("return",new e.t0(e.t2,e.t3,e.t4));case 20:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),vd=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:s.LO.svg})};function bd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return yd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yd(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function yd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xd=function(e,t){var n,r={},o=bd(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;!i.isDeleted&&"fileId"in i&&i.fileId&&t[i.fileId]&&(r[i.fileId]=t[i.fileId])}}catch(e){o.e(e)}finally{o.f()}return r},wd=function(e,t,n,r){var o={type:s.r8.excalidraw,version:s.Kr.excalidraw,source:s.pb,elements:"local"===r?Kc(e):Wc(e),appState:"local"===r?zn(t):Nn(t),files:"local"===r?xd(e,n):void 0};return JSON.stringify(o,null,2)},kd=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=wd(t,n,r,"local"),i=new Blob([o],{type:s.LO.excalidraw}),e.next=4,Gu(i,{name:n.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:cd(n.fileHandle)?null:n.fileHandle});case 4:return a=e.sent,e.abrupt("return",{fileHandle:a});case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),_d=function(){var e=(0,d.Z)(g().mark((function e(t,n){var r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Vu({description:"Excalidraw files"});case 2:return r=e.sent,e.abrupt("return",ud(r,t,n));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Sd=function(e){return(null==e?void 0:e.type)===s.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"===T(e.appState)))},Ed=function(e){return"object"===T(e)&&e&&e.type===s.r8.excalidrawLibrary&&(1===e.version||2===e.version)},jd=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={type:s.r8.excalidrawLibrary,version:s.Kr.excalidrawLibrary,source:s.pb,libraryItems:t},r=JSON.stringify(n,null,2),e.next=4,Gu(new Blob([r],{type:s.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Cd=function(){var e=(0,d.Z)(g().mark((function e(t){var n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Vu({description:"Excalidraw library files"});case 2:return n=e.sent,e.next=5,t.importLibrary(n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Od(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Id(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Od(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Od(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Md=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},Td=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileIds,r=t.files,o=t.imageCache,i=new Map,a=new Map,e.next=5,Promise.all(n.reduce((function(e,t){var n=r[t];return n&&!i.has(t)?(i.set(t,!0),e.concat((0,d.Z)(g().mark((function e(){var r,i,l;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.mimeType!==s.LO.binary){e.next=3;break}throw new Error("Only images can be added to ImageCache");case 3:return r=Md(n.dataURL),i={image:r,mimeType:n.mimeType},o.set(t,i),e.next=8,r;case 8:l=e.sent,o.set(t,Id(Id({},i),{},{image:l})),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),a.set(t,!0);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})))())):e}),[]));case 5:return e.abrupt("return",{imageCache:o,updatedFiles:i,erroredFiles:a});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ad=function(e){return e.filter((function(e){return We(e)}))},Pd=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(new DOMParser).parseFromString(t,s.LO.svg),r=n.querySelector("svg"),!n.querySelector("parsererror")&&"svg"===(null==(o=r)?void 0:o.nodeName.toLowerCase())){e.next=7;break}throw new Error(C("errors.invalidSVGString"));case 7:return r.hasAttribute("xmlns")||r.setAttribute("xmlns",s.hR),e.abrupt("return",r.outerHTML);case 9:case"end":return e.stop()}var o}),e)})));return function(t){return e.apply(this,arguments)}}(),Ld="\x3c!-- svg-source:excalidraw --\x3e",Dd=function(){var e=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a,l,c,u,d,f,p,m,v,b,y,x,w,k,_,S,E,j=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.exportBackground,a=o.exportPadding,l=void 0===a?s.qy:a,c=o.viewBackgroundColor,u=j.length>4&&void 0!==j[4]?j[4]:function(e,t){var r=document.createElement("canvas");return r.width=e*n.exportScale,r.height=t*n.exportScale,{canvas:r,scale:n.exportScale}},d=zd(t,l),f=h(d,4),p=f[0],m=f[1],v=f[2],b=f[3],y=u(v,b),x=y.canvas,w=y.scale,k=void 0===w?1:w,_=Ln(),e.next=7,Td({imageCache:new Map,fileIds:Ad(t).map((function(e){return e.fileId})),files:r});case 7:return S=e.sent,E=S.imageCache,du(t,n,null,k,Be.canvas(x),x,{viewBackgroundColor:i?c:null,scrollX:-p+l,scrollY:-m+l,zoom:_.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:n.exportWithDarkMode?"dark":"light",imageCache:E,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),e.abrupt("return",x);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),Rd=function(){var e=(0,d.Z)(g().mark((function e(t,r,o){var i,a,l,c,u,d,f,p,m,v,b,y,x,w,k,_;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.exportPadding,a=void 0===i?s.qy:i,l=r.viewBackgroundColor,c=r.exportScale,u=void 0===c?1:c,d=r.exportEmbedScene,f="",!d){e.next=14;break}return e.prev=3,e.next=6,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 6:return e.next=8,e.sent.encodeSvgMetadata({text:wd(t,r,o||{},"local")});case 8:f=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0);case 14:return p=zd(t,a),m=h(p,4),v=m[0],b=m[1],y=m[2],x=m[3],(w=document.createElementNS(s.hR,"svg")).setAttribute("version","1.1"),w.setAttribute("xmlns",s.hR),w.setAttribute("viewBox","0 0 ".concat(y," ").concat(x)),w.setAttribute("width","".concat(y*u)),w.setAttribute("height","".concat(x*u)),r.exportWithDarkMode&&w.setAttribute("filter",s.ZF),w.innerHTML="\n ".concat(Ld,"\n ").concat(f,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),r.exportBackground&&l&&((k=w.ownerDocument.createElementNS(s.hR,"rect")).setAttribute("x","0"),k.setAttribute("y","0"),k.setAttribute("width","".concat(y)),k.setAttribute("height","".concat(x)),k.setAttribute("fill",l),w.appendChild(k)),_=Be.svg(w),bu(t,_,w,o||{},{offsetX:-v+a,offsetY:-b+a,exportWithDarkMode:r.exportWithDarkMode}),e.abrupt("return",w);case 27:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t,n,r){return e.apply(this,arguments)}}(),zd=function(e,t){var n=h(kt(e),4),r=n[0],o=n[1],i=n[2],a=n[3];return[r,o,pn(r,i)+2*t,pn(o,a)+t+t]};function Nd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Bd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bd(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Bd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hd(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ud=32,Wd=12,Kd=256,Vd="NOT_SPREADSHEET",Gd="VALID_SPREADSHEET",Zd=function(e){var t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Yd=function(e,t){return e.slice(1).every((function(e){return null!==Zd(e[t])}))},qd=function(e){var t=e[0].length;if(t>2)return{type:Vd,reason:"More than 2 columns"};if(1===t){if(!Yd(e,0))return{type:Vd,reason:"Value is not numeric"};var n=null===Zd(e[0][0]),r=(n?e.slice(1):e).map((function(e){return Zd(e[0])}));return r.length<2?{type:Vd,reason:"Less than two rows"}:{type:Gd,spreadsheet:{title:n?e[0][0]:null,labels:null,values:r}}}var o=Yd(e,0)?0:1;if(!Yd(e,o))return{type:Vd,reason:"Value is not numeric"};var i=(o+1)%2,a=null===Zd(e[0][o]),l=a?e.slice(1):e;return l.length<2?{type:Vd,reason:"Less than 2 rows"}:{type:Gd,spreadsheet:{title:a?e[0][o]:null,labels:l.map((function(e){return e[i]})),values:l.map((function(e){return Zd(e[o])}))}}},Xd=Ot.elementBackground.slice(2,Ot.elementBackground.length),$d={fillStyle:"hachure",fontFamily:s.rk,fontSize:s.n5,opacity:100,roughness:1,strokeColor:Ot.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},Qd=function(e){return{chartWidth:44*e.values.length+Wd,chartHeight:280}},Jd=function(e,t,n,r,o,i){var a=Qd(e),l=a.chartWidth,c=a.chartHeight,u=e.title?Oo(Fd(Fd({backgroundColor:o,groupIds:[r]},$d),{},{text:e.title,x:t+l/2,y:n-Kd-24-s.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=i?jo(Fd(Fd({backgroundColor:o,groupIds:[r]},$d),{},{type:"rectangle",x:t,y:n-c,width:l,height:c,strokeColor:Ot.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[].concat(A(d?[d]:[]),A(u?[u]:[]),A(function(e,t,n,r,o){var i;return(null===(i=e.labels)||void 0===i?void 0:i.map((function(e,i){return Oo(Fd(Fd({groupIds:[r],backgroundColor:o},$d),{},{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*i+24,y:n+6,width:Ud,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))})))||[]}(e,t,n,r,o)),A(function(e,t,n,r,o){var i=Oo(Fd(Fd({groupIds:[r],backgroundColor:o},$d),{},{x:t-Wd,y:n-Wd,text:"0",textAlign:"right"}));return[i,Oo(Fd(Fd({groupIds:[r],backgroundColor:o},$d),{},{x:t-Wd,y:n-Kd-i.height/2,text:Math.max.apply(Math,A(e.values)).toLocaleString(),textAlign:"right"}))]}(e,t,n,r,o)),A(function(e,t,n,r,o){var i=Qd(e),a=i.chartWidth,l=i.chartHeight;return[Mo(Fd(Fd({backgroundColor:o,groupIds:[r]},$d),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:a,points:[[0,0],[a,0]]})),Mo(Fd(Fd({backgroundColor:o,groupIds:[r]},$d),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:l,points:[[0,0],[0,-l]]})),Mo(Fd(Fd({backgroundColor:o,groupIds:[r]},$d),{},{type:"line",x:t,y:n-Kd-Wd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:a,opacity:50,points:[[0,0],[a,0]]}))]}(e,t,n,r,o)))},ef=function(e,t,n,r){return"line"===e?function(e,t,n){var r,o=Math.max.apply(Math,A(e.values)),i=Qr(),a=Xd[Math.floor(Math.random()*Xd.length)],l=0,c=[],u=Nd(e.values);try{for(u.s();!(r=u.n()).done;){var d=r.value,f=44*l,p=-d/o*Kd;c.push([f,p]),l++}}catch(e){u.e(e)}finally{u.f()}var h=Math.max.apply(Math,A(c.map((function(e){return e[0]})))),m=Math.max.apply(Math,A(c.map((function(e){return e[1]})))),g=Math.min.apply(Math,A(c.map((function(e){return e[0]})))),v=Math.min.apply(Math,A(c.map((function(e){return e[1]})))),b=Mo(Fd(Fd({backgroundColor:a,groupIds:[i]},$d),{},{type:"line",x:t+Wd+16,y:n-Wd,startArrowhead:null,endArrowhead:null,height:m-v,width:h-g,strokeWidth:2,points:c})),y=e.values.map((function(e,r){var l=44*r+6,c=-e/o*Kd+6;return jo(Fd(Fd({backgroundColor:a,groupIds:[i]},$d),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+l+16,y:n+c-24,width:Wd,height:Wd}))})),x=e.values.map((function(e,r){var l=44*r+6,c=e/o*Kd+6+Wd;return Mo(Fd(Fd({backgroundColor:a,groupIds:[i]},$d),{},{type:"line",x:t+l+16+6,y:n-c,startArrowhead:null,endArrowhead:null,height:c,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,c]]}))}));return[].concat(A(Jd(e,t,n,i,a,"production"===s.Vi.DEVELOPMENT)),[b],A(x),A(y))}(t,n,r):function(e,t,n){var r=Math.max.apply(Math,A(e.values)),o=Qr(),i=Xd[Math.floor(Math.random()*Xd.length)],a=e.values.map((function(e,a){var l=e/r*Kd;return jo(Fd(Fd({backgroundColor:i,groupIds:[o]},$d),{},{type:"rectangle",x:t+44*a+Wd,y:n-l-Wd,width:Ud,height:l}))}));return[].concat(A(a),A(Jd(e,t,n,o,i,"production"===s.Vi.DEVELOPMENT)))}(t,n,r)},tf="",nf=!1,rf="clipboard"in navigator&&"readText"in navigator.clipboard,of="clipboard"in navigator&&"writeText"in navigator.clipboard,af="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,lf=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Yc(t,n,!0),i={type:s.r8.excalidrawClipboard,elements:o,files:o.reduce((function(e,t){return We(t)&&r[t.fileId]&&(e[t.fileId]=r[t.fileId]),e}),{})},a=JSON.stringify(i),tf=a,e.prev=4,nf=!1,e.next=8,pf(a);case 8:e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),nf=!0,console.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t,n,r){return e.apply(this,arguments)}}(),cf=function(){if(!tf)return{};try{return JSON.parse(tf)}catch(e){return console.error(e),{}}},sf=function(e){var t=function(e){var t=e.trim().split("\n").map((function(e){return e.trim().split("\t")}));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((function(e){return e.trim().split(",")}))),0===t.length)return{type:Vd,reason:"No values"};var n=t[0].length,r=t.every((function(e){return e.length===n}));if(!r)return{type:Vd,reason:"All rows don't have same number of columns"};var o=qd(t);if(o.type!==Gd){var i=qd(function(e){for(var t=[],n=0;n<e[0].length;n++){for(var r=[],o=0;o<e.length;o++)r.push(e[o][n]);t.push(r)}return t}(t));if(i.type===Gd)return i}return o}(e);return t.type===Gd?{spreadsheet:t.spreadsheet}:null},uf=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t){e.next=5;break}e.t0=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/plain").trim(),e.next=11;break;case 5:if(e.t1=rf,!e.t1){e.next=10;break}return e.next=9,navigator.clipboard.readText();case 9:e.t1=e.sent;case 10:e.t0=e.t1;case 11:return r=e.t0,e.abrupt("return",r||"");case 15:return e.prev=15,e.t2=e.catch(0),e.abrupt("return","");case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}(),df=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uf(t);case 2:if((n=e.sent)&&!n.includes(Ld)){e.next=5;break}return e.abrupt("return",cf());case 5:if(!(r=sf(n))){e.next=8;break}return e.abrupt("return",r);case 8:if(o=cf(),e.prev=9,i=JSON.parse(n),a=i,![s.r8.excalidraw,s.r8.excalidrawClipboard].includes(null==a?void 0:a.type)||!Array.isArray(a.elements)){e.next=13;break}return e.abrupt("return",{elements:i.elements,files:i.files});case 13:return e.abrupt("return",o);case 16:return e.prev=16,e.t0=e.catch(9),e.abrupt("return",nf&&o.elements?o:{text:n});case 19:case"end":return e.stop()}var a}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),ff=function(){var e=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.clipboard.write([new window.ClipboardItem(P({},s.LO.png,t))]);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pf=function(){var e=(0,d.Z)(g().mark((function e(t){var n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!of){e.next=11;break}return e.prev=2,e.next=5,navigator.clipboard.writeText(t||"");case 5:n=!0,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0);case 11:if(n||hf(t||" ")){e.next=13;break}throw new Error("couldn't copy");case 13:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}(),hf=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),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";var r=window.pageYOffset||document.documentElement.scrollTop;n.style.top="".concat(r,"px"),n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);var o=!1;try{n.select(),n.setSelectionRange(0,n.value.length),o=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),o},mf=function(){var e=(0,d.Z)(g().mark((function e(t,r,o,i,a){var l,c,u,d,f,p,h,m,v,b;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=a.exportBackground,c=a.exportPadding,u=void 0===c?s.qy:c,d=a.viewBackgroundColor,f=a.name,p=a.fileHandle,h=void 0===p?null:p,0!==r.length){e.next=3;break}throw new Error(C("alerts.cannotExportEmptyCanvas"));case 3:if("svg"!==t&&"clipboard-svg"!==t){e.next=17;break}return e.next=6,Rd(r,{exportBackground:l,exportWithDarkMode:o.exportWithDarkMode,viewBackgroundColor:d,exportPadding:u,exportScale:o.exportScale,exportEmbedScene:o.exportEmbedScene&&"svg"===t},i);case 6:if(m=e.sent,"svg"!==t){e.next=13;break}return e.next=10,Gu(new Blob([m.outerHTML],{type:s.LO.svg}),{description:"Export to SVG",name:f,extension:"svg",fileHandle:h});case 10:return e.abrupt("return",e.sent);case 13:if("clipboard-svg"!==t){e.next=17;break}return e.next=16,pf(m.outerHTML);case 16:return e.abrupt("return");case 17:return e.next=19,Dd(r,o,i,{exportBackground:l,viewBackgroundColor:d,exportPadding:u});case 19:return(v=e.sent).style.display="none",document.body.appendChild(v),e.next=24,fd(v);case 24:if(b=e.sent,v.remove(),"png"!==t){e.next=38;break}if(!o.exportEmbedScene){e.next=33;break}return e.next=30,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 30:return e.next=32,e.sent.encodePngMetadata({blob:b,metadata:wd(r,o,i,"local")});case 32:b=e.sent;case 33:return e.next=35,Gu(b,{description:"Export to PNG",name:f,extension:"png",fileHandle:h});case 35:return e.abrupt("return",e.sent);case 38:if("clipboard"!==t){e.next=49;break}return e.prev=39,e.next=42,ff(b);case 42:e.next=49;break;case 44:if(e.prev=44,e.t0=e.catch(39),"CANVAS_POSSIBLY_TOO_BIG"!==e.t0.name){e.next=48;break}throw e.t0;case 48:throw new Error(C("alerts.couldNotCopyToClipboard"));case 49:case"end":return e.stop()}}),e,null,[[39,44]])})));return function(t,n,r,o,i){return e.apply(this,arguments)}}();function gf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bf=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a,l,c,s;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(o=n).exportBackground,a=o.viewBackgroundColor,l=o.name,c=o.fileHandle,s=ld(c),c&&("png"===(u=s)||"svg"===u)){e.next=4;break}throw new Error("fileHandle should exist and should be of type svg or png when resaving");case 4:return n=vf(vf({},n),{},{exportEmbedScene:!0}),e.next=7,mf(s,Hc(t),n,r,{exportBackground:i,viewBackgroundColor:a,name:l,fileHandle:c});case 7:return e.abrupt("return",{fileHandle:c});case 8:case"end":return e.stop()}var u}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),yf=(n(7225),function(e){var t=e.children,n=e.checked,r=e.onChange,o=e.className;return(0,O.jsxs)("div",{className:Fe("Checkbox",o,{"is-checked":n}),onClick:function(e){r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,O.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:ol}),(0,O.jsx)("div",{className:"Checkbox-label",children:t})]})});n(4623);function xf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kf=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,i=e.className,a=e.style;return(0,O.jsx)("div",{className:Fe("Stack Stack_horizontal",i),style:wf({"--gap":n,alignItems:r,justifyContent:o},a),children:t})},_f=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,i=e.className;return(0,O.jsx)("div",{className:Fe("Stack Stack_vertical",i),style:{"--gap":n,justifyItems:r,justifyContent:o},children:t})},Sf=(n(554),function(e){var t=e.fileName,n=e.onSave;return(0,O.jsxs)(kf,{className:"ActiveFile",gap:1,align:"center",children:[(0,O.jsxs)("span",{className:"ActiveFile__fileName",children:[Nl,(0,O.jsx)("span",{children:t})]}),(0,O.jsx)(ls,{type:"icon",icon:al,title:C("buttons.save"),"aria-label":C("buttons.save"),onClick:n,"data-testid":"save-button"})]})});function Ef(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ef(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}jc({name:"changeProjectName",perform:function(e,t,n){return ru("change","title"),{appState:jf(jf({},t),{},{name:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.appProps;return(0,O.jsx)(ou,{label:C("labels.fileTitle"),value:t.name||"Unnamed",onChange:function(e){return n(e)},isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),jc({name:"changeExportScale",perform:function(e,t,n){return{appState:jf(jf({},t),{},{exportScale:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=Hc(t),i=Gc(o,n)?Yc(o,n):o;return(0,O.jsx)(O.Fragment,{children:s.ZB.map((function(e){var t=function(e,t,n){var r=h(zd(e,t).map((function(e){return Math.trunc(e*n)})),4);return[r[2],r[3]]}(i,s.qy,e),o=h(t,2),a=o[0],l=o[1],c="".concat(C("buttons.scale")," ").concat(e,"x (").concat(a,"x").concat(l,")");return(0,O.jsx)(ls,{size:"small",type:"radio",icon:"".concat(e,"x"),name:"export-canvas-scale",title:c,"aria-label":c,id:"export-canvas-scale",checked:e===n.exportScale,onChange:function(){return r(e)}},e)}))})}}),jc({name:"changeExportBackground",perform:function(e,t,n){return{appState:jf(jf({},t),{},{exportBackground:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,O.jsx)(yf,{checked:t.exportBackground,onChange:function(e){return n(e)},children:C("labels.withBackground")})}}),jc({name:"changeExportEmbedScene",perform:function(e,t,n){return{appState:jf(jf({},t),{},{exportEmbedScene:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,O.jsxs)(yf,{checked:t.exportEmbedScene,onChange:function(e){return n(e)},children:[C("labels.exportEmbedScene"),(0,O.jsx)(Rs,{label:C("labels.exportEmbedScene_details"),long:!0,children:(0,O.jsx)("div",{className:"excalidraw-tooltip-icon",children:wl})})]})}}),jc({name:"saveToActiveFile",perform:(Cf=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a,l;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!!n.fileHandle,e.prev=1,!cd(n.fileHandle)){e.next=8;break}return e.next=5,bf(t,n,o.files);case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,kd(t,n,o.files);case 10:e.t0=e.sent;case 11:return a=e.t0,l=a.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:jf(jf({},n),{},{fileHandle:l,toastMessage:i?null!=l&&l.name?C("toast.fileSavedToFilename").replace("{filename}",'"'.concat(l.name,'"')):C("toast.fileSaved"):null})});case 16:return e.prev=16,e.t1=e.catch(1),"AbortError"!==(null===e.t1||void 0===e.t1?void 0:e.t1.name)?console.error(e.t1):console.warn(e.t1),e.abrupt("return",{commitToHistory:!1});case 20:case"end":return e.stop()}}),e,null,[[1,16]])}))),function(e,t,n,r){return Cf.apply(this,arguments)}),keyTest:function(e){return e.key===Jt.S&&e[Jt.CTRL_OR_CMD]&&!e.shiftKey},PanelComponent:function(e){var t,n=e.updateData,r=e.appState;return(0,O.jsx)(Sf,{onSave:function(){return n(null)},fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}});var Cf,Of,If,Mf=jc({name:"saveFileToDisk",perform:(Of=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,kd(t,jf(jf({},n),{},{fileHandle:null}),o.files);case 3:return i=e.sent,a=i.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:jf(jf({},n),{},{fileHandle:a})});case 8:return e.prev=8,e.t0=e.catch(0),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)?console.error(e.t0):console.warn(e.t0),e.abrupt("return",{commitToHistory:!1});case 12:case"end":return e.stop()}}),e,null,[[0,8]])}))),function(e,t,n,r){return Of.apply(this,arguments)}),keyTest:function(e){return e.key===Jt.S&&e.shiftKey&&e[Jt.CTRL_OR_CMD]},PanelComponent:function(e){var t=e.updateData;return(0,O.jsx)(ls,{type:"button",icon:ll,title:C("buttons.saveAs"),"aria-label":C("buttons.saveAs"),showAriaLabel:km(),hidden:!Uu,onClick:function(){return t(null)},"data-testid":"save-as-button"})}});jc({name:"loadScene",perform:(If=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a,l,c;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_d(n,t);case 3:return i=e.sent,a=i.elements,l=i.appState,c=i.files,e.abrupt("return",{elements:a,appState:l,files:c,commitToHistory:!0});case 10:if(e.prev=10,e.t0=e.catch(0),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=15;break}return console.warn(e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",{elements:t,appState:jf(jf({},n),{},{errorMessage:e.t0.message}),files:o.files,commitToHistory:!1});case 16:case"end":return e.stop()}}),e,null,[[0,10]])}))),function(e,t,n,r){return If.apply(this,arguments)}),keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.key===Jt.O},PanelComponent:function(e){var t=e.updateData;e.appState;return(0,O.jsx)(ls,{type:"button",icon:cl,title:C("buttons.load"),"aria-label":C("buttons.load"),showAriaLabel:km(),onClick:t,"data-testid":"load-button"})}}),jc({name:"exportWithDarkMode",perform:function(e,t,n){return{appState:jf(jf({},t),{},{exportWithDarkMode:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,O.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,O.jsx)(Ps,{value:t.exportWithDarkMode?s.C6.DARK:s.C6.LIGHT,onChange:function(e){n(e===s.C6.DARK)},title:C("labels.toggleExportColorScheme")})})}});function Tf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pf="{}",Lf=jc({name:"copyStyles",perform:function(e,t){var n=e.find((function(e){return t.selectedElementIds[e.id]}));return n&&(Pf=JSON.stringify(n)),{appState:Af(Af({},t),{},{toastMessage:C("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.altKey&&e.code===Kt}}),Df=jc({name:"pasteStyles",perform:function(e,t){var n,r=JSON.parse(Pf);return"text"!==(null==(n=r)?void 0:n.type)&&"diamond"!==(null==n?void 0:n.type)&&"rectangle"!==(null==n?void 0:n.type)&&"ellipse"!==(null==n?void 0:n.type)&&"arrow"!==(null==n?void 0:n.type)&&"freedraw"!==(null==n?void 0:n.type)&&"line"!==(null==n?void 0:n.type)?{elements:e,commitToHistory:!1}:{elements:e.map((function(e){if(t.selectedElementIds[e.id]){var n=no(e,{backgroundColor:null==r?void 0:r.backgroundColor,strokeWidth:null==r?void 0:r.strokeWidth,strokeColor:null==r?void 0:r.strokeColor,strokeStyle:null==r?void 0:r.strokeStyle,fillStyle:null==r?void 0:r.fillStyle,opacity:null==r?void 0:r.opacity,roughness:null==r?void 0:r.roughness});return Ve(n)&&Ve(e)&&(to(n,{fontSize:(null==r?void 0:r.fontSize)||s.n5,fontFamily:(null==r?void 0:r.fontFamily)||s.rk,textAlign:(null==r?void 0:r.textAlign)||s.Hg}),lr(e,xr(e))),n}return e})),commitToHistory:!0}},contextItemLabel:"labels.pasteStyles",keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.altKey&&e.code===qt}}),Rf=function(e){return(0,O.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:wl})};function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}jc({name:"toggleCanvasMenu",perform:function(e,t){return{appState:Nf(Nf({},t),{},{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,O.jsx)(ls,{type:"button",icon:bl,"aria-label":C("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),jc({name:"toggleEditMenu",perform:function(e,t){return{appState:Nf(Nf({},t),{},{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{visible:Rc(n,Hc(t)),type:"button",icon:dl,"aria-label":C("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),jc({name:"toggleFullScreen",perform:function(){return vn()||document.documentElement.requestFullscreen(),vn()&&document.exitFullscreen(),{commitToHistory:!1}},keyTest:function(e){return e.code===Zt&&!e[Jt.CTRL_OR_CMD]}}),jc({name:"toggleShortcuts",perform:function(e,t,n,r){var o=r.focusContainer;return t.showHelpDialog&&o(),{appState:Nf(Nf({},t),{},{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,O.jsx)(Rf,{title:C("helpDialog.title"),onClick:t})},keyTest:function(e){return e.key===Jt.QUESTION_MARK}});function Bf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ff(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Uf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uf(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Uf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wf=function(e,t){var n=Yc(Hc(e),t,!0);return n.length>=2&&!function(e){if(e.length>=2){var t,n=Ff(e[0].groupIds);try{var r=function(){var n=t.value;if(e.reduce((function(e,t){return e&&bo(t,n)}),!0))return{v:!0}};for(n.s();!(t=n.n()).done;){var o=r();if("object"===T(o))return o.v}}catch(e){n.e(e)}finally{n.f()}}return!1}(n)},Kf=jc({name:"group",perform:function(e,t){var n=Yc(Hc(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};var r=go(t);if(1===r.length){var o=r[0],i=new Set(yo(e,o).map((function(e){return e.id}))),a=new Set(n.map((function(e){return e.id})));if(new Set([].concat(A(Array.from(i)),A(Array.from(a)))).size===i.size)return{appState:t,elements:e,commitToHistory:!1}}var l=Qr(),c=In(n),s=e.map((function(e){return c.get(e.id)?no(e,{groupIds:xo(e.groupIds,l,t.editingGroupId)}):e})),u=yo(s,l),d=u[u.length-1],f=s.lastIndexOf(d),p=s.slice(f+1),h=s.slice(0,f).filter((function(e){return!bo(e,l)})),m=[].concat(A(h),A(u),A(p));return{appState:po(l,Hf(Hf({},t),{},{selectedGroupIds:{}}),Hc(m)),elements:m,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(e,t){return Wf(e,t)},keyTest:function(e){return!e.shiftKey&&e[Jt.CTRL_OR_CMD]&&e.code===Gt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!Wf(t,n),type:"button",icon:(0,O.jsx)(Bl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.group")," — ").concat(bn("CtrlOrCmd+G")),"aria-label":C("labels.group"),visible:Gc(Hc(t),n)})}}),Vf=jc({name:"ungroup",perform:function(e,t){if(0===go(t).length)return{appState:t,elements:e,commitToHistory:!1};var n=[],r=e.map((function(e){et(e)&&n.push(e.id);var r=function(e,t){return e.filter((function(e){return!t[e]}))}(e.groupIds,t.selectedGroupIds);return r.length===e.groupIds.length?e:no(e,{groupIds:r})})),o=vo(Hf(Hf({},t),{},{selectedGroupIds:{}}),Hc(r));return n.forEach((function(e){return o.selectedElementIds[e]=!1})),{appState:o,elements:r,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&e[Jt.CTRL_OR_CMD]&&e.code===Gt},contextItemLabel:"labels.ungroup",contextItemPredicate:function(e,t){return go(t).length>0},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{type:"button",hidden:0===go(n).length,icon:(0,O.jsx)(Hl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.ungroup")," — ").concat(bn("CtrlOrCmd+Shift+G")),"aria-label":C("labels.ungroup"),visible:Gc(Hc(t),n)})}}),Gf=(n(2789),function(e){var t=e.children,n=e.color,r=e.border,o=e.onClick;return(0,O.jsx)("div",{className:"Avatar",style:{background:n,border:"1px solid ".concat(r)},onClick:o,children:t})});function Zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}jc({name:"goToCollaborator",perform:function(e,t,n){var r=n;return r?{appState:Yf(Yf(Yf({},t),Xc({scenePoint:r,viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})),{},{openMenu:"canvas"===t.openMenu?null:t.openMenu}),commitToHistory:!1}:{appState:t,commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.data,o=null==r?void 0:r.id;if(!o)return null;var i=t.collaborators.get(o);if(!i)return null;var a=iu(o,t),l=a.background,c=a.stroke,s=function(e){if(!e)return"?";var t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();var n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()}(i.username);return(0,O.jsx)(Gf,{color:l,border:c,onClick:function(){return n(i.pointer)},children:s})}});function qf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $f=jc({name:"addToLibrary",perform:function(e,t,n,r){var o=Yc(Hc(e),t,!0);return o.some((function(e){return"image"===e.type}))?{commitToHistory:!1,appState:Xf(Xf({},t),{},{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((function(e){return r.library.saveLibrary([{id:Qr(),status:"unpublished",elements:o.map(To),created:Date.now()}].concat(A(e)))})).then((function(){return{commitToHistory:!1,appState:Xf(Xf({},t),{},{toastMessage:C("toast.addedToLibrary")})}})).catch((function(e){return{commitToHistory:!1,appState:Xf(Xf({},t),{},{errorMessage:e.message})}}))},contextItemLabel:"labels.addToLibrary"});function Qf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qf(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ep=function(e,t,n){var r=n.axis,o=n.position,i=Et(e),a=h("x"===r?["minX","maxX"]:["minY","maxY"],2),l=a[0],c=a[1],s={x:0,y:0};return Jf(Jf({},s),{},P({},r,"start"===o?t[l]-i[l]:"end"===o?t[c]-i[c]:(t[l]+t[c])/2-(i[l]+i[c])/2))},tp=function(e,t){return Yc(Hc(e),t).length>1},np=function(e,t,n){var r=function(e,t){var n=wo(e),r=Et(e);return n.flatMap((function(e){var n=ep(e,r,t);return e.map((function(e){return no(e,{x:e.x+n.x,y:e.y+n.y})}))}))}(Yc(Hc(e),t),n),o=In(r);return e.map((function(e){return o.get(e.id)||e}))};jc({name:"alignTop",perform:function(e,t){return{appState:t,elements:np(e,t,{position:"start",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Jt.ARROW_UP},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!tp(t,n),type:"button",icon:(0,O.jsx)(jl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.alignTop")," — ").concat(bn("CtrlOrCmd+Shift+Up")),"aria-label":C("labels.alignTop"),visible:Gc(Hc(t),n)})}}),jc({name:"alignBottom",perform:function(e,t){return{appState:t,elements:np(e,t,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Jt.ARROW_DOWN},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!tp(t,n),type:"button",icon:(0,O.jsx)(Cl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.alignBottom")," — ").concat(bn("CtrlOrCmd+Shift+Down")),"aria-label":C("labels.alignBottom"),visible:Gc(Hc(t),n)})}}),jc({name:"alignLeft",perform:function(e,t){return{appState:t,elements:np(e,t,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Jt.ARROW_LEFT},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!tp(t,n),type:"button",icon:(0,O.jsx)(Ol,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.alignLeft")," — ").concat(bn("CtrlOrCmd+Shift+Left")),"aria-label":C("labels.alignLeft"),visible:Gc(Hc(t),n)})}}),jc({name:"alignRight",perform:function(e,t){return{appState:t,elements:np(e,t,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Jt.ARROW_RIGHT},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!tp(t,n),type:"button",icon:(0,O.jsx)(Il,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.alignRight")," — ").concat(bn("CtrlOrCmd+Shift+Right")),"aria-label":C("labels.alignRight"),visible:Gc(Hc(t),n)})}}),jc({name:"alignVerticallyCentered",perform:function(e,t){return{appState:t,elements:np(e,t,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!tp(t,n),type:"button",icon:(0,O.jsx)(Al,{theme:n.theme}),onClick:function(){return r(null)},title:C("labels.centerVertically"),"aria-label":C("labels.centerVertically"),visible:Gc(Hc(t),n)})}}),jc({name:"alignHorizontallyCentered",perform:function(e,t){return{appState:t,elements:np(e,t,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!tp(t,n),type:"button",icon:(0,O.jsx)(Pl,{theme:n.theme}),onClick:function(){return r(null)},title:C("labels.centerHorizontally"),"aria-label":C("labels.centerHorizontally"),visible:Gc(Hc(t),n)})}});function rp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return op(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return op(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function op(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ip=function(e,t){return Yc(Hc(e),t).length>1},ap=function(e,t,n){var r=function(e,t){var n,r=h("x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],4),o=r[0],i=r[1],a=r[2],l=r[3],c=Et(e),s=wo(e).map((function(e){return[e,Et(e)]})).sort((function(e,t){return e[1][i]-t[1][i]})),u=0,d=rp(s);try{for(d.s();!(n=d.n()).done;)u+=n.value[1][l]}catch(e){d.e(e)}finally{d.f()}var f=(c[l]-u)/(s.length-1);if(f<0){var p=s.findIndex((function(e){return e[1][o]===c[o]})),m=s.findIndex((function(e){return e[1][a]===c[a]})),g=(s[m][1][i]-s[p][1][i])/(s.length-1),v=s[p][1][i];return s.flatMap((function(e,n){var r=h(e,2),o=r[0],a=r[1],l={x:0,y:0};return n!==p&&n!==m&&(v+=g,l[t.axis]=v-a[i]),o.map((function(e){return no(e,{x:e.x+l.x,y:e.y+l.y})}))}))}var b=c[o];return s.flatMap((function(e){var n=h(e,2),r=n[0],i=n[1],a={x:0,y:0};return a[t.axis]=b-i[o],b+=f,b+=i[l],r.map((function(e){return no(e,{x:e.x+a.x,y:e.y+a.y})}))}))}(Yc(Hc(e),t),n),o=In(r);return e.map((function(e){return o.get(e.id)||e}))},lp=(jc({name:"distributeHorizontally",perform:function(e,t){return{appState:t,elements:ap(e,t,{space:"between",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===Yt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!ip(t,n),type:"button",icon:(0,O.jsx)(Ml,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.distributeHorizontally")," — ").concat(bn("Alt+H")),"aria-label":C("labels.distributeHorizontally"),visible:Gc(Hc(t),n)})}}),jc({name:"distributeVertically",perform:function(e,t){return{appState:t,elements:ap(e,t,{space:"between",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===qt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,O.jsx)(ls,{hidden:!ip(t,n),type:"button",icon:(0,O.jsx)(Tl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(C("labels.distributeVertically")," — ").concat(bn("Alt+V")),"aria-label":C("labels.distributeVertically"),visible:Gc(Hc(t),n)})}}),jc({name:"flipHorizontal",perform:function(e,t){return{elements:sp(e,t,"horizontal"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyH"===e.code},contextItemLabel:"labels.flipHorizontal",contextItemPredicate:function(e,t){return function(e,t){var n=Yc(Hc(e),t);return 1===n.length&&"text"!==n[0].type}(e,t)}})),cp=jc({name:"flipVertical",perform:function(e,t){return{elements:sp(e,t,"vertical"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyV"===e.code},contextItemLabel:"labels.flipVertical",contextItemPredicate:function(e,t){return function(e,t){return 1===Yc(Hc(e),t).length}(e,t)}}),sp=function(e,t,n){var r=Yc(Hc(e),t);if(r.length>1)return e;var o=up(r,t,n),i=In(o);return e.map((function(e){return i.get(e.id)||e}))},up=function(e,t,n){return e.forEach((function(e){dp(e,t),"vertical"===n&&fp(e,Math.PI)})),e},dp=function(e,t){var n=e.x,r=e.y,o=e.width,i=e.height,a=Pa(e.angle),l=0;(Ye(e)||Ge(e))&&(l=2*e.points.reduce((function(e,t){return Math.max(e,t[0])}),0)-e.width),to(e,{angle:Pa(0)});var c=Ho(e,t.zoom),s=!0,u=0,d=c.nw;if(d||(s=!1,d=c.ne)){if(Ye(e)){for(var f=1;f<e.points.length;f++)ta.movePoints(e,[{index:f,point:[-e.points[f][0],e.points[f][1]]}]);ta.normalizePoints(e)}else u=s?e.x+2*o:e.x-2*o,Ba(e,!0,e,s?"nw":"ne",!1,u,d[1]),to(e,{width:o,height:i});var p=Pa(2*Math.PI-a);p<0&&(p=Pa(p+2*Math.PI)),to(e,{angle:p}),to(e,{x:n+l,y:r}),va(e)}else to(e,{angle:a})},fp=function(e,t){var n=e.x,r=e.y,o=Pa(e.angle+t);o<0&&(o=Pa(2*Math.PI+o)),to(e,{angle:o}),to(e,{x:n,y:r})};function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pp(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mp=jc({name:"copy",perform:function(e,t,n,r){return lf(Hc(e),t,r.files),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),gp=jc({name:"cut",perform:function(e,t,n,r){return mp.perform(e,t,n,r),ds.perform(e,t)},contextItemLabel:"labels.cut",keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.code===Xt}}),vp=jc({name:"copyAsSvg",perform:function(){var e=(0,d.Z)(g().mark((function e(t,n,r,o){var i;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.canvas){e.next=2;break}return e.abrupt("return",{commitToHistory:!1});case 2:return i=Yc(Hc(t),n,!0),e.prev=3,e.next=6,mf("clipboard-svg",i.length?i:Hc(t),n,o.files,n);case 6:return e.abrupt("return",{commitToHistory:!1});case 9:return e.prev=9,e.t0=e.catch(3),console.error(e.t0),e.abrupt("return",{appState:hp(hp({},n),{},{errorMessage:e.t0.message}),commitToHistory:!1});case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsSvg"}),bp=jc({name:"copyAsPng",perform:function(){var e=(0,d.Z)(g().mark((function e(t,n,r,o){var i;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.canvas){e.next=2;break}return e.abrupt("return",{commitToHistory:!1});case 2:return i=Yc(Hc(t),n,!0),e.prev=3,e.next=6,mf("clipboard",i.length?i:Hc(t),n,o.files,n);case 6:return e.abrupt("return",{appState:hp(hp({},n),{},{toastMessage:C("toast.copyToClipboardAsPng",{exportSelection:i.length?C("toast.selection"):C("toast.canvas"),exportColorScheme:n.exportWithDarkMode?C("buttons.darkMode"):C("buttons.lightMode")})}),commitToHistory:!1});case 9:return e.prev=9,e.t0=e.catch(3),console.error(e.t0),e.abrupt("return",{appState:hp(hp({},n),{},{errorMessage:e.t0.message}),commitToHistory:!1});case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsPng",keyTest:function(e){return e.code===Kt&&e.altKey&&e.shiftKey}});function yp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yp(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wp=jc({name:"gridMode",perform:function(e,t){return ru("view","mode","grid"),{appState:xp(xp({},t),{},{gridSize:this.checked(t)?null:s.k}),commitToHistory:!1}},checked:function(e){return null!==e.gridSize},contextItemLabel:"labels.showGrid",keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.code===Ft}});function kp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Sp=jc({name:"zenMode",perform:function(e,t){return ru("view","mode","zen"),{appState:_p(_p({},t),{},{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.zenModeEnabled},contextItemLabel:"buttons.zenMode",keyTest:function(e){return!e[Jt.CTRL_OR_CMD]&&e.altKey&&e.code===$t}});function Ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ep(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ep(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Cp=jc({name:"stats",perform:function(e,t){return{appState:jp(jp({},t),{},{showStats:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.showStats},contextItemLabel:"stats.title",keyTest:function(e){return!e[Jt.CTRL_OR_CMD]&&e.altKey&&e.code===Wt}});function Op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ip(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Op(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Op(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mp=function(e,t,n){var r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){var o=n();if(null===o)return{commitToHistory:r};var i=In(e),a=o.elements,l=In(a),c=e.filter((function(e){return!l.has(e.id)})),s=a.map((function(e){return no(i.get(e.id)||e,e)})).concat(c.map((function(e){return no(e,{isDeleted:!0})})));return Ia(s,c),{elements:s,appState:Ip(Ip({},t),o.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},Tp=function(){function e(t,n,r,o){var i=this;L(this,e),this.actions={},this.renderAction=function(e,t){var n=i.app.props.UIOptions.canvasActions;if(i.actions[e]&&"PanelComponent"in i.actions[e]&&(!(e in n)||n[e])){var r=i.actions[e],o=r.PanelComponent;return(0,O.jsx)(o,{elements:i.getElementsIncludingDeleted(),appState:i.getAppState(),updateData:function(e){i.updater(r.perform(i.getElementsIncludingDeleted(),i.getAppState(),e,i.app))},appProps:i.app.props,data:t})}return null},this.updater=function(e){if(!e||!("then"in e))return t(e);e.then((function(e){return t(e)}))},this.getAppState=n,this.getElementsIncludingDeleted=r,this.app=o}return R(e,[{key:"registerAction",value:function(e){this.actions[e.name]=e}},{key:"registerAll",value:function(e){var t=this;e.forEach((function(e){return t.registerAction(e)}))}},{key:"handleKeyDown",value:function(e){var t=this,n=this.app.props.UIOptions.canvasActions,r=Object.values(this.actions).sort((function(e,t){return(t.keyPriority||0)-(e.keyPriority||0)})).filter((function(r){return(!(r.name in n)||n[r.name])&&r.keyTest&&r.keyTest(e,t.getAppState(),t.getElementsIncludingDeleted())}));return 0!==r.length&&(!(this.getAppState().viewModeEnabled&&!Object.values(s.EH).includes(r[0].name))&&(e.preventDefault(),this.updater(r[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0))}},{key:"executeAction",value:function(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}]),e}();function Ap(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Pp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pp(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lp(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Rp=function(){function e(t){var n=this;L(this,e),this.libraryCache=null,this.resetLibrary=(0,d.Z)(g().mark((function e(){var t,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=(r=n.app.props).onLibraryChange)||void 0===t?void 0:t.call(r,[]);case 2:n.libraryCache=[];case 3:case"end":return e.stop()}}),e)}))),this.restoreLibraryItem=function(e){var t=Hc(ed(e.elements,null));return t.length?Dp(Dp({},e),{},{elements:t}):null},this.loadLibrary=function(){return new Promise(function(){var e=(0,d.Z)(g().mark((function e(t){var r,o;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.libraryCache){e.next=2;break}return e.abrupt("return",t(JSON.parse(JSON.stringify(n.libraryCache))));case 2:if(e.prev=2,r=n.app.libraryItemsFromStorage){e.next=6;break}return e.abrupt("return",t([]));case 6:o=r.reduce((function(e,t){return n.restoreLibraryItem(t)&&e.push(t),e}),[]),n.libraryCache=JSON.parse(JSON.stringify(o)),t(o),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(2),console.error(e.t0),t([]);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}())},this.saveLibrary=function(){var e=(0,d.Z)(g().mark((function e(t){var r,o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.libraryCache,e.prev=1,a=JSON.stringify(t),n.libraryCache=JSON.parse(a),e.next=6,null===(o=(i=n.app.props).onLibraryChange)||void 0===o?void 0:o.call(i,t);case 6:e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(1),n.libraryCache=r,e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this.app=t}var t;return R(e,[{key:"importLibrary",value:(t=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l,c,s,u,d,f,p=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:"unpublished",e.next=3,dd(t);case 3:if((r=e.sent)&&(r.libraryItems||r.library)){e.next=6;break}return e.abrupt("return");case 6:return o=function(e,t){return!e.find((function(e){return e.elements.length===t.elements.length&&e.elements.every((function(e,n){return e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce}))}))},e.next=9,this.loadLibrary();case 9:i=e.sent,a=r.libraryItems||r.library||[],l=rd(a,n),c=[],s=Ap(l);try{for(s.s();!(u=s.n()).done;)d=u.value,(f=this.restoreLibraryItem(d))&&o(i,f)&&c.push(f)}catch(e){s.e(e)}finally{s.f()}return e.next=17,this.saveLibrary([].concat(c,A(i)));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),zp=Rp,Np=function(e){var t=Array.from(e.values());return{x:Hp(t,(function(e){return e.x}))/t.length,y:Hp(t,(function(e){return e.y}))/t.length}},Bp=function(e){var t=h(e,2),n=t[0],r=t[1];return Math.hypot(n.x-r.x,n.y-r.y)},Hp=function(e,t){return e.reduce((function(e,n){return e+t(n)}),0)};function Fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Up(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fp(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wp=function(e){return{selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name}},Kp=function(){function e(){var t=this;L(this,e),this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=function(e,n){return t.dehydrateHistoryEntry({appState:Wp(e),elements:n.reduce((function(t,n){if(Ye(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(Up(Up({},n),{},{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}}return R(e,[{key:"hydrateHistoryEntry",value:function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.parse(n),elements:r.map((function(e){var n,r=null===(n=t.elementCache.get(e.id))||void 0===n?void 0:n.get(e.versionNonce);if(!r)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return r}))}}},{key:"dehydrateHistoryEntry",value:function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.stringify(n),elements:r.map((function(e){t.elementCache.has(e.id)||t.elementCache.set(e.id,new Map);var n=t.elementCache.get(e.id);return n.has(e.versionNonce)||n.set(e.versionNonce,To(e)),{id:e.id,versionNonce:e.versionNonce}}))}}},{key:"getSnapshotForTest",value:function(){var e=this;return{recording:this.recording,stateHistory:this.stateHistory.map((function(t){return e.hydrateHistoryEntry(t)})),redoStack:this.redoStack.map((function(t){return e.hydrateHistoryEntry(t)}))}}},{key:"clear",value:function(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}},{key:"shouldCreateEntry",value:function(e){var t,n=this.lastEntry;if(!n)return!0;if(e.elements.length!==n.elements.length)return!0;for(var r=e.elements.length-1;r>-1;r--){var o=e.elements[r],i=n.elements[r];if(!o||!i||o.id!==i.id||o.versionNonce!==i.versionNonce)return!0}for(t in e.appState){var a,l;if("editingLinearElement"===t)if((null===(a=e.appState[t])||void 0===a?void 0:a.elementId)===(null===(l=n.appState[t])||void 0===l?void 0:l.elementId))continue;if("selectedElementIds"!==t&&"selectedGroupIds"!==t&&e.appState[t]!==n.appState[t])return!0}return!1}},{key:"pushEntry",value:function(e,t){var n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}}},{key:"clearRedoStack",value:function(){this.redoStack.splice(0,this.redoStack.length)}},{key:"redoOnce",value:function(){if(0===this.redoStack.length)return null;var e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}},{key:"undoOnce",value:function(){if(1===this.stateHistory.length)return null;var e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}},{key:"setCurrentState",value:function(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}},{key:"resumeRecording",value:function(){this.recording=!0}},{key:"record",value:function(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}}]),e}(),Vp=[{icon:(0,O.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,O.jsx)("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})}),value:"selection",key:Jt.V},{icon:(0,O.jsx)("svg",{viewBox:"0 0 448 512",children:(0,O.jsx)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})}),value:"rectangle",key:Jt.R},{icon:(0,O.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,O.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:Jt.D},{icon:(0,O.jsx)("svg",{viewBox:"0 0 512 512",children:(0,O.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:Jt.E},{icon:(0,O.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,O.jsx)("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})}),value:"arrow",key:Jt.A},{icon:(0,O.jsx)("svg",{viewBox:"0 0 6 6",children:(0,O.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[Jt.P,Jt.L]},{icon:(0,O.jsx)("svg",{viewBox:"0 0 512 512",children:(0,O.jsx)("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})}),value:"freedraw",key:[Jt.X,Jt.P.toUpperCase()]},{icon:(0,O.jsx)("svg",{viewBox:"0 0 448 512",children:(0,O.jsx)("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})}),value:"text",key:Jt.T},{icon:(0,O.jsx)("svg",{viewBox:"0 0 512 512",children:(0,O.jsx)("path",{fill:"currentColor",d:"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"})}),value:"image",key:null}],Gp=(n(1292),{cut:[bn("CtrlOrCmd+X")],copy:[bn("CtrlOrCmd+C")],paste:[bn("CtrlOrCmd+V")],copyStyles:[bn("CtrlOrCmd+Alt+C")],pasteStyles:[bn("CtrlOrCmd+Alt+V")],selectAll:[bn("CtrlOrCmd+A")],deleteSelectedElements:[bn("Del")],duplicateSelection:[bn("CtrlOrCmd+D"),bn("Alt+".concat(C("helpDialog.drag")))],sendBackward:[bn("CtrlOrCmd+[")],bringForward:[bn("CtrlOrCmd+]")],sendToBack:[bn(Mt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[bn(Mt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[bn("Shift+Alt+C")],copyAsSvg:[],group:[bn("CtrlOrCmd+G")],ungroup:[bn("CtrlOrCmd+Shift+G")],gridMode:[bn("CtrlOrCmd+'")],zenMode:[bn("Alt+Z")],stats:[bn("Alt+/")],addToLibrary:[],flipHorizontal:[bn("Shift+H")],flipVertical:[bn("Shift+V")],viewMode:[bn("Alt+R")]}),Zp=function(e){var t=e.options,n=e.onCloseRequest,r=e.top,o=e.left,i=e.actionManager,a=e.appState;return(0,O.jsx)(Va,{onCloseRequest:n,top:r,left:o,fitInViewport:!0,children:(0,O.jsx)("ul",{className:"context-menu",onContextMenu:function(e){return e.preventDefault()},children:t.map((function(e,t){var r;if("separator"===e)return(0,O.jsx)("hr",{className:"context-menu-option-separator"},t);var o,l,c=e.name,s=e.contextItemLabel?C(e.contextItemLabel):"";return(0,O.jsx)("li",{"data-testid":c,onClick:n,children:(0,O.jsxs)("button",{className:Fe("context-menu-option",{dangerous:"deleteSelectedElements"===c,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:function(){return i.executeAction(e)},children:[(0,O.jsx)("div",{className:"context-menu-option__label",children:s}),(0,O.jsx)("kbd",{className:"context-menu-option__shortcut",children:c?(o=c,l=Gp[o],l&&l.length>0?l[0]:""):""})]})},t)}))})})},Yp=new WeakMap,qp=function(e){var t,n,r=Array.of();e.options.forEach((function(e){e&&r.push(e)})),r.length&&(0,It.render)((0,O.jsx)(Zp,{top:e.top,left:e.left,options:r,onCloseRequest:function(){return t=e.container,void((n=Yp.get(t))&&((0,It.unmountComponentAtNode)(n),n.remove(),Yp.delete(t)));var t,n},actionManager:e.actionManager,appState:e.appState}),(t=e.container,(n=Yp.get(t))||(n=document.createElement("div"),t.querySelector(".excalidraw-contextMenuContainer").appendChild(n),Yp.set(t,n),n)))};function Xp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $p(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function $p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qp=function(e){var t,n,r=e.appState,o=e.elements,i=e.renderAction,a=e.elementType,l=qc(Hc(o),r),c=Boolean(r.editingElement),s=km(),u="rtl"===document.documentElement.getAttribute("dir"),d=mc(a)||l.some((function(e){return mc(e.type)&&!jn(e.backgroundColor)})),f=mc(a)||l.some((function(e){return mc(e.type)})),p=(null===(t=l[0])||void 0===t?void 0:t.type)||null,h=Xp(l);try{for(h.s();!(n=h.n()).done;){if(n.value.type!==p){p=null;break}}}catch(e){h.e(e)}finally{h.f()}return(0,O.jsxs)("div",{className:"panelColumn",children:[(gc(a)&&"image"!==a&&"image"!==p||l.some((function(e){return gc(e.type)})))&&i("changeStrokeColor"),f&&i("changeBackgroundColor"),d&&i("changeFillStyle"),(vc(a)||l.some((function(e){return vc(e.type)})))&&i("changeStrokeWidth"),("freedraw"===a||l.some((function(e){return"freedraw"===e.type})))&&i("changeStrokeShape"),(bc(a)||l.some((function(e){return bc(e.type)})))&&(0,O.jsxs)(O.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(yc(a)||l.some((function(e){return yc(e.type)})))&&(0,O.jsx)(O.Fragment,{children:i("changeSharpness")}),(xc(a)||l.some((function(e){return xc(e.type)})))&&(0,O.jsxs)(O.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),(wc(a)||l.some((function(e){return wc(e.type)})))&&(0,O.jsx)(O.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.layers")}),(0,O.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),l.length>1&&(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.align")}),(0,O.jsxs)("div",{className:"buttonList",children:[u?(0,O.jsxs)(O.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,O.jsxs)(O.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),l.length>2&&i("distributeHorizontally"),(0,O.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),l.length>2&&i("distributeVertically")]})]})]}),!s&&!c&&l.length>0&&(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.actions")}),(0,O.jsxs)("div",{className:"buttonList",children:[i("duplicateSelection"),i("deleteSelectedElements"),i("group"),i("ungroup")]})]})]})},Jp=function(e){var t=e.canvas,n=e.elementType,r=e.setAppState,o=e.onImageAction;return(0,O.jsx)(O.Fragment,{children:Vp.map((function(e,i){var a=e.value,l=e.icon,c=e.key,s=C("toolBar.".concat(a)),u=c&&("string"==typeof c?c:c[0]),d=u?"".concat(ln(u)," ").concat(C("helpDialog.or")," ").concat(i+1):"".concat(i+1);return(0,O.jsx)(ls,{className:"Shape",type:"radio",icon:l,checked:n===a,name:"editor-current-shape",title:"".concat(ln(s)," — ").concat(d),keyBindingLabel:"".concat(i+1),"aria-label":ln(s),"aria-keyshortcuts":d,"data-testid":a,onChange:function(e){var n=e.pointerType;r({elementType:a,multiElement:null,selectedElementIds:{}}),gn(t,a),"image"===a&&o({pointerType:n})}},a)}))})},eh=function(e){var t=e.renderAction;e.zoom;return(0,O.jsx)(_f,{gap:1,children:(0,O.jsxs)(kf,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},th=function(e){e.appState,e.setAppState;var t=e.actionManager,n=e.showThemeBtn;return(0,O.jsxs)("div",{style:{display:"flex"},children:[t.renderAction("changeViewBackgroundColor"),n&&t.renderAction("toggleTheme")]})},nh=(n(778),function(e){var t=e.isCollaborating,n=e.collaboratorCount,r=e.onClick;return(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(ls,{className:Fe("CollabButton",{"is-collaborating":t}),onClick:r,icon:Ll,type:"button",title:C("labels.liveCollaboration"),"aria-label":C("labels.liveCollaboration"),showAriaLabel:km(),children:n>0&&(0,O.jsx)("div",{className:"CollabButton-collaborators",children:n})})})}),rh=function(e){var t=e.message,n=e.onClose,r=h((0,l.useState)(!!t),2),o=r[0],i=r[1],a=Sm().container,s=c().useCallback((function(){i(!1),n&&n(),null==a||a.focus()}),[n,a]);return(0,O.jsx)(O.Fragment,{children:o&&(0,O.jsx)(Us,{small:!0,onCloseRequest:s,title:C("errorDialog.title"),children:(0,O.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})},oh=(n(2205),"filter"in document.createElement("canvas").getContext("2d")),ih=function(){return(0,O.jsxs)("div",{children:[(0,O.jsx)("h3",{children:C("canvasError.cannotShowPreview")}),(0,O.jsx)("p",{children:(0,O.jsx)("span",{children:C("canvasError.canvasTooBig")})}),(0,O.jsxs)("em",{children:["(",C("canvasError.canvasTooBigTip"),")"]})]})},ah=function(e,t){(0,It.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,It.render)((0,O.jsx)(ih,{}),t)},lh=function(e){var t,n=e.children,r=e.title,o=e.onClick,i=e.color,a=e.shade,l=void 0===a?6:a;return(0,O.jsx)("button",{className:"ExportDialog-imageExportButton",style:(t={},P(t,"--button-color",jt[i][l]),P(t,"--button-color-darker",jt[i][l+1]),P(t,"--button-color-darkest",jt[i][l+2]),t),title:r,"aria-label":r,onClick:o,children:n})},ch=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,i=void 0===o?s.qy:o,a=e.actionManager,c=e.onExportToPng,u=e.onExportToSvg,d=e.onExportToClipboard,f=Gc(t,n),p=h((0,l.useState)(f),2),m=p[0],g=p[1],v=(0,l.useRef)(null),b=n.exportBackground,y=n.viewBackgroundColor,x=m?Yc(t,n,!0):t;return(0,l.useEffect)((function(){g(f)}),[f]),(0,l.useEffect)((function(){var e=v.current;e&&Dd(x,n,r,{exportBackground:b,viewBackgroundColor:y,exportPadding:i}).then((function(t){return fd(t).then((function(){ah(t,e)}))})).catch((function(t){console.error(t),ah(new os,e)}))}),[n,r,x,b,i,y]),(0,O.jsxs)("div",{className:"ExportDialog",children:[(0,O.jsx)("div",{className:"ExportDialog__preview",ref:v}),oh&&a.renderAction("exportWithDarkMode"),(0,O.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,O.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[a.renderAction("changeExportBackground"),f&&(0,O.jsx)(yf,{checked:m,onChange:function(e){return g(e)},children:C("labels.onlySelected")}),a.renderAction("changeExportEmbedScene")]})}),(0,O.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,O.jsx)(kf,{gap:2,children:a.renderAction("changeExportScale")}),(0,O.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,O.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!Uu&&a.renderAction("changeProjectName")}),(0,O.jsxs)(kf,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,O.jsx)(lh,{color:"indigo",title:C("buttons.exportToPng"),"aria-label":C("buttons.exportToPng"),onClick:function(){return c(x)},children:"PNG"}),(0,O.jsx)(lh,{color:"red",title:C("buttons.exportToSvg"),"aria-label":C("buttons.exportToSvg"),onClick:function(){return u(x)},children:"SVG"}),af&&(0,O.jsx)(lh,{title:C("buttons.copyPngToClipboard"),onClick:function(){return d(x)},color:"gray",shade:7,children:sl})]})]})},sh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,i=void 0===o?s.qy:o,a=e.actionManager,u=e.onExportToPng,d=e.onExportToSvg,f=e.onExportToClipboard,p=h((0,l.useState)(!1),2),m=p[0],g=p[1],v=c().useCallback((function(){g(!1)}),[]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(ls,{onClick:function(){g(!0)},"data-testid":"image-export-button",icon:pl,type:"button","aria-label":C("buttons.exportImage"),showAriaLabel:km(),title:C("buttons.exportImage")}),m&&(0,O.jsx)(Us,{onCloseRequest:v,title:C("buttons.exportImage"),children:(0,O.jsx)(ch,{elements:t,appState:n,files:r,exportPadding:i,actionManager:a,onExportToPng:u,onExportToSvg:d,onExportToClipboard:f,onCloseRequest:v})})]})},uh=(n(1310),function(e){var t=e.children,n=e.side,r=e.className;return(0,O.jsx)("div",{className:Fe("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})}),dh=(n(7096),function(e){var t=function(e){var t=e.appState,n=e.elements,r=e.isMobile,o=t.elementType,i=t.isResizing,a=t.isRotating,l=t.lastPointerDownWith,c=null!==t.multiElement;if("arrow"===o||"line"===o)return C(c?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===o)return C("hints.freeDraw");if("text"===o)return C("hints.text");if("image"===t.elementType&&t.pendingImageElement)return C("hints.placeImage");var s,u=Yc(n,t);if(i&&"mouse"===l&&1===u.length){var d=u[0];return Ye(d)&&2===d.points.length?C("hints.lockAngle"):Ke(d)?C("hints.resizeImage"):C("hints.resize")}if(a&&"mouse"===l)return C("hints.rotate");if(1===u.length&&Ve(u[0]))return C("hints.text_selected");if(t.editingElement&&Ve(t.editingElement))return C("hints.text_editing");if("selection"===o){var f;if("selection"===(null===(f=t.draggingElement)||void 0===f?void 0:f.type)&&!t.editingElement&&!t.editingLinearElement)return C("hints.deepBoxSelect");if(!u.length&&!r)return C("hints.canvasPanning")}if(1===u.length){if(Ye(u[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?C("hints.lineEditor_pointSelected"):C("hints.lineEditor_nothingSelected"):C("hints.lineEditor_info");if(null!=(s=u[0])&&("rectangle"===s.type||"diamond"===s.type||"ellipse"===s.type||"image"===s.type))return C("hints.bindTextToElement")}return null}({appState:e.appState,elements:e.elements,isMobile:e.isMobile});return t?(t=bn(t),(0,O.jsx)("div",{className:"HintViewer",children:(0,O.jsx)("span",{children:t})})):null}),fh={CHECKED:(0,O.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,O.jsx)("path",{d:"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"})}),UNCHECKED:(0,O.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:(0,O.jsx)("path",{d:"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z"})})},ph=function(e){return(0,O.jsxs)("label",{className:Fe("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,O.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,O.jsx)("div",{className:"ToolIcon__icon",children:e.checked?fh.CHECKED:fh.UNCHECKED})]})},hh=["heading","children"];function mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mh(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var vh=function(e){var t=e.heading,n=e.children,r=lo(e,hh),o=Sm().id,i=(0,O.jsx)("h2",{className:"visually-hidden",id:"".concat(o,"-").concat(t,"-title"),children:C("headings.".concat(t))});return(0,O.jsx)("section",gh(gh({},r),{},{"aria-labelledby":"".concat(o,"-").concat(t,"-title"),children:"function"==typeof n?n(i):(0,O.jsxs)(O.Fragment,{children:[i,n]})}))},bh=(n(580),function(e){var t=e.children,n=e.className,r=e.mobile;return(0,O.jsx)("div",{className:Fe("UserList",n,{UserList_mobile:r}),children:t})}),yh=(0,O.jsx)("svg",{viewBox:"0 0 576 512",children:(0,O.jsx)("path",{fill:"currentColor",d:"M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"})}),xh=function(e){var t=e.appState,n=e.setAppState,r=e.isMobile;return(0,O.jsxs)("label",{className:Fe("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(ln(C("toolBar.library"))," — 0"),children:[(0,O.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:function(e){n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":ln(C("toolBar.library")),"aria-keyshortcuts":"0"}),(0,O.jsx)("div",{className:"ToolIcon__icon",children:yh})]})};function wh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var kh=function(e){var t=e.appState,n=e.elements,r=e.libraryMenu,o=e.actionManager,i=e.renderJSONExportDialog,a=e.renderImageExportDialog,l=e.setAppState,s=e.onCollabButtonClick,u=e.onLockToggle,d=e.canvas,f=e.isCollaborating,p=e.renderCustomFooter,m=e.viewModeEnabled,g=e.showThemeBtn,v=e.onImageAction,b=e.renderTopRightUI;return(0,O.jsxs)(O.Fragment,{children:[!m&&(0,O.jsxs)(uh,{side:"top",className:"App-top-bar",children:[(0,O.jsx)(vh,{heading:"shapes",children:function(e){return(0,O.jsxs)(_f,{gap:4,align:"center",children:[(0,O.jsxs)(kf,{gap:1,className:"App-toolbar-container",children:[(0,O.jsxs)(Bs,{padding:1,className:"App-toolbar",children:[e,(0,O.jsx)(kf,{gap:1,children:(0,O.jsx)(Jp,{canvas:d,elementType:t.elementType,setAppState:l,onImageAction:function(e){var t=e.pointerType;v({insertOnCanvasDirectly:"mouse"!==t})}})})]}),b&&b(!0,t),(0,O.jsx)(ph,{checked:t.elementLocked,onChange:u,title:C("toolBar.lock"),isMobile:!0}),(0,O.jsx)(xh,{appState:t,setAppState:l,isMobile:!0})]}),r]})}}),(0,O.jsx)(dh,{appState:t,elements:n,isMobile:!0})]}),(0,O.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,O.jsxs)(Bs,{padding:0,children:["canvas"===t.openMenu?(0,O.jsx)(vh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,O.jsx)("div",{className:"panelColumn",children:(0,O.jsxs)(_f,{gap:4,children:[m?(0,O.jsxs)(O.Fragment,{children:[i(),a()]}):(0,O.jsxs)(O.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),i(),a(),s&&(0,O.jsx)(nh,{isCollaborating:f,collaboratorCount:t.collaborators.size,onClick:s}),(0,O.jsx)(th,{actionManager:o,appState:t,setAppState:l,showThemeBtn:g})]}),null==p?void 0:p(!0,t),t.collaborators.size>0&&(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:C("labels.collaborators")}),(0,O.jsx)(bh,{mobile:!0,children:Array.from(t.collaborators).filter((function(e){var t=h(e,2),n=(t[0],t[1]);return 0!==Object.keys(n).length})).map((function(e){var t=h(e,2),n=t[0];t[1];return(0,O.jsx)(c().Fragment,{children:o.renderAction("goToCollaborator",{id:n})},n)}))})]})]})})}):"shape"===t.openMenu&&!m&&Rc(t,n)?(0,O.jsx)(vh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,O.jsx)(Qp,{appState:t,elements:n,renderAction:o.renderAction,elementType:t.elementType})}):null,(0,O.jsxs)("footer",{className:"App-toolbar",children:[m?(0,O.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,O.jsxs)("div",{className:"App-toolbar-content",children:[o.renderAction("toggleCanvasMenu"),o.renderAction("toggleEditMenu"),o.renderAction("undo"),o.renderAction("redo"),o.renderAction(t.multiElement?"finalize":"duplicateSelection"),o.renderAction("deleteSelectedElements")]}),t.scrolledOutside&&!t.openMenu&&(0,O.jsx)("button",{className:"scroll-back-to-content",onClick:function(){l(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wh(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},$c(n,t)))},children:C("buttons.scrollBackToContent")})]})]})})]})},_h=(n(8051),function(e){var t=(0,l.useRef)(null),n=h((0,l.useState)(null),2),r=n[0],o=n[1];return(0,l.useLayoutEffect)((function(){if(e.spreadsheet){var n,r=ef(e.chartType,e.spreadsheet,0,0);o(r);var i=t.current;return(0,d.Z)(g().mark((function t(){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Rd(r,{exportBackground:!1,viewBackgroundColor:jt.white},null);case 2:n=t.sent,i.appendChild(n),e.selected&&i.parentNode.focus();case 5:case"end":return t.stop()}}),t)})))(),function(){i.removeChild(n)}}}),[e.spreadsheet,e.chartType,e.selected]),(0,O.jsx)("button",{className:"ChartPreview",onClick:function(){r&&e.onClick(e.chartType,r)},children:(0,O.jsx)("div",{ref:t})})}),Sh=function(e){var t=e.setAppState,n=e.appState,r=e.onClose,o=e.onInsertChart,i=c().useCallback((function(){r&&r()}),[r]),a=function(e,n){o(n),ru("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,O.jsx)(Us,{small:!0,onCloseRequest:i,title:C("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,O.jsxs)("div",{className:"container",children:[(0,O.jsx)(_h,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:a}),(0,O.jsx)(_h,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:a})]})})};n(3922);function Eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var jh=function(){return(0,O.jsxs)("div",{className:"HelpDialog--header",children:[(0,O.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:C("helpDialog.documentation")}),(0,O.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:C("helpDialog.blog")}),(0,O.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:C("helpDialog.github")})]})},Ch=function(e){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("h3",{children:e.title}),e.children]})},Oh=function(e){return(0,O.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children})},Ih=function(e){return(0,O.jsx)("div",{style:{width:"49%"},children:e.children})},Mh=function(e){return(0,O.jsxs)("div",{className:"HelpDialog--island",children:[(0,O.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]})},Th=function(e){return(0,O.jsx)("div",{className:"HelpDialog--shortcut",children:(0,O.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,O.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,O.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map((function(t,n){return(0,O.jsxs)(c().Fragment,{children:[(0,O.jsx)(Ah,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&C("helpDialog.or")]},n)}))})]})})};Th.defaultProps={isOr:!0};var Ah=function(e){return(0,O.jsx)("kbd",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Eh(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"HelpDialog--key"},e))},Ph=function(e){var t=e.onClose,n=c().useCallback((function(){t&&t()}),[t]);return(0,O.jsx)(O.Fragment,{children:(0,O.jsxs)(Us,{onCloseRequest:n,title:C("helpDialog.title"),className:"HelpDialog",children:[(0,O.jsx)(jh,{}),(0,O.jsx)(Ch,{title:C("helpDialog.shortcuts"),children:(0,O.jsxs)(Oh,{children:[(0,O.jsxs)(Ih,{children:[(0,O.jsxs)(Mh,{caption:C("helpDialog.shapes"),children:[(0,O.jsx)(Th,{label:C("toolBar.selection"),shortcuts:["V","1"]}),(0,O.jsx)(Th,{label:C("toolBar.rectangle"),shortcuts:["R","2"]}),(0,O.jsx)(Th,{label:C("toolBar.diamond"),shortcuts:["D","3"]}),(0,O.jsx)(Th,{label:C("toolBar.ellipse"),shortcuts:["E","4"]}),(0,O.jsx)(Th,{label:C("toolBar.arrow"),shortcuts:["A","5"]}),(0,O.jsx)(Th,{label:C("toolBar.line"),shortcuts:["P","6"]}),(0,O.jsx)(Th,{label:C("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,O.jsx)(Th,{label:C("toolBar.text"),shortcuts:["T","8"]}),(0,O.jsx)(Th,{label:C("toolBar.image"),shortcuts:["9"]}),(0,O.jsx)(Th,{label:C("toolBar.library"),shortcuts:["0"]}),(0,O.jsx)(Th,{label:C("helpDialog.editSelectedShape"),shortcuts:[bn("Enter"),C("helpDialog.doubleClick")]}),(0,O.jsx)(Th,{label:C("helpDialog.textNewLine"),shortcuts:[bn("Enter"),bn("Shift+Enter")]}),(0,O.jsx)(Th,{label:C("helpDialog.textFinish"),shortcuts:[bn("Esc"),bn("CtrlOrCmd+Enter")]}),(0,O.jsx)(Th,{label:C("helpDialog.curvedArrow"),shortcuts:["A",C("helpDialog.click"),C("helpDialog.click"),C("helpDialog.click")],isOr:!1}),(0,O.jsx)(Th,{label:C("helpDialog.curvedLine"),shortcuts:["L",C("helpDialog.click"),C("helpDialog.click"),C("helpDialog.click")],isOr:!1}),(0,O.jsx)(Th,{label:C("toolBar.lock"),shortcuts:["Q"]}),(0,O.jsx)(Th,{label:C("helpDialog.preventBinding"),shortcuts:[bn("CtrlOrCmd")]})]}),(0,O.jsxs)(Mh,{caption:C("helpDialog.view"),children:[(0,O.jsx)(Th,{label:C("buttons.zoomIn"),shortcuts:[bn("CtrlOrCmd++")]}),(0,O.jsx)(Th,{label:C("buttons.zoomOut"),shortcuts:[bn("CtrlOrCmd+-")]}),(0,O.jsx)(Th,{label:C("buttons.resetZoom"),shortcuts:[bn("CtrlOrCmd+0")]}),(0,O.jsx)(Th,{label:C("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,O.jsx)(Th,{label:C("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,O.jsx)(Th,{label:C("buttons.fullScreen"),shortcuts:["F"]}),(0,O.jsx)(Th,{label:C("buttons.zenMode"),shortcuts:[bn("Alt+Z")]}),(0,O.jsx)(Th,{label:C("labels.showGrid"),shortcuts:[bn("CtrlOrCmd+'")]}),(0,O.jsx)(Th,{label:C("labels.viewMode"),shortcuts:[bn("Alt+R")]}),(0,O.jsx)(Th,{label:C("labels.toggleTheme"),shortcuts:[bn("Alt+Shift+D")]}),(0,O.jsx)(Th,{label:C("stats.title"),shortcuts:[bn("Alt+/")]})]})]}),(0,O.jsx)(Ih,{children:(0,O.jsxs)(Mh,{caption:C("helpDialog.editor"),children:[(0,O.jsx)(Th,{label:C("labels.selectAll"),shortcuts:[bn("CtrlOrCmd+A")]}),(0,O.jsx)(Th,{label:C("labels.multiSelect"),shortcuts:[bn("Shift+".concat(C("helpDialog.click")))]}),(0,O.jsx)(Th,{label:C("helpDialog.deepSelect"),shortcuts:[bn("CtrlOrCmd+".concat(C("helpDialog.click")))]}),(0,O.jsx)(Th,{label:C("helpDialog.deepBoxSelect"),shortcuts:[bn("CtrlOrCmd+".concat(C("helpDialog.drag")))]}),(0,O.jsx)(Th,{label:C("labels.moveCanvas"),shortcuts:[bn("Space+".concat(C("helpDialog.drag"))),bn("Wheel+".concat(C("helpDialog.drag")))],isOr:!0}),(0,O.jsx)(Th,{label:C("labels.cut"),shortcuts:[bn("CtrlOrCmd+X")]}),(0,O.jsx)(Th,{label:C("labels.copy"),shortcuts:[bn("CtrlOrCmd+C")]}),(0,O.jsx)(Th,{label:C("labels.paste"),shortcuts:[bn("CtrlOrCmd+V")]}),(0,O.jsx)(Th,{label:C("labels.copyAsPng"),shortcuts:[bn("Shift+Alt+C")]}),(0,O.jsx)(Th,{label:C("labels.copyStyles"),shortcuts:[bn("CtrlOrCmd+Alt+C")]}),(0,O.jsx)(Th,{label:C("labels.pasteStyles"),shortcuts:[bn("CtrlOrCmd+Alt+V")]}),(0,O.jsx)(Th,{label:C("labels.delete"),shortcuts:[bn("Del")]}),(0,O.jsx)(Th,{label:C("labels.sendToBack"),shortcuts:[bn(Mt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,O.jsx)(Th,{label:C("labels.bringToFront"),shortcuts:[bn(Mt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,O.jsx)(Th,{label:C("labels.sendBackward"),shortcuts:[bn("CtrlOrCmd+[")]}),(0,O.jsx)(Th,{label:C("labels.bringForward"),shortcuts:[bn("CtrlOrCmd+]")]}),(0,O.jsx)(Th,{label:C("labels.alignTop"),shortcuts:[bn("CtrlOrCmd+Shift+Up")]}),(0,O.jsx)(Th,{label:C("labels.alignBottom"),shortcuts:[bn("CtrlOrCmd+Shift+Down")]}),(0,O.jsx)(Th,{label:C("labels.alignLeft"),shortcuts:[bn("CtrlOrCmd+Shift+Left")]}),(0,O.jsx)(Th,{label:C("labels.alignRight"),shortcuts:[bn("CtrlOrCmd+Shift+Right")]}),(0,O.jsx)(Th,{label:C("labels.duplicateSelection"),shortcuts:[bn("CtrlOrCmd+D"),bn("Alt+".concat(C("helpDialog.drag")))]}),(0,O.jsx)(Th,{label:C("buttons.undo"),shortcuts:[bn("CtrlOrCmd+Z")]}),(0,O.jsx)(Th,{label:C("buttons.redo"),shortcuts:Tt?[bn("CtrlOrCmd+Y"),bn("CtrlOrCmd+Shift+Z")]:[bn("CtrlOrCmd+Shift+Z")]}),(0,O.jsx)(Th,{label:C("labels.group"),shortcuts:[bn("CtrlOrCmd+G")]}),(0,O.jsx)(Th,{label:C("labels.ungroup"),shortcuts:[bn("CtrlOrCmd+Shift+G")]}),(0,O.jsx)(Th,{label:C("labels.flipHorizontal"),shortcuts:[bn("Shift+H")]}),(0,O.jsx)(Th,{label:C("labels.flipVertical"),shortcuts:[bn("Shift+V")]}),(0,O.jsx)(Th,{label:C("labels.showStroke"),shortcuts:[bn("S")]}),(0,O.jsx)(Th,{label:C("labels.showBackground"),shortcuts:[bn("G")]}),(0,O.jsx)(Th,{label:C("labels.decreaseFontSize"),shortcuts:[bn("CtrlOrCmd+Shift+<")]}),(0,O.jsx)(Th,{label:C("labels.increaseFontSize"),shortcuts:[bn("CtrlOrCmd+Shift+>")]})]})})]})})]})})},Lh=(n(5080),function(e){var t,n=e.children,r=e.color;return(0,O.jsx)("div",{className:"Card",style:(t={},P(t,"--card-color","primary"===r?"var(--color-primary)":jt[r][7]),P(t,"--card-color-darker","primary"===r?"var(--color-primary-darker)":jt[r][8]),P(t,"--card-color-darkest","primary"===r?"var(--color-primary-darkest)":jt[r][9]),t),children:n})}),Dh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,i=e.exportOpts,a=e.canvas,l=i.onExportToBackend;return(0,O.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,O.jsxs)("div",{className:"ExportDialog-cards",children:[i.saveFileToDisk&&(0,O.jsxs)(Lh,{color:"lime",children:[(0,O.jsx)("div",{className:"Card-icon",children:hl}),(0,O.jsx)("h2",{children:C("exportDialog.disk_title")}),(0,O.jsxs)("div",{className:"Card-details",children:[C("exportDialog.disk_details"),!Uu&&o.renderAction("changeProjectName")]}),(0,O.jsx)(ls,{className:"Card-button",type:"button",title:C("exportDialog.disk_button"),"aria-label":C("exportDialog.disk_button"),showAriaLabel:!0,onClick:function(){o.executeAction(Mf)}})]}),l&&(0,O.jsxs)(Lh,{color:"pink",children:[(0,O.jsx)("div",{className:"Card-icon",children:il}),(0,O.jsx)("h2",{children:C("exportDialog.link_title")}),(0,O.jsx)("div",{className:"Card-details",children:C("exportDialog.link_details")}),(0,O.jsx)(ls,{className:"Card-button",type:"button",title:C("exportDialog.link_button"),"aria-label":C("exportDialog.link_button"),showAriaLabel:!0,onClick:function(){return l(t,n,r,a)}})]}),i.renderCustomUI&&i.renderCustomUI(t,n,r,a)]})})},Rh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,i=e.exportOpts,a=e.canvas,s=h((0,l.useState)(!1),2),u=s[0],d=s[1],f=c().useCallback((function(){d(!1)}),[]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(ls,{onClick:function(){d(!0)},"data-testid":"json-export-button",icon:fl,type:"button","aria-label":C("buttons.export"),showAriaLabel:km(),title:C("buttons.export")}),u&&(0,O.jsx)(Us,{onCloseRequest:f,title:C("buttons.export"),children:(0,O.jsx)(Dh,{elements:t,appState:n,files:r,actionManager:o,onCloseRequest:f,exportOpts:i,canvas:a})})]})};function zh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zh(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Bh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.maxWidthOrHeight,i=e.getDimensions,a=nd({elements:t,appState:n},null,null),l=a.elements,c=a.appState,s=c.exportBackground,u=c.viewBackgroundColor;return Dd(Hc(l),Nh(Nh({},c),{},{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:s,viewBackgroundColor:u},(function(e,t){var n,r=document.createElement("canvas");if(o){"function"==typeof i&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");var a=Math.max(e,t),l=o/a;return r.width=e*l,r.height=t*l,{canvas:r,scale:l}}var c=(null==i?void 0:i(e,t))||{width:e,height:t};return r.width=c.width,r.height=c.height,{canvas:r,scale:null!==(n=c.scale)&&void 0!==n?n:1}}))},Hh=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(r=t).mimeType,i=void 0===o?s.LO.png:o,a=r.quality,i===s.LO.png&&"number"==typeof a&&console.warn('"quality" will be ignored for "'.concat(s.LO.png,'" mimeType')),"image/jpg"===i&&(i=s.LO.jpg),i!==s.LO.jpg||null!==(n=t.appState)&&void 0!==n&&n.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(s.LO.jpg,'" mimeType')),t=Nh(Nh({},t),{},{appState:Nh(Nh({},t.appState),{},{exportBackground:!0})})),e.next=6,Bh(t);case 6:return l=e.sent,a=a||(/image\/jpe?g/.test(i)?.92:.8),e.abrupt("return",new Promise((function(e){l.toBlob((function(t){e(t)}),i,a)})));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Fh=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l,c,s,u;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.elements,r=t.appState,o=void 0===r?Ln():r,i=t.files,a=void 0===i?{}:i,l=t.exportPadding,c=nd({elements:n,appState:o},null,null),s=c.elements,u=c.appState,e.abrupt("return",Rd(Hc(s),Nh(Nh({},u),{},{exportPadding:l}),a));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();n(9295),n(9781);function Uh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uh(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kh=function(e){var t=e.libItem,n=e.appState,r=e.index,o=e.onChange,i=e.onRemove,a=(0,l.useRef)(null),c=(0,l.useRef)(null);return(0,l.useEffect)((function(){var e=a.current;e&&(0,d.Z)(g().mark((function r(){var o;return g().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Fh({elements:t.elements,appState:Wh(Wh({},n),{},{viewBackgroundColor:jt.white,exportBackground:!0}),files:null});case 2:o=r.sent,e.innerHTML=o.outerHTML;case 4:case"end":return r.stop()}}),r)})))()}),[t.elements,n]),(0,O.jsxs)("div",{className:"single-library-item",children:[(0,O.jsx)("div",{ref:a,className:"single-library-item__svg"}),(0,O.jsx)(ls,{"aria-label":C("buttons.remove"),type:"button",icon:Dl,className:"single-library-item--remove",onClick:i.bind(null,t.id),title:C("buttons.remove")}),(0,O.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,O.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,O.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,O.jsx)("span",{style:{fontWeight:500,color:jt.gray[6]},children:C("publishDialog.itemName")}),(0,O.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,O.jsx)("input",{type:"text",ref:c,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:function(e){o(e.target.value,r)}})]}),(0,O.jsx)("span",{className:"error",children:t.error})]})]})};function Vh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vh(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Yh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yh(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qh="publish-library-data",Xh=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l,c,u,d,f,p,m,v,b,y,x,w;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=6,r=128,o=Math.round(r/16),i=Math.max(Math.round(r/64),2),a=fn(t,n),(l=document.createElement("canvas")).width=a[0].length*r+(a[0].length+1)*(2*o)-2*o,l.height=a.length*r+(a.length+1)*(2*o)-2*o,(c=l.getContext("2d")).fillStyle=jt.white,c.fillRect(0,0,l.width,l.height),u=Zh(t.entries()),e.prev=12,u.s();case 14:if((d=u.n()).done){e.next=28;break}return f=h(d.value,2),p=f[0],m=f[1],e.next=18,Bh({elements:m.elements,files:null,maxWidthOrHeight:r});case 18:v=e.sent,b=v.width,y=v.height,x=Math.floor(p/n)*(r+2*o),w=p%n*(r+2*o),c.drawImage(v,w+(r-b)/2+o,x+(r-y)/2+o),c.lineWidth=i,c.strokeStyle=jt.gray[4],c.strokeRect(w+o/2,x+o/2,r+o,r+o);case 26:e.next=14;break;case 28:e.next=33;break;case 30:e.prev=30,e.t0=e.catch(12),u.e(e.t0);case 33:return e.prev=33,u.f(),e.finish(33);case 36:return e.t1=gd,e.t2=File,e.next=40,fd(l);case 40:return e.t3=e.sent,e.t4=[e.t3],e.t5={type:s.LO.png},e.t6=new e.t2(e.t4,"preview",e.t5),e.t7={outputType:s.LO.jpg,maxWidthOrHeight:5e3},e.next=47,(0,e.t1)(e.t6,e.t7);case 47:return e.abrupt("return",e.sent);case 48:case"end":return e.stop()}}),e,null,[[12,30,33,36]])})));return function(t){return e.apply(this,arguments)}}(),$h=function(e){var t=e.onClose,n=e.libraryItems,r=e.appState,o=e.onSuccess,i=e.onError,a=e.updateItemsInStorage,c=e.onRemove,u=h((0,l.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),2),f=u[0],p=u[1],m=h((0,l.useState)(!1),2),v=m[0],b=m[1];(0,l.useEffect)((function(){var e=function(){try{var e=localStorage.getItem(qh);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null}();e&&p(e)}),[]);var y=h((0,l.useState)(n.slice()),2),x=y[0],w=y[1];(0,l.useEffect)((function(){w(n.slice())}),[n]);var k,_=function(e){p(Gh(Gh({},f),{},P({},e.target.name,e.target.value)))},S=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,a,l,c,u,d;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),b(!0),n=[],r=!1,x.forEach((function(e){var t="";e.name||(t=C("publishDialog.errors.required"),r=!0),n.push(Gh(Gh({},e),{},{error:t}))})),!r){e.next=9;break}return w(n),b(!1),e.abrupt("return");case 9:return e.next=11,Xh(x);case 11:a=e.sent,l={type:s.r8.excalidrawLibrary,version:s.Kr.excalidrawLibrary,source:s.pb,libraryItems:x},c=JSON.stringify(l,null,2),u=new Blob([c],{type:"application/json"}),(d=new FormData).append("excalidrawLib",u),d.append("previewImage",a),d.append("previewImageType",a.type),d.append("title",f.name),d.append("authorName",f.authorName),d.append("githubHandle",f.githubHandle),d.append("name",f.name),d.append("description",f.description),d.append("twitterHandle",f.twitterHandle),d.append("website",f.website),fetch("".concat("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries","/submit"),{method:"post",body:d}).then((function(e){return e.ok?e.json().then((function(e){var t=e.url;localStorage.removeItem(qh),o({url:t,authorName:f.authorName,items:x})})):e.json().catch((function(){throw new Error(e.statusText||"something went wrong")})).then((function(t){throw new Error(t.message||e.statusText||"something went wrong")}))}),(function(e){console.error(e),i(e),b(!1)})).catch((function(e){console.error(e),i(e),b(!1)}));case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=(0,l.useCallback)((function(){a(x),function(e){try{localStorage.setItem(qh,JSON.stringify(e))}catch(e){console.error(e)}}(f),t()}),[x,t,a,f]),j=!!n.length;return(0,O.jsx)(Us,{onCloseRequest:E,title:C("publishDialog.title"),className:"publish-library",children:j?(0,O.jsxs)("form",{onSubmit:S,children:[(0,O.jsxs)("div",{className:"publish-library-note",children:[C("publishDialog.noteDescription.pre"),(0,O.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:C("publishDialog.noteDescription.link")})," ",C("publishDialog.noteDescription.post")]}),(0,O.jsxs)("span",{className:"publish-library-note",children:[C("publishDialog.noteGuidelines.pre"),(0,O.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:C("publishDialog.noteGuidelines.link")}),C("publishDialog.noteGuidelines.post")]}),(0,O.jsx)("div",{className:"publish-library-note",children:C("publishDialog.noteItems")}),(k=[],x.forEach((function(e,t){k.push((0,O.jsx)("div",{className:"single-library-item-wrapper",children:(0,O.jsx)(Kh,{libItem:e,appState:r,index:t,onChange:function(e,t){var n=x.slice();n[t].name=e,w(n)},onRemove:c})},t))})),(0,O.jsx)("div",{className:"selected-library-items",children:k})),(0,O.jsxs)("div",{className:"publish-library__fields",children:[(0,O.jsxs)("label",{children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("span",{children:C("publishDialog.libraryName")}),(0,O.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,O.jsx)("input",{type:"text",name:"name",required:!0,value:f.name,onChange:_,placeholder:C("publishDialog.placeholder.libraryName")})]}),(0,O.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("span",{children:C("publishDialog.libraryDesc")}),(0,O.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,O.jsx)("textarea",{name:"description",rows:4,required:!0,value:f.description,onChange:_,placeholder:C("publishDialog.placeholder.libraryDesc")})]}),(0,O.jsxs)("label",{children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("span",{children:C("publishDialog.authorName")}),(0,O.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,O.jsx)("input",{type:"text",name:"authorName",required:!0,value:f.authorName,onChange:_,placeholder:C("publishDialog.placeholder.authorName")})]}),(0,O.jsxs)("label",{children:[(0,O.jsx)("span",{children:C("publishDialog.githubUsername")}),(0,O.jsx)("input",{type:"text",name:"githubHandle",value:f.githubHandle,onChange:_,placeholder:C("publishDialog.placeholder.githubHandle")})]}),(0,O.jsxs)("label",{children:[(0,O.jsx)("span",{children:C("publishDialog.twitterUsername")}),(0,O.jsx)("input",{type:"text",name:"twitterHandle",value:f.twitterHandle,onChange:_,placeholder:C("publishDialog.placeholder.twitterHandle")})]}),(0,O.jsxs)("label",{children:[(0,O.jsx)("span",{children:C("publishDialog.website")}),(0,O.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:C("publishDialog.errors.website"),value:f.website,onChange:_,placeholder:C("publishDialog.placeholder.website")})]}),(0,O.jsxs)("span",{className:"publish-library-note",children:[C("publishDialog.noteLicense.pre"),(0,O.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:C("publishDialog.noteLicense.link")}),C("publishDialog.noteLicense.post")]})]}),(0,O.jsxs)("div",{className:"publish-library__buttons",children:[(0,O.jsx)(ls,{type:"button",title:C("buttons.cancel"),"aria-label":C("buttons.cancel"),label:C("buttons.cancel"),onClick:E,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,O.jsx)(ls,{type:"submit",title:C("buttons.submit"),"aria-label":C("buttons.submit"),label:C("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:v})]})]}):(0,O.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:C("publishDialog.atleastOneLibItem")})})},Qh=(n(4406),n(2891)),Jh=(n(694),(0,O.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,O.jsx)("path",{d:"M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z",style:{stroke:"#fff",strokeWidth:140},transform:"translate(0 64)"})})),em=function(e){var t=e.id,n=e.elements,r=e.files,o=e.isPending,i=e.onClick,a=e.selected,c=e.onToggle,u=(0,l.useRef)(null);(0,l.useEffect)((function(){var e=u.current;if(e)return(0,d.Z)(g().mark((function t(){var o;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,Rd(n,{exportBackground:!1,viewBackgroundColor:jt.white},r);case 4:o=t.sent,e.innerHTML=o.outerHTML;case 6:case"end":return t.stop()}}),t)})))(),function(){e.innerHTML=""}}),[n,r]);var f=h((0,l.useState)(!1),2),p=f[0],m=f[1],v=km(),b=o&&(0,O.jsx)("div",{className:"library-unit__adder",children:Jh});return(0,O.jsxs)("div",{className:Fe("library-unit",{"library-unit__active":n,"library-unit--hover":n&&p,"library-unit--selected":a}),onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},children:[(0,O.jsx)("div",{className:Fe("library-unit__dragger",{"library-unit__pulse":!!o}),ref:u,draggable:!!n,onClick:n||o?function(e){t&&e.shiftKey?c(t,e):i()}:void 0,onDragStart:function(e){m(!1),e.dataTransfer.setData(s.LO.excalidrawlib,JSON.stringify(n))}}),b,t&&n&&(p||v||a)&&(0,O.jsx)(yf,{checked:a,onChange:function(e,n){return c(t,n)},className:"library-unit__checkbox"})]})},tm=(n(6043),function(e){var t,n,r,o=e.libraryItems,i=e.onRemoveFromLibrary,a=e.onAddToLibrary,c=e.onInsertShape,u=e.pendingElements,f=e.theme,p=e.setAppState,m=e.libraryReturnUrl,v=e.library,b=e.files,y=e.id,x=e.selectedItems,w=e.onToggle,k=e.onPublish,_=e.resetLibrary,S=(0,l.useCallback)((function(){var e=x.length?C("alerts.removeItemsFromsLibrary",{count:x.length}):C("alerts.resetLibrary"),t=x.length?C("confirmDialog.removeItemsFromLib"):C("confirmDialog.resetLibrary");return(0,O.jsx)(Gs,{onConfirm:function(){x.length?i():_(),I(!1)},onCancel:function(){I(!1)},title:t,children:(0,O.jsx)("p",{children:e})})}),[x,i,_]),E=h((0,l.useState)(!1),2),j=E[0],I=E[1],M=km(),T=M?4:6,P=m||window.location.origin+window.location.pathname,L=x.some((function(e){var t;return"published"===(null===(t=o.find((function(t){return t.id===e})))||void 0===t?void 0:t.status)})),D=function(e){var t,n,r,o,i;return(0,O.jsx)(_f,{children:(0,O.jsx)(em,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:b,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||function(){},id:(null===(o=e.item)||void 0===o?void 0:o.id)||null,selected:!(null===(i=e.item)||void 0===i||!i.id)&&x.includes(e.item.id),onToggle:function(e,t){w(e,t)}})},e.key)},R=function(e){var t=e.map((function(e){return e.id?D({item:e,onClick:function(){return c(e.elements)},key:e.id}):D({key:"__pending__item__",item:e,onClick:function(){return a(u)}})})),n=(0,Qh.chunk)(t,T);return n.length||(n=[[]]),n.map((function(e,t,n){return t===n.length-1&&(e=e.concat(new Array(T-e.length).fill(null).map((function(e,t){return D({key:"empty_".concat(t),item:null})})))),(0,O.jsx)(kf,{align:"center",gap:1,children:e},t)}))},z=o.filter((function(e){return"published"===e.status})),N=[].concat(A(u.length?[{id:null,elements:u}]:[]),A(o.filter((function(e){return"published"!==e.status}))));return(0,O.jsxs)("div",{className:"library-menu-items-container",children:[j&&S(),(0,O.jsxs)("div",{className:"layer-ui__library-header",children:[(t=!!x.length,n=t?o.filter((function(e){return x.includes(e.id)})):o,r=C(t?"buttons.remove":"buttons.resetLibrary"),(0,O.jsxs)("div",{className:"library-actions",children:[(!t||!M)&&(0,O.jsx)(ls,{type:"button",title:C("buttons.load"),"aria-label":C("buttons.load"),icon:cl,onClick:function(){Cd(v).then((function(){p({isLibraryOpen:!1}),p({isLibraryOpen:!0})})).catch(En).catch((function(e){p({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(ls,{type:"button",title:C("buttons.export"),"aria-label":C("buttons.export"),icon:hl,onClick:(0,d.Z)(g().mark((function e(){var r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}e.t0=n,e.next=7;break;case 4:return e.next=6,v.loadLibrary();case 6:e.t0=e.sent;case 7:r=e.t0,jd(r).catch(En).catch((function(e){p({errorMessage:e.message})}));case 9:case"end":return e.stop()}}),e)}))),className:"library-actions--export",children:x.length>0&&(0,O.jsx)("span",{className:"library-actions-counter",children:x.length})},"export"),(0,O.jsx)(ls,{type:"button",title:r,"aria-label":r,icon:ul,onClick:function(){return I(!0)},className:"library-actions--remove",children:x.length>0&&(0,O.jsx)("span",{className:"library-actions-counter",children:x.length})},"reset")]}),t&&!L&&(0,O.jsx)(Rs,{label:C("hints.publishLibrary"),children:(0,O.jsxs)(ls,{type:"button","aria-label":C("buttons.publishLibrary"),label:C("buttons.publishLibrary"),icon:hc,className:"library-actions--publish",onClick:k,children:[!M&&(0,O.jsx)("label",{children:C("buttons.publishLibrary")}),x.length>0&&(0,O.jsx)("span",{className:"library-actions-counter",children:x.length})]})})]})),(0,O.jsx)("a",{href:"".concat("https://libraries.excalidraw.com","?target=").concat(window.name||"_blank","&referrer=").concat(P,"&useHash=true&token=").concat(y,"&theme=").concat(f,"&version=").concat(s.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:C("labels.libraries")})]},"library-header"),(0,O.jsxs)(_f,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{className:"separator",children:C("labels.personalLib")}),R(N)]}),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"separator",children:[C("labels.excalidrawLib")," "]}),R(z)]})]})]})}),nm=function(e,t){return e.filter((function(e){return t.includes(e.id)}))},rm=function(e){var t=e.onClose,n=e.onInsertShape,r=e.pendingElements,o=e.onAddToLibrary,i=e.theme,a=e.setAppState,c=e.files,u=e.libraryReturnUrl,f=e.focusContainer,p=e.library,m=e.id,v=e.appState,b=(0,l.useRef)(null);!function(e,t){(0,l.useEffect)((function(){var n=function(n){e.current&&(n.target instanceof Element&&(e.current.contains(n.target)||!document.body.contains(n.target))||t(n))};return document.addEventListener("pointerdown",n,!1),function(){document.removeEventListener("pointerdown",n)}}),[e,t])}(b,(function(e){e.target.closest(".ToolIcon__library")||t()})),(0,l.useEffect)((function(){var e=function(e){e.key===Jt.ESCAPE&&t()};return document.addEventListener(s.Ks.KEYDOWN,e),function(){document.removeEventListener(s.Ks.KEYDOWN,e)}}),[t]);var y=h((0,l.useState)([]),2),x=y[0],w=y[1],k=h((0,l.useState)("preloading"),2),_=k[0],S=k[1],E=h((0,l.useState)([]),2),j=E[0],I=E[1],M=h((0,l.useState)(!1),2),T=M[0],P=M[1],L=h((0,l.useState)(null),2),D=L[0],R=L[1],z=(0,l.useRef)(null);(0,l.useEffect)((function(){return Promise.race([new Promise((function(e){z.current=window.setTimeout((function(){e("loading")}),100)})),p.loadLibrary().then((function(e){w(e),S("ready")}))]).then((function(e){"loading"===e&&S("loading")})),function(){clearTimeout(z.current)}}),[p]);var N=(0,l.useCallback)((0,d.Z)(g().mark((function e(){var t,n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.loadLibrary();case 2:t=e.sent,n=t.filter((function(e){return!j.includes(e.id)})),p.saveLibrary(n).catch((function(e){w(t),a({errorMessage:C("alerts.errorRemovingFromLibrary")})})),I([]),w(n);case 7:case"end":return e.stop()}}),e)}))),[p,a,j,I]),B=(0,l.useCallback)((function(){p.resetLibrary(),w([]),f()}),[p,f]),H=(0,l.useCallback)(function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.some((function(e){return"image"===e.type}))){e.next=2;break}return e.abrupt("return",a({errorMessage:"Support for adding images to the library coming soon!"}));case 2:return e.next=4,p.loadLibrary();case 4:n=e.sent,r=[{status:"unpublished",elements:t,id:Qr(),created:Date.now()}].concat(A(n)),o(),p.saveLibrary(r).catch((function(e){w(n),a({errorMessage:C("alerts.errorAddingToLibrary")})})),w(r);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,p,a]),F=(0,l.useCallback)((function(){return(0,O.jsxs)(Us,{onCloseRequest:function(){return R(null)},title:C("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,O.jsxs)("p",{children:[C("publishSuccessDialog.content",{authorName:D.authorName})," ",(0,O.jsx)("a",{href:null==D?void 0:D.url,target:"_blank",rel:"noopener noreferrer",children:C("publishSuccessDialog.link")})]}),(0,O.jsx)(ls,{type:"button",title:C("buttons.close"),"aria-label":C("buttons.close"),label:C("buttons.close"),onClick:function(){return R(null)},"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})}),[R,D]),U=(0,l.useCallback)((function(e){P(!1),R({url:e.url,authorName:e.authorName});var t=x.slice();t.forEach((function(e){j.includes(e.id)&&(e.status="published")})),p.saveLibrary(t),w(t)}),[P,R,x,j,p]),W=h((0,l.useState)(null),2),K=W[0],V=W[1];return"preloading"===_?null:(0,O.jsxs)(Bs,{padding:1,ref:b,className:"layer-ui__library",children:[T&&(0,O.jsx)($h,{onClose:function(){return P(!1)},libraryItems:nm(x,j),appState:v,onSuccess:U,onError:function(e){return window.alert(e)},updateItemsInStorage:function(){return p.saveLibrary(x)},onRemove:function(e){return I(j.filter((function(t){return t!==e})))}}),D&&F(),"loading"===_?(0,O.jsx)("div",{className:"layer-ui__library-message",children:C("labels.libraryLoadingMessage")}):(0,O.jsx)(tm,{libraryItems:x,onRemoveFromLibrary:N,onAddToLibrary:H,onInsertShape:n,pendingElements:r,setAppState:a,libraryReturnUrl:u,library:p,theme:i,files:c,id:m,selectedItems:j,onToggle:function(e,t){if(!j.includes(e)){if(t.shiftKey&&K){var n=x.findIndex((function(e){return e.id===K})),r=x.findIndex((function(t){return t.id===e}));if(-1===n||-1===r)return void I([].concat(A(j),[e]));var o=In(j),i=x.reduce((function(e,t,i){return(i>=n&&i<=r||o.has(t.id))&&e.push(t.id),e}),[]);I(i)}else I([].concat(A(j),[e]));V(e)}else V(null),I(j.filter((function(t){return t!==e})))},onPublish:function(){return P(!0)},resetLibrary:B})]})},om=(n(3336),n(276),["suggestedBindings","startBoundElement"]);function im(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var am=function(e){var t,n=e.actionManager,r=e.appState,o=e.files,i=e.setAppState,a=e.canvas,c=e.elements,u=e.onCollabButtonClick,f=e.onLockToggle,p=e.onInsertElements,m=e.zenModeEnabled,v=e.showExitZenModeBtn,b=e.showThemeBtn,y=e.toggleZenMode,x=e.isCollaborating,w=e.renderTopRightUI,k=e.renderCustomFooter,_=e.viewModeEnabled,S=e.libraryReturnUrl,E=e.UIOptions,j=e.focusContainer,M=e.library,T=e.id,A=e.onImageAction,L=km(),D=function(){return E.canvasActions.export?(0,O.jsx)(Rh,{elements:c,appState:r,files:o,actionManager:n,exportOpts:E.canvasActions.export,canvas:a}):null},R=function(){if(!E.canvasActions.saveAsImage)return null;var e=function(e){return function(){var t=(0,d.Z)(g().mark((function t(n){var a;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,mf(e,n,r,o,{exportBackground:r.exportBackground,name:r.name,viewBackgroundColor:r.viewBackgroundColor}).catch(En).catch((function(e){console.error(e),i({errorMessage:e.message})}));case 2:a=t.sent,r.exportEmbedScene&&a&&cd(a)&&i({fileHandle:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};return(0,O.jsx)(sh,{elements:c,appState:r,files:o,actionManager:n,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},z=function(){return(0,O.jsx)("div",{style:{width:".625em"}})},N=(0,l.useCallback)((function(){!!document.querySelector(".Dialog")||i({isLibraryOpen:!1})}),[i]),B=(0,l.useCallback)((function(){i({selectedElementIds:{},selectedGroupIds:{}})}),[i]),H=r.isLibraryOpen?(0,O.jsx)(rm,{pendingElements:Yc(c,r,!0),onClose:N,onInsertShape:p,onAddToLibrary:B,setAppState:i,libraryReturnUrl:S,focusContainer:j,library:M,theme:r.theme,files:o,id:T,appState:r}):null,F=(0,O.jsxs)(O.Fragment,{children:[r.isLoading&&(0,O.jsx)(I,{}),r.errorMessage&&(0,O.jsx)(rh,{message:r.errorMessage,onClose:function(){return i({errorMessage:null})}}),r.showHelpDialog&&(0,O.jsx)(Ph,{onClose:function(){i({showHelpDialog:!1})}}),r.pasteDialog.shown&&(0,O.jsx)(Sh,{setAppState:i,appState:r,onInsertChart:p,onClose:function(){return i({pasteDialog:{shown:!1,data:null}})}})]});return L?(0,O.jsxs)(O.Fragment,{children:[F,(0,O.jsx)(kh,{appState:r,elements:c,actionManager:n,libraryMenu:H,renderJSONExportDialog:D,renderImageExportDialog:R,setAppState:i,onCollabButtonClick:u,onLockToggle:f,canvas:a,isCollaborating:x,renderCustomFooter:k,viewModeEnabled:_,showThemeBtn:b,onImageAction:A,renderTopRightUI:w})]}):(0,O.jsxs)("div",{className:Fe("layer-ui__wrapper",{"disable-pointerEvents":r.draggingElement||r.resizingElement||r.editingElement&&!Ve(r.editingElement)}),children:[F,(t=Rc(r,c),(0,O.jsx)(uh,{side:"top",children:(0,O.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,O.jsxs)(_f,{gap:4,className:Fe({"disable-pointerEvents":m}),children:[_?(0,O.jsx)(vh,{heading:"canvasActions",className:Fe("zen-mode-transition",{"transition-left":m}),children:(0,O.jsx)(Bs,{padding:2,style:{zIndex:1},children:(0,O.jsx)(_f,{gap:4,children:(0,O.jsxs)(kf,{gap:1,justifyContent:"space-between",children:[D(),R()]})})})}):(0,O.jsx)(vh,{heading:"canvasActions",className:Fe("zen-mode-transition",{"transition-left":m}),children:(0,O.jsx)(Bs,{padding:2,style:{zIndex:1},children:(0,O.jsxs)(_f,{gap:4,children:[(0,O.jsxs)(kf,{gap:1,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),(0,O.jsx)(z,{}),n.renderAction("loadScene"),D(),R(),(0,O.jsx)(z,{}),u&&(0,O.jsx)(nh,{isCollaborating:x,collaboratorCount:r.collaborators.size,onClick:u})]}),(0,O.jsx)(th,{actionManager:n,appState:r,setAppState:i,showThemeBtn:b}),r.fileHandle&&(0,O.jsx)(O.Fragment,{children:n.renderAction("saveToActiveFile")})]})})}),t&&(0,O.jsx)(vh,{heading:"selectedShapeActions",className:Fe("zen-mode-transition",{"transition-left":m}),children:(0,O.jsx)(Bs,{className:s.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(r.height-(r.fileHandle?248:200),"px")},children:(0,O.jsx)(Qp,{appState:r,elements:c,renderAction:n.renderAction,elementType:r.elementType})})})]}),!_&&(0,O.jsx)(vh,{heading:"shapes",children:function(e){return(0,O.jsxs)(_f,{gap:4,align:"start",children:[(0,O.jsxs)(kf,{gap:1,className:Fe("App-toolbar-container",{"zen-mode":m}),children:[(0,O.jsx)(ph,{zenModeEnabled:m,checked:r.elementLocked,onChange:f,title:C("toolBar.lock")}),(0,O.jsxs)(Bs,{padding:1,className:Fe("App-toolbar",{"zen-mode":m}),children:[(0,O.jsx)(dh,{appState:r,elements:c,isMobile:L}),e,(0,O.jsx)(kf,{gap:1,children:(0,O.jsx)(Jp,{canvas:a,elementType:r.elementType,setAppState:i,onImageAction:function(e){var t=e.pointerType;A({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,O.jsx)(xh,{appState:r,setAppState:i})]}),H]})}}),(0,O.jsxs)("div",{className:Fe("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":m}),children:[(0,O.jsx)(bh,{children:r.collaborators.size>0&&Array.from(r.collaborators).filter((function(e){var t=h(e,2),n=(t[0],t[1]);return 0!==Object.keys(n).length})).map((function(e){var t=h(e,2),r=t[0],o=t[1];return(0,O.jsx)(Rs,{label:o.username||"Unknown user",children:n.renderAction("goToCollaborator",{id:r})},r)}))}),null==w?void 0:w(L,r)]})]})})),(0,O.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,O.jsx)("div",{className:Fe("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":m}),children:(0,O.jsx)(_f,{gap:2,children:(0,O.jsxs)(vh,{heading:"canvasActions",children:[(0,O.jsx)(Bs,{padding:1,children:(0,O.jsx)(eh,{renderAction:n.renderAction,zoom:r.zoom})}),!_&&(0,O.jsxs)("div",{className:Fe("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":m}),children:[n.renderAction("undo",{size:"small"}),n.renderAction("redo",{size:"small"})]})]})})}),(0,O.jsx)("div",{className:Fe("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":m}),children:null==k?void 0:k(!1,r)}),(0,O.jsx)("div",{className:Fe("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":m}),children:n.renderAction("toggleShortcuts")}),(0,O.jsx)("button",{className:Fe("disable-zen-mode",{"disable-zen-mode--visible":v}),onClick:y,children:C("buttons.exitZenMode")})]}),r.scrolledOutside&&(0,O.jsx)("button",{className:"scroll-back-to-content",onClick:function(){i(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?im(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):im(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},$c(c,r)))},children:C("buttons.scrollBackToContent")})]})},lm=function(e,t){var n=function(e){e.suggestedBindings,e.startBoundElement;return lo(e,om)},r=n(e.appState),o=n(t.appState),i=Object.keys(r);return e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&i.every((function(e){return r[e]===o[e]}))},cm=c().memo(am,lm),sm=(n(1528),function(e){var t,n=km(),r=kt(e.elements),o=qc(e.elements,e.appState),i=kt(o);return n&&e.appState.openMenu?null:(0,O.jsx)("div",{className:"Stats",children:(0,O.jsxs)(Bs,{padding:2,children:[(0,O.jsx)("div",{className:"close",onClick:e.onClose,children:Dl}),(0,O.jsx)("h3",{children:C("stats.title")}),(0,O.jsx)("table",{children:(0,O.jsxs)("tbody",{children:[(0,O.jsx)("tr",{children:(0,O.jsx)("th",{colSpan:2,children:C("stats.scene")})}),(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:C("stats.elements")}),(0,O.jsx)("td",{children:e.elements.length})]}),(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:C("stats.width")}),(0,O.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:C("stats.height")}),(0,O.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===o.length&&(0,O.jsx)("tr",{children:(0,O.jsx)("th",{colSpan:2,children:C("stats.element")})}),o.length>1&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("tr",{children:(0,O.jsx)("th",{colSpan:2,children:C("stats.selected")})}),(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:C("stats.elements")}),(0,O.jsx)("td",{children:o.length})]})]}),o.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:"x"}),(0,O.jsx)("td",{children:Math.round(i[0])})]}),(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:"y"}),(0,O.jsx)("td",{children:Math.round(i[1])})]}),(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:C("stats.width")}),(0,O.jsx)("td",{children:Math.round(i[2]-i[0])})]}),(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:C("stats.height")}),(0,O.jsx)("td",{children:Math.round(i[3]-i[1])})]})]}),1===o.length&&(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:C("stats.angle")}),(0,O.jsx)("td",{children:"".concat(Math.round(180*o[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})}),um=(n(9757),function(e){var t=e.message,n=e.clearToast,r=(0,l.useRef)(0),o=(0,l.useCallback)((function(){return r.current=window.setTimeout((function(){return n()}),s.Lg)}),[n]);return(0,l.useEffect)((function(){return o(),function(){return clearTimeout(r.current)}}),[o,t]),(0,O.jsx)("div",{className:"Toast",onMouseEnter:function(){return clearTimeout(null==r?void 0:r.current)},onMouseLeave:o,children:(0,O.jsx)("p",{className:"Toast__message",children:t})})});function dm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dm(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pm=jc({name:"viewMode",perform:function(e,t){return ru("view","mode","view"),{appState:fm(fm({},t),{},{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.viewModeEnabled},contextItemLabel:"labels.viewMode",keyTest:function(e){return!e[Jt.CTRL_OR_CMD]&&e.altKey&&e.code===Qt}}),hm=n(200),mm=n.n(hm);function gm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return vm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vm(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function vm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ym(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=F(e);if(t){var o=F(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H(this,n)}}var wm=c().createContext(!1),km=function(){return(0,l.useContext)(wm)},_m=c().createContext({container:null,id:null}),Sm=function(){return(0,l.useContext)(_m)},Em=!1,jm=0,Cm=0,Om=0,Im=!1,Mm=!1,Tm=!1,Am={horizontal:null,vertical:null},Pm=0,Lm=!1,Dm=null,Rm={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},zm=function(e){B(o,e);var t,n,r=xm(o);function o(e){var t;L(this,o),t=r.call(this,e),Nm.call(z(t));var n,i=Ln(),a=e.excalidrawRef,l=e.viewModeEnabled,c=void 0!==l&&l,u=e.zenModeEnabled,d=void 0!==u&&u,f=e.gridModeEnabled,p=void 0!==f&&f,h=e.theme,m=void 0===h?i.theme:h,g=e.name,v=void 0===g?i.name:g;if(t.state=ym(ym(ym({},i),{},{theme:m,isLoading:!0},t.getCanvasOffsets()),{},{viewModeEnabled:c,zenModeEnabled:d,gridSize:p?s.k:null,name:v,width:window.innerWidth,height:window.innerHeight}),t.id=Ue(),a){var b,y="current"in a&&(null===(b=a.current)||void 0===b?void 0:b.readyPromise)||function(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}(),x={ready:!0,readyPromise:y,updateScene:t.updateScene,addFiles:t.addFiles,resetScene:t.resetScene,getSceneElementsIncludingDeleted:t.getSceneElementsIncludingDeleted,history:{clear:t.resetHistory},scrollToContent:t.scrollToContent,getSceneElements:t.getSceneElements,getAppState:function(){return t.state},getFiles:function(){return t.files},refresh:t.refresh,importLibrary:t.importLibraryFromUrl,setToastMessage:t.setToastMessage,id:t.id};"function"==typeof a?a(x):a.current=x,y.resolve(x)}return t.excalidrawContainerValue={container:t.excalidrawContainerRef.current,id:t.id},t.scene=new ar,t.library=new zp(z(t)),t.history=new Kp,t.actionManager=new Tp(t.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),z(t)),t.actionManager.registerAll(Ec),t.actionManager.registerAction((n=t.history,{name:"undo",perform:function(e,t){return Mp(e,t,(function(){return n.undoOnce()}))},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.key.toLowerCase()===Jt.Z&&!e.shiftKey},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,O.jsx)(ls,{type:"button",icon:yl,"aria-label":C("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}})),t.actionManager.registerAction(function(e){return{name:"redo",perform:function(t,n){return Mp(t,n,(function(){return e.redoOnce()}))},keyTest:function(e){return e[Jt.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Jt.Z||Tt&&e.ctrlKey&&!e.shiftKey&&e.key===Jt.Y},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,O.jsx)(ls,{type:"button",icon:xl,"aria-label":C("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}}}(t.history)),t}return R(o,[{key:"renderCanvas",value:function(){var e=window.devicePixelRatio,t=this.state,n=t.width,r=t.height,o=n*e,i=r*e;return t.viewModeEnabled?(0,O.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r,cursor:s.oc.GRAB},width:o,height:i,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:C("labels.drawingCanvas")}):(0,O.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r},width:o,height:i,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:C("labels.drawingCanvas")})}},{key:"render",value:function(){var e,t,n=this,r=this.state,o=r.zenModeEnabled,i=r.viewModeEnabled,a=this.props,l=a.onCollabButtonClick,c=a.renderTopRightUI,s=a.renderFooter,u=a.renderCustomStats;return(0,O.jsx)("div",{className:Fe("excalidraw excalidraw-container",{"excalidraw--view-mode":i,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,O.jsx)(_m.Provider,{value:this.excalidrawContainerValue,children:(0,O.jsxs)(wm.Provider,{value:this.isMobile,children:[(0,O.jsx)(cm,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:l,onLockToggle:this.toggleLock,onInsertElements:function(e){return n.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null})},zenModeEnabled:o,toggleZenMode:this.toggleZenMode,langCode:E().code,isCollaborating:this.props.isCollaborating,renderTopRightUI:c,renderCustomFooter:s,viewModeEnabled:i,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&o,showThemeBtn:void 0===(null===(t=this.props)||void 0===t?void 0:t.theme)&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id,onImageAction:this.onImageAction}),(0,O.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,O.jsx)("div",{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&(0,O.jsx)(sm,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:u}),null!==this.state.toastMessage&&(0,O.jsx)(um,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,O.jsx)("main",{children:this.renderCanvas()})]})})})}},{key:"componentDidMount",value:(n=(0,d.Z)(g().mark((function e(){var t,n,r,o,i=this;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"!==s.Vi.TEST&&"production"!==s.Vi.DEVELOPMENT||(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:function(){return i.state}},setState:{configurable:!0,value:function(){return i.setState.apply(i,arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})),this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current?(this.resizeObserver=new ResizeObserver((function(){var e=i.excalidrawContainerRef.current.getBoundingClientRect(),t=e.width,n=e.height;i.isMobile=t<s.kV||n<s.Yx&&t<s.sS,i.updateDOMRect()})),null===(n=this.resizeObserver)||void 0===n||n.observe(this.excalidrawContainerRef.current)):window.matchMedia&&(r=window.matchMedia("(max-width: ".concat(s.kV,"px), (max-height: ").concat(s.Yx,"px) and (max-width: ").concat(s.sS,"px)")),o=function(){return i.isMobile=r.matches},r.addListener(o),this.detachIsMobileMqHandler=function(){return r.removeListener(o)}),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){var e;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),clearTimeout(Pm),Pm=0}},{key:"removeEventListeners",value:function(){var e,t,n,r;document.removeEventListener(s.Ks.POINTER_UP,this.removePointer),document.removeEventListener(s.Ks.COPY,this.onCopy),document.removeEventListener(s.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(s.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(s.Ks.SCROLL,this.onScroll),document.removeEventListener(s.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(s.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(s.Ks.KEYUP,this.onKeyUp),window.removeEventListener(s.Ks.RESIZE,this.onResize,!1),window.removeEventListener(s.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(s.Ks.BLUR,this.onBlur,!1),null===(t=this.excalidrawContainerRef.current)||void 0===t||t.removeEventListener(s.Ks.DRAG_OVER,this.disableEvent,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.removeEventListener(s.Ks.DROP,this.disableEvent,!1),document.removeEventListener(s.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(s.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(s.Ks.GESTURE_END,this.onGestureEnd,!1),null===(r=this.detachIsMobileMqHandler)||void 0===r||r.call(this)}},{key:"addEventListeners",value:function(){var e,t,n,r;this.removeEventListeners(),document.addEventListener(s.Ks.POINTER_UP,this.removePointer),document.addEventListener(s.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(s.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(s.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(s.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition),null===(e=document.fonts)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"loadingdone",this.onFontLoaded),document.addEventListener(s.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(s.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(s.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(s.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(s.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=function(e){for(var t=e.parentElement;t;){if(t===document.body)return document;var n=window.getComputedStyle(t).overflowY;if(t.scrollHeight>t.clientHeight&&("auto"===n||"scroll"===n))return t;t=t.parentElement}return document}(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(s.Ks.SCROLL,this.onScroll)),window.addEventListener(s.Ks.RESIZE,this.onResize,!1),window.addEventListener(s.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(s.Ks.BLUR,this.onBlur,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.addEventListener(s.Ks.DRAG_OVER,this.disableEvent,!1),null===(r=this.excalidrawContainerRef.current)||void 0===r||r.addEventListener(s.Ks.DROP,this.disableEvent,!1))}},{key:"componentDidUpdate",value:function(e,t){var n,r=this;e.langCode!==this.props.langCode&&this.updateLanguage(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),e.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?s.k:null}),this.props.name&&e.name!==this.props.name&&this.setState({name:this.props.name}),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.classList.toggle("theme--dark","dark"===this.state.theme),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout((function(){r.actionManager.executeAction(nu)}));var o=t.multiElement;t.elementType!==this.state.elementType&&null!=o&&oa(this.state)&&Xe(o)&&sa(o,this.state,this.scene,Sn(ta.getPointAtIndexGlobalCoordinates(o,-1)));var i={},a={},l={},c={},u={};this.state.collaborators.forEach((function(e,t){if(e.selectedElementIds)for(var n=0,o=Object.keys(e.selectedElementIds);n<o.length;n++){var s=o[n];s in l||(l[s]=[]),l[s].push(t)}e.pointer&&(e.username&&(c[t]=e.username),e.userState&&(u[t]=e.userState),a[t]=xn({sceneX:e.pointer.x,sceneY:e.pointer.y},r.state),i[t]=e.button)}));var d=this.scene.getElements().filter((function(e){return(!Ke(e)||!r.state.pendingImageElement||e.id!==r.state.pendingImageElement.id)&&(!r.state.editingElement||"text"!==r.state.editingElement.type||e.id!==r.state.editingElement.id)})),f=du(d,this.state,this.state.selectionElement,window.devicePixelRatio,this.rc,this.canvas,{scrollX:this.state.scrollX,scrollY:this.state.scrollY,viewBackgroundColor:this.state.viewBackgroundColor,zoom:this.state.zoom,remotePointerViewportCoords:a,remotePointerButton:i,remoteSelectedElementIds:l,remotePointerUsernames:c,remotePointerUserStates:u,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile}),p=f.atLeastOneVisibleElement,h=f.scrollBars;h&&(Am=h);var m,g,v=!Ve(this.state.editingElement)&&(!p&&d.length>0);(this.state.scrolledOutside!==v&&this.setState({scrolledOutside:v}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(m=(g=this.props).onChange)||void 0===m||m.call(g,this.scene.getElementsIncludingDeleted(),this.state,this.files))}},{key:"addTextFromPaste",value:function(e){var t=yn({clientX:Cm,clientY:Om},this.state),n=t.x,r=t.y,o=Oo({x:n,y:r,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,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:s.hs});this.scene.replaceAllElements([].concat(A(this.scene.getElementsIncludingDeleted()),[o])),this.setState({selectedElementIds:P({},o.id,!0)}),this.history.resumeRecording()}},{key:"selectShapeTool",value:function(e){var t;Im||gn(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),qe(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}},{key:"handleTextWysiwyg",value:function(e,t){var n=this,r=t.isExistingElement,o=void 0!==r&&r,i=function(t,r,o){n.scene.replaceAllElements(A(n.scene.getElementsIncludingDeleted().map((function(n){return n.id===e.id&&Ve(n)?Io(n,{text:t,isDeleted:o,originalText:r}):n}))))};Dc({id:e.id,appState:this.state,canvas:this.canvas,getViewportCoords:function(e,t){var r=xn({sceneX:e,sceneY:t},n.state),o=r.x,i=r.y;return[o-n.state.offsetLeft,i-n.state.offsetTop]},onChange:Cn((function(t){i(t,t,!1),Fc(e)&&va(e)})),onSubmit:Cn((function(t){var r=t.text,a=t.viaKeyboard,l=t.originalText,c=!r.trim();if(i(r,l,c),!c&&a){var s=e.containerId?e.containerId:e.id;n.setState((function(e){return{selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},s,!0))}}))}c&&Ia(n.scene.getElements(),[e]),c&&!o||n.history.resumeRecording(),n.setState({draggingElement:null,editingElement:null}),n.state.elementLocked&&gn(n.canvas,n.state.elementType),n.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current,app:this}),this.deselectElements(),i(e.text,e.originalText,!1)}},{key:"deselectElements",value:function(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}},{key:"getTextElementAtPosition",value:function(e,t){var n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&Ve(n)&&!n.isDeleted?n:null}},{key:"getElementAtPosition",value:function(e,t,n){var r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement);if(r.length>1){if(null!=n&&n.preferSelected)for(var o=r.length-1;o>-1;o--)if(this.state.selectedElementIds[r[o].id])return r[o];var i=r[r.length-1];return pi(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}},{key:"getElementsAtPosition",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r?this.scene.getElements():this.scene.getElements().filter((function(e){return!(Ve(e)&&e.containerId)}));return _c(o,(function(r){return fi(r,n.state,e,t)}))}},{key:"maybeCleanupAfterMissingPointerUp",value:function(e){null!==Dm&&Dm(e)}},{key:"updateGestureOnPointerDown",value:function(e){Rm.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Rm.pointers.size&&(Rm.lastCenter=Np(Rm.pointers),Rm.initialScale=this.state.zoom.value,Rm.initialDistance=Bp(Array.from(Rm.pointers.values())))}},{key:"initialPointerDownState",value:function(e){var t=yn(e,this.state),n=Yc(this.scene.getElements(),this.state),r=h(kt(n),4),o=r[0],i=r[1],a=r[2],l=r[3];return{origin:t,withCmdOrCtrl:e[Jt.CTRL_OR_CMD],originInGrid:Sn(ut(t.x,t.y,this.state.gridSize)),scrollbars:Vc(Am,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:ym({},t),originalElements:this.scene.getElements().reduce((function(e,t){return e.set(t.id,To(t)),e}),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(a+o)/2,y:(l+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n),hasHitElementInside:!1},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}},{key:"handleDraggingScrollBar",value:function(e,t){var n=this;if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;Tm=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;var r=Cn((function(e){e.target instanceof HTMLElement&&n.handlePointerMoveOverScrollbars(e,t)})),o=Cn((function(){Tm=!1,gn(n.canvas,n.state.elementType),Dm=null,n.setState({cursorButton:"up"}),n.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(s.Ks.POINTER_MOVE,r),window.removeEventListener(s.Ks.POINTER_UP,o)}));return Dm=o,window.addEventListener(s.Ks.POINTER_MOVE,r),window.addEventListener(s.Ks.POINTER_UP,o),!0}},{key:"isASelectedElement",value:function(e){return null!=e&&this.state.selectedElementIds[e.id]}},{key:"isHittingCommonBoundingBoxOfSelectedElements",value:function(e,t){if(t.length<2)return!1;var n=10/this.state.zoom.value,r=h(kt(t),4),o=r[0],i=r[1],a=r[2],l=r[3];return e.x>o-n&&e.x<a+n&&e.y>i-n&&e.y<l+n}},{key:"onKeyDownFromPointerDownHandler",value:function(e){var t=this;return Cn((function(n){t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))}},{key:"onKeyUpFromPointerDownHandler",value:function(e){var t=this;return Cn((function(n){n.key===Jt.ALT&&n.preventDefault(),t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))}},{key:"onPointerMoveFromPointerDownHandler",value:function(e){var t=this;return Cn((function(n){var r,o;if(null===e.drag.offset&&(e.drag.offset=Sn(function(e,t,n){var r=h(kt(e),2);return[t-r[0],n-r[1]]}(Yc(t.scene.getElements(),t.state),e.origin.x,e.origin.y))),n.target instanceof HTMLElement&&!t.handlePointerMoveOverScrollbars(n,e)){var i=yn(n,t.state),a=h(ut(i.x,i.y,t.state.gridSize),2),l=a[0],c=a[1];if(e.drag.hasOccurred||"arrow"!==t.state.elementType&&"line"!==t.state.elementType||!(ot(i.x,i.y,e.origin.x,e.origin.y)<s.f)){if(e.resize.isResizing&&(e.lastCoords.x=i.x,e.lastCoords.y=i.y,t.maybeHandleResize(e,n)))return!0;if(t.state.editingLinearElement){var u=ta.handlePointDragging(t.state,(function(e){return t.setState(e)}),i.x,i.y,(function(e,n){t.maybeSuggestBindingsForLinearElementAtCoords(e,n)}));if(u)return e.lastCoords.x=i.x,void(e.lastCoords.y=i.y)}var d=e.hit.allHitElements.some((function(e){return t.isASelectedElement(e)}));if((d||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&(!t.state.editingLinearElement||!n.shiftKey)&&(!t.state.editingLinearElement||(null===(r=t.state.editingLinearElement)||void 0===r?void 0:r.elementId)!==(null===(o=e.hit.element)||void 0===o?void 0:o.id)||e.hit.hasHitElementInside)){e.drag.hasOccurred=!0;var f=Yc(t.scene.getElements(),t.state);if(f.length>0&&!e.withCmdOrCtrl){var p=h(ut(i.x-e.drag.offset.x,i.y-e.drag.offset.y,t.state.gridSize),2),m=p[0],g=p[1],v=[Math.abs(i.x-e.origin.x),Math.abs(i.y-e.origin.y)],b=v[0],y=v[1],x=n.shiftKey;if(function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7?arguments[7]:void 0,c=h(kt(t),2),s=c[0],u=c[1],d={x:n-s,y:r-u};t.forEach((function(n){if(Ua(o,i,a,e,n,d),!n.groupIds.length||l.editingGroupId&&!ho(l,n)){var r=br(n);if(r){var c=ar.getScene(n).getElement(r);Ua(o,i,a,e,c,d)}}va(n,{simultaneouslyUpdated:t})}))}(e,f,m,g,x,b,y,t.state),t.maybeSuggestBindingForAll(f),n.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;var w,k=[],_=[],S=new Map,E=new Map,j=e.hit.element,C=t.scene.getElementsIncludingDeleted(),O=Yc(C,t.state,!0).map((function(e){return e.id})),I=gm(C);try{for(I.s();!(w=I.n()).done;){var M=w.value;if(O.includes(M.id)||M.id===(null==j?void 0:j.id)&&e.hit.wasAddedToSelection){var T=Ao(t.state.editingGroupId,S,M),L=h(ut(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,t.state.gridSize),2),D=L[0],R=L[1];to(T,{x:T.x+(D-m),y:T.y+(R-g)}),k.push(T),_.push(M),E.set(M.id,T.id)}else k.push(M)}}catch(e){I.e(e)}finally{I.f()}var z=[].concat(k,_);cr(k,_,E),Ca(z,_,E,"duplicatesServeAsOld"),t.scene.replaceAllElements(z)}return}}var N=t.state.draggingElement;if(N){if("freedraw"===N.type){var B=N.points,H=i.x-N.x,F=i.y-N.y,U=N.simulatePressure?N.pressures:[].concat(A(N.pressures),[n.pressure]);to(N,{points:[].concat(A(B),[[H,F]]),pressures:U})}else if(Ye(N)){e.drag.hasOccurred=!0;var W=N.points,K=l-N.x,V=c-N.y;if(rn(n)&&2===W.length){var G=io(t.state.elementType,K,V);K=G.width,V=G.height}1===W.length?to(N,{points:[].concat(A(W),[[K,V]])}):W.length>1&&to(N,{points:[].concat(A(W.slice(0,-1)),[[K,V]])}),Xe(N)&&t.maybeSuggestBindingsForLinearElementAtCoords(N,[i],t.state.startBoundElement)}else e.lastCoords.x=i.x,e.lastCoords.y=i.y,t.maybeDragNewGenericElement(e,n);if("selection"===t.state.elementType){e.boxSelection.hasOccurred=!0;var Z=t.scene.getElements();if(n.shiftKey||t.state.editingLinearElement||!Gc(Z,t.state)||(e.withCmdOrCtrl&&e.hit.element?t.setState((function(n){return vo(ym(ym({},n),{},{selectedElementIds:P({},e.hit.element.id,!0)}),t.scene.getElements())})):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),t.state.editingLinearElement)ta.handleBoxSelection(n,t.state,t.setState.bind(t));else{var Y=function(e,t){var n=h(mt(t),4),r=n[0],o=n[1],i=n[2],a=n[3];return e.filter((function(e){var t=h(wt(e),4),n=t[0],l=t[1],c=t[2],s=t[3];return"selection"!==e.type&&!et(e)&&r<=n&&o<=l&&i>=c&&a>=s}))}(Z,N);t.setState((function(n){return vo(ym(ym({},n),{},{selectedElementIds:ym(ym(ym({},n.selectedElementIds),Y.reduce((function(e,t){return e[t.id]=!0,e}),{})),e.hit.element?P({},e.hit.element.id,!Y.length):null)}),t.scene.getElements())}))}}}}}}))}},{key:"handlePointerMoveOverScrollbars",value:function(e,t){if(t.scrollbars.isOverHorizontal){var n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){var o=e.clientY,i=o-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-i/this.state.zoom.value}),t.lastCoords.y=o,!0}return!1}},{key:"onPointerUpFromPointerDownHandler",value:function(e){var t=this;return Cn((function(n){var r,o,i=t.state,a=i.draggingElement,l=i.resizingElement,c=i.multiElement,u=i.elementType,d=i.elementLocked,f=i.isResizing,p=i.isRotating;if(t.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:c||Ve(t.state.editingElement)?t.state.editingElement:null}),t.savePointer(n.clientX,n.clientY,"up"),t.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(r=e.hit)||void 0===r||null===(o=r.element)||void 0===o?void 0:o.id)===t.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){var h=ta.handlePointerUp(n,t.state.editingLinearElement,t.state);h!==t.state.editingLinearElement&&t.setState({editingLinearElement:h,suggestedBindings:[]})}else t.actionManager.executeAction(nu);if(Dm=null,window.removeEventListener(s.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(s.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(s.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(s.Ks.KEYUP,e.eventListeners.onKeyUp),t.state.pendingImageElement&&t.setState({pendingImageElement:null}),"freedraw"===(null==a?void 0:a.type)){var m=yn(n,t.state),g=a.points,v=m.x-a.x,b=m.y-a.y;v===g[0][0]&&b===g[0][1]&&(b+=1e-4,v+=1e-4);var y=a.simulatePressure?[]:[].concat(A(a.pressures),[n.pressure]);return to(a,{points:[].concat(A(g),[[v,b]]),pressures:y,lastCommittedPoint:[v,b]}),void t.actionManager.executeAction(nu)}if(Ke(a)){var x=a;try{t.initializeImageDimensions(x),t.setState({selectedElementIds:P({},x.id,!0)},(function(){t.actionManager.executeAction(nu)}))}catch(e){console.error(e),t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==x.id}))),t.actionManager.executeAction(nu)}}else if(Ye(a)){a.points.length>1&&t.history.resumeRecording();var w=yn(n,t.state);e.drag.hasOccurred||!a||c?e.drag.hasOccurred&&!c&&(oa(t.state)&&Xe(a)&&sa(a,t.state,t.scene,w),t.setState({suggestedBindings:[],startBoundElement:null}),d?t.setState((function(e){return{draggingElement:null,selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},t.state.draggingElement.id,!0))}})):(hn(t.canvas),t.setState((function(e){return{draggingElement:null,elementType:"selection",selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},t.state.draggingElement.id,!0))}})))):(to(a,{points:[].concat(A(a.points),[[w.x-a.x,w.y-a.y]])}),t.setState({multiElement:a,editingElement:t.state.draggingElement}))}else{if("selection"!==u&&a&&oo(a))return t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().slice(0,-1)),void t.setState({draggingElement:null});a&&to(a,ao(a)),l&&t.history.resumeRecording(),l&&oo(l)&&t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==l.id})));var k=e.hit.element;if(k&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!t.state.editingLinearElement||!e.boxSelection.hasOccurred))if(n.shiftKey&&!t.state.editingLinearElement)if(t.state.selectedElementIds[k.id])if(ho(t.state,k)){var _=k.groupIds.flatMap((function(e){return yo(t.scene.getElements(),e)})).map((function(e){return P({},e.id,!1)})).reduce((function(e,t){return ym(ym({},e),t)}),{});t.setState((function(e){return{selectedGroupIds:ym(ym({},e.selectedElementIds),k.groupIds.map((function(e){return P({},e,!1)})).reduce((function(e,t){return ym(ym({},e),t)}),{})),selectedElementIds:ym(ym({},e.selectedElementIds),_)}}))}else t.setState((function(e){return vo(ym(ym({},e),{},{selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},k.id,!1))}),t.scene.getElements())}));else t.setState((function(e){return{selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},k.id,!0))}}));else t.setState((function(e){return ym({},vo(ym(ym({},e),{},{selectedElementIds:P({},k.id,!0)}),t.scene.getElements()))}));t.state.editingLinearElement||e.drag.hasOccurred||t.state.isResizing||!(k&&pi(k,t.state,e.origin.x,e.origin.y)||!k&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!d&&"freedraw"!==u&&a&&t.setState((function(e){return{selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},a.id,!0))}})),("selection"!==u||Gc(t.scene.getElements(),t.state))&&t.history.resumeRecording(),(e.drag.hasOccurred||f||p)&&(oa(t.state)?la:pa)(Yc(t.scene.getElements(),t.state)),d||"freedraw"===u?t.setState({draggingElement:null,suggestedBindings:[]}):(hn(t.canvas),t.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}}))}},{key:"maybeSuggestBindingForAll",value:function(e){var t,n,r=(t=e,n=new Set(t.map((function(e){return e.id}))),t.flatMap((function(e){return Xe(e)?ka(e).filter((function(e){return!n.has(e.id)})):Qe(e)?Ea(e).filter((function(e){return!n.has(e[0].id)})):[]})));this.setState({suggestedBindings:r})}},{key:"clearSelection",value:function(e){this.setState((function(t){return{selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&bo(e,t.editingGroupId)?t.editingGroupId:null}})),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}},{key:"getTextWysiwygSnappedToCenterPosition",value:function(e,t,n,r,o){var i=Sc(this.scene.getElementsIncludingDeleted().filter((function(e){return!Ve(e)})),e,t);if(i){var a=i.x+i.width/2,l=i.y+i.height/2;if(Math.hypot(e-a,t-l)<s.wZ){var c=xn({sceneX:a,sceneY:l},n);return{viewportX:c.x,viewportY:c.y,elementCenterX:a,elementCenterY:l}}}}},{key:"getCanvasOffsets",value:function(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){var t=this.excalidrawContainerRef.current.getBoundingClientRect();return{offsetLeft:t.left,offsetTop:t.top}}return{offsetLeft:0,offsetTop:0}}},{key:"updateLanguage",value:(t=(0,d.Z)(g().mark((function e(){var t,n=this;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=x.find((function(e){return e.code===n.props.langCode}))||y,e.next=3,S(t);case 3:this.setAppState({});case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"resetTapTwice",value:function(){Em=!1}}]),o}(c().Component);zm.defaultProps={UIOptions:s.cW};var Nm=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=c().createRef(),this.files={},this.imageCache=new Map,this.focusContainer=function(){var t;e.props.autoFocus&&(null===(t=e.excalidrawContainerRef.current)||void 0===t||t.focus())},this.getSceneElementsIncludingDeleted=function(){return e.scene.getElementsIncludingDeleted()},this.getSceneElements=function(){return e.scene.getElements()},this.syncActionResult=Cn((function(t){if(!e.unmounted&&!1!==t){var n=null;if(t.elements&&(t.elements.forEach((function(t){var r;(null===(r=e.state.editingElement)||void 0===r?void 0:r.id)===t.id&&e.state.editingElement!==t&&Fc(t)&&(n=t)})),e.scene.replaceAllElements(t.elements),t.commitToHistory&&e.history.resumeRecording()),t.files&&(e.files=t.replaceFiles?t.files:ym(ym({},e.files),t.files),e.addNewImagesToImageCache()),t.appState||n){var r,o,i,a,l,c;t.commitToHistory&&e.history.resumeRecording();var u=(null==t||null===(r=t.appState)||void 0===r?void 0:r.viewModeEnabled)||!1,d=(null==t||null===(o=t.appState)||void 0===o?void 0:o.zenModeEnabled)||!1,f=(null==t||null===(i=t.appState)||void 0===i?void 0:i.gridSize)||null,p=(null==t||null===(a=t.appState)||void 0===a?void 0:a.theme)||s.C6.LIGHT,h=null!==(l=null==t||null===(c=t.appState)||void 0===c?void 0:c.name)&&void 0!==l?l:e.state.name;void 0!==e.props.viewModeEnabled&&(u=e.props.viewModeEnabled),void 0!==e.props.zenModeEnabled&&(d=e.props.zenModeEnabled),void 0!==e.props.gridModeEnabled&&(f=e.props.gridModeEnabled?s.k:null),void 0!==e.props.theme&&(p=e.props.theme),void 0!==e.props.name&&(h=e.props.name),e.setState((function(e){var r;return Object.assign(t.appState||{},{editingElement:n||(null===(r=t.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:u,zenModeEnabled:d,gridSize:f,theme:p,name:h})}),(function(){t.syncHistory&&e.history.setCurrentState(e.state,e.scene.getElementsIncludingDeleted())}))}}})),this.onBlur=Cn((function(){Im=!1,e.setState({isBindingEnabled:!0})})),this.onUnload=function(){e.onBlur()},this.disableEvent=function(e){e.preventDefault()},this.onFontLoaded=function(){e.scene.getElementsIncludingDeleted().forEach((function(e){Ve(e)&&Rr(e)})),e.onSceneUpdated()},this.importLibraryFromUrl=function(){var t=(0,d.Z)(g().mark((function t(n,r){var o,i,a,l,c;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return window.location.hash.includes(s.ah.addLibrary)?((o=new URLSearchParams(window.location.hash.slice(1))).delete(s.ah.addLibrary),window.history.replaceState({},s.iC,"#".concat(o.toString()))):window.location.search.includes(s.UO.addLibrary)&&((i=new URLSearchParams(window.location.search)).delete(s.UO.addLibrary),window.history.replaceState({},s.iC,"?".concat(i.toString()))),t.prev=1,t.next=4,fetch(decodeURIComponent(n));case 4:return a=t.sent,t.next=7,a.blob();case 7:return l=t.sent,t.t0=JSON,t.next=11,l.text();case 11:if(t.t1=t.sent,c=t.t0.parse.call(t.t0,t.t1),Ed(c)){t.next=15;break}throw new Error;case 15:if(r!==e.id&&!window.confirm(C("alerts.confirmAddLibrary",{numShapes:(c.libraryItems||c.library||[]).length}))){t.next=20;break}return t.next=18,e.library.importLibrary(l,"published");case 18:e.state.isLibraryOpen&&e.setState({isLibraryOpen:!1}),e.setState({isLibraryOpen:!0});case 20:t.next=26;break;case 22:t.prev=22,t.t2=t.catch(1),window.alert(C("alerts.errorLoadingLibrary")),console.error(t.t2);case 26:return t.prev=26,e.focusContainer(),t.finish(26);case 29:case"end":return t.stop()}}),t,null,[[1,22,26,29]])})));return function(e,n){return t.apply(this,arguments)}}(),this.resetHistory=function(){e.history.clear()},this.resetScene=Cn((function(t){e.scene.replaceAllElements([]),e.setState((function(n){return ym(ym({},Ln()),{},{isLoading:(null==t||!t.resetLoadingState)&&n.isLoading,theme:e.state.theme})})),e.resetHistory()})),this.initializeScene=(0,d.Z)(g().mark((function t(){var n,r,o,i,a;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(function(){var t=(0,d.Z)(g().mark((function t(n){var r,o;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.files.length){t.next=2;break}return t.abrupt("return");case 2:return r=n.files[0],t.next=5,r.getFile();case 5:(o=t.sent).handle=r,ud(o,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(ym(ym({},t),{},{appState:ym(ym({},t.appState||e.state),{},{isLoading:!1}),commitToHistory:!0}))})).catch((function(t){e.setState({isLoading:!1,errorMessage:t.message})}));case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e.state.isLoading||e.setState({isLoading:!0}),r=null,t.prev=3,t.next=6,e.props.initialData;case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0=null;case 9:r=t.t0,null!==(o=r)&&void 0!==o&&o.libraryItems&&(e.libraryItemsFromStorage=rd(r.libraryItems,"unpublished")),t.next=17;break;case 13:t.prev=13,t.t1=t.catch(3),console.error(t.t1),r={appState:{errorMessage:t.t1.message||"Encountered an error during importing or restoring scene data"}};case 17:if((i=nd(r,null,null)).appState=ym(ym({},i.appState),{},{elementType:"image"===i.appState.elementType?"selection":i.appState.elementType,isLoading:!1}),null!==(n=r)&&void 0!==n&&n.scrollToContent&&(i.appState=ym(ym({},i.appState),$c(i.elements,ym(ym({},i.appState),{},{width:e.state.width,height:e.state.height,offsetTop:e.state.offsetTop,offsetLeft:e.state.offsetLeft})))),e.resetHistory(),e.syncActionResult(ym(ym({},i),{},{commitToHistory:!0})),!(a=new URLSearchParams(window.location.hash.slice(1)).get(s.ah.addLibrary)||new URLSearchParams(window.location.search).get(s.UO.addLibrary))){t.next=26;break}return t.next=26,e.importLibraryFromUrl(a);case 26:case"end":return t.stop()}}),t,null,[[3,13]])}))),this.onResize=Cn((function(){e.scene.getElementsIncludingDeleted().forEach((function(e){return Rr(e)})),e.setState({})})),this.onScroll=dn((function(){var t=e.getCanvasOffsets(),n=t.offsetTop,r=t.offsetLeft;e.setState((function(e){return e.offsetLeft===r&&e.offsetTop===n?null:{offsetTop:n,offsetLeft:r}}))}),s.HM),this.onCut=Cn((function(t){var n;(null===(n=e.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!cn(t.target)&&(e.cutAll(),t.preventDefault())})),this.onCopy=Cn((function(t){var n;(null===(n=e.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!cn(t.target)&&(e.copyAll(),t.preventDefault())})),this.cutAll=function(){e.copyAll(),e.actionManager.executeAction(ds)},this.copyAll=function(){lf(e.scene.getElements(),e.state,e.files)},this.onTapStart=function(t){if(!Em)return Em=!0,clearTimeout(jm),void(jm=window.setTimeout(zm.resetTapTwice,s.Gj));if(Em&&1===t.touches.length){var n=h(t.touches,1)[0];e.handleCanvasDoubleClick({clientX:n.clientX,clientY:n.clientY}),Em=!1,clearTimeout(jm)}t.preventDefault(),2===t.touches.length&&e.setState({selectedElementIds:{}})},this.onTapEnd=function(t){t.touches.length>0&&e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds})},this.pasteFromClipboard=Cn(function(){var t=(0,d.Z)(g().mark((function t(n){var r,o,i,a,l,c,s,u,d,f,p;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=document.activeElement,null===(r=e.excalidrawContainerRef.current)||void 0===r?void 0:r.contains(i)){t.next=4;break}return t.abrupt("return");case 4:if(a=document.elementFromPoint(Cm,Om),!n||a instanceof HTMLCanvasElement&&!cn(i)){t.next=7;break}return t.abrupt("return");case 7:return l=null==n||null===(o=n.clipboardData)||void 0===o?void 0:o.files[0],t.next=10,df(n);case 10:if(c=t.sent,!l&&c.text&&(s=c.text.trim()).startsWith("<svg")&&s.endsWith("</svg>")&&(l=vd(s)),!sd(l)||c.spreadsheet){t.next=19;break}return u=yn({clientX:Cm,clientY:Om},e.state),d=u.x,f=u.y,p=e.createImageElement({sceneX:d,sceneY:f}),e.insertImageElement(p,l),e.initializeImageDimensions(p),e.setState({selectedElementIds:P({},p.id,!0)}),t.abrupt("return");case 19:if(!e.props.onPaste){t.next=31;break}return t.prev=20,t.next=23,e.props.onPaste(c,n);case 23:if(t.t0=t.sent,!1!==t.t0){t.next=26;break}return t.abrupt("return");case 26:t.next=31;break;case 28:t.prev=28,t.t1=t.catch(20),console.error(t.t1);case 31:c.errorMessage?e.setState({errorMessage:c.errorMessage}):c.spreadsheet?e.setState({pasteDialog:{data:c.spreadsheet,shown:!0}}):c.elements?e.addElementsFromPasteOrLibrary({elements:c.elements,files:c.files||null,position:"cursor"}):c.text&&e.addTextFromPaste(c.text),e.selectShapeTool("selection"),null==n||n.preventDefault();case 34:case"end":return t.stop()}}),t,null,[[20,28]])})));return function(e){return t.apply(this,arguments)}}()),this.addElementsFromPasteOrLibrary=function(t){var n=ed(t.elements,null),r=h(kt(n),4),o=r[0],i=r[1],a=r[2],l=r[3],c=pn(o,a)/2,s=pn(i,l)/2,u="object"===T(t.position)?t.position.clientX:"cursor"===t.position?Cm:e.state.width/2+e.state.offsetLeft,d="object"===T(t.position)?t.position.clientY:"cursor"===t.position?Om:e.state.height/2+e.state.offsetTop,f=yn({clientX:u,clientY:d},e.state),p=f.x-c,m=f.y-s,g=new Map,v=h(ut(p,m,e.state.gridSize),2),b=v[0],y=v[1],x=new Map,w=n.map((function(t){var n=Ao(e.state.editingGroupId,g,t,{x:t.x+b-o,y:t.y+y-i});return x.set(t.id,n.id),n}));cr(w,n,x);var k=[].concat(A(e.scene.getElementsIncludingDeleted()),A(w));Ca(k,n,x),t.files&&(e.files=ym(ym({},e.files),t.files)),e.scene.replaceAllElements(k),e.history.resumeRecording(),e.setState(vo(ym(ym({},e.state),{},{isLibraryOpen:!1,selectedElementIds:w.reduce((function(e,t){return et(t)||(e[t.id]=!0),e}),{}),selectedGroupIds:{}}),e.scene.getElements()),(function(){t.files&&e.addNewImagesToImageCache()})),e.selectShapeTool("selection")},this.setAppState=function(t){e.setState(t)},this.removePointer=function(e){"touch"===e.pointerType&&Pm&&(clearTimeout(Pm),Pm=0,Lm=!1),Rm.pointers.delete(e.pointerId)},this.toggleLock=function(){e.setState((function(e){return{elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType}}))},this.toggleZenMode=function(){e.actionManager.executeAction(Sp)},this.toggleStats=function(){e.state.showStats||ru("dialog","stats"),e.actionManager.executeAction(Cp)},this.scrollToContent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(ym({},$c(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=function(){e.setState({toastMessage:null})},this.setToastMessage=function(t){e.setState({toastMessage:t})},this.restoreFileFromShare=(0,d.Z)(g().mark((function t(){var n,r,o;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,caches.open("web-share-target");case 3:return n=t.sent,t.next=6,n.match("shared-file");case 6:if(!(r=t.sent)){t.next=15;break}return t.next=10,r.blob();case 10:return o=t.sent,e.loadFileToCanvas(o),t.next=14,n.delete("shared-file");case 14:window.history.replaceState(null,s.iC,window.location.pathname);case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(0),e.setState({errorMessage:t.t0.message});case 20:case"end":return t.stop()}}),t,null,[[0,17]])}))),this.addFiles=Cn((function(t){var n=t.reduce((function(e,t){return e.set(t.id,t),e}),new Map);e.files=ym(ym({},e.files),Object.fromEntries(n)),e.scene.getElements().forEach((function(t){We(t)&&n.has(t.fileId)&&(e.imageCache.delete(t.fileId),Rr(t),ro(t))})),e.scene.informMutation(),e.addNewImagesToImageCache()})),this.updateScene=Cn((function(t){t.commitToHistory&&e.history.resumeRecording(),t.appState&&e.setState(t.appState),t.elements&&e.scene.replaceAllElements(t.elements),t.collaborators&&e.setState({collaborators:t.collaborators}),t.libraryItems&&e.library.saveLibrary(rd(t.libraryItems,"unpublished"))})),this.onSceneUpdated=function(){e.setState({})},this.updateCurrentCursorPosition=Cn((function(e){Cm=e.clientX,Om=e.clientY})),this.onKeyDown=Cn((function(t){var n;if(("Proxy"in window&&(!t.shiftKey&&/^[A-Z]$/.test(t.key)||t.shiftKey&&/^[a-z]$/.test(t.key))&&(t=new Proxy(t,{get:function(e,n){var r=e[n];return"function"==typeof r?r.bind(e):"key"===n?t.shiftKey?e.key.toUpperCase():e.key.toLowerCase():r}})),!(cn(t.target)&&t.key!==Jt.ESCAPE||en(t.key)&&(n=t.target,n instanceof HTMLElement&&"wysiwyg"===n.dataset.type||n instanceof HTMLBRElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)))&&(t.key===Jt.QUESTION_MARK&&e.setState({showHelpDialog:!0}),!e.actionManager.handleKeyDown(t)&&!e.state.viewModeEnabled)){if(t[Jt.CTRL_OR_CMD]&&e.state.isBindingEnabled&&e.setState({isBindingEnabled:!1}),t.code===Ut&&e.setState({isLibraryOpen:!e.state.isLibraryOpen}),en(t.key)){var r=e.state.gridSize&&(t.shiftKey?s.$e:e.state.gridSize)||(t.shiftKey?s.Iw:s.$e),o=Yc(e.scene.getElements(),e.state,!0),i=0,a=0;t.key===Jt.ARROW_LEFT?i=-r:t.key===Jt.ARROW_RIGHT?i=r:t.key===Jt.ARROW_UP?a=-r:t.key===Jt.ARROW_DOWN&&(a=r),o.forEach((function(e){to(e,{x:e.x+i,y:e.y+a}),va(e,{simultaneouslyUpdated:o})})),e.maybeSuggestBindingForAll(o),t.preventDefault()}else if(t.key===Jt.ENTER){var l=Yc(e.scene.getElements(),e.state);if(1===l.length&&Ye(l[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===l[0].id||(e.history.resumeRecording(),e.setState({editingLinearElement:new ta(l[0],e.scene)}));else if(1===l.length&&!Ye(l[0])){var c=l[0];return e.startTextEditing({sceneX:c.x+c.width/2,sceneY:c.y+c.height/2,shouldBind:!0}),void t.preventDefault()}}else if(!t.ctrlKey&&!t.altKey&&!t.metaKey&&null===e.state.draggingElement){var u=function(e){var t=Vp.find((function(t,n){return e===(n+1).toString()||t.key&&("string"==typeof t.key?t.key===e:t.key.includes(e))}));return(null==t?void 0:t.value)||null}(t.key);u?e.selectShapeTool(u):t.key===Jt.Q&&e.toggleLock()}if(t.key===Jt.SPACE&&0===Rm.pointers.size&&(Im=!0,mn(e.canvas,s.oc.GRABBING),t.preventDefault()),t.key===Jt.G||t.key===Jt.S){var d=Yc(e.scene.getElements(),e.state);if("selection"===e.state.elementType&&!d.length)return;t.key===Jt.G&&(mc(e.state.elementType)||d.some((function(e){return mc(e.type)})))&&e.setState({openPopup:"backgroundColorPicker"}),t.key===Jt.S&&e.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=Cn((function(t){if(t.key===Jt.SPACE&&(e.state.viewModeEnabled?mn(e.canvas,s.oc.GRAB):"selection"===e.state.elementType?hn(e.canvas):(gn(e.canvas,e.state.elementType),e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),Im=!1),t[Jt.CTRL_OR_CMD]||e.state.isBindingEnabled||e.setState({isBindingEnabled:!0}),en(t.key)){var n=Yc(e.scene.getElements(),e.state);oa(e.state)?la(n):pa(n),e.setState({suggestedBindings:[]})}})),this.onGestureStart=Cn((function(t){t.preventDefault(),e.setState({selectedElementIds:{}}),Rm.initialScale=e.state.zoom.value})),this.onGestureChange=Cn((function(t){if(t.preventDefault(),2!==Rm.pointers.size){var n=Rm.initialScale;n&&e.setState((function(e){var r=e.zoom,o=e.offsetLeft,i=e.offsetTop;return{zoom:Qc(Jc(n*t.scale),r,{left:o,top:i},{x:Cm,y:Om})}}))}})),this.onGestureEnd=Cn((function(t){t.preventDefault(),e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds}),Rm.initialScale=null})),this.startTextEditing=function(t){var n,r,o,i=t.sceneX,a=t.sceneY,l=t.shouldBind,c=t.insertAtParentCenter,u=(void 0===c||c)&&e.getTextWysiwygSnappedToCenterPosition(i,a,e.state,e.canvas,window.devicePixelRatio),d=l||u?Sc(e.scene.getElements().filter((function(e){return!Ve(e)})),i,a):null,f=e.getTextElementAtPosition(i,a);if(d){var p=br(d);p&&(f=e.scene.getElement(p))}if(!f&&d){var h={fontSize:e.state.currentItemFontSize,fontFamily:e.state.currentItemFontFamily},m=gr(un(h)),g=(o=un(h),fr(o)+2*s.gK),v=Math.max(d.height,g),b=Math.max(d.width,m);to(d,{height:v,width:b}),i=d.x+b/2,a=d.y+v/2,u&&(u=e.getTextWysiwygSnappedToCenterPosition(i,a,e.state,e.canvas,window.devicePixelRatio))}var y=f||Oo({x:u?u.elementCenterX:i,y:u?u.elementCenterY:a,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemStrokeSharpness,text:"",fontSize:e.state.currentItemFontSize,fontFamily:e.state.currentItemFontFamily,textAlign:u?"center":e.state.currentItemTextAlign,verticalAlign:u?"middle":s.hs,containerId:null!==(n=null==d?void 0:d.id)&&void 0!==n?n:void 0,groupIds:null!==(r=null==d?void 0:d.groupIds)&&void 0!==r?r:[]});e.setState({editingElement:y}),f?u&&"center"===y.textAlign||to(y,{verticalAlign:s.hs}):(e.scene.replaceAllElements([].concat(A(e.scene.getElementsIncludingDeleted()),[y])),u||to(y,{y:y.y-y.baseline/2})),e.setState({editingElement:y}),e.handleTextWysiwyg(y,{isExistingElement:!!f})},this.handleCanvasDoubleClick=function(t){if(!e.state.multiElement&&"selection"===e.state.elementType){var n=Yc(e.scene.getElements(),e.state);if(1===n.length&&Ye(n[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===n[0].id||(e.history.resumeRecording(),e.setState({editingLinearElement:new ta(n[0],e.scene)}));else{hn(e.canvas);var r=yn(t,e.state),o=r.x,i=r.y;if(go(e.state).length>0){var a=e.getElementAtPosition(o,i),l=a&&function(e,t){return e.groupIds.find((function(e){return t[e]}))}(a,e.state.selectedGroupIds);if(l)return void e.setState((function(t){return vo(ym(ym({},t),{},{editingGroupId:l,selectedElementIds:P({},a.id,!0),selectedGroupIds:{}}),e.scene.getElements())}))}if(hn(e.canvas),!t[Jt.CTRL_OR_CMD]&&!e.state.viewModeEnabled){var c=Yc(e.scene.getElements(),e.state);if(1===c.length){var s=c[0];Je(s)&&(o=s.x+s.width/2,i=s.y+s.height/2)}e.startTextEditing({sceneX:o,sceneY:i,shouldBind:!1,insertAtParentCenter:!t.altKey})}}}},this.handleCanvasPointerMove=function(t){e.savePointer(t.clientX,t.clientY,e.state.cursorButton),Rm.pointers.has(t.pointerId)&&Rm.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY});var n=Rm.initialScale;if(2===Rm.pointers.size&&Rm.lastCenter&&n&&Rm.initialDistance){var r=Np(Rm.pointers),o=r.x-Rm.lastCenter.x,i=r.y-Rm.lastCenter.y;Rm.lastCenter=r;var a=Bp(Array.from(Rm.pointers.values()))/Rm.initialDistance;e.setState((function(e){var t=e.zoom,l=e.scrollX,c=e.scrollY,s=e.offsetLeft,u=e.offsetTop;return{scrollX:l+o/t.value,scrollY:c+i/t.value,zoom:Qc(Jc(n*a),t,{left:s,top:u},r),shouldCacheIgnoreZoom:!0}})),e.resetShouldCacheIgnoreZoomDebounced()}else Rm.lastCenter=Rm.initialDistance=Rm.initialScale=null;if(!(Im||Mm||Tm)){var l=Vc(Am,t.clientX-e.state.offsetLeft,t.clientY-e.state.offsetTop).isOverEither;e.state.draggingElement||e.state.multiElement||(l?hn(e.canvas):gn(e.canvas,e.state.elementType));var c=yn(t,e.state),u=c.x,d=c.y;if(e.state.editingLinearElement&&!e.state.editingLinearElement.isDragging){var f=ta.handlePointerMove(t,u,d,e.state.editingLinearElement,e.state.gridSize);f!==e.state.editingLinearElement&&e.setState({editingLinearElement:f}),null!=f.lastUncommittedPoint?e.maybeSuggestBindingAtCursor(c):e.setState({suggestedBindings:[]})}if($e(e.state.elementType)){var p=e.state.draggingElement;Xe(p)?e.maybeSuggestBindingsForLinearElementAtCoords(p,[c],e.state.startBoundElement):e.maybeSuggestBindingAtCursor(c)}if(e.state.multiElement){var h=e.state.multiElement,m=h.x,g=h.y,v=h.points,b=h.lastCommittedPoint,y=v[v.length-1];return gn(e.canvas,e.state.elementType),void(y===b?ot(u-m,d-g,y[0],y[1])>=s.qx?to(h,{points:[].concat(A(v),[[u-m,d-g]])}):mn(e.canvas,s.oc.POINTER):v.length>2&&b&&ot(u-m,d-g,b[0],b[1])<s.qx?(mn(e.canvas,s.oc.POINTER),to(h,{points:v.slice(0,-1)})):(it(v,e.state.zoom.value)&&mn(e.canvas,s.oc.POINTER),to(h,{points:[].concat(A(v.slice(0,-1)),[[u-m,d-g]])})))}if(!(Boolean(t.buttons)||"selection"!==e.state.elementType&&"text"!==e.state.elementType)){var x=e.scene.getElements(),w=Yc(x,e.state);if(1!==w.length||l||e.state.editingLinearElement){if(w.length>1&&!l){var k=Yi(kt(w),u,d,e.state.zoom,t.pointerType);if(k)return void mn(e.canvas,Xi({transformHandleType:k}))}}else{var _=Zi(x,e.state,u,d,e.state.zoom,t.pointerType);if(_&&_.transformHandleType)return void mn(e.canvas,Xi(_))}var S=e.getElementAtPosition(c.x,c.y);if("text"===e.state.elementType)mn(e.canvas,Ve(S)?s.oc.TEXT:s.oc.CROSSHAIR);else if(e.state.viewModeEnabled)mn(e.canvas,s.oc.GRAB);else if(l)mn(e.canvas,s.oc.AUTO);else if(e.state.editingLinearElement){var E=ta.getElement(e.state.editingLinearElement.elementId);E&&hi(E,e.state,[c.x,c.y])?mn(e.canvas,s.oc.MOVE):mn(e.canvas,s.oc.AUTO)}else t[Jt.CTRL_OR_CMD]||!S&&!e.isHittingCommonBoundingBoxOfSelectedElements(c,w)?mn(e.canvas,s.oc.AUTO):mn(e.canvas,s.oc.MOVE)}}},this.handleTouchMove=function(e){Lm=!0},this.handleCanvasPointerDown=function(t){var n=document.getSelection();if(null!=n&&n.anchorNode&&n.removeAllRanges(),e.maybeOpenContextMenuAfterPointerDownOnTouchDevices(t),e.maybeCleanupAfterMissingPointerUp(t),!Mm&&(e.setState({lastPointerDownWith:t.pointerType,cursorButton:"down"}),e.savePointer(t.clientX,t.clientY,"down"),!e.handleCanvasPanUsingWheelOrSpaceDrag(t)&&!(t.button!==s.Oh.MAIN&&t.button!==s.Oh.TOUCH||(e.updateGestureOnPointerDown(t),Rm.pointers.size>1)))){var r=e.initialPointerDownState(t);if(!e.handleDraggingScrollBar(t,r)&&(e.clearSelectionIfNotUsingSelection(),e.updateBindingEnabledOnPointerMove(t),!e.handleSelectionOnPointerDown(t,r)))if("text"!==e.state.elementType){if("arrow"===e.state.elementType||"line"===e.state.elementType)e.handleLinearElementOnPointerDown(t,e.state.elementType,r);else if("image"===e.state.elementType){if(mn(e.canvas,s.oc.CROSSHAIR),!e.state.pendingImageElement)return;e.setState({draggingElement:e.state.pendingImageElement,editingElement:e.state.pendingImageElement,pendingImageElement:null,multiElement:null});var o=yn(t,e.state),i=o.x,a=o.y;to(e.state.pendingImageElement,{x:i,y:a})}else"freedraw"===e.state.elementType?e.handleFreeDrawElementOnPointerDown(t,e.state.elementType,r):e.createGenericElementOnPointerDown(e.state.elementType,r);var l=e.onPointerMoveFromPointerDownHandler(r),c=e.onPointerUpFromPointerDownHandler(r),u=e.onKeyDownFromPointerDownHandler(r),d=e.onKeyUpFromPointerDownHandler(r);Dm=c,e.state.viewModeEnabled||(window.addEventListener(s.Ks.POINTER_MOVE,l),window.addEventListener(s.Ks.POINTER_UP,c),window.addEventListener(s.Ks.KEYDOWN,u),window.addEventListener(s.Ks.KEYUP,d),r.eventListeners.onMove=l,r.eventListeners.onUp=c,r.eventListeners.onKeyUp=d,r.eventListeners.onKeyDown=u)}else e.handleTextOnPointerDown(t,r)}},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=function(t){"touch"===t.pointerType&&(Lm=!1,Pm?Lm=!0:Pm=window.setTimeout((function(){Pm=0,Lm||e.handleCanvasContextMenu(t)}),s.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=function(t){if(0!==Rm.pointers.size||!(t.button===s.Oh.WHEEL||t.button===s.Oh.MAIN&&Im||e.state.viewModeEnabled)||Ve(e.state.editingElement))return!1;Mm=!0,t.preventDefault();var n=!1,r=/Linux/.test(window.navigator.platform);mn(e.canvas,s.oc.GRABBING);var o=t.clientX,i=t.clientY,a=Cn((function(t){var a=o-t.clientX,l=i-t.clientY;if(o=t.clientX,i=t.clientY,r&&!n&&(Math.abs(a)>1||Math.abs(l)>1)){n=!0;var c=function e(t){document.body.removeEventListener(s.Ks.PASTE,e),t.stopPropagation()};document.body.addEventListener(s.Ks.PASTE,c),window.addEventListener(s.Ks.POINTER_UP,(function e(){setTimeout((function(){document.body.removeEventListener(s.Ks.PASTE,c),window.removeEventListener(s.Ks.POINTER_UP,e)}),100)}))}e.setState({scrollX:e.state.scrollX-a/e.state.zoom.value,scrollY:e.state.scrollY-l/e.state.zoom.value})})),l=Cn(Dm=function(){Dm=null,Mm=!1,Im||(e.state.viewModeEnabled?mn(e.canvas,s.oc.GRAB):gn(e.canvas,e.state.elementType)),e.setState({cursorButton:"up"}),e.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener(s.Ks.POINTER_MOVE,a),window.removeEventListener(s.Ks.POINTER_UP,l),window.removeEventListener(s.Ks.BLUR,l)});return window.addEventListener(s.Ks.BLUR,l),window.addEventListener(s.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(s.Ks.POINTER_UP,l),!0},this.clearSelectionIfNotUsingSelection=function(){"selection"!==e.state.elementType&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=function(t,n){if("selection"===e.state.elementType){var r=e.scene.getElements(),o=Yc(r,e.state);if(1!==o.length||e.state.editingLinearElement)o.length>1&&(n.resize.handleType=Yi(kt(o),n.origin.x,n.origin.y,e.state.zoom,t.pointerType));else{var i=Zi(r,e.state,n.origin.x,n.origin.y,e.state.zoom,t.pointerType);null!=i&&(e.setState({resizingElement:i.element}),n.resize.handleType=i.transformHandleType)}if(n.resize.handleType)mn(e.canvas,Xi({transformHandleType:n.resize.handleType})),n.resize.isResizing=!0,n.resize.offset=Sn(function(e,t,n,r){var o=h(1===t.length?mt(t[0]):kt(t),4),i=o[0],a=o[1],l=o[2],c=o[3],s=(i+l)/2,u=(a+c)/2,d=1===t.length?t[0].angle:0,f=h(tt(n,r,s,u,-d),2);switch(n=f[0],r=f[1],e){case"n":return tt(n-(i+l)/2,r-a,0,0,d);case"s":return tt(n-(i+l)/2,r-c,0,0,d);case"w":return tt(n-i,r-(a+c)/2,0,0,d);case"e":return tt(n-l,r-(a+c)/2,0,0,d);case"nw":return tt(n-i,r-a,0,0,d);case"ne":return tt(n-l,r-a,0,0,d);case"sw":return tt(n-i,r-c,0,0,d);case"se":return tt(n-l,r-c,0,0,d);default:return[0,0]}}(n.resize.handleType,o,n.origin.x,n.origin.y)),1===o.length&&Ye(o[0])&&2===o[0].points.length&&(n.resize.arrowDirection=(u=n.resize.handleType,d=o[0],f=h(d.points,2),p=h(f[1],2),m=p[0],g=p[1],"nw"===u&&(m<0||g<0)||"ne"===u&&m>=0||"sw"===u&&m<=0||"se"===u&&(m>0||g>0)?"end":"origin"));else{var a;if(e.state.editingLinearElement){var l=ta.handlePointerDown(t,e.state,(function(t){return e.setState(t)}),e.history,n.origin);if(l.hitElement&&(n.hit.element=l.hitElement),l.didAddPoint)return!0}n.hit.element=null!==(a=n.hit.element)&&void 0!==a?a:e.getElementAtPosition(n.origin.x,n.origin.y),n.hit.element&&(n.hit.hasHitElementInside=hi(n.hit.element,e.state,[n.origin.x,n.origin.y])),n.hit.allHitElements=e.getElementsAtPosition(n.origin.x,n.origin.y);var c=n.hit.element,s=n.hit.allHitElements.some((function(t){return e.isASelectedElement(t)}));if(null!==c&&s||t.shiftKey||n.hit.hasHitCommonBoundingBoxOfSelectedElements||e.clearSelection(c),e.state.editingLinearElement)e.setState({selectedElementIds:P({},e.state.editingLinearElement.elementId,!0)});else if(null!=c){if(t[Jt.CTRL_OR_CMD])return e.state.selectedElementIds[c.id]||(n.hit.wasAddedToSelection=!0),e.setState((function(t){return ym(ym({},function(e,t){return fo(fo({},e),{},{editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:P({},t.id,!0)})}(t,c)),{},{previousSelectedElementIds:e.state.selectedElementIds})})),!1;e.state.selectedElementIds[c.id]||(e.state.editingGroupId&&!bo(c,e.state.editingGroupId)&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),s||n.hit.hasHitCommonBoundingBoxOfSelectedElements||(e.setState((function(t){return vo(ym(ym({},t),{},{selectedElementIds:ym(ym({},t.selectedElementIds),{},P({},c.id,!0))}),e.scene.getElements())})),n.hit.wasAddedToSelection=!0))}e.setState({previousSelectedElementIds:e.state.selectedElementIds})}}var u,d,f,p,m,g;return!1},this.handleTextOnPointerDown=function(t,n){if(!Ve(e.state.editingElement)){var r=n.origin.x,o=n.origin.y,i=e.getElementAtPosition(r,o,{includeBoundTextElement:!0});Je(i)&&(r=i.x+i.width/2,o=i.y+i.height/2),e.startTextEditing({sceneX:r,sceneY:o,shouldBind:!1,insertAtParentCenter:!t.altKey}),hn(e.canvas),e.state.elementLocked||e.setState({elementType:"selection"})}},this.handleFreeDrawElementOnPointerDown=function(t,n,r){var o,i=h(ut(r.origin.x,r.origin.y,null),2),a=i[0],l=i[1],c=(o={type:n,x:a,y:l,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness,simulatePressure:.5===t.pressure},So(So({},Eo(o.type,o)),{},{points:o.points||[],pressures:[],simulatePressure:o.simulatePressure,lastCommittedPoint:null}));e.setState((function(e){return{selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},c.id,!1))}}));var s=c.simulatePressure?c.pressures:[].concat(A(c.pressures),[t.pressure]);to(c,{points:[[0,0]],pressures:s});var u=ma(r.origin,e.scene);e.scene.replaceAllElements([].concat(A(e.scene.getElementsIncludingDeleted()),[c])),e.setState({draggingElement:c,editingElement:c,startBoundElement:u,suggestedBindings:[]})},this.createImageElement=function(t){var n,r=t.sceneX,o=t.sceneY,i=h(ut(r,o,e.state.gridSize),2),a=i[0],l=i[1];return n={type:"image",x:a,y:l,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness},So(So({},Eo("image",n)),{},{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=function(t,n,r){if(e.state.multiElement){var o=e.state.multiElement;if("line"===o.type&&it(o.points,e.state.zoom.value))return to(o,{lastCommittedPoint:o.points[o.points.length-1]}),void e.actionManager.executeAction(nu);var i=o.x,a=o.y,l=o.lastCommittedPoint;if(o.points.length>1&&l&&ot(r.origin.x-i,r.origin.y-a,l[0],l[1])<s.qx)return void e.actionManager.executeAction(nu);e.setState((function(e){return{selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},o.id,!0))}})),to(o,{lastCommittedPoint:o.points[o.points.length-1]}),mn(e.canvas,s.oc.POINTER)}else{var c=h(ut(r.origin.x,r.origin.y,e.state.gridSize),2),u=c[0],d=c[1],f=e.state,p=f.currentItemStartArrowhead,m=f.currentItemEndArrowhead,g=h("arrow"===n?[p,m]:[null,null],2),v=g[0],b=g[1],y=Mo({type:n,x:u,y:d,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness,startArrowhead:v,endArrowhead:b});e.setState((function(e){return{selectedElementIds:ym(ym({},e.selectedElementIds),{},P({},y.id,!1))}})),to(y,{points:[].concat(A(y.points),[[0,0]])});var x=ma(r.origin,e.scene);e.scene.replaceAllElements([].concat(A(e.scene.getElementsIncludingDeleted()),[y])),e.setState({draggingElement:y,editingElement:y,startBoundElement:x,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=function(t,n){var r=h(ut(n.origin.x,n.origin.y,e.state.gridSize),2),o=r[0],i=r[1],a=jo({type:t,x:o,y:i,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemStrokeSharpness});"selection"===a.type?e.setState({selectionElement:a,draggingElement:a}):(e.scene.replaceAllElements([].concat(A(e.scene.getElementsIncludingDeleted()),[a])),e.setState({multiElement:null,draggingElement:a,editingElement:a}))},this.initializeImage=function(){var t=(0,d.Z)(g().mark((function t(n){var r,o,i,a,l,c,u,f,p,h,m,v,b,y,x;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n.imageFile,l=n.imageElement,c=n.showCursorImagePreview,u=void 0!==c&&c,sd(a)){t.next=3;break}throw new Error(C("errors.unsupportedFileType"));case 3:if(f=a.type,mn(e.canvas,"wait"),f!==s.LO.svg){t.next=23;break}return t.prev=6,t.t0=vd,t.t1=Pd,t.next=11,a.text();case 11:return t.t2=t.sent,t.next=14,(0,t.t1)(t.t2);case 14:t.t3=t.sent,t.t4=a.name,a=(0,t.t0)(t.t3,t.t4),t.next=23;break;case 19:throw t.prev=19,t.t5=t.catch(6),console.warn(t.t5),new Error(C("errors.svgImageInsertError"));case 23:return t.next=25,(null===(r=(o=e.props).generateIdForFile)||void 0===r?void 0:r.call(o,a))||pd(a);case 25:if(p=t.sent){t.next=29;break}throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(C("errors.imageInsertError"));case 29:if(null!=(h=e.files[p])&&h.dataURL){t.next=42;break}return t.prev=31,t.next=34,gd(a,{maxWidthOrHeight:s.h6});case 34:a=t.sent,t.next=40;break;case 37:t.prev=37,t.t6=t.catch(31),console.error("error trying to resing image file on insertion",t.t6);case 40:if(!(a.size>s.$n)){t.next=42;break}throw new Error(C("errors.fileTooBig",{maxSize:"".concat(Math.trunc(s.$n/1024/1024),"MB")}));case 42:if(u&&(v=null===(m=e.files[p])||void 0===m?void 0:m.dataURL,b=v&&md(v),e.setImagePreviewCursor(b||a)),t.t7=null===(i=e.files[p])||void 0===i?void 0:i.dataURL,t.t7){t.next=48;break}return t.next=47,hd(a);case 47:t.t7=t.sent;case 48:return y=t.t7,x=to(l,{fileId:p},!1),t.abrupt("return",new Promise(function(){var t=(0,d.Z)(g().mark((function t(n,r){var o,i,a;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e.files=ym(ym({},e.files),{},P({},p,{mimeType:f,id:p,dataURL:y,created:Date.now()})),a=e.imageCache.get(p)){t.next=7;break}return e.addNewImagesToImageCache(),t.next=7,e.updateImageCache([x]);case 7:if(!((null==a?void 0:a.image)instanceof Promise)){t.next=10;break}return t.next=10,a.image;case 10:(null===(o=e.state.pendingImageElement)||void 0===o?void 0:o.id)!==x.id&&(null===(i=e.state.draggingElement)||void 0===i?void 0:i.id)!==x.id&&e.initializeImageDimensions(x,!0),n(x),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),console.error(t.t0),r(new Error(C("errors.imageInsertError")));case 18:return t.prev=18,u||hn(e.canvas),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[0,14,18,21]])})));return function(e,n){return t.apply(this,arguments)}}()));case 51:case"end":return t.stop()}}),t,null,[[6,19],[31,37]])})));return function(e){return t.apply(this,arguments)}}(),this.insertImageElement=function(){var t=(0,d.Z)(g().mark((function t(n,r,o){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.scene.replaceAllElements([].concat(A(e.scene.getElementsIncludingDeleted()),[n])),t.prev=1,t.next=4,e.initializeImage({imageFile:r,imageElement:n,showCursorImagePreview:o});case 4:t.next=11;break;case 6:t.prev=6,t.t0=t.catch(1),to(n,{isDeleted:!0}),e.actionManager.executeAction(nu),e.setState({errorMessage:t.t0.message||C("errors.imageInsertError")});case 11:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(e,n,r){return t.apply(this,arguments)}}(),this.setImagePreviewCursor=function(){var t=(0,d.Z)(g().mark((function t(n){var r,o,i,a,l,c,u;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=96,t.next=3,gd(n,{maxWidthOrHeight:r});case 3:return o=t.sent,t.next=6,hd(o);case 6:if(i=t.sent,n.type!==s.LO.svg){t.next=20;break}return t.next=10,Md(i);case 10:a=t.sent,l=Math.min(a.height,r),(c=l*(a.width/a.height))>r&&(l=(c=r)*(a.height/a.width)),(u=document.createElement("canvas")).height=l,u.width=c,u.getContext("2d").drawImage(a,0,0,c,l),i=u.toDataURL(s.LO.svg);case 20:e.state.pendingImageElement&&mn(e.canvas,"url(".concat(i,") 4 4, auto"));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onImageAction=(0,d.Z)(g().mark((function t(){var n,r,o,i,a,l,c,s,u,d=arguments;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=d.length>0&&void 0!==d[0]?d[0]:{insertOnCanvasDirectly:!1},r=n.insertOnCanvasDirectly,t.prev=1,o=e.state.width/2+e.state.offsetLeft,i=e.state.height/2+e.state.offsetTop,a=yn({clientX:o,clientY:i},e.state),l=a.x,c=a.y,t.next=7,Vu({description:"Image",extensions:["jpg","png","svg","gif"]});case 7:s=t.sent,u=e.createImageElement({sceneX:l,sceneY:c}),r?(e.insertImageElement(u,s),e.initializeImageDimensions(u),e.setState({selectedElementIds:P({},u.id,!0)},(function(){e.actionManager.executeAction(nu)}))):e.setState({pendingImageElement:u},(function(){e.insertImageElement(u,s,!0)})),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(1),"AbortError"!==t.t0.name?console.error(t.t0):console.warn(t.t0),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(function(){e.actionManager.executeAction(nu)}));case 16:case"end":return t.stop()}}),t,null,[[1,12]])}))),this.initializeImageDimensions=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=We(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!o||o instanceof Promise){if(t.width<s.f/e.state.zoom.value&&t.height<s.f/e.state.zoom.value){var i=100/e.state.zoom.value;to(t,{x:t.x-i/2,y:t.y-i/2,width:i,height:i})}}else if(r||t.width<s.f/e.state.zoom.value&&t.height<s.f/e.state.zoom.value){var a=Math.max(e.state.height-120,160),l=Math.min(a,Math.floor(.5*e.state.height)/e.state.zoom.value),c=Math.min(o.naturalHeight,l),u=c*(o.naturalWidth/o.naturalHeight),d=t.x+t.width/2-u/2,f=t.y+t.height/2-c/2;to(t,{x:d,y:f,width:u,height:c})}},this.updateImageCache=function(){var t=(0,d.Z)(g().mark((function t(n){var r,o,i,a,l,c,s,u=arguments;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:e.files,t.next=3,Td({imageCache:e.imageCache,fileIds:n.map((function(e){return e.fileId})),files:r});case 3:if(o=t.sent,i=o.updatedFiles,a=o.erroredFiles,i.size||a.size){l=gm(n);try{for(l.s();!(c=l.n()).done;)s=c.value,i.has(s.fileId)&&Rr(s)}catch(e){l.e(e)}finally{l.f()}}return a.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((function(e){return We(e)&&a.has(e.fileId)?no(e,{status:"error"}):e}))),t.abrupt("return",{updatedFiles:i,erroredFiles:a});case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.addNewImagesToImageCache=(0,d.Z)(g().mark((function t(){var n,r,o,i,a=arguments;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.length>0&&void 0!==a[0]?a[0]:Ad(e.scene.getElements()),r=a.length>1&&void 0!==a[1]?a[1]:e.files,!(o=n.filter((function(t){return!t.isDeleted&&!e.imageCache.has(t.fileId)}))).length){t.next=9;break}return t.next=6,e.updateImageCache(o,r);case 6:i=t.sent,i.updatedFiles.size&&e.scene.informMutation();case 9:case"end":return t.stop()}}),t)}))),this.scheduleImageRefresh=mm()((function(){e.addNewImagesToImageCache()}),s.LL),this.updateBindingEnabledOnPointerMove=function(t){var n=function(e){return!e[Jt.CTRL_OR_CMD]}(t);e.state.isBindingEnabled!==n&&e.setState({isBindingEnabled:n})},this.maybeSuggestBindingAtCursor=function(t){var n=ma(t,e.scene);e.setState({suggestedBindings:null!=n?[n]:[]})},this.maybeSuggestBindingsForLinearElementAtCoords=function(t,n,r){if(n.length){var o=n.reduce((function(n,o){var i=ma(o,e.scene);return null==i||fa(t,null==r?void 0:r.id,i)||n.push(i),n}),[]);e.setState({suggestedBindings:o})}},this.handleCanvasRef=function(t){var n,r,o;null!==t?(e.canvas=t,e.rc=Be.canvas(e.canvas),e.canvas.addEventListener(s.Ks.WHEEL,e.handleWheel,{passive:!1}),e.canvas.addEventListener(s.Ks.TOUCH_START,e.onTapStart),e.canvas.addEventListener(s.Ks.TOUCH_END,e.onTapEnd)):(null===(n=e.canvas)||void 0===n||n.removeEventListener(s.Ks.WHEEL,e.handleWheel),null===(r=e.canvas)||void 0===r||r.removeEventListener(s.Ks.TOUCH_START,e.onTapStart),null===(o=e.canvas)||void 0===o||o.removeEventListener(s.Ks.TOUCH_END,e.onTapEnd))},this.handleAppOnDrop=function(){var t=(0,d.Z)(g().mark((function t(n){var r,o,i,a,l,c,u,d,f,p,h,m;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,i=n.dataTransfer.files[0],!sd(i)){t.next=33;break}if((null==i?void 0:i.type)!==s.LO.png&&(null==i?void 0:i.type)!==s.LO.svg){t.next=27;break}if(t.prev=4,!Uu){t.next=16;break}return t.prev=6,a=n.dataTransfer.items[0],t.next=10,a.getAsFileSystemHandle();case 10:i.handle=t.sent,t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),console.warn(t.t0.name,t.t0.message);case 16:return t.next=18,ud(i,e.state,e.scene.getElementsIncludingDeleted());case 18:return l=t.sent,e.syncActionResult(ym(ym({},l),{},{appState:ym(ym({},l.appState||e.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0})),t.abrupt("return");case 23:if(t.prev=23,t.t1=t.catch(4),"EncodingError"===t.t1.name){t.next=27;break}throw t.t1;case 27:return c=yn(n,e.state),u=c.x,d=c.y,f=e.createImageElement({sceneX:u,sceneY:d}),e.insertImageElement(f,i),e.initializeImageDimensions(f),e.setState({selectedElementIds:P({},f.id,!0)}),t.abrupt("return");case 33:t.next=38;break;case 35:return t.prev=35,t.t2=t.catch(0),t.abrupt("return",e.setState({isLoading:!1,errorMessage:t.t2.message}));case 38:if(""===(p=n.dataTransfer.getData(s.LO.excalidrawlib))){t.next=42;break}return e.addElementsFromPasteOrLibrary({elements:JSON.parse(p),position:n,files:null}),t.abrupt("return");case 42:if(!((null==(h=null===(r=n.dataTransfer)||void 0===r?void 0:r.files[0])?void 0:h.type)===s.LO.excalidrawlib||null!=h&&null!==(o=h.name)&&void 0!==o&&o.endsWith(".excalidrawlib"))){t.next=47;break}e.library.importLibrary(h).then((function(){e.setState({isLibraryOpen:!1}),e.setState({isLibraryOpen:!0})})).catch((function(t){return e.setState({isLoading:!1,errorMessage:t.message})})),t.next=61;break;case 47:if(e.setState({isLoading:!0}),!Uu){t.next=59;break}return t.prev=49,m=n.dataTransfer.items[0],t.next=53,m.getAsFileSystemHandle();case 53:h.handle=t.sent,t.next=59;break;case 56:t.prev=56,t.t3=t.catch(49),console.warn(t.t3.name,t.t3.message);case 59:return t.next=61,e.loadFileToCanvas(h);case 61:case"end":return t.stop()}}),t,null,[[0,35],[4,23],[6,13],[49,56]])})));return function(e){return t.apply(this,arguments)}}(),this.loadFileToCanvas=function(t){ud(t,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(ym(ym({},t),{},{appState:ym(ym({},t.appState||e.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((function(t){e.setState({isLoading:!1,errorMessage:t.message})}))},this.handleCanvasContextMenu=function(t){t.preventDefault();var n=yn(t,e.state),r=n.x,o=n.y,i=e.getElementAtPosition(r,o,{preferSelected:!0}),a=i?"element":"canvas",l=e.excalidrawContainerRef.current.getBoundingClientRect(),c=l.top,s=l.left,u=t.clientX-s,d=t.clientY-c;i&&!e.state.selectedElementIds[i.id]?e.setState({selectedElementIds:P({},i.id,!0)},(function(){e._openContextMenu({top:d,left:u},a)})):e._openContextMenu({top:d,left:u},a)},this.maybeDragNewGenericElement=function(t,n){var r=e.state.draggingElement,o=t.lastCoords;if(r)if("selection"===r.type)Wa(r,e.state.elementType,t.origin.x,t.origin.y,o.x,o.y,pn(t.origin.x,o.x),pn(t.origin.y,o.y),nn(n),tn(n));else{var i,a=h(ut(o.x,o.y,e.state.gridSize),2),l=a[0],c=a[1],s=We(r)&&(null===(i=e.imageCache.get(r.fileId))||void 0===i?void 0:i.image),u=!s||s instanceof Promise?null:s.width/s.height;Wa(r,e.state.elementType,t.originInGrid.x,t.originInGrid.y,l,c,pn(t.originInGrid.x,l),pn(t.originInGrid.y,c),Ke(r)?!nn(n):nn(n),tn(n),u),e.maybeSuggestBindingForAll([r])}},this.maybeHandleResize=function(t,n){var r=Yc(e.scene.getElements(),e.state),o=t.resize.handleType;e.setState({isResizing:o&&"rotation"!==o,isRotating:"rotation"===o});var i=t.lastCoords,a=h(ut(i.x-t.resize.offset.x,i.y-t.resize.offset.y,e.state.gridSize),2),l=a[0],c=a[1];return!!function(e,t,n,r,o,i,a,l,c,s,u){if(1===n.length){var d=h(n,1)[0];return"rotation"===t?(La(d,l,c,o),va(d)):!Ye(d)||2!==d.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ve(d)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&Ba(e.originalElements.get(d.id),a,d,t,i,l,c):(Na(d,t,i,l,c),va(d)):Da(d,r,o,l,c),!0}if(n.length>1){if("rotation"===t)return Fa(e,n,l,c,o,s,u),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return Ha(n,t,l,c),sr(n,t),!0}return!1}(t,o,r,t.resize.arrowDirection,rn(n),tn(n),1===r.length&&Ke(r[0])?!nn(n):nn(n),l,c,t.resize.center.x,t.resize.center.y)&&(e.maybeSuggestBindingForAll(r),!0)},this._openContextMenu=function(t,n){var r=t.left,o=t.top,i=Kf.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),a=Vf.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),l=lp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),c=cp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),s="separator",u=e.scene.getElements(),d=[];if(af&&u.length>0&&d.push(bp),of&&u.length>0&&d.push(vp),"canvas"===n){var f=[].concat(d,[void 0===e.props.gridModeEnabled&&wp,void 0===e.props.zenModeEnabled&&Sp,void 0===e.props.viewModeEnabled&&pm,Cp]);e.state.viewModeEnabled?qp({options:f,top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):qp({options:[e.isMobile&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},e.isMobile&&navigator.clipboard&&s,af&&u.length>0&&bp,of&&u.length>0&&vp,(af&&u.length>0||of&&u.length>0)&&s,Os,s,void 0===e.props.gridModeEnabled&&wp,void 0===e.props.zenModeEnabled&&Sp,void 0===e.props.viewModeEnabled&&pm,Cp],top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current})}else"element"===n&&(e.state.viewModeEnabled?qp({options:[navigator.clipboard&&mp].concat(d),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):qp({options:[e.isMobile&&gp,e.isMobile&&navigator.clipboard&&mp,e.isMobile&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},e.isMobile&&s].concat(d,[s,Lf,Df,s,i&&Kf,a&&Vf,(i||a)&&s,$f,s,ks,_s,Ss,Es,s,l&&lp,c&&cp,(l||c)&&s,Ts,ds]),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}))},this.handleWheel=Cn((function(t){if(t.preventDefault(),!Mm){var n=t.deltaX,r=t.deltaY,o=e.state,i=o.selectedElementIds,a=o.previousSelectedElementIds;if(t.metaKey||t.ctrlKey){var l=Math.sign(r),c=Math.abs(r);c>10&&(c=10),c*=l,0!==Object.keys(a).length&&setTimeout((function(){e.setState({selectedElementIds:a,previousSelectedElementIds:{}})}),1e3);var u=e.state.zoom.value-c/100;return u+=Math.log10(Math.max(1,e.state.zoom.value))*-l,u=Math.round(u*s.V4*100)/(100*s.V4),e.setState((function(e){var t=e.zoom,n=e.offsetLeft,r=e.offsetTop;return{zoom:Qc(Jc(u),t,{left:n,top:r},{x:Cm,y:Om}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(i).length?i:a,shouldCacheIgnoreZoom:!0}})),void e.resetShouldCacheIgnoreZoomDebounced()}t.shiftKey?e.setState((function(e){var t=e.zoom;return{scrollX:e.scrollX-(r||n)/t.value}})):e.setState((function(e){var t=e.zoom,o=e.scrollX,i=e.scrollY;return{scrollX:o-n/t.value,scrollY:i-r/t.value}}))}})),this.savePointer=function(t,n,r){var o,i;if(t&&n){var a=yn({clientX:t,clientY:n},e.state);isNaN(a.x)||isNaN(a.y),null===(o=(i=e.props).onPointerUpdate)||void 0===o||o.call(i,{pointer:a,button:r,pointersMap:Rm.pointers})}},this.resetShouldCacheIgnoreZoomDebounced=dn((function(){e.unmounted||e.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=function(t){var n;if(null!==(n=e.excalidrawContainerRef)&&void 0!==n&&n.current){var r=e.excalidrawContainerRef.current.getBoundingClientRect(),o=r.width,i=r.height,a=r.left,l=r.top,c=e.state,s=c.width,u=c.height,d=c.offsetTop,f=c.offsetLeft;if(o===s&&i===u&&a===f&&l===d)return void(t&&t());e.setState({width:o,height:i,offsetLeft:a,offsetTop:l},(function(){t&&t()}))}},this.refresh=function(){e.setState(ym({},e.getCanvasOffsets()))}};"production"!==s.Vi.TEST&&"production"!==s.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){return this.app.scene.getElementsIncludingDeleted()},set:function(e){return this.app.scene.replaceAllElements(e)}}}));var Bm=zm,Hm=(n(4285),n(3313),["initialData","UIOptions"]),Fm=["initialData","UIOptions"];function Um(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Um(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Um(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Km=function(e){var t,n,r,o=e.onChange,i=e.initialData,a=e.excalidrawRef,c=e.onCollabButtonClick,u=e.isCollaborating,d=void 0!==u&&u,f=e.onPointerUpdate,p=e.renderTopRightUI,h=e.renderFooter,m=e.langCode,g=void 0===m?y.code:m,v=e.viewModeEnabled,b=e.zenModeEnabled,x=e.gridModeEnabled,w=e.libraryReturnUrl,k=e.theme,_=e.name,S=e.renderCustomStats,E=e.onPaste,j=e.detectScroll,C=void 0===j||j,I=e.handleKeyboardGlobally,T=void 0!==I&&I,A=e.onLibraryChange,P=e.autoFocus,L=void 0!==P&&P,D=e.generateIdForFile,R=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,z={canvasActions:Wm(Wm({},s.cW.canvasActions),R)};null!=R&&R.export&&(z.canvasActions.export.saveFileToDisk=null!==(n=null===(r=R.export)||void 0===r?void 0:r.saveFileToDisk)&&void 0!==n?n:s.cW.canvasActions.export.saveFileToDisk);return(0,l.useEffect)((function(){var e=function(e){"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),function(){document.removeEventListener("touchmove",e)}}),[]),(0,O.jsx)(M,{langCode:g,children:(0,O.jsx)(Bm,{onChange:o,initialData:i,excalidrawRef:a,onCollabButtonClick:c,isCollaborating:d,onPointerUpdate:f,renderTopRightUI:p,renderFooter:h,langCode:g,viewModeEnabled:v,zenModeEnabled:b,gridModeEnabled:x,libraryReturnUrl:w,theme:k,name:_,renderCustomStats:S,UIOptions:z,onPaste:E,detectScroll:C,handleKeyboardGlobally:T,onLibraryChange:A,autoFocus:L,generateIdForFile:D})})},Vm=function(e,t){e.initialData;var n=e.UIOptions,r=void 0===n?{}:n,i=o()(e,Hm),a=(t.initialData,t.UIOptions),l=void 0===a?{}:a,c=o()(t,Fm),s=Object.keys(r),u=Object.keys(l);if(s.length!==u.length)return!1;var d=s.every((function(e){"canvasActions"===e&&Object.keys(r.canvasActions).every((function(e){var t,n,o,i;return"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=l&&null!==(n=l.canvasActions)&&void 0!==n&&n.export?r.canvasActions.export.saveFileToDisk===l.canvasActions.export.saveFileToDisk:(null==r||null===(o=r.canvasActions)||void 0===o?void 0:o[e])===(null==l||null===(i=l.canvasActions)||void 0===i?void 0:i[e])}));return!0})),f=Object.keys(e),p=Object.keys(t);return d&&f.length===p.length&&f.every((function(e){return i[e]===c[e]}))},Gm=(0,l.forwardRef)((function(e,t){return(0,O.jsx)(Km,Wm(Wm({},e),{},{excalidrawRef:t}))})),Zm=c().memo(Gm,Vm),Ym=(n(8336),Zm)},9669:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:function(e){"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},1639:function(e){"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},3147:function(e,t,n){"use strict";e.exports=n.p+"excalidraw-assets/Cascadia.woff2"},3940:function(e,t,n){"use strict";e.exports=n.p+"excalidraw-assets/Virgil.woff2"},9787:function(t){"use strict";t.exports=e},5156:function(e){"use strict";e.exports=t},8950:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function l(e){r(a,o,i,l,c,"next",e)}function c(e){r(a,o,i,l,c,"throw",e)}l(void 0)}))}}n.d(t,{Z:function(){return o}})},1463:function(e){"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library","decreaseFontSize":"Decrease font size","increaseFontSize":"Increase font size"},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save to current file","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG."},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point(s),\\nCtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to edit (hold SHIFT to select multiple),\\nor hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library","bindTextToElement":"Press enter to add text","deepBoxSelect":"Hold CtrlOrCmd to deep select, and to prevent dragging"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version.","shareTitle":"Join a live collaboration session on Excalidraw"},"errorDialog":{"title":"Error"},"exportDialog":{"disk_title":"Save to disk","disk_details":"Export the scene data to a file from which you can import later.","disk_button":"Save to file","link_title":"Shareable link","link_details":"Export as a read-only link.","link_button":"Export to Link","excalidrawplus_description":"Save the scene to your Excalidraw+ workspace.","excalidrawplus_button":"Export","excalidrawplus_exportError":"Couldn\'t export to Excalidraw+ at this moment..."},"helpDialog":{"blog":"Read our blog","click":"click","deepSelect":"Deep select","deepBoxSelect":"Deep select within box, and prevent dragging","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')},4451:function(e){"use strict";e.exports=JSON.parse('{"ar-SA":88,"bg-BG":62,"bn-BD":0,"ca-ES":97,"cs-CZ":24,"da-DK":17,"de-DE":100,"el-GR":88,"en":100,"es-ES":86,"eu-ES":84,"fa-IR":64,"fi-FI":97,"fr-FR":100,"he-IL":82,"hi-IN":56,"hu-HU":50,"id-ID":100,"it-IT":98,"ja-JP":98,"kab-KAB":96,"kk-KZ":23,"ko-KR":57,"lt-LT":24,"lv-LV":100,"my-MM":47,"nb-NO":100,"nl-NL":91,"nn-NO":85,"oc-FR":98,"pa-IN":88,"pl-PL":95,"pt-BR":100,"pt-PT":85,"ro-RO":100,"ru-RU":100,"si-LK":9,"sk-SK":99,"sv-SE":99,"ta-IN":97,"tr-TR":86,"uk-UA":83,"zh-CN":100,"zh-HK":29,"zh-TW":100}')}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,c),n.loaded=!0,n.exports}return c.m=a,c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},c.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);c.r(o);var i={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((function(t){i[t]=function(){return e[t]}}));return i.default=function(){return e},c.d(o,i),o},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce((function(t,n){return c.f[n](e,t),t}),[]))},c.u=function(e){return"excalidraw-assets/"+{9:"i18n-zh-HK-json",43:"i18n-de-DE-json",58:"i18n-lt-LT-json",60:"i18n-ko-KR-json",62:"i18n-zh-TW-json",90:"i18n-si-LK-json",137:"i18n-ja-JP-json",149:"i18n-pt-PT-json",164:"i18n-kab-KAB-json",196:"i18n-nl-NL-json",213:"i18n-tr-TR-json",242:"i18n-my-MM-json",246:"i18n-nb-NO-json",262:"i18n-he-IL-json",280:"i18n-pa-IN-json",304:"i18n-zh-CN-json",317:"i18n-es-ES-json",351:"i18n-ca-ES-json",364:"i18n-fr-FR-json",381:"i18n-pt-BR-json",384:"i18n-bg-BG-json",387:"i18n-cs-CZ-json",395:"i18n-ta-IN-json",401:"i18n-sk-SK-json",431:"i18n-eu-ES-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",499:"image",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",565:"i18n-oc-FR-json",583:"i18n-uk-UA-json",603:"i18n-bn-BD-json",617:"i18n-da-DK-json",649:"i18n-kk-KZ-json",661:"i18n-hu-HU-json",698:"i18n-sv-SE-json",710:"i18n-fa-IR-json",736:"vendor",752:"i18n-ro-RO-json",852:"i18n-pl-PL-json",869:"i18n-ru-RU-json",899:"i18n-lv-LV-json",920:"i18n-nn-NO-json",933:"i18n-hi-IN-json"}[e]+"-"+{9:"24ab7abe8e695f165b3b",43:"1f36c83788d93a26c574",58:"e9bd2413c78d8cd605c1",60:"df4ca911d661a3668791",62:"9a0e7901a1a58502bfa4",90:"29566ffe4c2aab9bc9d7",137:"045af0024c647d78ff48",149:"088903851b38144d92cd",164:"dec84820b3b3b8cea91e",196:"676bbee6b2201018afea",213:"b92a92cca02f833721d4",242:"4326db071b2b5ad9ebd2",246:"f99ea85b15d9c0fd412f",262:"5f850f9fc31f38e08e11",280:"5edc5b8da2685495dc6f",304:"02c2e2cacd9b605b9433",317:"c58a268683a5a98cb339",351:"d4752239985378d6687b",364:"7d9dfefbcbd632631e26",381:"df0e1971ca6c9ab7ba96",384:"b75f0626e77ba4b93a1a",387:"3f0957ec0784a1e70989",395:"fadfdd197ff5b857ed62",401:"68881f095026d35935f3",431:"a3036124af529be40107",465:"30125a866f08cd0c8dce",472:"25e90ae7a679737c89fa",491:"7dc2565e1c0b98d44e81",499:"b76d879db8316c30fd0d",526:"c7749e93b5ee2ef46f01",558:"bad937b9c5872d8bb08c",565:"5ce59f015d4aaae56795",583:"550e1d2467d2c10ba4c5",603:"ba2910bdfa31bf4a3b47",617:"30c4bddb0657ba3ec9f0",649:"a2be2aa000093bb0c4b1",661:"29933e37837a1a237a79",698:"11387dba5283047f00f2",710:"e49ff1b123f75b3fe6ae",736:"41e5c0be76c29ad2aba4",752:"e9e42a4eea14e9780121",852:"2a6bca3404366166de44",869:"6619d335c0dc5729f858",899:"35f7377cd0651c3473cb",920:"1a9f7d30feff1eafa425",933:"022f6946007c53005bf4"}[e]+".js"},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o={},i="Excalidraw:",c.l=function(e,t,n,r){if(o[e])o[e].push(t);else{var a,l;if(void 0!==n)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var d=s[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==i+n){a=d;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,c.nc&&a.setAttribute("nonce",c.nc),a.setAttribute("data-webpack",i+n),a.src=e),o[e]=[t];var f=function(t,n){a.onerror=a.onload=null,clearTimeout(p);var r=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),l&&document.head.appendChild(a)}},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},c.p="",function(){c.b=document.baseURI||self.location.href;var e={388:0};c.f.j=function(t,n){var r=c.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var i=c.p+c.u(t),a=new Error;c.l(i,(function(n){if(c.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}};var t=function(t,n){var r,o,i=n[0],a=n[1],l=n[2],s=0;if(i.some((function(t){return 0!==e[t]}))){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);if(l)l(c)}for(t&&t(n);s<i.length;s++)o=i[s],c.o(e,o)&&e[o]&&e[o][0](),e[i[s]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),c(6210)}()}));
|