@ours.network/messenger-server 1.0.28 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -8
- package/dist/chunks/{chunk-2JJTF5OK.js → chunk-3EUXH4PV.js} +1 -1
- package/dist/chunks/{server-423DCFTU.js → server-WOE26ICL.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/web/assets/{abnfDiagram-N423BO3Z-CmqtXm9e.js → abnfDiagram-N423BO3Z-C-iag_Nj.js} +2 -2
- package/dist/web/assets/{abnfDiagram-N423BO3Z-CmqtXm9e.js.map → abnfDiagram-N423BO3Z-C-iag_Nj.js.map} +1 -1
- package/dist/web/assets/{arc-ByTkPL8X.js → arc-Bcm2sZNj.js} +2 -2
- package/dist/web/assets/{arc-ByTkPL8X.js.map → arc-Bcm2sZNj.js.map} +1 -1
- package/dist/web/assets/{architectureDiagram-T3A2C74G-Deystmq0.js → architectureDiagram-T3A2C74G-Cf8AnIVp.js} +2 -2
- package/dist/web/assets/{architectureDiagram-T3A2C74G-Deystmq0.js.map → architectureDiagram-T3A2C74G-Cf8AnIVp.js.map} +1 -1
- package/dist/web/assets/{blockDiagram-VBNYF7ZC-H1NKSUCA.js → blockDiagram-VBNYF7ZC-Ch9RzKmh.js} +2 -2
- package/dist/web/assets/{blockDiagram-VBNYF7ZC-H1NKSUCA.js.map → blockDiagram-VBNYF7ZC-Ch9RzKmh.js.map} +1 -1
- package/dist/web/assets/{browser-Cya_kJEb.js → browser-mCqw9EMW.js} +2 -2
- package/dist/web/assets/{browser-Cya_kJEb.js.map → browser-mCqw9EMW.js.map} +1 -1
- package/dist/web/assets/{c4Diagram-5PPSVZJV-Bo53j4MW.js → c4Diagram-5PPSVZJV-vFBfClLI.js} +2 -2
- package/dist/web/assets/{c4Diagram-5PPSVZJV-Bo53j4MW.js.map → c4Diagram-5PPSVZJV-vFBfClLI.js.map} +1 -1
- package/dist/web/assets/channel-B7e1tuOt.js +2 -0
- package/dist/web/assets/{channel-DxwvuvRo.js.map → channel-B7e1tuOt.js.map} +1 -1
- package/dist/web/assets/{chunk-2GRJ4B5K-RanroX_6.js → chunk-2GRJ4B5K-CovDVQb1.js} +2 -2
- package/dist/web/assets/{chunk-2GRJ4B5K-RanroX_6.js.map → chunk-2GRJ4B5K-CovDVQb1.js.map} +1 -1
- package/dist/web/assets/{chunk-2Q5K7J3B-Ezr8zlMo.js → chunk-2Q5K7J3B-DMq4JEsX.js} +2 -2
- package/dist/web/assets/{chunk-2Q5K7J3B-Ezr8zlMo.js.map → chunk-2Q5K7J3B-DMq4JEsX.js.map} +1 -1
- package/dist/web/assets/{chunk-5RXB4S5H-DlPCHTE4.js → chunk-5RXB4S5H-CrraHros.js} +2 -2
- package/dist/web/assets/{chunk-5RXB4S5H-DlPCHTE4.js.map → chunk-5RXB4S5H-CrraHros.js.map} +1 -1
- package/dist/web/assets/{chunk-5VM5RSS4-DZLOUoM5.js → chunk-5VM5RSS4-Dtkchtl6.js} +2 -2
- package/dist/web/assets/{chunk-5VM5RSS4-DZLOUoM5.js.map → chunk-5VM5RSS4-Dtkchtl6.js.map} +1 -1
- package/dist/web/assets/{chunk-6Q2QTUOP-CBTgQ4oE.js → chunk-6Q2QTUOP-C7hewS6C.js} +2 -2
- package/dist/web/assets/{chunk-6Q2QTUOP-CBTgQ4oE.js.map → chunk-6Q2QTUOP-C7hewS6C.js.map} +1 -1
- package/dist/web/assets/{chunk-GF5L2VYU-DRgJDmMS.js → chunk-GF5L2VYU-lRYUPE4E.js} +2 -2
- package/dist/web/assets/{chunk-GF5L2VYU-DRgJDmMS.js.map → chunk-GF5L2VYU-lRYUPE4E.js.map} +1 -1
- package/dist/web/assets/{chunk-JWPE2WC7-CUm26Y4N.js → chunk-JWPE2WC7-DmDsLF1N.js} +2 -2
- package/dist/web/assets/{chunk-JWPE2WC7-CUm26Y4N.js.map → chunk-JWPE2WC7-DmDsLF1N.js.map} +1 -1
- package/dist/web/assets/{chunk-KBJHAD2P-Db_Ma2dA.js → chunk-KBJHAD2P-C4tA-lat.js} +2 -2
- package/dist/web/assets/{chunk-KBJHAD2P-Db_Ma2dA.js.map → chunk-KBJHAD2P-C4tA-lat.js.map} +1 -1
- package/dist/web/assets/{chunk-RYQCIY6F-CxvcRvu9.js → chunk-RYQCIY6F-CWf-qdbG.js} +2 -2
- package/dist/web/assets/{chunk-RYQCIY6F-CxvcRvu9.js.map → chunk-RYQCIY6F-CWf-qdbG.js.map} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-914wTtt6.js → chunk-XXDRQBXY-C0-3Uouc.js} +2 -2
- package/dist/web/assets/{chunk-XXDRQBXY-914wTtt6.js.map → chunk-XXDRQBXY-C0-3Uouc.js.map} +1 -1
- package/dist/web/assets/classDiagram-JCYQIIEL-D0TeT53t.js +2 -0
- package/dist/web/assets/{classDiagram-JCYQIIEL-1vxBWvib.js.map → classDiagram-JCYQIIEL-D0TeT53t.js.map} +1 -1
- package/dist/web/assets/classDiagram-v2-OCEON4UE-D0TeT53t.js +2 -0
- package/dist/web/assets/{classDiagram-v2-OCEON4UE-1vxBWvib.js.map → classDiagram-v2-OCEON4UE-D0TeT53t.js.map} +1 -1
- package/dist/web/assets/{cose-bilkent-JH36ORCC-t8VumxtG.js → cose-bilkent-JH36ORCC-C8vPfGok.js} +2 -2
- package/dist/web/assets/{cose-bilkent-JH36ORCC-t8VumxtG.js.map → cose-bilkent-JH36ORCC-C8vPfGok.js.map} +1 -1
- package/dist/web/assets/{cynefin-VYW2F7L2-CZDH3BfG.js → cynefin-VYW2F7L2-Qz363tl0.js} +2 -2
- package/dist/web/assets/{cynefin-VYW2F7L2-CZDH3BfG.js.map → cynefin-VYW2F7L2-Qz363tl0.js.map} +1 -1
- package/dist/web/assets/{cynefinDiagram-MW4NZA55-CesdgGzK.js → cynefinDiagram-MW4NZA55-CCZz9fIq.js} +2 -2
- package/dist/web/assets/{cynefinDiagram-MW4NZA55-CesdgGzK.js.map → cynefinDiagram-MW4NZA55-CCZz9fIq.js.map} +1 -1
- package/dist/web/assets/{dagre-VZM6K2ZE-DCNmE9mb.js → dagre-VZM6K2ZE-TEwK45KH.js} +2 -2
- package/dist/web/assets/{dagre-VZM6K2ZE-DCNmE9mb.js.map → dagre-VZM6K2ZE-TEwK45KH.js.map} +1 -1
- package/dist/web/assets/{diagram-7IWD3JNH-BOx306BC.js → diagram-7IWD3JNH-CpCoKfEC.js} +2 -2
- package/dist/web/assets/{diagram-7IWD3JNH-BOx306BC.js.map → diagram-7IWD3JNH-CpCoKfEC.js.map} +1 -1
- package/dist/web/assets/{diagram-B4RE2ZJO-CV9ZFWWL.js → diagram-B4RE2ZJO-CJS8Rz4d.js} +2 -2
- package/dist/web/assets/{diagram-B4RE2ZJO-CV9ZFWWL.js.map → diagram-B4RE2ZJO-CJS8Rz4d.js.map} +1 -1
- package/dist/web/assets/{diagram-LBJQPF4R-bjbi1Pep.js → diagram-LBJQPF4R-Dp-7zIWd.js} +2 -2
- package/dist/web/assets/{diagram-LBJQPF4R-bjbi1Pep.js.map → diagram-LBJQPF4R-Dp-7zIWd.js.map} +1 -1
- package/dist/web/assets/{diagram-Q27KOJAE-CbRDe3Sg.js → diagram-Q27KOJAE-BeOOSo_Y.js} +2 -2
- package/dist/web/assets/{diagram-Q27KOJAE-CbRDe3Sg.js.map → diagram-Q27KOJAE-BeOOSo_Y.js.map} +1 -1
- package/dist/web/assets/{diagram-UB23O5K3-BUSN8Wb8.js → diagram-UB23O5K3-wtVvpUaS.js} +2 -2
- package/dist/web/assets/{diagram-UB23O5K3-BUSN8Wb8.js.map → diagram-UB23O5K3-wtVvpUaS.js.map} +1 -1
- package/dist/web/assets/{ebnfDiagram-BXEA7PRR-Bjagp_OX.js → ebnfDiagram-BXEA7PRR-BUZU6kcO.js} +2 -2
- package/dist/web/assets/{ebnfDiagram-BXEA7PRR-Bjagp_OX.js.map → ebnfDiagram-BXEA7PRR-BUZU6kcO.js.map} +1 -1
- package/dist/web/assets/{erDiagram-JOGREHBK-Bnj6Bfea.js → erDiagram-JOGREHBK-BeLhinfN.js} +2 -2
- package/dist/web/assets/{erDiagram-JOGREHBK-Bnj6Bfea.js.map → erDiagram-JOGREHBK-BeLhinfN.js.map} +1 -1
- package/dist/web/assets/{flowDiagram-UKHOOZJN-BH0DcCTE.js → flowDiagram-UKHOOZJN-BWAl9KvX.js} +2 -2
- package/dist/web/assets/{flowDiagram-UKHOOZJN-BH0DcCTE.js.map → flowDiagram-UKHOOZJN-BWAl9KvX.js.map} +1 -1
- package/dist/web/assets/{ganttDiagram-PKOTCBZU-Ca_J4VWY.js → ganttDiagram-PKOTCBZU-BQM681Qz.js} +2 -2
- package/dist/web/assets/{ganttDiagram-PKOTCBZU-Ca_J4VWY.js.map → ganttDiagram-PKOTCBZU-BQM681Qz.js.map} +1 -1
- package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-N0g6rh8s.js → gitGraphDiagram-DS77QQ5N-B90O3LS2.js} +2 -2
- package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-N0g6rh8s.js.map → gitGraphDiagram-DS77QQ5N-B90O3LS2.js.map} +1 -1
- package/dist/web/assets/index-C65oKF4f.js +332 -0
- package/dist/web/assets/index-C65oKF4f.js.map +1 -0
- package/dist/web/assets/{index-BeN854Pj.css → index-SAASLXJR.css} +1 -1
- package/dist/web/assets/{infoDiagram-6WML65LV-z0g90Wql.js → infoDiagram-6WML65LV-DL7wlrUp.js} +2 -2
- package/dist/web/assets/{infoDiagram-6WML65LV-z0g90Wql.js.map → infoDiagram-6WML65LV-DL7wlrUp.js.map} +1 -1
- package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-BSf65bRg.js → ishikawaDiagram-WSZJBQD7-CGJ65gLl.js} +2 -2
- package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-BSf65bRg.js.map → ishikawaDiagram-WSZJBQD7-CGJ65gLl.js.map} +1 -1
- package/dist/web/assets/{journeyDiagram-NVQOT4AX-C4bPrPEZ.js → journeyDiagram-NVQOT4AX-CWln_1Vi.js} +2 -2
- package/dist/web/assets/{journeyDiagram-NVQOT4AX-C4bPrPEZ.js.map → journeyDiagram-NVQOT4AX-CWln_1Vi.js.map} +1 -1
- package/dist/web/assets/{jsQR-udnxLlXb.js → jsQR-C-e-dPgH.js} +2 -2
- package/dist/web/assets/{jsQR-udnxLlXb.js.map → jsQR-C-e-dPgH.js.map} +1 -1
- package/dist/web/assets/{kanban-definition-27J2QSJJ-DwIk-_Kb.js → kanban-definition-27J2QSJJ-Ch_LASS_.js} +2 -2
- package/dist/web/assets/{kanban-definition-27J2QSJJ-DwIk-_Kb.js.map → kanban-definition-27J2QSJJ-Ch_LASS_.js.map} +1 -1
- package/dist/web/assets/{linear-jf0h1LD6.js → linear-DLAFoEik.js} +2 -2
- package/dist/web/assets/{linear-jf0h1LD6.js.map → linear-DLAFoEik.js.map} +1 -1
- package/dist/web/assets/{mermaid.core-I6IW-yFT.js → mermaid.core-11YjnhKz.js} +5 -5
- package/dist/web/assets/{mermaid.core-I6IW-yFT.js.map → mermaid.core-11YjnhKz.js.map} +1 -1
- package/dist/web/assets/{mindmap-definition-FAOFIHXS-DIOz61sO.js → mindmap-definition-FAOFIHXS-j-6HQbPv.js} +2 -2
- package/dist/web/assets/{mindmap-definition-FAOFIHXS-DIOz61sO.js.map → mindmap-definition-FAOFIHXS-j-6HQbPv.js.map} +1 -1
- package/dist/web/assets/{pegDiagram-VL7TDLO6-Dhund2ye.js → pegDiagram-VL7TDLO6-1XHHRMUK.js} +2 -2
- package/dist/web/assets/{pegDiagram-VL7TDLO6-Dhund2ye.js.map → pegDiagram-VL7TDLO6-1XHHRMUK.js.map} +1 -1
- package/dist/web/assets/{pieDiagram-7S7Q4E2Y-BXwlCLfp.js → pieDiagram-7S7Q4E2Y-Cu-3GzNo.js} +2 -2
- package/dist/web/assets/{pieDiagram-7S7Q4E2Y-BXwlCLfp.js.map → pieDiagram-7S7Q4E2Y-Cu-3GzNo.js.map} +1 -1
- package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-CWIG722H.js → quadrantDiagram-CIZ2JOQS-DkP9Oaqo.js} +2 -2
- package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-CWIG722H.js.map → quadrantDiagram-CIZ2JOQS-DkP9Oaqo.js.map} +1 -1
- package/dist/web/assets/{railroadDiagram-AXF67PYL-BqpzvWch.js → railroadDiagram-AXF67PYL-BFaH77uW.js} +2 -2
- package/dist/web/assets/{railroadDiagram-AXF67PYL-BqpzvWch.js.map → railroadDiagram-AXF67PYL-BFaH77uW.js.map} +1 -1
- package/dist/web/assets/{requirementDiagram-LRYGKXZP-CdQYqyY3.js → requirementDiagram-LRYGKXZP-D4D1Up4W.js} +2 -2
- package/dist/web/assets/{requirementDiagram-LRYGKXZP-CdQYqyY3.js.map → requirementDiagram-LRYGKXZP-D4D1Up4W.js.map} +1 -1
- package/dist/web/assets/{sankeyDiagram-W5VNT64P-CjygBsyf.js → sankeyDiagram-W5VNT64P-BrHCAjc9.js} +2 -2
- package/dist/web/assets/{sankeyDiagram-W5VNT64P-CjygBsyf.js.map → sankeyDiagram-W5VNT64P-BrHCAjc9.js.map} +1 -1
- package/dist/web/assets/{sequenceDiagram-SI44F4Z6-CNHyT-7s.js → sequenceDiagram-SI44F4Z6-CWxNfjdi.js} +2 -2
- package/dist/web/assets/{sequenceDiagram-SI44F4Z6-CNHyT-7s.js.map → sequenceDiagram-SI44F4Z6-CWxNfjdi.js.map} +1 -1
- package/dist/web/assets/{sizeCapture-X5ZJPWSS-CWKmVg5k.js → sizeCapture-X5ZJPWSS-ePEYSWdD.js} +2 -2
- package/dist/web/assets/{sizeCapture-X5ZJPWSS-CWKmVg5k.js.map → sizeCapture-X5ZJPWSS-ePEYSWdD.js.map} +1 -1
- package/dist/web/assets/{stateDiagram-OKZ733FA-JLEZh7rE.js → stateDiagram-OKZ733FA-BLfZi2Ah.js} +2 -2
- package/dist/web/assets/{stateDiagram-OKZ733FA-JLEZh7rE.js.map → stateDiagram-OKZ733FA-BLfZi2Ah.js.map} +1 -1
- package/dist/web/assets/stateDiagram-v2-UEYNNEHI-CtzDIhSY.js +2 -0
- package/dist/web/assets/{stateDiagram-v2-UEYNNEHI-CerzA_PO.js.map → stateDiagram-v2-UEYNNEHI-CtzDIhSY.js.map} +1 -1
- package/dist/web/assets/{swimlanes-SLNWSIFB-C1lOy4R9.js → swimlanes-SLNWSIFB-HnXWSaTr.js} +3 -3
- package/dist/web/assets/{swimlanes-SLNWSIFB-C1lOy4R9.js.map → swimlanes-SLNWSIFB-HnXWSaTr.js.map} +1 -1
- package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-DEnvqxAR.js +9 -0
- package/dist/web/assets/{swimlanesDiagram-ULZ7WXOC-Bn8fWNMY.js.map → swimlanesDiagram-ULZ7WXOC-DEnvqxAR.js.map} +1 -1
- package/dist/web/assets/{timeline-definition-Z64GVDOM-QFTjVz-z.js → timeline-definition-Z64GVDOM-D4kboPkf.js} +2 -2
- package/dist/web/assets/{timeline-definition-Z64GVDOM-QFTjVz-z.js.map → timeline-definition-Z64GVDOM-D4kboPkf.js.map} +1 -1
- package/dist/web/assets/{vennDiagram-T6HMQDX7-CeJkPnQF.js → vennDiagram-T6HMQDX7-CmUlC-yb.js} +2 -2
- package/dist/web/assets/{vennDiagram-T6HMQDX7-CeJkPnQF.js.map → vennDiagram-T6HMQDX7-CmUlC-yb.js.map} +1 -1
- package/dist/web/assets/{wardleyDiagram-T6FBY63Y-NWi7Y8OK.js → wardleyDiagram-T6FBY63Y-DoLIyOSu.js} +2 -2
- package/dist/web/assets/{wardleyDiagram-T6FBY63Y-NWi7Y8OK.js.map → wardleyDiagram-T6FBY63Y-DoLIyOSu.js.map} +1 -1
- package/dist/web/assets/{xychartDiagram-ELKLHX3M-1LhXU_ZK.js → xychartDiagram-ELKLHX3M-BII0rBQD.js} +2 -2
- package/dist/web/assets/{xychartDiagram-ELKLHX3M-1LhXU_ZK.js.map → xychartDiagram-ELKLHX3M-BII0rBQD.js.map} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/web/version.json +1 -1
- package/package.json +5 -3
- package/dist/web/assets/channel-DxwvuvRo.js +0 -2
- package/dist/web/assets/classDiagram-JCYQIIEL-1vxBWvib.js +0 -2
- package/dist/web/assets/classDiagram-v2-OCEON4UE-1vxBWvib.js +0 -2
- package/dist/web/assets/index-km-YMg5Y.js +0 -332
- package/dist/web/assets/index-km-YMg5Y.js.map +0 -1
- package/dist/web/assets/stateDiagram-v2-UEYNNEHI-CerzA_PO.js +0 -2
- package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-Bn8fWNMY.js +0 -9
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
function zE(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function Jh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bd={exports:{}},Lo={},Ud={exports:{}},ze={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Uy;function BE(){if(Uy)return ze;Uy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function y(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,b={};function E(F,X,M){this.props=F,this.context=X,this.refs=b,this.updater=M||w}E.prototype.isReactComponent={},E.prototype.setState=function(F,X){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,X,"setState")},E.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function P(){}P.prototype=E.prototype;function R(F,X,M){this.props=F,this.context=X,this.refs=b,this.updater=M||w}var _=R.prototype=new P;_.constructor=R,k(_,E.prototype),_.isPureReactComponent=!0;var j=Array.isArray,A=Object.prototype.hasOwnProperty,N={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function B(F,X,M){var oe,ue={},ae=null,me=null;if(X!=null)for(oe in X.ref!==void 0&&(me=X.ref),X.key!==void 0&&(ae=""+X.key),X)A.call(X,oe)&&!q.hasOwnProperty(oe)&&(ue[oe]=X[oe]);var ke=arguments.length-2;if(ke===1)ue.children=M;else if(1<ke){for(var xe=Array(ke),$e=0;$e<ke;$e++)xe[$e]=arguments[$e+2];ue.children=xe}if(F&&F.defaultProps)for(oe in ke=F.defaultProps,ke)ue[oe]===void 0&&(ue[oe]=ke[oe]);return{$$typeof:e,type:F,key:ae,ref:me,props:ue,_owner:N.current}}function D(F,X){return{$$typeof:e,type:F.type,key:X,ref:F.ref,props:F.props,_owner:F._owner}}function I(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function U(F){var X={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(M){return X[M]})}var z=/\/+/g;function he(F,X){return typeof F=="object"&&F!==null&&F.key!=null?U(""+F.key):X.toString(36)}function J(F,X,M,oe,ue){var ae=typeof F;(ae==="undefined"||ae==="boolean")&&(F=null);var me=!1;if(F===null)me=!0;else switch(ae){case"string":case"number":me=!0;break;case"object":switch(F.$$typeof){case e:case t:me=!0}}if(me)return me=F,ue=ue(me),F=oe===""?"."+he(me,0):oe,j(ue)?(M="",F!=null&&(M=F.replace(z,"$&/")+"/"),J(ue,X,M,"",function($e){return $e})):ue!=null&&(I(ue)&&(ue=D(ue,M+(!ue.key||me&&me.key===ue.key?"":(""+ue.key).replace(z,"$&/")+"/")+F)),X.push(ue)),1;if(me=0,oe=oe===""?".":oe+":",j(F))for(var ke=0;ke<F.length;ke++){ae=F[ke];var xe=oe+he(ae,ke);me+=J(ae,X,M,xe,ue)}else if(xe=y(F),typeof xe=="function")for(F=xe.call(F),ke=0;!(ae=F.next()).done;)ae=ae.value,xe=oe+he(ae,ke++),me+=J(ae,X,M,xe,ue);else if(ae==="object")throw X=String(F),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return me}function Z(F,X,M){if(F==null)return F;var oe=[],ue=0;return J(F,oe,"","",function(ae){return X.call(M,ae,ue++)}),oe}function ve(F){if(F._status===-1){var X=F._result;X=X(),X.then(function(M){(F._status===0||F._status===-1)&&(F._status=1,F._result=M)},function(M){(F._status===0||F._status===-1)&&(F._status=2,F._result=M)}),F._status===-1&&(F._status=0,F._result=X)}if(F._status===1)return F._result.default;throw F._result}var Se={current:null},Q={transition:null},pe={ReactCurrentDispatcher:Se,ReactCurrentBatchConfig:Q,ReactCurrentOwner:N};function T(){throw Error("act(...) is not supported in production builds of React.")}return ze.Children={map:Z,forEach:function(F,X,M){Z(F,function(){X.apply(this,arguments)},M)},count:function(F){var X=0;return Z(F,function(){X++}),X},toArray:function(F){return Z(F,function(X){return X})||[]},only:function(F){if(!I(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},ze.Component=E,ze.Fragment=n,ze.Profiler=s,ze.PureComponent=R,ze.StrictMode=r,ze.Suspense=d,ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pe,ze.act=T,ze.cloneElement=function(F,X,M){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var oe=k({},F.props),ue=F.key,ae=F.ref,me=F._owner;if(X!=null){if(X.ref!==void 0&&(ae=X.ref,me=N.current),X.key!==void 0&&(ue=""+X.key),F.type&&F.type.defaultProps)var ke=F.type.defaultProps;for(xe in X)A.call(X,xe)&&!q.hasOwnProperty(xe)&&(oe[xe]=X[xe]===void 0&&ke!==void 0?ke[xe]:X[xe])}var xe=arguments.length-2;if(xe===1)oe.children=M;else if(1<xe){ke=Array(xe);for(var $e=0;$e<xe;$e++)ke[$e]=arguments[$e+2];oe.children=ke}return{$$typeof:e,type:F.type,key:ue,ref:ae,props:oe,_owner:me}},ze.createContext=function(F){return F={$$typeof:l,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:a,_context:F},F.Consumer=F},ze.createElement=B,ze.createFactory=function(F){var X=B.bind(null,F);return X.type=F,X},ze.createRef=function(){return{current:null}},ze.forwardRef=function(F){return{$$typeof:c,render:F}},ze.isValidElement=I,ze.lazy=function(F){return{$$typeof:m,_payload:{_status:-1,_result:F},_init:ve}},ze.memo=function(F,X){return{$$typeof:f,type:F,compare:X===void 0?null:X}},ze.startTransition=function(F){var X=Q.transition;Q.transition={};try{F()}finally{Q.transition=X}},ze.unstable_act=T,ze.useCallback=function(F,X){return Se.current.useCallback(F,X)},ze.useContext=function(F){return Se.current.useContext(F)},ze.useDebugValue=function(){},ze.useDeferredValue=function(F){return Se.current.useDeferredValue(F)},ze.useEffect=function(F,X){return Se.current.useEffect(F,X)},ze.useId=function(){return Se.current.useId()},ze.useImperativeHandle=function(F,X,M){return Se.current.useImperativeHandle(F,X,M)},ze.useInsertionEffect=function(F,X){return Se.current.useInsertionEffect(F,X)},ze.useLayoutEffect=function(F,X){return Se.current.useLayoutEffect(F,X)},ze.useMemo=function(F,X){return Se.current.useMemo(F,X)},ze.useReducer=function(F,X,M){return Se.current.useReducer(F,X,M)},ze.useRef=function(F){return Se.current.useRef(F)},ze.useState=function(F){return Se.current.useState(F)},ze.useSyncExternalStore=function(F,X,M){return Se.current.useSyncExternalStore(F,X,M)},ze.useTransition=function(){return Se.current.useTransition()},ze.version="18.3.1",ze}var $y;function Zh(){return $y||($y=1,Ud.exports=BE()),Ud.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Hy;function UE(){if(Hy)return Lo;Hy=1;var e=Zh(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,f){var m,p={},y=null,w=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(w=d.ref);for(m in d)r.call(d,m)&&!a.hasOwnProperty(m)&&(p[m]=d[m]);if(c&&c.defaultProps)for(m in d=c.defaultProps,d)p[m]===void 0&&(p[m]=d[m]);return{$$typeof:t,type:c,key:y,ref:w,props:p,_owner:s.current}}return Lo.Fragment=n,Lo.jsx=l,Lo.jsxs=l,Lo}var Wy;function $E(){return Wy||(Wy=1,Bd.exports=UE()),Bd.exports}var v=$E(),jl={},$d={exports:{}},gn={},Hd={exports:{}},Wd={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var qy;function HE(){return qy||(qy=1,function(e){function t(Q,pe){var T=Q.length;Q.push(pe);e:for(;0<T;){var F=T-1>>>1,X=Q[F];if(0<s(X,pe))Q[F]=pe,Q[T]=X,T=F;else break e}}function n(Q){return Q.length===0?null:Q[0]}function r(Q){if(Q.length===0)return null;var pe=Q[0],T=Q.pop();if(T!==pe){Q[0]=T;e:for(var F=0,X=Q.length,M=X>>>1;F<M;){var oe=2*(F+1)-1,ue=Q[oe],ae=oe+1,me=Q[ae];if(0>s(ue,T))ae<X&&0>s(me,ue)?(Q[F]=me,Q[ae]=T,F=ae):(Q[F]=ue,Q[oe]=T,F=oe);else if(ae<X&&0>s(me,T))Q[F]=me,Q[ae]=T,F=ae;else break e}}return pe}function s(Q,pe){var T=Q.sortIndex-pe.sortIndex;return T!==0?T:Q.id-pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],m=1,p=null,y=3,w=!1,k=!1,b=!1,E=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(Q){for(var pe=n(f);pe!==null;){if(pe.callback===null)r(f);else if(pe.startTime<=Q)r(f),pe.sortIndex=pe.expirationTime,t(d,pe);else break;pe=n(f)}}function j(Q){if(b=!1,_(Q),!k)if(n(d)!==null)k=!0,ve(A);else{var pe=n(f);pe!==null&&Se(j,pe.startTime-Q)}}function A(Q,pe){k=!1,b&&(b=!1,P(B),B=-1),w=!0;var T=y;try{for(_(pe),p=n(d);p!==null&&(!(p.expirationTime>pe)||Q&&!U());){var F=p.callback;if(typeof F=="function"){p.callback=null,y=p.priorityLevel;var X=F(p.expirationTime<=pe);pe=e.unstable_now(),typeof X=="function"?p.callback=X:p===n(d)&&r(d),_(pe)}else r(d);p=n(d)}if(p!==null)var M=!0;else{var oe=n(f);oe!==null&&Se(j,oe.startTime-pe),M=!1}return M}finally{p=null,y=T,w=!1}}var N=!1,q=null,B=-1,D=5,I=-1;function U(){return!(e.unstable_now()-I<D)}function z(){if(q!==null){var Q=e.unstable_now();I=Q;var pe=!0;try{pe=q(!0,Q)}finally{pe?he():(N=!1,q=null)}}else N=!1}var he;if(typeof R=="function")he=function(){R(z)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,Z=J.port2;J.port1.onmessage=z,he=function(){Z.postMessage(null)}}else he=function(){E(z,0)};function ve(Q){q=Q,N||(N=!0,he())}function Se(Q,pe){B=E(function(){Q(e.unstable_now())},pe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Q){Q.callback=null},e.unstable_continueExecution=function(){k||w||(k=!0,ve(A))},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(Q){switch(y){case 1:case 2:case 3:var pe=3;break;default:pe=y}var T=y;y=pe;try{return Q()}finally{y=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,pe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var T=y;y=Q;try{return pe()}finally{y=T}},e.unstable_scheduleCallback=function(Q,pe,T){var F=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?F+T:F):T=F,Q){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=T+X,Q={id:m++,callback:pe,priorityLevel:Q,startTime:T,expirationTime:X,sortIndex:-1},T>F?(Q.sortIndex=T,t(f,Q),n(d)===null&&Q===n(f)&&(b?(P(B),B=-1):b=!0,Se(j,T-F))):(Q.sortIndex=X,t(d,Q),k||w||(k=!0,ve(A))),Q},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(Q){var pe=y;return function(){var T=y;y=pe;try{return Q.apply(this,arguments)}finally{y=T}}}}(Wd)),Wd}var Gy;function WE(){return Gy||(Gy=1,Hd.exports=HE()),Hd.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Ky;function qE(){if(Ky)return gn;Ky=1;var e=Zh(),t=WE();function n(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,u=1;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(i,o){l(i,o),l(i+"Capture",o)}function l(i,o){for(s[i]=o,i=0;i<o.length;i++)r.add(o[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},p={};function y(i){return d.call(p,i)?!0:d.call(m,i)?!1:f.test(i)?p[i]=!0:(m[i]=!0,!1)}function w(i,o,u,h){if(u!==null&&u.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function k(i,o,u,h){if(o===null||typeof o>"u"||w(i,o,u,h))return!0;if(h)return!1;if(u!==null)switch(u.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function b(i,o,u,h,g,x,C){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=h,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=i,this.type=o,this.sanitizeURL=x,this.removeEmptyString=C}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){E[i]=new b(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];E[o]=new b(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){E[i]=new b(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){E[i]=new b(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){E[i]=new b(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){E[i]=new b(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){E[i]=new b(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){E[i]=new b(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){E[i]=new b(i,5,!1,i.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function R(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(P,R);E[o]=new b(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(P,R);E[o]=new b(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(P,R);E[o]=new b(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){E[i]=new b(i,1,!1,i.toLowerCase(),null,!1,!1)}),E.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){E[i]=new b(i,1,!1,i.toLowerCase(),null,!0,!0)});function _(i,o,u,h){var g=E.hasOwnProperty(o)?E[o]:null;(g!==null?g.type!==0:h||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(k(o,u,g,h)&&(u=null),h||g===null?y(o)&&(u===null?i.removeAttribute(o):i.setAttribute(o,""+u)):g.mustUseProperty?i[g.propertyName]=u===null?g.type===3?!1:"":u:(o=g.attributeName,h=g.attributeNamespace,u===null?i.removeAttribute(o):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,h?i.setAttributeNS(h,o,u):i.setAttribute(o,u))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),N=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),U=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),ve=Symbol.for("react.lazy"),Se=Symbol.for("react.offscreen"),Q=Symbol.iterator;function pe(i){return i===null||typeof i!="object"?null:(i=Q&&i[Q]||i["@@iterator"],typeof i=="function"?i:null)}var T=Object.assign,F;function X(i){if(F===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);F=o&&o[1]||""}return`
|
|
34
|
+
`+F+i}var M=!1;function oe(i,o){if(!i||M)return"";M=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(G){var h=G}Reflect.construct(i,[],o)}else{try{o.call()}catch(G){h=G}i.call(o.prototype)}else{try{throw Error()}catch(G){h=G}i()}}catch(G){if(G&&h&&typeof G.stack=="string"){for(var g=G.stack.split(`
|
|
35
|
+
`),x=h.stack.split(`
|
|
36
|
+
`),C=g.length-1,L=x.length-1;1<=C&&0<=L&&g[C]!==x[L];)L--;for(;1<=C&&0<=L;C--,L--)if(g[C]!==x[L]){if(C!==1||L!==1)do if(C--,L--,0>L||g[C]!==x[L]){var O=`
|
|
37
|
+
`+g[C].replace(" at new "," at ");return i.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",i.displayName)),O}while(1<=C&&0<=L);break}}}finally{M=!1,Error.prepareStackTrace=u}return(i=i?i.displayName||i.name:"")?X(i):""}function ue(i){switch(i.tag){case 5:return X(i.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return i=oe(i.type,!1),i;case 11:return i=oe(i.type.render,!1),i;case 1:return i=oe(i.type,!0),i;default:return""}}function ae(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case q:return"Fragment";case N:return"Portal";case D:return"Profiler";case B:return"StrictMode";case he:return"Suspense";case J:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case U:return(i.displayName||"Context")+".Consumer";case I:return(i._context.displayName||"Context")+".Provider";case z:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Z:return o=i.displayName||null,o!==null?o:ae(i.type)||"Memo";case ve:o=i._payload,i=i._init;try{return ae(i(o))}catch{}}return null}function me(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(o);case 8:return o===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function ke(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function xe(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function $e(i){var o=xe(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),h=""+i[o];if(!i.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,x=u.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return g.call(this)},set:function(C){h=""+C,x.call(this,C)}}),Object.defineProperty(i,o,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(C){h=""+C},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Fe(i){i._valueTracker||(i._valueTracker=$e(i))}function qe(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var u=o.getValue(),h="";return i&&(h=xe(i)?i.checked?"true":"false":i.value),i=h,i!==u?(o.setValue(i),!0):!1}function st(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ot(i,o){var u=o.checked;return T({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??i._wrapperState.initialChecked})}function Vt(i,o){var u=o.defaultValue==null?"":o.defaultValue,h=o.checked!=null?o.checked:o.defaultChecked;u=ke(o.value!=null?o.value:u),i._wrapperState={initialChecked:h,initialValue:u,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function en(i,o){o=o.checked,o!=null&&_(i,"checked",o,!1)}function et(i,o){en(i,o);var u=ke(o.value),h=o.type;if(u!=null)h==="number"?(u===0&&i.value===""||i.value!=u)&&(i.value=""+u):i.value!==""+u&&(i.value=""+u);else if(h==="submit"||h==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?Tn(i,o.type,u):o.hasOwnProperty("defaultValue")&&Tn(i,o.type,ke(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function Wt(i,o,u){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var h=o.type;if(!(h!=="submit"&&h!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,u||o===i.value||(i.value=o),i.defaultValue=o}u=i.name,u!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,u!==""&&(i.name=u)}function Tn(i,o,u){(o!=="number"||st(i.ownerDocument)!==i)&&(u==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+u&&(i.defaultValue=""+u))}var zt=Array.isArray;function tn(i,o,u,h){if(i=i.options,o){o={};for(var g=0;g<u.length;g++)o["$"+u[g]]=!0;for(u=0;u<i.length;u++)g=o.hasOwnProperty("$"+i[u].value),i[u].selected!==g&&(i[u].selected=g),g&&h&&(i[u].defaultSelected=!0)}else{for(u=""+ke(u),o=null,g=0;g<i.length;g++){if(i[g].value===u){i[g].selected=!0,h&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function bt(i,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return T({},o,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function tr(i,o){var u=o.value;if(u==null){if(u=o.children,o=o.defaultValue,u!=null){if(o!=null)throw Error(n(92));if(zt(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}i._wrapperState={initialValue:ke(u)}}function He(i,o){var u=ke(o.value),h=ke(o.defaultValue);u!=null&&(u=""+u,u!==i.value&&(i.value=u),o.defaultValue==null&&i.defaultValue!==u&&(i.defaultValue=u)),h!=null&&(i.defaultValue=""+h)}function Lr(i){var o=i.textContent;o===i._wrapperState.initialValue&&o!==""&&o!==null&&(i.value=o)}function Y(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ee(i,o){return i==null||i==="http://www.w3.org/1999/xhtml"?Y(o):i==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Te,Ae=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,u,h,g){MSApp.execUnsafeLocalFunction(function(){return i(o,u,h,g)})}:i}(function(i,o){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=o;else{for(Te=Te||document.createElement("div"),Te.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Te.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function Ve(i,o){if(o){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=o;return}}i.textContent=o}var at={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Nt=["Webkit","ms","Moz","O"];Object.keys(at).forEach(function(i){Nt.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),at[o]=at[i]})});function H(i,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||at.hasOwnProperty(i)&&at[i]?(""+o).trim():o+"px"}function ge(i,o){i=i.style;for(var u in o)if(o.hasOwnProperty(u)){var h=u.indexOf("--")===0,g=H(u,o[u],h);u==="float"&&(u="cssFloat"),h?i.setProperty(u,g):i[u]=g}}var ie=T({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(i,o){if(o){if(ie[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function Le(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fe=null;function Ge(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var wt=null,dt=null,Je=null;function yt(i){if(i=xo(i)){if(typeof wt!="function")throw Error(n(280));var o=i.stateNode;o&&(o=Ya(o),wt(i.stateNode,i.type,o))}}function ht(i){dt?Je?Je.push(i):Je=[i]:dt=i}function qt(){if(dt){var i=dt,o=Je;if(Je=dt=null,yt(i),o)for(i=0;i<o.length;i++)yt(o[i])}}function Tt(i,o){return i(o)}function Ta(){}var Yi=!1;function mi(i,o,u){if(Yi)return i(o,u);Yi=!0;try{return Tt(i,o,u)}finally{Yi=!1,(dt!==null||Je!==null)&&(Ta(),qt())}}function jr(i,o){var u=i.stateNode;if(u===null)return null;var h=Ya(u);if(h===null)return null;u=h[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(n(231,o,typeof u));return u}var Qi=!1;if(c)try{var xn={};Object.defineProperty(xn,"passive",{get:function(){Qi=!0}}),window.addEventListener("test",xn,xn),window.removeEventListener("test",xn,xn)}catch{Qi=!1}function Ra(i,o,u,h,g,x,C,L,O){var G=Array.prototype.slice.call(arguments,3);try{o.apply(u,G)}catch(re){this.onError(re)}}var nr=!1,Lt=null,Dr=!1,vr=null,Aa={onError:function(i){nr=!0,Lt=i}};function ac(i,o,u,h,g,x,C,L,O){nr=!1,Lt=null,Ra.apply(Aa,arguments)}function Js(i,o,u,h,g,x,C,L,O){if(ac.apply(this,arguments),nr){if(nr){var G=Lt;nr=!1,Lt=null}else throw Error(n(198));Dr||(Dr=!0,vr=G)}}function xr(i){var o=i,u=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(u=o.return),i=o.return;while(i)}return o.tag===3?u:null}function Ji(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function Zs(i){if(xr(i)!==i)throw Error(n(188))}function K(i){var o=i.alternate;if(!o){if(o=xr(i),o===null)throw Error(n(188));return o!==i?null:i}for(var u=i,h=o;;){var g=u.return;if(g===null)break;var x=g.alternate;if(x===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===u)return Zs(g),i;if(x===h)return Zs(g),o;x=x.sibling}throw Error(n(188))}if(u.return!==h.return)u=g,h=x;else{for(var C=!1,L=g.child;L;){if(L===u){C=!0,u=g,h=x;break}if(L===h){C=!0,h=g,u=x;break}L=L.sibling}if(!C){for(L=x.child;L;){if(L===u){C=!0,u=x,h=g;break}if(L===h){C=!0,h=x,u=g;break}L=L.sibling}if(!C)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?i:o}function ne(i){return i=K(i),i!==null?ce(i):null}function ce(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var o=ce(i);if(o!==null)return o;i=i.sibling}return null}var Oe=t.unstable_scheduleCallback,pt=t.unstable_cancelCallback,Rt=t.unstable_shouldYield,Rn=t.unstable_requestPaint,Qe=t.unstable_now,Gt=t.unstable_getCurrentPriorityLevel,cn=t.unstable_ImmediatePriority,St=t.unstable_UserBlockingPriority,Bn=t.unstable_NormalPriority,eb=t.unstable_LowPriority,vm=t.unstable_IdlePriority,Ia=null,rr=null;function tb(i){if(rr&&typeof rr.onCommitFiberRoot=="function")try{rr.onCommitFiberRoot(Ia,i,void 0,(i.current.flags&128)===128)}catch{}}var Un=Math.clz32?Math.clz32:ib,nb=Math.log,rb=Math.LN2;function ib(i){return i>>>=0,i===0?32:31-(nb(i)/rb|0)|0}var Ma=64,Na=4194304;function eo(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function La(i,o){var u=i.pendingLanes;if(u===0)return 0;var h=0,g=i.suspendedLanes,x=i.pingedLanes,C=u&268435455;if(C!==0){var L=C&~g;L!==0?h=eo(L):(x&=C,x!==0&&(h=eo(x)))}else C=u&~g,C!==0?h=eo(C):x!==0&&(h=eo(x));if(h===0)return 0;if(o!==0&&o!==h&&(o&g)===0&&(g=h&-h,x=o&-o,g>=x||g===16&&(x&4194240)!==0))return o;if((h&4)!==0&&(h|=u&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=h;0<o;)u=31-Un(o),g=1<<u,h|=i[u],o&=~g;return h}function sb(i,o){switch(i){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ob(i,o){for(var u=i.suspendedLanes,h=i.pingedLanes,g=i.expirationTimes,x=i.pendingLanes;0<x;){var C=31-Un(x),L=1<<C,O=g[C];O===-1?((L&u)===0||(L&h)!==0)&&(g[C]=sb(L,o)):O<=o&&(i.expiredLanes|=L),x&=~L}}function lc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function xm(){var i=Ma;return Ma<<=1,(Ma&4194240)===0&&(Ma=64),i}function uc(i){for(var o=[],u=0;31>u;u++)o.push(i);return o}function to(i,o,u){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-Un(o),i[o]=u}function ab(i,o){var u=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var h=i.eventTimes;for(i=i.expirationTimes;0<u;){var g=31-Un(u),x=1<<g;o[g]=0,h[g]=-1,i[g]=-1,u&=~x}}function cc(i,o){var u=i.entangledLanes|=o;for(i=i.entanglements;u;){var h=31-Un(u),g=1<<h;g&o|i[h]&o&&(i[h]|=o),u&=~g}}var Ze=0;function wm(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Sm,dc,km,Cm,bm,fc=!1,ja=[],Or=null,Fr=null,Vr=null,no=new Map,ro=new Map,zr=[],lb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Em(i,o){switch(i){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":no.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(o.pointerId)}}function io(i,o,u,h,g,x){return i===null||i.nativeEvent!==x?(i={blockedOn:o,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[g]},o!==null&&(o=xo(o),o!==null&&dc(o)),i):(i.eventSystemFlags|=h,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function ub(i,o,u,h,g){switch(o){case"focusin":return Or=io(Or,i,o,u,h,g),!0;case"dragenter":return Fr=io(Fr,i,o,u,h,g),!0;case"mouseover":return Vr=io(Vr,i,o,u,h,g),!0;case"pointerover":var x=g.pointerId;return no.set(x,io(no.get(x)||null,i,o,u,h,g)),!0;case"gotpointercapture":return x=g.pointerId,ro.set(x,io(ro.get(x)||null,i,o,u,h,g)),!0}return!1}function _m(i){var o=gi(i.target);if(o!==null){var u=xr(o);if(u!==null){if(o=u.tag,o===13){if(o=Ji(u),o!==null){i.blockedOn=o,bm(i.priority,function(){km(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Da(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var u=pc(i.domEventName,i.eventSystemFlags,o[0],i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);fe=h,u.target.dispatchEvent(h),fe=null}else return o=xo(u),o!==null&&dc(o),i.blockedOn=u,!1;o.shift()}return!0}function Pm(i,o,u){Da(i)&&u.delete(o)}function cb(){fc=!1,Or!==null&&Da(Or)&&(Or=null),Fr!==null&&Da(Fr)&&(Fr=null),Vr!==null&&Da(Vr)&&(Vr=null),no.forEach(Pm),ro.forEach(Pm)}function so(i,o){i.blockedOn===o&&(i.blockedOn=null,fc||(fc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,cb)))}function oo(i){function o(g){return so(g,i)}if(0<ja.length){so(ja[0],i);for(var u=1;u<ja.length;u++){var h=ja[u];h.blockedOn===i&&(h.blockedOn=null)}}for(Or!==null&&so(Or,i),Fr!==null&&so(Fr,i),Vr!==null&&so(Vr,i),no.forEach(o),ro.forEach(o),u=0;u<zr.length;u++)h=zr[u],h.blockedOn===i&&(h.blockedOn=null);for(;0<zr.length&&(u=zr[0],u.blockedOn===null);)_m(u),u.blockedOn===null&&zr.shift()}var Zi=j.ReactCurrentBatchConfig,Oa=!0;function db(i,o,u,h){var g=Ze,x=Zi.transition;Zi.transition=null;try{Ze=1,hc(i,o,u,h)}finally{Ze=g,Zi.transition=x}}function fb(i,o,u,h){var g=Ze,x=Zi.transition;Zi.transition=null;try{Ze=4,hc(i,o,u,h)}finally{Ze=g,Zi.transition=x}}function hc(i,o,u,h){if(Oa){var g=pc(i,o,u,h);if(g===null)Ic(i,o,h,Fa,u),Em(i,h);else if(ub(g,i,o,u,h))h.stopPropagation();else if(Em(i,h),o&4&&-1<lb.indexOf(i)){for(;g!==null;){var x=xo(g);if(x!==null&&Sm(x),x=pc(i,o,u,h),x===null&&Ic(i,o,h,Fa,u),x===g)break;g=x}g!==null&&h.stopPropagation()}else Ic(i,o,h,null,u)}}var Fa=null;function pc(i,o,u,h){if(Fa=null,i=Ge(h),i=gi(i),i!==null)if(o=xr(i),o===null)i=null;else if(u=o.tag,u===13){if(i=Ji(o),i!==null)return i;i=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null);return Fa=i,null}function Tm(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Gt()){case cn:return 1;case St:return 4;case Bn:case eb:return 16;case vm:return 536870912;default:return 16}default:return 16}}var Br=null,mc=null,Va=null;function Rm(){if(Va)return Va;var i,o=mc,u=o.length,h,g="value"in Br?Br.value:Br.textContent,x=g.length;for(i=0;i<u&&o[i]===g[i];i++);var C=u-i;for(h=1;h<=C&&o[u-h]===g[x-h];h++);return Va=g.slice(i,1<h?1-h:void 0)}function za(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Ba(){return!0}function Am(){return!1}function wn(i){function o(u,h,g,x,C){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=x,this.target=C,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(u=i[L],this[L]=u?u(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ba:Am,this.isPropagationStopped=Am,this}return T(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ba)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),o}var es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gc=wn(es),ao=T({},es,{view:0,detail:0}),hb=wn(ao),yc,vc,lo,Ua=T({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==lo&&(lo&&i.type==="mousemove"?(yc=i.screenX-lo.screenX,vc=i.screenY-lo.screenY):vc=yc=0,lo=i),yc)},movementY:function(i){return"movementY"in i?i.movementY:vc}}),Im=wn(Ua),pb=T({},Ua,{dataTransfer:0}),mb=wn(pb),gb=T({},ao,{relatedTarget:0}),xc=wn(gb),yb=T({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),vb=wn(yb),xb=T({},es,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),wb=wn(xb),Sb=T({},es,{data:0}),Mm=wn(Sb),kb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cb={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Eb(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=bb[i])?!!o[i]:!1}function wc(){return Eb}var _b=T({},ao,{key:function(i){if(i.key){var o=kb[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=za(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Cb[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wc,charCode:function(i){return i.type==="keypress"?za(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?za(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Pb=wn(_b),Tb=T({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nm=wn(Tb),Rb=T({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wc}),Ab=wn(Rb),Ib=T({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mb=wn(Ib),Nb=T({},Ua,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Lb=wn(Nb),jb=[9,13,27,32],Sc=c&&"CompositionEvent"in window,uo=null;c&&"documentMode"in document&&(uo=document.documentMode);var Db=c&&"TextEvent"in window&&!uo,Lm=c&&(!Sc||uo&&8<uo&&11>=uo),jm=" ",Dm=!1;function Om(i,o){switch(i){case"keyup":return jb.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fm(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ts=!1;function Ob(i,o){switch(i){case"compositionend":return Fm(o);case"keypress":return o.which!==32?null:(Dm=!0,jm);case"textInput":return i=o.data,i===jm&&Dm?null:i;default:return null}}function Fb(i,o){if(ts)return i==="compositionend"||!Sc&&Om(i,o)?(i=Rm(),Va=mc=Br=null,ts=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Lm&&o.locale!=="ko"?null:o.data;default:return null}}var Vb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vm(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Vb[i.type]:o==="textarea"}function zm(i,o,u,h){ht(h),o=Ga(o,"onChange"),0<o.length&&(u=new gc("onChange","change",null,u,h),i.push({event:u,listeners:o}))}var co=null,fo=null;function zb(i){ig(i,0)}function $a(i){var o=os(i);if(qe(o))return i}function Bb(i,o){if(i==="change")return o}var Bm=!1;if(c){var kc;if(c){var Cc="oninput"in document;if(!Cc){var Um=document.createElement("div");Um.setAttribute("oninput","return;"),Cc=typeof Um.oninput=="function"}kc=Cc}else kc=!1;Bm=kc&&(!document.documentMode||9<document.documentMode)}function $m(){co&&(co.detachEvent("onpropertychange",Hm),fo=co=null)}function Hm(i){if(i.propertyName==="value"&&$a(fo)){var o=[];zm(o,fo,i,Ge(i)),mi(zb,o)}}function Ub(i,o,u){i==="focusin"?($m(),co=o,fo=u,co.attachEvent("onpropertychange",Hm)):i==="focusout"&&$m()}function $b(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return $a(fo)}function Hb(i,o){if(i==="click")return $a(o)}function Wb(i,o){if(i==="input"||i==="change")return $a(o)}function qb(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var $n=typeof Object.is=="function"?Object.is:qb;function ho(i,o){if($n(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var u=Object.keys(i),h=Object.keys(o);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!d.call(o,g)||!$n(i[g],o[g]))return!1}return!0}function Wm(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function qm(i,o){var u=Wm(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=o&&h>=o)return{node:u,offset:o-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Wm(u)}}function Gm(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Gm(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Km(){for(var i=window,o=st();o instanceof i.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)i=o.contentWindow;else break;o=st(i.document)}return o}function bc(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function Gb(i){var o=Km(),u=i.focusedElem,h=i.selectionRange;if(o!==u&&u&&u.ownerDocument&&Gm(u.ownerDocument.documentElement,u)){if(h!==null&&bc(u)){if(o=h.start,i=h.end,i===void 0&&(i=o),"selectionStart"in u)u.selectionStart=o,u.selectionEnd=Math.min(i,u.value.length);else if(i=(o=u.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var g=u.textContent.length,x=Math.min(h.start,g);h=h.end===void 0?x:Math.min(h.end,g),!i.extend&&x>h&&(g=h,h=x,x=g),g=qm(u,x);var C=qm(u,h);g&&C&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==C.node||i.focusOffset!==C.offset)&&(o=o.createRange(),o.setStart(g.node,g.offset),i.removeAllRanges(),x>h?(i.addRange(o),i.extend(C.node,C.offset)):(o.setEnd(C.node,C.offset),i.addRange(o)))}}for(o=[],i=u;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<o.length;u++)i=o[u],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var Kb=c&&"documentMode"in document&&11>=document.documentMode,ns=null,Ec=null,po=null,_c=!1;function Xm(i,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;_c||ns==null||ns!==st(h)||(h=ns,"selectionStart"in h&&bc(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),po&&ho(po,h)||(po=h,h=Ga(Ec,"onSelect"),0<h.length&&(o=new gc("onSelect","select",null,o,u),i.push({event:o,listeners:h}),o.target=ns)))}function Ha(i,o){var u={};return u[i.toLowerCase()]=o.toLowerCase(),u["Webkit"+i]="webkit"+o,u["Moz"+i]="moz"+o,u}var rs={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionend:Ha("Transition","TransitionEnd")},Pc={},Ym={};c&&(Ym=document.createElement("div").style,"AnimationEvent"in window||(delete rs.animationend.animation,delete rs.animationiteration.animation,delete rs.animationstart.animation),"TransitionEvent"in window||delete rs.transitionend.transition);function Wa(i){if(Pc[i])return Pc[i];if(!rs[i])return i;var o=rs[i],u;for(u in o)if(o.hasOwnProperty(u)&&u in Ym)return Pc[i]=o[u];return i}var Qm=Wa("animationend"),Jm=Wa("animationiteration"),Zm=Wa("animationstart"),eg=Wa("transitionend"),tg=new Map,ng="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ur(i,o){tg.set(i,o),a(o,[i])}for(var Tc=0;Tc<ng.length;Tc++){var Rc=ng[Tc],Xb=Rc.toLowerCase(),Yb=Rc[0].toUpperCase()+Rc.slice(1);Ur(Xb,"on"+Yb)}Ur(Qm,"onAnimationEnd"),Ur(Jm,"onAnimationIteration"),Ur(Zm,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(eg,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Qb=new Set("cancel close invalid load scroll toggle".split(" ").concat(mo));function rg(i,o,u){var h=i.type||"unknown-event";i.currentTarget=u,Js(h,o,void 0,i),i.currentTarget=null}function ig(i,o){o=(o&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],g=h.event;h=h.listeners;e:{var x=void 0;if(o)for(var C=h.length-1;0<=C;C--){var L=h[C],O=L.instance,G=L.currentTarget;if(L=L.listener,O!==x&&g.isPropagationStopped())break e;rg(g,L,G),x=O}else for(C=0;C<h.length;C++){if(L=h[C],O=L.instance,G=L.currentTarget,L=L.listener,O!==x&&g.isPropagationStopped())break e;rg(g,L,G),x=O}}}if(Dr)throw i=vr,Dr=!1,vr=null,i}function ut(i,o){var u=o[Oc];u===void 0&&(u=o[Oc]=new Set);var h=i+"__bubble";u.has(h)||(sg(o,i,2,!1),u.add(h))}function Ac(i,o,u){var h=0;o&&(h|=4),sg(u,i,h,o)}var qa="_reactListening"+Math.random().toString(36).slice(2);function go(i){if(!i[qa]){i[qa]=!0,r.forEach(function(u){u!=="selectionchange"&&(Qb.has(u)||Ac(u,!1,i),Ac(u,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[qa]||(o[qa]=!0,Ac("selectionchange",!1,o))}}function sg(i,o,u,h){switch(Tm(o)){case 1:var g=db;break;case 4:g=fb;break;default:g=hc}u=g.bind(null,o,u,i),g=void 0,!Qi||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),h?g!==void 0?i.addEventListener(o,u,{capture:!0,passive:g}):i.addEventListener(o,u,!0):g!==void 0?i.addEventListener(o,u,{passive:g}):i.addEventListener(o,u,!1)}function Ic(i,o,u,h,g){var x=h;if((o&1)===0&&(o&2)===0&&h!==null)e:for(;;){if(h===null)return;var C=h.tag;if(C===3||C===4){var L=h.stateNode.containerInfo;if(L===g||L.nodeType===8&&L.parentNode===g)break;if(C===4)for(C=h.return;C!==null;){var O=C.tag;if((O===3||O===4)&&(O=C.stateNode.containerInfo,O===g||O.nodeType===8&&O.parentNode===g))return;C=C.return}for(;L!==null;){if(C=gi(L),C===null)return;if(O=C.tag,O===5||O===6){h=x=C;continue e}L=L.parentNode}}h=h.return}mi(function(){var G=x,re=Ge(u),se=[];e:{var te=tg.get(i);if(te!==void 0){var we=gc,Ee=i;switch(i){case"keypress":if(za(u)===0)break e;case"keydown":case"keyup":we=Pb;break;case"focusin":Ee="focus",we=xc;break;case"focusout":Ee="blur",we=xc;break;case"beforeblur":case"afterblur":we=xc;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=Im;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=mb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=Ab;break;case Qm:case Jm:case Zm:we=vb;break;case eg:we=Mb;break;case"scroll":we=hb;break;case"wheel":we=Lb;break;case"copy":case"cut":case"paste":we=wb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=Nm}var Pe=(o&4)!==0,kt=!Pe&&i==="scroll",$=Pe?te!==null?te+"Capture":null:te;Pe=[];for(var V=G,W;V!==null;){W=V;var de=W.stateNode;if(W.tag===5&&de!==null&&(W=de,$!==null&&(de=jr(V,$),de!=null&&Pe.push(yo(V,de,W)))),kt)break;V=V.return}0<Pe.length&&(te=new we(te,Ee,null,u,re),se.push({event:te,listeners:Pe}))}}if((o&7)===0){e:{if(te=i==="mouseover"||i==="pointerover",we=i==="mouseout"||i==="pointerout",te&&u!==fe&&(Ee=u.relatedTarget||u.fromElement)&&(gi(Ee)||Ee[wr]))break e;if((we||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,we?(Ee=u.relatedTarget||u.toElement,we=G,Ee=Ee?gi(Ee):null,Ee!==null&&(kt=xr(Ee),Ee!==kt||Ee.tag!==5&&Ee.tag!==6)&&(Ee=null)):(we=null,Ee=G),we!==Ee)){if(Pe=Im,de="onMouseLeave",$="onMouseEnter",V="mouse",(i==="pointerout"||i==="pointerover")&&(Pe=Nm,de="onPointerLeave",$="onPointerEnter",V="pointer"),kt=we==null?te:os(we),W=Ee==null?te:os(Ee),te=new Pe(de,V+"leave",we,u,re),te.target=kt,te.relatedTarget=W,de=null,gi(re)===G&&(Pe=new Pe($,V+"enter",Ee,u,re),Pe.target=W,Pe.relatedTarget=kt,de=Pe),kt=de,we&&Ee)t:{for(Pe=we,$=Ee,V=0,W=Pe;W;W=is(W))V++;for(W=0,de=$;de;de=is(de))W++;for(;0<V-W;)Pe=is(Pe),V--;for(;0<W-V;)$=is($),W--;for(;V--;){if(Pe===$||$!==null&&Pe===$.alternate)break t;Pe=is(Pe),$=is($)}Pe=null}else Pe=null;we!==null&&og(se,te,we,Pe,!1),Ee!==null&&kt!==null&&og(se,kt,Ee,Pe,!0)}}e:{if(te=G?os(G):window,we=te.nodeName&&te.nodeName.toLowerCase(),we==="select"||we==="input"&&te.type==="file")var Re=Bb;else if(Vm(te))if(Bm)Re=Wb;else{Re=$b;var Ie=Ub}else(we=te.nodeName)&&we.toLowerCase()==="input"&&(te.type==="checkbox"||te.type==="radio")&&(Re=Hb);if(Re&&(Re=Re(i,G))){zm(se,Re,u,re);break e}Ie&&Ie(i,te,G),i==="focusout"&&(Ie=te._wrapperState)&&Ie.controlled&&te.type==="number"&&Tn(te,"number",te.value)}switch(Ie=G?os(G):window,i){case"focusin":(Vm(Ie)||Ie.contentEditable==="true")&&(ns=Ie,Ec=G,po=null);break;case"focusout":po=Ec=ns=null;break;case"mousedown":_c=!0;break;case"contextmenu":case"mouseup":case"dragend":_c=!1,Xm(se,u,re);break;case"selectionchange":if(Kb)break;case"keydown":case"keyup":Xm(se,u,re)}var Me;if(Sc)e:{switch(i){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else ts?Om(i,u)&&(je="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(je="onCompositionStart");je&&(Lm&&u.locale!=="ko"&&(ts||je!=="onCompositionStart"?je==="onCompositionEnd"&&ts&&(Me=Rm()):(Br=re,mc="value"in Br?Br.value:Br.textContent,ts=!0)),Ie=Ga(G,je),0<Ie.length&&(je=new Mm(je,i,null,u,re),se.push({event:je,listeners:Ie}),Me?je.data=Me:(Me=Fm(u),Me!==null&&(je.data=Me)))),(Me=Db?Ob(i,u):Fb(i,u))&&(G=Ga(G,"onBeforeInput"),0<G.length&&(re=new Mm("onBeforeInput","beforeinput",null,u,re),se.push({event:re,listeners:G}),re.data=Me))}ig(se,o)})}function yo(i,o,u){return{instance:i,listener:o,currentTarget:u}}function Ga(i,o){for(var u=o+"Capture",h=[];i!==null;){var g=i,x=g.stateNode;g.tag===5&&x!==null&&(g=x,x=jr(i,u),x!=null&&h.unshift(yo(i,x,g)),x=jr(i,o),x!=null&&h.push(yo(i,x,g))),i=i.return}return h}function is(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function og(i,o,u,h,g){for(var x=o._reactName,C=[];u!==null&&u!==h;){var L=u,O=L.alternate,G=L.stateNode;if(O!==null&&O===h)break;L.tag===5&&G!==null&&(L=G,g?(O=jr(u,x),O!=null&&C.unshift(yo(u,O,L))):g||(O=jr(u,x),O!=null&&C.push(yo(u,O,L)))),u=u.return}C.length!==0&&i.push({event:o,listeners:C})}var Jb=/\r\n?/g,Zb=/\u0000|\uFFFD/g;function ag(i){return(typeof i=="string"?i:""+i).replace(Jb,`
|
|
38
|
+
`).replace(Zb,"")}function Ka(i,o,u){if(o=ag(o),ag(i)!==o&&u)throw Error(n(425))}function Xa(){}var Mc=null,Nc=null;function Lc(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var jc=typeof setTimeout=="function"?setTimeout:void 0,eE=typeof clearTimeout=="function"?clearTimeout:void 0,lg=typeof Promise=="function"?Promise:void 0,tE=typeof queueMicrotask=="function"?queueMicrotask:typeof lg<"u"?function(i){return lg.resolve(null).then(i).catch(nE)}:jc;function nE(i){setTimeout(function(){throw i})}function Dc(i,o){var u=o,h=0;do{var g=u.nextSibling;if(i.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(h===0){i.removeChild(g),oo(o);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=g}while(u);oo(o)}function $r(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return i}function ug(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return i;o--}else u==="/$"&&o++}i=i.previousSibling}return null}var ss=Math.random().toString(36).slice(2),ir="__reactFiber$"+ss,vo="__reactProps$"+ss,wr="__reactContainer$"+ss,Oc="__reactEvents$"+ss,rE="__reactListeners$"+ss,iE="__reactHandles$"+ss;function gi(i){var o=i[ir];if(o)return o;for(var u=i.parentNode;u;){if(o=u[wr]||u[ir]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(i=ug(i);i!==null;){if(u=i[ir])return u;i=ug(i)}return o}i=u,u=i.parentNode}return null}function xo(i){return i=i[ir]||i[wr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function os(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Ya(i){return i[vo]||null}var Fc=[],as=-1;function Hr(i){return{current:i}}function ct(i){0>as||(i.current=Fc[as],Fc[as]=null,as--)}function lt(i,o){as++,Fc[as]=i.current,i.current=o}var Wr={},Kt=Hr(Wr),dn=Hr(!1),yi=Wr;function ls(i,o){var u=i.type.contextTypes;if(!u)return Wr;var h=i.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===o)return h.__reactInternalMemoizedMaskedChildContext;var g={},x;for(x in u)g[x]=o[x];return h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=g),g}function fn(i){return i=i.childContextTypes,i!=null}function Qa(){ct(dn),ct(Kt)}function cg(i,o,u){if(Kt.current!==Wr)throw Error(n(168));lt(Kt,o),lt(dn,u)}function dg(i,o,u){var h=i.stateNode;if(o=o.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var g in h)if(!(g in o))throw Error(n(108,me(i)||"Unknown",g));return T({},u,h)}function Ja(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Wr,yi=Kt.current,lt(Kt,i),lt(dn,dn.current),!0}function fg(i,o,u){var h=i.stateNode;if(!h)throw Error(n(169));u?(i=dg(i,o,yi),h.__reactInternalMemoizedMergedChildContext=i,ct(dn),ct(Kt),lt(Kt,i)):ct(dn),lt(dn,u)}var Sr=null,Za=!1,Vc=!1;function hg(i){Sr===null?Sr=[i]:Sr.push(i)}function sE(i){Za=!0,hg(i)}function qr(){if(!Vc&&Sr!==null){Vc=!0;var i=0,o=Ze;try{var u=Sr;for(Ze=1;i<u.length;i++){var h=u[i];do h=h(!0);while(h!==null)}Sr=null,Za=!1}catch(g){throw Sr!==null&&(Sr=Sr.slice(i+1)),Oe(cn,qr),g}finally{Ze=o,Vc=!1}}return null}var us=[],cs=0,el=null,tl=0,An=[],In=0,vi=null,kr=1,Cr="";function xi(i,o){us[cs++]=tl,us[cs++]=el,el=i,tl=o}function pg(i,o,u){An[In++]=kr,An[In++]=Cr,An[In++]=vi,vi=i;var h=kr;i=Cr;var g=32-Un(h)-1;h&=~(1<<g),u+=1;var x=32-Un(o)+g;if(30<x){var C=g-g%5;x=(h&(1<<C)-1).toString(32),h>>=C,g-=C,kr=1<<32-Un(o)+g|u<<g|h,Cr=x+i}else kr=1<<x|u<<g|h,Cr=i}function zc(i){i.return!==null&&(xi(i,1),pg(i,1,0))}function Bc(i){for(;i===el;)el=us[--cs],us[cs]=null,tl=us[--cs],us[cs]=null;for(;i===vi;)vi=An[--In],An[In]=null,Cr=An[--In],An[In]=null,kr=An[--In],An[In]=null}var Sn=null,kn=null,ft=!1,Hn=null;function mg(i,o){var u=jn(5,null,null,0);u.elementType="DELETED",u.stateNode=o,u.return=i,o=i.deletions,o===null?(i.deletions=[u],i.flags|=16):o.push(u)}function gg(i,o){switch(i.tag){case 5:var u=i.type;return o=o.nodeType!==1||u.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(i.stateNode=o,Sn=i,kn=$r(o.firstChild),!0):!1;case 6:return o=i.pendingProps===""||o.nodeType!==3?null:o,o!==null?(i.stateNode=o,Sn=i,kn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=vi!==null?{id:kr,overflow:Cr}:null,i.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=jn(18,null,null,0),u.stateNode=o,u.return=i,i.child=u,Sn=i,kn=null,!0):!1;default:return!1}}function Uc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function $c(i){if(ft){var o=kn;if(o){var u=o;if(!gg(i,o)){if(Uc(i))throw Error(n(418));o=$r(u.nextSibling);var h=Sn;o&&gg(i,o)?mg(h,u):(i.flags=i.flags&-4097|2,ft=!1,Sn=i)}}else{if(Uc(i))throw Error(n(418));i.flags=i.flags&-4097|2,ft=!1,Sn=i}}}function yg(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Sn=i}function nl(i){if(i!==Sn)return!1;if(!ft)return yg(i),ft=!0,!1;var o;if((o=i.tag!==3)&&!(o=i.tag!==5)&&(o=i.type,o=o!=="head"&&o!=="body"&&!Lc(i.type,i.memoizedProps)),o&&(o=kn)){if(Uc(i))throw vg(),Error(n(418));for(;o;)mg(i,o),o=$r(o.nextSibling)}if(yg(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"){if(o===0){kn=$r(i.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}i=i.nextSibling}kn=null}}else kn=Sn?$r(i.stateNode.nextSibling):null;return!0}function vg(){for(var i=kn;i;)i=$r(i.nextSibling)}function ds(){kn=Sn=null,ft=!1}function Hc(i){Hn===null?Hn=[i]:Hn.push(i)}var oE=j.ReactCurrentBatchConfig;function wo(i,o,u){if(i=u.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,i));var g=h,x=""+i;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===x?o.ref:(o=function(C){var L=g.refs;C===null?delete L[x]:L[x]=C},o._stringRef=x,o)}if(typeof i!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,i))}return i}function rl(i,o){throw i=Object.prototype.toString.call(o),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i))}function xg(i){var o=i._init;return o(i._payload)}function wg(i){function o($,V){if(i){var W=$.deletions;W===null?($.deletions=[V],$.flags|=16):W.push(V)}}function u($,V){if(!i)return null;for(;V!==null;)o($,V),V=V.sibling;return null}function h($,V){for($=new Map;V!==null;)V.key!==null?$.set(V.key,V):$.set(V.index,V),V=V.sibling;return $}function g($,V){return $=ei($,V),$.index=0,$.sibling=null,$}function x($,V,W){return $.index=W,i?(W=$.alternate,W!==null?(W=W.index,W<V?($.flags|=2,V):W):($.flags|=2,V)):($.flags|=1048576,V)}function C($){return i&&$.alternate===null&&($.flags|=2),$}function L($,V,W,de){return V===null||V.tag!==6?(V=jd(W,$.mode,de),V.return=$,V):(V=g(V,W),V.return=$,V)}function O($,V,W,de){var Re=W.type;return Re===q?re($,V,W.props.children,de,W.key):V!==null&&(V.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===ve&&xg(Re)===V.type)?(de=g(V,W.props),de.ref=wo($,V,W),de.return=$,de):(de=Pl(W.type,W.key,W.props,null,$.mode,de),de.ref=wo($,V,W),de.return=$,de)}function G($,V,W,de){return V===null||V.tag!==4||V.stateNode.containerInfo!==W.containerInfo||V.stateNode.implementation!==W.implementation?(V=Dd(W,$.mode,de),V.return=$,V):(V=g(V,W.children||[]),V.return=$,V)}function re($,V,W,de,Re){return V===null||V.tag!==7?(V=Pi(W,$.mode,de,Re),V.return=$,V):(V=g(V,W),V.return=$,V)}function se($,V,W){if(typeof V=="string"&&V!==""||typeof V=="number")return V=jd(""+V,$.mode,W),V.return=$,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case A:return W=Pl(V.type,V.key,V.props,null,$.mode,W),W.ref=wo($,null,V),W.return=$,W;case N:return V=Dd(V,$.mode,W),V.return=$,V;case ve:var de=V._init;return se($,de(V._payload),W)}if(zt(V)||pe(V))return V=Pi(V,$.mode,W,null),V.return=$,V;rl($,V)}return null}function te($,V,W,de){var Re=V!==null?V.key:null;if(typeof W=="string"&&W!==""||typeof W=="number")return Re!==null?null:L($,V,""+W,de);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case A:return W.key===Re?O($,V,W,de):null;case N:return W.key===Re?G($,V,W,de):null;case ve:return Re=W._init,te($,V,Re(W._payload),de)}if(zt(W)||pe(W))return Re!==null?null:re($,V,W,de,null);rl($,W)}return null}function we($,V,W,de,Re){if(typeof de=="string"&&de!==""||typeof de=="number")return $=$.get(W)||null,L(V,$,""+de,Re);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case A:return $=$.get(de.key===null?W:de.key)||null,O(V,$,de,Re);case N:return $=$.get(de.key===null?W:de.key)||null,G(V,$,de,Re);case ve:var Ie=de._init;return we($,V,W,Ie(de._payload),Re)}if(zt(de)||pe(de))return $=$.get(W)||null,re(V,$,de,Re,null);rl(V,de)}return null}function Ee($,V,W,de){for(var Re=null,Ie=null,Me=V,je=V=0,Ot=null;Me!==null&&je<W.length;je++){Me.index>je?(Ot=Me,Me=null):Ot=Me.sibling;var Ye=te($,Me,W[je],de);if(Ye===null){Me===null&&(Me=Ot);break}i&&Me&&Ye.alternate===null&&o($,Me),V=x(Ye,V,je),Ie===null?Re=Ye:Ie.sibling=Ye,Ie=Ye,Me=Ot}if(je===W.length)return u($,Me),ft&&xi($,je),Re;if(Me===null){for(;je<W.length;je++)Me=se($,W[je],de),Me!==null&&(V=x(Me,V,je),Ie===null?Re=Me:Ie.sibling=Me,Ie=Me);return ft&&xi($,je),Re}for(Me=h($,Me);je<W.length;je++)Ot=we(Me,$,je,W[je],de),Ot!==null&&(i&&Ot.alternate!==null&&Me.delete(Ot.key===null?je:Ot.key),V=x(Ot,V,je),Ie===null?Re=Ot:Ie.sibling=Ot,Ie=Ot);return i&&Me.forEach(function(ti){return o($,ti)}),ft&&xi($,je),Re}function Pe($,V,W,de){var Re=pe(W);if(typeof Re!="function")throw Error(n(150));if(W=Re.call(W),W==null)throw Error(n(151));for(var Ie=Re=null,Me=V,je=V=0,Ot=null,Ye=W.next();Me!==null&&!Ye.done;je++,Ye=W.next()){Me.index>je?(Ot=Me,Me=null):Ot=Me.sibling;var ti=te($,Me,Ye.value,de);if(ti===null){Me===null&&(Me=Ot);break}i&&Me&&ti.alternate===null&&o($,Me),V=x(ti,V,je),Ie===null?Re=ti:Ie.sibling=ti,Ie=ti,Me=Ot}if(Ye.done)return u($,Me),ft&&xi($,je),Re;if(Me===null){for(;!Ye.done;je++,Ye=W.next())Ye=se($,Ye.value,de),Ye!==null&&(V=x(Ye,V,je),Ie===null?Re=Ye:Ie.sibling=Ye,Ie=Ye);return ft&&xi($,je),Re}for(Me=h($,Me);!Ye.done;je++,Ye=W.next())Ye=we(Me,$,je,Ye.value,de),Ye!==null&&(i&&Ye.alternate!==null&&Me.delete(Ye.key===null?je:Ye.key),V=x(Ye,V,je),Ie===null?Re=Ye:Ie.sibling=Ye,Ie=Ye);return i&&Me.forEach(function(VE){return o($,VE)}),ft&&xi($,je),Re}function kt($,V,W,de){if(typeof W=="object"&&W!==null&&W.type===q&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case A:e:{for(var Re=W.key,Ie=V;Ie!==null;){if(Ie.key===Re){if(Re=W.type,Re===q){if(Ie.tag===7){u($,Ie.sibling),V=g(Ie,W.props.children),V.return=$,$=V;break e}}else if(Ie.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===ve&&xg(Re)===Ie.type){u($,Ie.sibling),V=g(Ie,W.props),V.ref=wo($,Ie,W),V.return=$,$=V;break e}u($,Ie);break}else o($,Ie);Ie=Ie.sibling}W.type===q?(V=Pi(W.props.children,$.mode,de,W.key),V.return=$,$=V):(de=Pl(W.type,W.key,W.props,null,$.mode,de),de.ref=wo($,V,W),de.return=$,$=de)}return C($);case N:e:{for(Ie=W.key;V!==null;){if(V.key===Ie)if(V.tag===4&&V.stateNode.containerInfo===W.containerInfo&&V.stateNode.implementation===W.implementation){u($,V.sibling),V=g(V,W.children||[]),V.return=$,$=V;break e}else{u($,V);break}else o($,V);V=V.sibling}V=Dd(W,$.mode,de),V.return=$,$=V}return C($);case ve:return Ie=W._init,kt($,V,Ie(W._payload),de)}if(zt(W))return Ee($,V,W,de);if(pe(W))return Pe($,V,W,de);rl($,W)}return typeof W=="string"&&W!==""||typeof W=="number"?(W=""+W,V!==null&&V.tag===6?(u($,V.sibling),V=g(V,W),V.return=$,$=V):(u($,V),V=jd(W,$.mode,de),V.return=$,$=V),C($)):u($,V)}return kt}var fs=wg(!0),Sg=wg(!1),il=Hr(null),sl=null,hs=null,Wc=null;function qc(){Wc=hs=sl=null}function Gc(i){var o=il.current;ct(il),i._currentValue=o}function Kc(i,o,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,h!==null&&(h.childLanes|=o)):h!==null&&(h.childLanes&o)!==o&&(h.childLanes|=o),i===u)break;i=i.return}}function ps(i,o){sl=i,Wc=hs=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(hn=!0),i.firstContext=null)}function Mn(i){var o=i._currentValue;if(Wc!==i)if(i={context:i,memoizedValue:o,next:null},hs===null){if(sl===null)throw Error(n(308));hs=i,sl.dependencies={lanes:0,firstContext:i}}else hs=hs.next=i;return o}var wi=null;function Xc(i){wi===null?wi=[i]:wi.push(i)}function kg(i,o,u,h){var g=o.interleaved;return g===null?(u.next=u,Xc(o)):(u.next=g.next,g.next=u),o.interleaved=u,br(i,h)}function br(i,o){i.lanes|=o;var u=i.alternate;for(u!==null&&(u.lanes|=o),u=i,i=i.return;i!==null;)i.childLanes|=o,u=i.alternate,u!==null&&(u.childLanes|=o),u=i,i=i.return;return u.tag===3?u.stateNode:null}var Gr=!1;function Yc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cg(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Er(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Kr(i,o,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Ke&2)!==0){var g=h.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),h.pending=o,br(i,u)}return g=h.interleaved,g===null?(o.next=o,Xc(h)):(o.next=g.next,g.next=o),h.interleaved=o,br(i,u)}function ol(i,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194240)!==0)){var h=o.lanes;h&=i.pendingLanes,u|=h,o.lanes=u,cc(i,u)}}function bg(i,o){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var C={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?g=x=C:x=x.next=C,u=u.next}while(u!==null);x===null?g=x=o:x=x.next=o}else g=x=o;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:h.shared,effects:h.effects},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=o:i.next=o,u.lastBaseUpdate=o}function al(i,o,u,h){var g=i.updateQueue;Gr=!1;var x=g.firstBaseUpdate,C=g.lastBaseUpdate,L=g.shared.pending;if(L!==null){g.shared.pending=null;var O=L,G=O.next;O.next=null,C===null?x=G:C.next=G,C=O;var re=i.alternate;re!==null&&(re=re.updateQueue,L=re.lastBaseUpdate,L!==C&&(L===null?re.firstBaseUpdate=G:L.next=G,re.lastBaseUpdate=O))}if(x!==null){var se=g.baseState;C=0,re=G=O=null,L=x;do{var te=L.lane,we=L.eventTime;if((h&te)===te){re!==null&&(re=re.next={eventTime:we,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Ee=i,Pe=L;switch(te=o,we=u,Pe.tag){case 1:if(Ee=Pe.payload,typeof Ee=="function"){se=Ee.call(we,se,te);break e}se=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Pe.payload,te=typeof Ee=="function"?Ee.call(we,se,te):Ee,te==null)break e;se=T({},se,te);break e;case 2:Gr=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,te=g.effects,te===null?g.effects=[L]:te.push(L))}else we={eventTime:we,lane:te,tag:L.tag,payload:L.payload,callback:L.callback,next:null},re===null?(G=re=we,O=se):re=re.next=we,C|=te;if(L=L.next,L===null){if(L=g.shared.pending,L===null)break;te=L,L=te.next,te.next=null,g.lastBaseUpdate=te,g.shared.pending=null}}while(!0);if(re===null&&(O=se),g.baseState=O,g.firstBaseUpdate=G,g.lastBaseUpdate=re,o=g.shared.interleaved,o!==null){g=o;do C|=g.lane,g=g.next;while(g!==o)}else x===null&&(g.shared.lanes=0);Ci|=C,i.lanes=C,i.memoizedState=se}}function Eg(i,o,u){if(i=o.effects,o.effects=null,i!==null)for(o=0;o<i.length;o++){var h=i[o],g=h.callback;if(g!==null){if(h.callback=null,h=u,typeof g!="function")throw Error(n(191,g));g.call(h)}}}var So={},sr=Hr(So),ko=Hr(So),Co=Hr(So);function Si(i){if(i===So)throw Error(n(174));return i}function Qc(i,o){switch(lt(Co,o),lt(ko,i),lt(sr,So),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:ee(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=ee(o,i)}ct(sr),lt(sr,o)}function ms(){ct(sr),ct(ko),ct(Co)}function _g(i){Si(Co.current);var o=Si(sr.current),u=ee(o,i.type);o!==u&&(lt(ko,i),lt(sr,u))}function Jc(i){ko.current===i&&(ct(sr),ct(ko))}var mt=Hr(0);function ll(i){for(var o=i;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Zc=[];function ed(){for(var i=0;i<Zc.length;i++)Zc[i]._workInProgressVersionPrimary=null;Zc.length=0}var ul=j.ReactCurrentDispatcher,td=j.ReactCurrentBatchConfig,ki=0,gt=null,At=null,jt=null,cl=!1,bo=!1,Eo=0,aE=0;function Xt(){throw Error(n(321))}function nd(i,o){if(o===null)return!1;for(var u=0;u<o.length&&u<i.length;u++)if(!$n(i[u],o[u]))return!1;return!0}function rd(i,o,u,h,g,x){if(ki=x,gt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,ul.current=i===null||i.memoizedState===null?dE:fE,i=u(h,g),bo){x=0;do{if(bo=!1,Eo=0,25<=x)throw Error(n(301));x+=1,jt=At=null,o.updateQueue=null,ul.current=hE,i=u(h,g)}while(bo)}if(ul.current=hl,o=At!==null&&At.next!==null,ki=0,jt=At=gt=null,cl=!1,o)throw Error(n(300));return i}function id(){var i=Eo!==0;return Eo=0,i}function or(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?gt.memoizedState=jt=i:jt=jt.next=i,jt}function Nn(){if(At===null){var i=gt.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var o=jt===null?gt.memoizedState:jt.next;if(o!==null)jt=o,At=i;else{if(i===null)throw Error(n(310));At=i,i={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},jt===null?gt.memoizedState=jt=i:jt=jt.next=i}return jt}function _o(i,o){return typeof o=="function"?o(i):o}function sd(i){var o=Nn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var h=At,g=h.baseQueue,x=u.pending;if(x!==null){if(g!==null){var C=g.next;g.next=x.next,x.next=C}h.baseQueue=g=x,u.pending=null}if(g!==null){x=g.next,h=h.baseState;var L=C=null,O=null,G=x;do{var re=G.lane;if((ki&re)===re)O!==null&&(O=O.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),h=G.hasEagerState?G.eagerState:i(h,G.action);else{var se={lane:re,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};O===null?(L=O=se,C=h):O=O.next=se,gt.lanes|=re,Ci|=re}G=G.next}while(G!==null&&G!==x);O===null?C=h:O.next=L,$n(h,o.memoizedState)||(hn=!0),o.memoizedState=h,o.baseState=C,o.baseQueue=O,u.lastRenderedState=h}if(i=u.interleaved,i!==null){g=i;do x=g.lane,gt.lanes|=x,Ci|=x,g=g.next;while(g!==i)}else g===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function od(i){var o=Nn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=i;var h=u.dispatch,g=u.pending,x=o.memoizedState;if(g!==null){u.pending=null;var C=g=g.next;do x=i(x,C.action),C=C.next;while(C!==g);$n(x,o.memoizedState)||(hn=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,h]}function Pg(){}function Tg(i,o){var u=gt,h=Nn(),g=o(),x=!$n(h.memoizedState,g);if(x&&(h.memoizedState=g,hn=!0),h=h.queue,ad(Ig.bind(null,u,h,i),[i]),h.getSnapshot!==o||x||jt!==null&&jt.memoizedState.tag&1){if(u.flags|=2048,Po(9,Ag.bind(null,u,h,g,o),void 0,null),Dt===null)throw Error(n(349));(ki&30)!==0||Rg(u,o,g)}return g}function Rg(i,o,u){i.flags|=16384,i={getSnapshot:o,value:u},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.stores=[i]):(u=o.stores,u===null?o.stores=[i]:u.push(i))}function Ag(i,o,u,h){o.value=u,o.getSnapshot=h,Mg(o)&&Ng(i)}function Ig(i,o,u){return u(function(){Mg(o)&&Ng(i)})}function Mg(i){var o=i.getSnapshot;i=i.value;try{var u=o();return!$n(i,u)}catch{return!0}}function Ng(i){var o=br(i,1);o!==null&&Kn(o,i,1,-1)}function Lg(i){var o=or();return typeof i=="function"&&(i=i()),o.memoizedState=o.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_o,lastRenderedState:i},o.queue=i,i=i.dispatch=cE.bind(null,gt,i),[o.memoizedState,i]}function Po(i,o,u,h){return i={tag:i,create:o,destroy:u,deps:h,next:null},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.lastEffect=i.next=i):(u=o.lastEffect,u===null?o.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,o.lastEffect=i)),i}function jg(){return Nn().memoizedState}function dl(i,o,u,h){var g=or();gt.flags|=i,g.memoizedState=Po(1|o,u,void 0,h===void 0?null:h)}function fl(i,o,u,h){var g=Nn();h=h===void 0?null:h;var x=void 0;if(At!==null){var C=At.memoizedState;if(x=C.destroy,h!==null&&nd(h,C.deps)){g.memoizedState=Po(o,u,x,h);return}}gt.flags|=i,g.memoizedState=Po(1|o,u,x,h)}function Dg(i,o){return dl(8390656,8,i,o)}function ad(i,o){return fl(2048,8,i,o)}function Og(i,o){return fl(4,2,i,o)}function Fg(i,o){return fl(4,4,i,o)}function Vg(i,o){if(typeof o=="function")return i=i(),o(i),function(){o(null)};if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function zg(i,o,u){return u=u!=null?u.concat([i]):null,fl(4,4,Vg.bind(null,o,i),u)}function ld(){}function Bg(i,o){var u=Nn();o=o===void 0?null:o;var h=u.memoizedState;return h!==null&&o!==null&&nd(o,h[1])?h[0]:(u.memoizedState=[i,o],i)}function Ug(i,o){var u=Nn();o=o===void 0?null:o;var h=u.memoizedState;return h!==null&&o!==null&&nd(o,h[1])?h[0]:(i=i(),u.memoizedState=[i,o],i)}function $g(i,o,u){return(ki&21)===0?(i.baseState&&(i.baseState=!1,hn=!0),i.memoizedState=u):($n(u,o)||(u=xm(),gt.lanes|=u,Ci|=u,i.baseState=!0),o)}function lE(i,o){var u=Ze;Ze=u!==0&&4>u?u:4,i(!0);var h=td.transition;td.transition={};try{i(!1),o()}finally{Ze=u,td.transition=h}}function Hg(){return Nn().memoizedState}function uE(i,o,u){var h=Jr(i);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},Wg(i))qg(o,u);else if(u=kg(i,o,u,h),u!==null){var g=rn();Kn(u,i,h,g),Gg(u,o,h)}}function cE(i,o,u){var h=Jr(i),g={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(Wg(i))qg(o,g);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var C=o.lastRenderedState,L=x(C,u);if(g.hasEagerState=!0,g.eagerState=L,$n(L,C)){var O=o.interleaved;O===null?(g.next=g,Xc(o)):(g.next=O.next,O.next=g),o.interleaved=g;return}}catch{}finally{}u=kg(i,o,g,h),u!==null&&(g=rn(),Kn(u,i,h,g),Gg(u,o,h))}}function Wg(i){var o=i.alternate;return i===gt||o!==null&&o===gt}function qg(i,o){bo=cl=!0;var u=i.pending;u===null?o.next=o:(o.next=u.next,u.next=o),i.pending=o}function Gg(i,o,u){if((u&4194240)!==0){var h=o.lanes;h&=i.pendingLanes,u|=h,o.lanes=u,cc(i,u)}}var hl={readContext:Mn,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},dE={readContext:Mn,useCallback:function(i,o){return or().memoizedState=[i,o===void 0?null:o],i},useContext:Mn,useEffect:Dg,useImperativeHandle:function(i,o,u){return u=u!=null?u.concat([i]):null,dl(4194308,4,Vg.bind(null,o,i),u)},useLayoutEffect:function(i,o){return dl(4194308,4,i,o)},useInsertionEffect:function(i,o){return dl(4,2,i,o)},useMemo:function(i,o){var u=or();return o=o===void 0?null:o,i=i(),u.memoizedState=[i,o],i},useReducer:function(i,o,u){var h=or();return o=u!==void 0?u(o):o,h.memoizedState=h.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},h.queue=i,i=i.dispatch=uE.bind(null,gt,i),[h.memoizedState,i]},useRef:function(i){var o=or();return i={current:i},o.memoizedState=i},useState:Lg,useDebugValue:ld,useDeferredValue:function(i){return or().memoizedState=i},useTransition:function(){var i=Lg(!1),o=i[0];return i=lE.bind(null,i[1]),or().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,u){var h=gt,g=or();if(ft){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),Dt===null)throw Error(n(349));(ki&30)!==0||Rg(h,o,u)}g.memoizedState=u;var x={value:u,getSnapshot:o};return g.queue=x,Dg(Ig.bind(null,h,x,i),[i]),h.flags|=2048,Po(9,Ag.bind(null,h,x,u,o),void 0,null),u},useId:function(){var i=or(),o=Dt.identifierPrefix;if(ft){var u=Cr,h=kr;u=(h&~(1<<32-Un(h)-1)).toString(32)+u,o=":"+o+"R"+u,u=Eo++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=aE++,o=":"+o+"r"+u.toString(32)+":";return i.memoizedState=o},unstable_isNewReconciler:!1},fE={readContext:Mn,useCallback:Bg,useContext:Mn,useEffect:ad,useImperativeHandle:zg,useInsertionEffect:Og,useLayoutEffect:Fg,useMemo:Ug,useReducer:sd,useRef:jg,useState:function(){return sd(_o)},useDebugValue:ld,useDeferredValue:function(i){var o=Nn();return $g(o,At.memoizedState,i)},useTransition:function(){var i=sd(_o)[0],o=Nn().memoizedState;return[i,o]},useMutableSource:Pg,useSyncExternalStore:Tg,useId:Hg,unstable_isNewReconciler:!1},hE={readContext:Mn,useCallback:Bg,useContext:Mn,useEffect:ad,useImperativeHandle:zg,useInsertionEffect:Og,useLayoutEffect:Fg,useMemo:Ug,useReducer:od,useRef:jg,useState:function(){return od(_o)},useDebugValue:ld,useDeferredValue:function(i){var o=Nn();return At===null?o.memoizedState=i:$g(o,At.memoizedState,i)},useTransition:function(){var i=od(_o)[0],o=Nn().memoizedState;return[i,o]},useMutableSource:Pg,useSyncExternalStore:Tg,useId:Hg,unstable_isNewReconciler:!1};function Wn(i,o){if(i&&i.defaultProps){o=T({},o),i=i.defaultProps;for(var u in i)o[u]===void 0&&(o[u]=i[u]);return o}return o}function ud(i,o,u,h){o=i.memoizedState,u=u(h,o),u=u==null?o:T({},o,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var pl={isMounted:function(i){return(i=i._reactInternals)?xr(i)===i:!1},enqueueSetState:function(i,o,u){i=i._reactInternals;var h=rn(),g=Jr(i),x=Er(h,g);x.payload=o,u!=null&&(x.callback=u),o=Kr(i,x,g),o!==null&&(Kn(o,i,g,h),ol(o,i,g))},enqueueReplaceState:function(i,o,u){i=i._reactInternals;var h=rn(),g=Jr(i),x=Er(h,g);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=Kr(i,x,g),o!==null&&(Kn(o,i,g,h),ol(o,i,g))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var u=rn(),h=Jr(i),g=Er(u,h);g.tag=2,o!=null&&(g.callback=o),o=Kr(i,g,h),o!==null&&(Kn(o,i,h,u),ol(o,i,h))}};function Kg(i,o,u,h,g,x,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,x,C):o.prototype&&o.prototype.isPureReactComponent?!ho(u,h)||!ho(g,x):!0}function Xg(i,o,u){var h=!1,g=Wr,x=o.contextType;return typeof x=="object"&&x!==null?x=Mn(x):(g=fn(o)?yi:Kt.current,h=o.contextTypes,x=(h=h!=null)?ls(i,g):Wr),o=new o(u,x),i.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=pl,i.stateNode=o,o._reactInternals=i,h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=x),o}function Yg(i,o,u,h){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,h),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,h),o.state!==i&&pl.enqueueReplaceState(o,o.state,null)}function cd(i,o,u,h){var g=i.stateNode;g.props=u,g.state=i.memoizedState,g.refs={},Yc(i);var x=o.contextType;typeof x=="object"&&x!==null?g.context=Mn(x):(x=fn(o)?yi:Kt.current,g.context=ls(i,x)),g.state=i.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(ud(i,o,x,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(o=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),o!==g.state&&pl.enqueueReplaceState(g,g.state,null),al(i,u,g,h),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function gs(i,o){try{var u="",h=o;do u+=ue(h),h=h.return;while(h);var g=u}catch(x){g=`
|
|
39
|
+
Error generating stack: `+x.message+`
|
|
40
|
+
`+x.stack}return{value:i,source:o,stack:g,digest:null}}function dd(i,o,u){return{value:i,source:null,stack:u??null,digest:o??null}}function fd(i,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var pE=typeof WeakMap=="function"?WeakMap:Map;function Qg(i,o,u){u=Er(-1,u),u.tag=3,u.payload={element:null};var h=o.value;return u.callback=function(){Sl||(Sl=!0,Pd=h),fd(i,o)},u}function Jg(i,o,u){u=Er(-1,u),u.tag=3;var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var g=o.value;u.payload=function(){return h(g)},u.callback=function(){fd(i,o)}}var x=i.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){fd(i,o),typeof h!="function"&&(Yr===null?Yr=new Set([this]):Yr.add(this));var C=o.stack;this.componentDidCatch(o.value,{componentStack:C!==null?C:""})}),u}function Zg(i,o,u){var h=i.pingCache;if(h===null){h=i.pingCache=new pE;var g=new Set;h.set(o,g)}else g=h.get(o),g===void 0&&(g=new Set,h.set(o,g));g.has(u)||(g.add(u),i=TE.bind(null,i,o,u),o.then(i,i))}function ey(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function ty(i,o,u,h,g){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(o=Er(-1,1),o.tag=2,Kr(u,o,1))),u.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var mE=j.ReactCurrentOwner,hn=!1;function nn(i,o,u,h){o.child=i===null?Sg(o,null,u,h):fs(o,i.child,u,h)}function ny(i,o,u,h,g){u=u.render;var x=o.ref;return ps(o,g),h=rd(i,o,u,h,x,g),u=id(),i!==null&&!hn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~g,_r(i,o,g)):(ft&&u&&zc(o),o.flags|=1,nn(i,o,h,g),o.child)}function ry(i,o,u,h,g){if(i===null){var x=u.type;return typeof x=="function"&&!Ld(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,iy(i,o,x,h,g)):(i=Pl(u.type,null,h,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(x=i.child,(i.lanes&g)===0){var C=x.memoizedProps;if(u=u.compare,u=u!==null?u:ho,u(C,h)&&i.ref===o.ref)return _r(i,o,g)}return o.flags|=1,i=ei(x,h),i.ref=o.ref,i.return=o,o.child=i}function iy(i,o,u,h,g){if(i!==null){var x=i.memoizedProps;if(ho(x,h)&&i.ref===o.ref)if(hn=!1,o.pendingProps=h=x,(i.lanes&g)!==0)(i.flags&131072)!==0&&(hn=!0);else return o.lanes=i.lanes,_r(i,o,g)}return hd(i,o,u,h,g)}function sy(i,o,u){var h=o.pendingProps,g=h.children,x=i!==null?i.memoizedState:null;if(h.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},lt(vs,Cn),Cn|=u;else{if((u&1073741824)===0)return i=x!==null?x.baseLanes|u:u,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,lt(vs,Cn),Cn|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=x!==null?x.baseLanes:u,lt(vs,Cn),Cn|=h}else x!==null?(h=x.baseLanes|u,o.memoizedState=null):h=u,lt(vs,Cn),Cn|=h;return nn(i,o,g,u),o.child}function oy(i,o){var u=o.ref;(i===null&&u!==null||i!==null&&i.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function hd(i,o,u,h,g){var x=fn(u)?yi:Kt.current;return x=ls(o,x),ps(o,g),u=rd(i,o,u,h,x,g),h=id(),i!==null&&!hn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~g,_r(i,o,g)):(ft&&h&&zc(o),o.flags|=1,nn(i,o,u,g),o.child)}function ay(i,o,u,h,g){if(fn(u)){var x=!0;Ja(o)}else x=!1;if(ps(o,g),o.stateNode===null)gl(i,o),Xg(o,u,h),cd(o,u,h,g),h=!0;else if(i===null){var C=o.stateNode,L=o.memoizedProps;C.props=L;var O=C.context,G=u.contextType;typeof G=="object"&&G!==null?G=Mn(G):(G=fn(u)?yi:Kt.current,G=ls(o,G));var re=u.getDerivedStateFromProps,se=typeof re=="function"||typeof C.getSnapshotBeforeUpdate=="function";se||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(L!==h||O!==G)&&Yg(o,C,h,G),Gr=!1;var te=o.memoizedState;C.state=te,al(o,h,C,g),O=o.memoizedState,L!==h||te!==O||dn.current||Gr?(typeof re=="function"&&(ud(o,u,re,h),O=o.memoizedState),(L=Gr||Kg(o,u,L,h,te,O,G))?(se||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(o.flags|=4194308)):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=h,o.memoizedState=O),C.props=h,C.state=O,C.context=G,h=L):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),h=!1)}else{C=o.stateNode,Cg(i,o),L=o.memoizedProps,G=o.type===o.elementType?L:Wn(o.type,L),C.props=G,se=o.pendingProps,te=C.context,O=u.contextType,typeof O=="object"&&O!==null?O=Mn(O):(O=fn(u)?yi:Kt.current,O=ls(o,O));var we=u.getDerivedStateFromProps;(re=typeof we=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(L!==se||te!==O)&&Yg(o,C,h,O),Gr=!1,te=o.memoizedState,C.state=te,al(o,h,C,g);var Ee=o.memoizedState;L!==se||te!==Ee||dn.current||Gr?(typeof we=="function"&&(ud(o,u,we,h),Ee=o.memoizedState),(G=Gr||Kg(o,u,G,h,te,Ee,O)||!1)?(re||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(h,Ee,O),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(h,Ee,O)),typeof C.componentDidUpdate=="function"&&(o.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof C.componentDidUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=1024),o.memoizedProps=h,o.memoizedState=Ee),C.props=h,C.state=Ee,C.context=O,h=G):(typeof C.componentDidUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&te===i.memoizedState||(o.flags|=1024),h=!1)}return pd(i,o,u,h,x,g)}function pd(i,o,u,h,g,x){oy(i,o);var C=(o.flags&128)!==0;if(!h&&!C)return g&&fg(o,u,!1),_r(i,o,x);h=o.stateNode,mE.current=o;var L=C&&typeof u.getDerivedStateFromError!="function"?null:h.render();return o.flags|=1,i!==null&&C?(o.child=fs(o,i.child,null,x),o.child=fs(o,null,L,x)):nn(i,o,L,x),o.memoizedState=h.state,g&&fg(o,u,!0),o.child}function ly(i){var o=i.stateNode;o.pendingContext?cg(i,o.pendingContext,o.pendingContext!==o.context):o.context&&cg(i,o.context,!1),Qc(i,o.containerInfo)}function uy(i,o,u,h,g){return ds(),Hc(g),o.flags|=256,nn(i,o,u,h),o.child}var md={dehydrated:null,treeContext:null,retryLane:0};function gd(i){return{baseLanes:i,cachePool:null,transitions:null}}function cy(i,o,u){var h=o.pendingProps,g=mt.current,x=!1,C=(o.flags&128)!==0,L;if((L=C)||(L=i!==null&&i.memoizedState===null?!1:(g&2)!==0),L?(x=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),lt(mt,g&1),i===null)return $c(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(C=h.children,i=h.fallback,x?(h=o.mode,x=o.child,C={mode:"hidden",children:C},(h&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=C):x=Tl(C,h,0,null),i=Pi(i,h,u,null),x.return=o,i.return=o,x.sibling=i,o.child=x,o.child.memoizedState=gd(u),o.memoizedState=md,i):yd(o,C));if(g=i.memoizedState,g!==null&&(L=g.dehydrated,L!==null))return gE(i,o,C,h,L,g,u);if(x){x=h.fallback,C=o.mode,g=i.child,L=g.sibling;var O={mode:"hidden",children:h.children};return(C&1)===0&&o.child!==g?(h=o.child,h.childLanes=0,h.pendingProps=O,o.deletions=null):(h=ei(g,O),h.subtreeFlags=g.subtreeFlags&14680064),L!==null?x=ei(L,x):(x=Pi(x,C,u,null),x.flags|=2),x.return=o,h.return=o,h.sibling=x,o.child=h,h=x,x=o.child,C=i.child.memoizedState,C=C===null?gd(u):{baseLanes:C.baseLanes|u,cachePool:null,transitions:C.transitions},x.memoizedState=C,x.childLanes=i.childLanes&~u,o.memoizedState=md,h}return x=i.child,i=x.sibling,h=ei(x,{mode:"visible",children:h.children}),(o.mode&1)===0&&(h.lanes=u),h.return=o,h.sibling=null,i!==null&&(u=o.deletions,u===null?(o.deletions=[i],o.flags|=16):u.push(i)),o.child=h,o.memoizedState=null,h}function yd(i,o){return o=Tl({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function ml(i,o,u,h){return h!==null&&Hc(h),fs(o,i.child,null,u),i=yd(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function gE(i,o,u,h,g,x,C){if(u)return o.flags&256?(o.flags&=-257,h=dd(Error(n(422))),ml(i,o,C,h)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(x=h.fallback,g=o.mode,h=Tl({mode:"visible",children:h.children},g,0,null),x=Pi(x,g,C,null),x.flags|=2,h.return=o,x.return=o,h.sibling=x,o.child=h,(o.mode&1)!==0&&fs(o,i.child,null,C),o.child.memoizedState=gd(C),o.memoizedState=md,x);if((o.mode&1)===0)return ml(i,o,C,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var L=h.dgst;return h=L,x=Error(n(419)),h=dd(x,h,void 0),ml(i,o,C,h)}if(L=(C&i.childLanes)!==0,hn||L){if(h=Dt,h!==null){switch(C&-C){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(h.suspendedLanes|C))!==0?0:g,g!==0&&g!==x.retryLane&&(x.retryLane=g,br(i,g),Kn(h,i,g,-1))}return Nd(),h=dd(Error(n(421))),ml(i,o,C,h)}return g.data==="$?"?(o.flags|=128,o.child=i.child,o=RE.bind(null,i),g._reactRetry=o,null):(i=x.treeContext,kn=$r(g.nextSibling),Sn=o,ft=!0,Hn=null,i!==null&&(An[In++]=kr,An[In++]=Cr,An[In++]=vi,kr=i.id,Cr=i.overflow,vi=o),o=yd(o,h.children),o.flags|=4096,o)}function dy(i,o,u){i.lanes|=o;var h=i.alternate;h!==null&&(h.lanes|=o),Kc(i.return,o,u)}function vd(i,o,u,h,g){var x=i.memoizedState;x===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=h,x.tail=u,x.tailMode=g)}function fy(i,o,u){var h=o.pendingProps,g=h.revealOrder,x=h.tail;if(nn(i,o,h.children,u),h=mt.current,(h&2)!==0)h=h&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&dy(i,u,o);else if(i.tag===19)dy(i,u,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}if(lt(mt,h),(o.mode&1)===0)o.memoizedState=null;else switch(g){case"forwards":for(u=o.child,g=null;u!==null;)i=u.alternate,i!==null&&ll(i)===null&&(g=u),u=u.sibling;u=g,u===null?(g=o.child,o.child=null):(g=u.sibling,u.sibling=null),vd(o,!1,g,u,x);break;case"backwards":for(u=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&ll(i)===null){o.child=g;break}i=g.sibling,g.sibling=u,u=g,g=i}vd(o,!0,u,null,x);break;case"together":vd(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function gl(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function _r(i,o,u){if(i!==null&&(o.dependencies=i.dependencies),Ci|=o.lanes,(u&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(n(153));if(o.child!==null){for(i=o.child,u=ei(i,i.pendingProps),o.child=u,u.return=o;i.sibling!==null;)i=i.sibling,u=u.sibling=ei(i,i.pendingProps),u.return=o;u.sibling=null}return o.child}function yE(i,o,u){switch(o.tag){case 3:ly(o),ds();break;case 5:_g(o);break;case 1:fn(o.type)&&Ja(o);break;case 4:Qc(o,o.stateNode.containerInfo);break;case 10:var h=o.type._context,g=o.memoizedProps.value;lt(il,h._currentValue),h._currentValue=g;break;case 13:if(h=o.memoizedState,h!==null)return h.dehydrated!==null?(lt(mt,mt.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?cy(i,o,u):(lt(mt,mt.current&1),i=_r(i,o,u),i!==null?i.sibling:null);lt(mt,mt.current&1);break;case 19:if(h=(u&o.childLanes)!==0,(i.flags&128)!==0){if(h)return fy(i,o,u);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),lt(mt,mt.current),h)break;return null;case 22:case 23:return o.lanes=0,sy(i,o,u)}return _r(i,o,u)}var hy,xd,py,my;hy=function(i,o){for(var u=o.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},xd=function(){},py=function(i,o,u,h){var g=i.memoizedProps;if(g!==h){i=o.stateNode,Si(sr.current);var x=null;switch(u){case"input":g=ot(i,g),h=ot(i,h),x=[];break;case"select":g=T({},g,{value:void 0}),h=T({},h,{value:void 0}),x=[];break;case"textarea":g=bt(i,g),h=bt(i,h),x=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(i.onclick=Xa)}ye(u,h);var C;u=null;for(G in g)if(!h.hasOwnProperty(G)&&g.hasOwnProperty(G)&&g[G]!=null)if(G==="style"){var L=g[G];for(C in L)L.hasOwnProperty(C)&&(u||(u={}),u[C]="")}else G!=="dangerouslySetInnerHTML"&&G!=="children"&&G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(s.hasOwnProperty(G)?x||(x=[]):(x=x||[]).push(G,null));for(G in h){var O=h[G];if(L=g?.[G],h.hasOwnProperty(G)&&O!==L&&(O!=null||L!=null))if(G==="style")if(L){for(C in L)!L.hasOwnProperty(C)||O&&O.hasOwnProperty(C)||(u||(u={}),u[C]="");for(C in O)O.hasOwnProperty(C)&&L[C]!==O[C]&&(u||(u={}),u[C]=O[C])}else u||(x||(x=[]),x.push(G,u)),u=O;else G==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,L=L?L.__html:void 0,O!=null&&L!==O&&(x=x||[]).push(G,O)):G==="children"?typeof O!="string"&&typeof O!="number"||(x=x||[]).push(G,""+O):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&(s.hasOwnProperty(G)?(O!=null&&G==="onScroll"&&ut("scroll",i),x||L===O||(x=[])):(x=x||[]).push(G,O))}u&&(x=x||[]).push("style",u);var G=x;(o.updateQueue=G)&&(o.flags|=4)}},my=function(i,o,u,h){u!==h&&(o.flags|=4)};function To(i,o){if(!ft)switch(i.tailMode){case"hidden":o=i.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function Yt(i){var o=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(o)for(var g=i.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&14680064,h|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=h,i.childLanes=u,o}function vE(i,o,u){var h=o.pendingProps;switch(Bc(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(o),null;case 1:return fn(o.type)&&Qa(),Yt(o),null;case 3:return h=o.stateNode,ms(),ct(dn),ct(Kt),ed(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(nl(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Hn!==null&&(Ad(Hn),Hn=null))),xd(i,o),Yt(o),null;case 5:Jc(o);var g=Si(Co.current);if(u=o.type,i!==null&&o.stateNode!=null)py(i,o,u,h,g),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!h){if(o.stateNode===null)throw Error(n(166));return Yt(o),null}if(i=Si(sr.current),nl(o)){h=o.stateNode,u=o.type;var x=o.memoizedProps;switch(h[ir]=o,h[vo]=x,i=(o.mode&1)!==0,u){case"dialog":ut("cancel",h),ut("close",h);break;case"iframe":case"object":case"embed":ut("load",h);break;case"video":case"audio":for(g=0;g<mo.length;g++)ut(mo[g],h);break;case"source":ut("error",h);break;case"img":case"image":case"link":ut("error",h),ut("load",h);break;case"details":ut("toggle",h);break;case"input":Vt(h,x),ut("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!x.multiple},ut("invalid",h);break;case"textarea":tr(h,x),ut("invalid",h)}ye(u,x),g=null;for(var C in x)if(x.hasOwnProperty(C)){var L=x[C];C==="children"?typeof L=="string"?h.textContent!==L&&(x.suppressHydrationWarning!==!0&&Ka(h.textContent,L,i),g=["children",L]):typeof L=="number"&&h.textContent!==""+L&&(x.suppressHydrationWarning!==!0&&Ka(h.textContent,L,i),g=["children",""+L]):s.hasOwnProperty(C)&&L!=null&&C==="onScroll"&&ut("scroll",h)}switch(u){case"input":Fe(h),Wt(h,x,!0);break;case"textarea":Fe(h),Lr(h);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(h.onclick=Xa)}h=g,o.updateQueue=h,h!==null&&(o.flags|=4)}else{C=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Y(u)),i==="http://www.w3.org/1999/xhtml"?u==="script"?(i=C.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof h.is=="string"?i=C.createElement(u,{is:h.is}):(i=C.createElement(u),u==="select"&&(C=i,h.multiple?C.multiple=!0:h.size&&(C.size=h.size))):i=C.createElementNS(i,u),i[ir]=o,i[vo]=h,hy(i,o,!1,!1),o.stateNode=i;e:{switch(C=Le(u,h),u){case"dialog":ut("cancel",i),ut("close",i),g=h;break;case"iframe":case"object":case"embed":ut("load",i),g=h;break;case"video":case"audio":for(g=0;g<mo.length;g++)ut(mo[g],i);g=h;break;case"source":ut("error",i),g=h;break;case"img":case"image":case"link":ut("error",i),ut("load",i),g=h;break;case"details":ut("toggle",i),g=h;break;case"input":Vt(i,h),g=ot(i,h),ut("invalid",i);break;case"option":g=h;break;case"select":i._wrapperState={wasMultiple:!!h.multiple},g=T({},h,{value:void 0}),ut("invalid",i);break;case"textarea":tr(i,h),g=bt(i,h),ut("invalid",i);break;default:g=h}ye(u,g),L=g;for(x in L)if(L.hasOwnProperty(x)){var O=L[x];x==="style"?ge(i,O):x==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,O!=null&&Ae(i,O)):x==="children"?typeof O=="string"?(u!=="textarea"||O!=="")&&Ve(i,O):typeof O=="number"&&Ve(i,""+O):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(s.hasOwnProperty(x)?O!=null&&x==="onScroll"&&ut("scroll",i):O!=null&&_(i,x,O,C))}switch(u){case"input":Fe(i),Wt(i,h,!1);break;case"textarea":Fe(i),Lr(i);break;case"option":h.value!=null&&i.setAttribute("value",""+ke(h.value));break;case"select":i.multiple=!!h.multiple,x=h.value,x!=null?tn(i,!!h.multiple,x,!1):h.defaultValue!=null&&tn(i,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Xa)}switch(u){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return Yt(o),null;case 6:if(i&&o.stateNode!=null)my(i,o,i.memoizedProps,h);else{if(typeof h!="string"&&o.stateNode===null)throw Error(n(166));if(u=Si(Co.current),Si(sr.current),nl(o)){if(h=o.stateNode,u=o.memoizedProps,h[ir]=o,(x=h.nodeValue!==u)&&(i=Sn,i!==null))switch(i.tag){case 3:Ka(h.nodeValue,u,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Ka(h.nodeValue,u,(i.mode&1)!==0)}x&&(o.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[ir]=o,o.stateNode=h}return Yt(o),null;case 13:if(ct(mt),h=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ft&&kn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)vg(),ds(),o.flags|=98560,x=!1;else if(x=nl(o),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(n(318));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[ir]=o}else ds(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Yt(o),x=!1}else Hn!==null&&(Ad(Hn),Hn=null),x=!0;if(!x)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=u,o):(h=h!==null,h!==(i!==null&&i.memoizedState!==null)&&h&&(o.child.flags|=8192,(o.mode&1)!==0&&(i===null||(mt.current&1)!==0?It===0&&(It=3):Nd())),o.updateQueue!==null&&(o.flags|=4),Yt(o),null);case 4:return ms(),xd(i,o),i===null&&go(o.stateNode.containerInfo),Yt(o),null;case 10:return Gc(o.type._context),Yt(o),null;case 17:return fn(o.type)&&Qa(),Yt(o),null;case 19:if(ct(mt),x=o.memoizedState,x===null)return Yt(o),null;if(h=(o.flags&128)!==0,C=x.rendering,C===null)if(h)To(x,!1);else{if(It!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(C=ll(i),C!==null){for(o.flags|=128,To(x,!1),h=C.updateQueue,h!==null&&(o.updateQueue=h,o.flags|=4),o.subtreeFlags=0,h=u,u=o.child;u!==null;)x=u,i=h,x.flags&=14680066,C=x.alternate,C===null?(x.childLanes=0,x.lanes=i,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=C.childLanes,x.lanes=C.lanes,x.child=C.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=C.memoizedProps,x.memoizedState=C.memoizedState,x.updateQueue=C.updateQueue,x.type=C.type,i=C.dependencies,x.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),u=u.sibling;return lt(mt,mt.current&1|2),o.child}i=i.sibling}x.tail!==null&&Qe()>xs&&(o.flags|=128,h=!0,To(x,!1),o.lanes=4194304)}else{if(!h)if(i=ll(C),i!==null){if(o.flags|=128,h=!0,u=i.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),To(x,!0),x.tail===null&&x.tailMode==="hidden"&&!C.alternate&&!ft)return Yt(o),null}else 2*Qe()-x.renderingStartTime>xs&&u!==1073741824&&(o.flags|=128,h=!0,To(x,!1),o.lanes=4194304);x.isBackwards?(C.sibling=o.child,o.child=C):(u=x.last,u!==null?u.sibling=C:o.child=C,x.last=C)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=Qe(),o.sibling=null,u=mt.current,lt(mt,h?u&1|2:u&1),o):(Yt(o),null);case 22:case 23:return Md(),h=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==h&&(o.flags|=8192),h&&(o.mode&1)!==0?(Cn&1073741824)!==0&&(Yt(o),o.subtreeFlags&6&&(o.flags|=8192)):Yt(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function xE(i,o){switch(Bc(o),o.tag){case 1:return fn(o.type)&&Qa(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ms(),ct(dn),ct(Kt),ed(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Jc(o),null;case 13:if(ct(mt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));ds()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return ct(mt),null;case 4:return ms(),null;case 10:return Gc(o.type._context),null;case 22:case 23:return Md(),null;case 24:return null;default:return null}}var yl=!1,Qt=!1,wE=typeof WeakSet=="function"?WeakSet:Set,be=null;function ys(i,o){var u=i.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){vt(i,o,h)}else u.current=null}function wd(i,o,u){try{u()}catch(h){vt(i,o,h)}}var gy=!1;function SE(i,o){if(Mc=Oa,i=Km(),bc(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var C=0,L=-1,O=-1,G=0,re=0,se=i,te=null;t:for(;;){for(var we;se!==u||g!==0&&se.nodeType!==3||(L=C+g),se!==x||h!==0&&se.nodeType!==3||(O=C+h),se.nodeType===3&&(C+=se.nodeValue.length),(we=se.firstChild)!==null;)te=se,se=we;for(;;){if(se===i)break t;if(te===u&&++G===g&&(L=C),te===x&&++re===h&&(O=C),(we=se.nextSibling)!==null)break;se=te,te=se.parentNode}se=we}u=L===-1||O===-1?null:{start:L,end:O}}else u=null}u=u||{start:0,end:0}}else u=null;for(Nc={focusedElem:i,selectionRange:u},Oa=!1,be=o;be!==null;)if(o=be,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,be=i;else for(;be!==null;){o=be;try{var Ee=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Ee!==null){var Pe=Ee.memoizedProps,kt=Ee.memoizedState,$=o.stateNode,V=$.getSnapshotBeforeUpdate(o.elementType===o.type?Pe:Wn(o.type,Pe),kt);$.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var W=o.stateNode.containerInfo;W.nodeType===1?W.textContent="":W.nodeType===9&&W.documentElement&&W.removeChild(W.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){vt(o,o.return,de)}if(i=o.sibling,i!==null){i.return=o.return,be=i;break}be=o.return}return Ee=gy,gy=!1,Ee}function Ro(i,o,u){var h=o.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var g=h=h.next;do{if((g.tag&i)===i){var x=g.destroy;g.destroy=void 0,x!==void 0&&wd(o,u,x)}g=g.next}while(g!==h)}}function vl(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&i)===i){var h=u.create;u.destroy=h()}u=u.next}while(u!==o)}}function Sd(i){var o=i.ref;if(o!==null){var u=i.stateNode;switch(i.tag){case 5:i=u;break;default:i=u}typeof o=="function"?o(i):o.current=i}}function yy(i){var o=i.alternate;o!==null&&(i.alternate=null,yy(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[ir],delete o[vo],delete o[Oc],delete o[rE],delete o[iE])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function vy(i){return i.tag===5||i.tag===3||i.tag===4}function xy(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||vy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function kd(i,o,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?u.nodeType===8?u.parentNode.insertBefore(i,o):u.insertBefore(i,o):(u.nodeType===8?(o=u.parentNode,o.insertBefore(i,u)):(o=u,o.appendChild(i)),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Xa));else if(h!==4&&(i=i.child,i!==null))for(kd(i,o,u),i=i.sibling;i!==null;)kd(i,o,u),i=i.sibling}function Cd(i,o,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?u.insertBefore(i,o):u.appendChild(i);else if(h!==4&&(i=i.child,i!==null))for(Cd(i,o,u),i=i.sibling;i!==null;)Cd(i,o,u),i=i.sibling}var Bt=null,qn=!1;function Xr(i,o,u){for(u=u.child;u!==null;)wy(i,o,u),u=u.sibling}function wy(i,o,u){if(rr&&typeof rr.onCommitFiberUnmount=="function")try{rr.onCommitFiberUnmount(Ia,u)}catch{}switch(u.tag){case 5:Qt||ys(u,o);case 6:var h=Bt,g=qn;Bt=null,Xr(i,o,u),Bt=h,qn=g,Bt!==null&&(qn?(i=Bt,u=u.stateNode,i.nodeType===8?i.parentNode.removeChild(u):i.removeChild(u)):Bt.removeChild(u.stateNode));break;case 18:Bt!==null&&(qn?(i=Bt,u=u.stateNode,i.nodeType===8?Dc(i.parentNode,u):i.nodeType===1&&Dc(i,u),oo(i)):Dc(Bt,u.stateNode));break;case 4:h=Bt,g=qn,Bt=u.stateNode.containerInfo,qn=!0,Xr(i,o,u),Bt=h,qn=g;break;case 0:case 11:case 14:case 15:if(!Qt&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var x=g,C=x.destroy;x=x.tag,C!==void 0&&((x&2)!==0||(x&4)!==0)&&wd(u,o,C),g=g.next}while(g!==h)}Xr(i,o,u);break;case 1:if(!Qt&&(ys(u,o),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(L){vt(u,o,L)}Xr(i,o,u);break;case 21:Xr(i,o,u);break;case 22:u.mode&1?(Qt=(h=Qt)||u.memoizedState!==null,Xr(i,o,u),Qt=h):Xr(i,o,u);break;default:Xr(i,o,u)}}function Sy(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var u=i.stateNode;u===null&&(u=i.stateNode=new wE),o.forEach(function(h){var g=AE.bind(null,i,h);u.has(h)||(u.add(h),h.then(g,g))})}}function Gn(i,o){var u=o.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];try{var x=i,C=o,L=C;e:for(;L!==null;){switch(L.tag){case 5:Bt=L.stateNode,qn=!1;break e;case 3:Bt=L.stateNode.containerInfo,qn=!0;break e;case 4:Bt=L.stateNode.containerInfo,qn=!0;break e}L=L.return}if(Bt===null)throw Error(n(160));wy(x,C,g),Bt=null,qn=!1;var O=g.alternate;O!==null&&(O.return=null),g.return=null}catch(G){vt(g,o,G)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)ky(o,i),o=o.sibling}function ky(i,o){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Gn(o,i),ar(i),h&4){try{Ro(3,i,i.return),vl(3,i)}catch(Pe){vt(i,i.return,Pe)}try{Ro(5,i,i.return)}catch(Pe){vt(i,i.return,Pe)}}break;case 1:Gn(o,i),ar(i),h&512&&u!==null&&ys(u,u.return);break;case 5:if(Gn(o,i),ar(i),h&512&&u!==null&&ys(u,u.return),i.flags&32){var g=i.stateNode;try{Ve(g,"")}catch(Pe){vt(i,i.return,Pe)}}if(h&4&&(g=i.stateNode,g!=null)){var x=i.memoizedProps,C=u!==null?u.memoizedProps:x,L=i.type,O=i.updateQueue;if(i.updateQueue=null,O!==null)try{L==="input"&&x.type==="radio"&&x.name!=null&&en(g,x),Le(L,C);var G=Le(L,x);for(C=0;C<O.length;C+=2){var re=O[C],se=O[C+1];re==="style"?ge(g,se):re==="dangerouslySetInnerHTML"?Ae(g,se):re==="children"?Ve(g,se):_(g,re,se,G)}switch(L){case"input":et(g,x);break;case"textarea":He(g,x);break;case"select":var te=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!x.multiple;var we=x.value;we!=null?tn(g,!!x.multiple,we,!1):te!==!!x.multiple&&(x.defaultValue!=null?tn(g,!!x.multiple,x.defaultValue,!0):tn(g,!!x.multiple,x.multiple?[]:"",!1))}g[vo]=x}catch(Pe){vt(i,i.return,Pe)}}break;case 6:if(Gn(o,i),ar(i),h&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,x=i.memoizedProps;try{g.nodeValue=x}catch(Pe){vt(i,i.return,Pe)}}break;case 3:if(Gn(o,i),ar(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{oo(o.containerInfo)}catch(Pe){vt(i,i.return,Pe)}break;case 4:Gn(o,i),ar(i);break;case 13:Gn(o,i),ar(i),g=i.child,g.flags&8192&&(x=g.memoizedState!==null,g.stateNode.isHidden=x,!x||g.alternate!==null&&g.alternate.memoizedState!==null||(_d=Qe())),h&4&&Sy(i);break;case 22:if(re=u!==null&&u.memoizedState!==null,i.mode&1?(Qt=(G=Qt)||re,Gn(o,i),Qt=G):Gn(o,i),ar(i),h&8192){if(G=i.memoizedState!==null,(i.stateNode.isHidden=G)&&!re&&(i.mode&1)!==0)for(be=i,re=i.child;re!==null;){for(se=be=re;be!==null;){switch(te=be,we=te.child,te.tag){case 0:case 11:case 14:case 15:Ro(4,te,te.return);break;case 1:ys(te,te.return);var Ee=te.stateNode;if(typeof Ee.componentWillUnmount=="function"){h=te,u=te.return;try{o=h,Ee.props=o.memoizedProps,Ee.state=o.memoizedState,Ee.componentWillUnmount()}catch(Pe){vt(h,u,Pe)}}break;case 5:ys(te,te.return);break;case 22:if(te.memoizedState!==null){Ey(se);continue}}we!==null?(we.return=te,be=we):Ey(se)}re=re.sibling}e:for(re=null,se=i;;){if(se.tag===5){if(re===null){re=se;try{g=se.stateNode,G?(x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(L=se.stateNode,O=se.memoizedProps.style,C=O!=null&&O.hasOwnProperty("display")?O.display:null,L.style.display=H("display",C))}catch(Pe){vt(i,i.return,Pe)}}}else if(se.tag===6){if(re===null)try{se.stateNode.nodeValue=G?"":se.memoizedProps}catch(Pe){vt(i,i.return,Pe)}}else if((se.tag!==22&&se.tag!==23||se.memoizedState===null||se===i)&&se.child!==null){se.child.return=se,se=se.child;continue}if(se===i)break e;for(;se.sibling===null;){if(se.return===null||se.return===i)break e;re===se&&(re=null),se=se.return}re===se&&(re=null),se.sibling.return=se.return,se=se.sibling}}break;case 19:Gn(o,i),ar(i),h&4&&Sy(i);break;case 21:break;default:Gn(o,i),ar(i)}}function ar(i){var o=i.flags;if(o&2){try{e:{for(var u=i.return;u!==null;){if(vy(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var g=h.stateNode;h.flags&32&&(Ve(g,""),h.flags&=-33);var x=xy(i);Cd(i,x,g);break;case 3:case 4:var C=h.stateNode.containerInfo,L=xy(i);kd(i,L,C);break;default:throw Error(n(161))}}catch(O){vt(i,i.return,O)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function kE(i,o,u){be=i,Cy(i)}function Cy(i,o,u){for(var h=(i.mode&1)!==0;be!==null;){var g=be,x=g.child;if(g.tag===22&&h){var C=g.memoizedState!==null||yl;if(!C){var L=g.alternate,O=L!==null&&L.memoizedState!==null||Qt;L=yl;var G=Qt;if(yl=C,(Qt=O)&&!G)for(be=g;be!==null;)C=be,O=C.child,C.tag===22&&C.memoizedState!==null?_y(g):O!==null?(O.return=C,be=O):_y(g);for(;x!==null;)be=x,Cy(x),x=x.sibling;be=g,yl=L,Qt=G}by(i)}else(g.subtreeFlags&8772)!==0&&x!==null?(x.return=g,be=x):by(i)}}function by(i){for(;be!==null;){var o=be;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:Qt||vl(5,o);break;case 1:var h=o.stateNode;if(o.flags&4&&!Qt)if(u===null)h.componentDidMount();else{var g=o.elementType===o.type?u.memoizedProps:Wn(o.type,u.memoizedProps);h.componentDidUpdate(g,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&Eg(o,x,h);break;case 3:var C=o.updateQueue;if(C!==null){if(u=null,o.child!==null)switch(o.child.tag){case 5:u=o.child.stateNode;break;case 1:u=o.child.stateNode}Eg(o,C,u)}break;case 5:var L=o.stateNode;if(u===null&&o.flags&4){u=L;var O=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":O.autoFocus&&u.focus();break;case"img":O.src&&(u.src=O.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var G=o.alternate;if(G!==null){var re=G.memoizedState;if(re!==null){var se=re.dehydrated;se!==null&&oo(se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Qt||o.flags&512&&Sd(o)}catch(te){vt(o,o.return,te)}}if(o===i){be=null;break}if(u=o.sibling,u!==null){u.return=o.return,be=u;break}be=o.return}}function Ey(i){for(;be!==null;){var o=be;if(o===i){be=null;break}var u=o.sibling;if(u!==null){u.return=o.return,be=u;break}be=o.return}}function _y(i){for(;be!==null;){var o=be;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{vl(4,o)}catch(O){vt(o,u,O)}break;case 1:var h=o.stateNode;if(typeof h.componentDidMount=="function"){var g=o.return;try{h.componentDidMount()}catch(O){vt(o,g,O)}}var x=o.return;try{Sd(o)}catch(O){vt(o,x,O)}break;case 5:var C=o.return;try{Sd(o)}catch(O){vt(o,C,O)}}}catch(O){vt(o,o.return,O)}if(o===i){be=null;break}var L=o.sibling;if(L!==null){L.return=o.return,be=L;break}be=o.return}}var CE=Math.ceil,xl=j.ReactCurrentDispatcher,bd=j.ReactCurrentOwner,Ln=j.ReactCurrentBatchConfig,Ke=0,Dt=null,Et=null,Ut=0,Cn=0,vs=Hr(0),It=0,Ao=null,Ci=0,wl=0,Ed=0,Io=null,pn=null,_d=0,xs=1/0,Pr=null,Sl=!1,Pd=null,Yr=null,kl=!1,Qr=null,Cl=0,Mo=0,Td=null,bl=-1,El=0;function rn(){return(Ke&6)!==0?Qe():bl!==-1?bl:bl=Qe()}function Jr(i){return(i.mode&1)===0?1:(Ke&2)!==0&&Ut!==0?Ut&-Ut:oE.transition!==null?(El===0&&(El=xm()),El):(i=Ze,i!==0||(i=window.event,i=i===void 0?16:Tm(i.type)),i)}function Kn(i,o,u,h){if(50<Mo)throw Mo=0,Td=null,Error(n(185));to(i,u,h),((Ke&2)===0||i!==Dt)&&(i===Dt&&((Ke&2)===0&&(wl|=u),It===4&&Zr(i,Ut)),mn(i,h),u===1&&Ke===0&&(o.mode&1)===0&&(xs=Qe()+500,Za&&qr()))}function mn(i,o){var u=i.callbackNode;ob(i,o);var h=La(i,i===Dt?Ut:0);if(h===0)u!==null&&pt(u),i.callbackNode=null,i.callbackPriority=0;else if(o=h&-h,i.callbackPriority!==o){if(u!=null&&pt(u),o===1)i.tag===0?sE(Ty.bind(null,i)):hg(Ty.bind(null,i)),tE(function(){(Ke&6)===0&&qr()}),u=null;else{switch(wm(h)){case 1:u=cn;break;case 4:u=St;break;case 16:u=Bn;break;case 536870912:u=vm;break;default:u=Bn}u=Dy(u,Py.bind(null,i))}i.callbackPriority=o,i.callbackNode=u}}function Py(i,o){if(bl=-1,El=0,(Ke&6)!==0)throw Error(n(327));var u=i.callbackNode;if(ws()&&i.callbackNode!==u)return null;var h=La(i,i===Dt?Ut:0);if(h===0)return null;if((h&30)!==0||(h&i.expiredLanes)!==0||o)o=_l(i,h);else{o=h;var g=Ke;Ke|=2;var x=Ay();(Dt!==i||Ut!==o)&&(Pr=null,xs=Qe()+500,Ei(i,o));do try{_E();break}catch(L){Ry(i,L)}while(!0);qc(),xl.current=x,Ke=g,Et!==null?o=0:(Dt=null,Ut=0,o=It)}if(o!==0){if(o===2&&(g=lc(i),g!==0&&(h=g,o=Rd(i,g))),o===1)throw u=Ao,Ei(i,0),Zr(i,h),mn(i,Qe()),u;if(o===6)Zr(i,h);else{if(g=i.current.alternate,(h&30)===0&&!bE(g)&&(o=_l(i,h),o===2&&(x=lc(i),x!==0&&(h=x,o=Rd(i,x))),o===1))throw u=Ao,Ei(i,0),Zr(i,h),mn(i,Qe()),u;switch(i.finishedWork=g,i.finishedLanes=h,o){case 0:case 1:throw Error(n(345));case 2:_i(i,pn,Pr);break;case 3:if(Zr(i,h),(h&130023424)===h&&(o=_d+500-Qe(),10<o)){if(La(i,0)!==0)break;if(g=i.suspendedLanes,(g&h)!==h){rn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=jc(_i.bind(null,i,pn,Pr),o);break}_i(i,pn,Pr);break;case 4:if(Zr(i,h),(h&4194240)===h)break;for(o=i.eventTimes,g=-1;0<h;){var C=31-Un(h);x=1<<C,C=o[C],C>g&&(g=C),h&=~x}if(h=g,h=Qe()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*CE(h/1960))-h,10<h){i.timeoutHandle=jc(_i.bind(null,i,pn,Pr),h);break}_i(i,pn,Pr);break;case 5:_i(i,pn,Pr);break;default:throw Error(n(329))}}}return mn(i,Qe()),i.callbackNode===u?Py.bind(null,i):null}function Rd(i,o){var u=Io;return i.current.memoizedState.isDehydrated&&(Ei(i,o).flags|=256),i=_l(i,o),i!==2&&(o=pn,pn=u,o!==null&&Ad(o)),i}function Ad(i){pn===null?pn=i:pn.push.apply(pn,i)}function bE(i){for(var o=i;;){if(o.flags&16384){var u=o.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var g=u[h],x=g.getSnapshot;g=g.value;try{if(!$n(x(),g))return!1}catch{return!1}}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Zr(i,o){for(o&=~Ed,o&=~wl,i.suspendedLanes|=o,i.pingedLanes&=~o,i=i.expirationTimes;0<o;){var u=31-Un(o),h=1<<u;i[u]=-1,o&=~h}}function Ty(i){if((Ke&6)!==0)throw Error(n(327));ws();var o=La(i,0);if((o&1)===0)return mn(i,Qe()),null;var u=_l(i,o);if(i.tag!==0&&u===2){var h=lc(i);h!==0&&(o=h,u=Rd(i,h))}if(u===1)throw u=Ao,Ei(i,0),Zr(i,o),mn(i,Qe()),u;if(u===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=o,_i(i,pn,Pr),mn(i,Qe()),null}function Id(i,o){var u=Ke;Ke|=1;try{return i(o)}finally{Ke=u,Ke===0&&(xs=Qe()+500,Za&&qr())}}function bi(i){Qr!==null&&Qr.tag===0&&(Ke&6)===0&&ws();var o=Ke;Ke|=1;var u=Ln.transition,h=Ze;try{if(Ln.transition=null,Ze=1,i)return i()}finally{Ze=h,Ln.transition=u,Ke=o,(Ke&6)===0&&qr()}}function Md(){Cn=vs.current,ct(vs)}function Ei(i,o){i.finishedWork=null,i.finishedLanes=0;var u=i.timeoutHandle;if(u!==-1&&(i.timeoutHandle=-1,eE(u)),Et!==null)for(u=Et.return;u!==null;){var h=u;switch(Bc(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&Qa();break;case 3:ms(),ct(dn),ct(Kt),ed();break;case 5:Jc(h);break;case 4:ms();break;case 13:ct(mt);break;case 19:ct(mt);break;case 10:Gc(h.type._context);break;case 22:case 23:Md()}u=u.return}if(Dt=i,Et=i=ei(i.current,null),Ut=Cn=o,It=0,Ao=null,Ed=wl=Ci=0,pn=Io=null,wi!==null){for(o=0;o<wi.length;o++)if(u=wi[o],h=u.interleaved,h!==null){u.interleaved=null;var g=h.next,x=u.pending;if(x!==null){var C=x.next;x.next=g,h.next=C}u.pending=h}wi=null}return i}function Ry(i,o){do{var u=Et;try{if(qc(),ul.current=hl,cl){for(var h=gt.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}cl=!1}if(ki=0,jt=At=gt=null,bo=!1,Eo=0,bd.current=null,u===null||u.return===null){It=1,Ao=o,Et=null;break}e:{var x=i,C=u.return,L=u,O=o;if(o=Ut,L.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){var G=O,re=L,se=re.tag;if((re.mode&1)===0&&(se===0||se===11||se===15)){var te=re.alternate;te?(re.updateQueue=te.updateQueue,re.memoizedState=te.memoizedState,re.lanes=te.lanes):(re.updateQueue=null,re.memoizedState=null)}var we=ey(C);if(we!==null){we.flags&=-257,ty(we,C,L,x,o),we.mode&1&&Zg(x,G,o),o=we,O=G;var Ee=o.updateQueue;if(Ee===null){var Pe=new Set;Pe.add(O),o.updateQueue=Pe}else Ee.add(O);break e}else{if((o&1)===0){Zg(x,G,o),Nd();break e}O=Error(n(426))}}else if(ft&&L.mode&1){var kt=ey(C);if(kt!==null){(kt.flags&65536)===0&&(kt.flags|=256),ty(kt,C,L,x,o),Hc(gs(O,L));break e}}x=O=gs(O,L),It!==4&&(It=2),Io===null?Io=[x]:Io.push(x),x=C;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var $=Qg(x,O,o);bg(x,$);break e;case 1:L=O;var V=x.type,W=x.stateNode;if((x.flags&128)===0&&(typeof V.getDerivedStateFromError=="function"||W!==null&&typeof W.componentDidCatch=="function"&&(Yr===null||!Yr.has(W)))){x.flags|=65536,o&=-o,x.lanes|=o;var de=Jg(x,L,o);bg(x,de);break e}}x=x.return}while(x!==null)}My(u)}catch(Re){o=Re,Et===u&&u!==null&&(Et=u=u.return);continue}break}while(!0)}function Ay(){var i=xl.current;return xl.current=hl,i===null?hl:i}function Nd(){(It===0||It===3||It===2)&&(It=4),Dt===null||(Ci&268435455)===0&&(wl&268435455)===0||Zr(Dt,Ut)}function _l(i,o){var u=Ke;Ke|=2;var h=Ay();(Dt!==i||Ut!==o)&&(Pr=null,Ei(i,o));do try{EE();break}catch(g){Ry(i,g)}while(!0);if(qc(),Ke=u,xl.current=h,Et!==null)throw Error(n(261));return Dt=null,Ut=0,It}function EE(){for(;Et!==null;)Iy(Et)}function _E(){for(;Et!==null&&!Rt();)Iy(Et)}function Iy(i){var o=jy(i.alternate,i,Cn);i.memoizedProps=i.pendingProps,o===null?My(i):Et=o,bd.current=null}function My(i){var o=i;do{var u=o.alternate;if(i=o.return,(o.flags&32768)===0){if(u=vE(u,o,Cn),u!==null){Et=u;return}}else{if(u=xE(u,o),u!==null){u.flags&=32767,Et=u;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{It=6,Et=null;return}}if(o=o.sibling,o!==null){Et=o;return}Et=o=i}while(o!==null);It===0&&(It=5)}function _i(i,o,u){var h=Ze,g=Ln.transition;try{Ln.transition=null,Ze=1,PE(i,o,u,h)}finally{Ln.transition=g,Ze=h}return null}function PE(i,o,u,h){do ws();while(Qr!==null);if((Ke&6)!==0)throw Error(n(327));u=i.finishedWork;var g=i.finishedLanes;if(u===null)return null;if(i.finishedWork=null,i.finishedLanes=0,u===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var x=u.lanes|u.childLanes;if(ab(i,x),i===Dt&&(Et=Dt=null,Ut=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||kl||(kl=!0,Dy(Bn,function(){return ws(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Ln.transition,Ln.transition=null;var C=Ze;Ze=1;var L=Ke;Ke|=4,bd.current=null,SE(i,u),ky(u,i),Gb(Nc),Oa=!!Mc,Nc=Mc=null,i.current=u,kE(u),Rn(),Ke=L,Ze=C,Ln.transition=x}else i.current=u;if(kl&&(kl=!1,Qr=i,Cl=g),x=i.pendingLanes,x===0&&(Yr=null),tb(u.stateNode),mn(i,Qe()),o!==null)for(h=i.onRecoverableError,u=0;u<o.length;u++)g=o[u],h(g.value,{componentStack:g.stack,digest:g.digest});if(Sl)throw Sl=!1,i=Pd,Pd=null,i;return(Cl&1)!==0&&i.tag!==0&&ws(),x=i.pendingLanes,(x&1)!==0?i===Td?Mo++:(Mo=0,Td=i):Mo=0,qr(),null}function ws(){if(Qr!==null){var i=wm(Cl),o=Ln.transition,u=Ze;try{if(Ln.transition=null,Ze=16>i?16:i,Qr===null)var h=!1;else{if(i=Qr,Qr=null,Cl=0,(Ke&6)!==0)throw Error(n(331));var g=Ke;for(Ke|=4,be=i.current;be!==null;){var x=be,C=x.child;if((be.flags&16)!==0){var L=x.deletions;if(L!==null){for(var O=0;O<L.length;O++){var G=L[O];for(be=G;be!==null;){var re=be;switch(re.tag){case 0:case 11:case 15:Ro(8,re,x)}var se=re.child;if(se!==null)se.return=re,be=se;else for(;be!==null;){re=be;var te=re.sibling,we=re.return;if(yy(re),re===G){be=null;break}if(te!==null){te.return=we,be=te;break}be=we}}}var Ee=x.alternate;if(Ee!==null){var Pe=Ee.child;if(Pe!==null){Ee.child=null;do{var kt=Pe.sibling;Pe.sibling=null,Pe=kt}while(Pe!==null)}}be=x}}if((x.subtreeFlags&2064)!==0&&C!==null)C.return=x,be=C;else e:for(;be!==null;){if(x=be,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:Ro(9,x,x.return)}var $=x.sibling;if($!==null){$.return=x.return,be=$;break e}be=x.return}}var V=i.current;for(be=V;be!==null;){C=be;var W=C.child;if((C.subtreeFlags&2064)!==0&&W!==null)W.return=C,be=W;else e:for(C=V;be!==null;){if(L=be,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:vl(9,L)}}catch(Re){vt(L,L.return,Re)}if(L===C){be=null;break e}var de=L.sibling;if(de!==null){de.return=L.return,be=de;break e}be=L.return}}if(Ke=g,qr(),rr&&typeof rr.onPostCommitFiberRoot=="function")try{rr.onPostCommitFiberRoot(Ia,i)}catch{}h=!0}return h}finally{Ze=u,Ln.transition=o}}return!1}function Ny(i,o,u){o=gs(u,o),o=Qg(i,o,1),i=Kr(i,o,1),o=rn(),i!==null&&(to(i,1,o),mn(i,o))}function vt(i,o,u){if(i.tag===3)Ny(i,i,u);else for(;o!==null;){if(o.tag===3){Ny(o,i,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Yr===null||!Yr.has(h))){i=gs(u,i),i=Jg(o,i,1),o=Kr(o,i,1),i=rn(),o!==null&&(to(o,1,i),mn(o,i));break}}o=o.return}}function TE(i,o,u){var h=i.pingCache;h!==null&&h.delete(o),o=rn(),i.pingedLanes|=i.suspendedLanes&u,Dt===i&&(Ut&u)===u&&(It===4||It===3&&(Ut&130023424)===Ut&&500>Qe()-_d?Ei(i,0):Ed|=u),mn(i,o)}function Ly(i,o){o===0&&((i.mode&1)===0?o=1:(o=Na,Na<<=1,(Na&130023424)===0&&(Na=4194304)));var u=rn();i=br(i,o),i!==null&&(to(i,o,u),mn(i,u))}function RE(i){var o=i.memoizedState,u=0;o!==null&&(u=o.retryLane),Ly(i,u)}function AE(i,o){var u=0;switch(i.tag){case 13:var h=i.stateNode,g=i.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=i.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(o),Ly(i,u)}var jy;jy=function(i,o,u){if(i!==null)if(i.memoizedProps!==o.pendingProps||dn.current)hn=!0;else{if((i.lanes&u)===0&&(o.flags&128)===0)return hn=!1,yE(i,o,u);hn=(i.flags&131072)!==0}else hn=!1,ft&&(o.flags&1048576)!==0&&pg(o,tl,o.index);switch(o.lanes=0,o.tag){case 2:var h=o.type;gl(i,o),i=o.pendingProps;var g=ls(o,Kt.current);ps(o,u),g=rd(null,o,h,i,g,u);var x=id();return o.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,fn(h)?(x=!0,Ja(o)):x=!1,o.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Yc(o),g.updater=pl,o.stateNode=g,g._reactInternals=o,cd(o,h,i,u),o=pd(null,o,h,!0,x,u)):(o.tag=0,ft&&x&&zc(o),nn(null,o,g,u),o=o.child),o;case 16:h=o.elementType;e:{switch(gl(i,o),i=o.pendingProps,g=h._init,h=g(h._payload),o.type=h,g=o.tag=ME(h),i=Wn(h,i),g){case 0:o=hd(null,o,h,i,u);break e;case 1:o=ay(null,o,h,i,u);break e;case 11:o=ny(null,o,h,i,u);break e;case 14:o=ry(null,o,h,Wn(h.type,i),u);break e}throw Error(n(306,h,""))}return o;case 0:return h=o.type,g=o.pendingProps,g=o.elementType===h?g:Wn(h,g),hd(i,o,h,g,u);case 1:return h=o.type,g=o.pendingProps,g=o.elementType===h?g:Wn(h,g),ay(i,o,h,g,u);case 3:e:{if(ly(o),i===null)throw Error(n(387));h=o.pendingProps,x=o.memoizedState,g=x.element,Cg(i,o),al(o,h,null,u);var C=o.memoizedState;if(h=C.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){g=gs(Error(n(423)),o),o=uy(i,o,h,u,g);break e}else if(h!==g){g=gs(Error(n(424)),o),o=uy(i,o,h,u,g);break e}else for(kn=$r(o.stateNode.containerInfo.firstChild),Sn=o,ft=!0,Hn=null,u=Sg(o,null,h,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(ds(),h===g){o=_r(i,o,u);break e}nn(i,o,h,u)}o=o.child}return o;case 5:return _g(o),i===null&&$c(o),h=o.type,g=o.pendingProps,x=i!==null?i.memoizedProps:null,C=g.children,Lc(h,g)?C=null:x!==null&&Lc(h,x)&&(o.flags|=32),oy(i,o),nn(i,o,C,u),o.child;case 6:return i===null&&$c(o),null;case 13:return cy(i,o,u);case 4:return Qc(o,o.stateNode.containerInfo),h=o.pendingProps,i===null?o.child=fs(o,null,h,u):nn(i,o,h,u),o.child;case 11:return h=o.type,g=o.pendingProps,g=o.elementType===h?g:Wn(h,g),ny(i,o,h,g,u);case 7:return nn(i,o,o.pendingProps,u),o.child;case 8:return nn(i,o,o.pendingProps.children,u),o.child;case 12:return nn(i,o,o.pendingProps.children,u),o.child;case 10:e:{if(h=o.type._context,g=o.pendingProps,x=o.memoizedProps,C=g.value,lt(il,h._currentValue),h._currentValue=C,x!==null)if($n(x.value,C)){if(x.children===g.children&&!dn.current){o=_r(i,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var L=x.dependencies;if(L!==null){C=x.child;for(var O=L.firstContext;O!==null;){if(O.context===h){if(x.tag===1){O=Er(-1,u&-u),O.tag=2;var G=x.updateQueue;if(G!==null){G=G.shared;var re=G.pending;re===null?O.next=O:(O.next=re.next,re.next=O),G.pending=O}}x.lanes|=u,O=x.alternate,O!==null&&(O.lanes|=u),Kc(x.return,u,o),L.lanes|=u;break}O=O.next}}else if(x.tag===10)C=x.type===o.type?null:x.child;else if(x.tag===18){if(C=x.return,C===null)throw Error(n(341));C.lanes|=u,L=C.alternate,L!==null&&(L.lanes|=u),Kc(C,u,o),C=x.sibling}else C=x.child;if(C!==null)C.return=x;else for(C=x;C!==null;){if(C===o){C=null;break}if(x=C.sibling,x!==null){x.return=C.return,C=x;break}C=C.return}x=C}nn(i,o,g.children,u),o=o.child}return o;case 9:return g=o.type,h=o.pendingProps.children,ps(o,u),g=Mn(g),h=h(g),o.flags|=1,nn(i,o,h,u),o.child;case 14:return h=o.type,g=Wn(h,o.pendingProps),g=Wn(h.type,g),ry(i,o,h,g,u);case 15:return iy(i,o,o.type,o.pendingProps,u);case 17:return h=o.type,g=o.pendingProps,g=o.elementType===h?g:Wn(h,g),gl(i,o),o.tag=1,fn(h)?(i=!0,Ja(o)):i=!1,ps(o,u),Xg(o,h,g),cd(o,h,g,u),pd(null,o,h,!0,i,u);case 19:return fy(i,o,u);case 22:return sy(i,o,u)}throw Error(n(156,o.tag))};function Dy(i,o){return Oe(i,o)}function IE(i,o,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(i,o,u,h){return new IE(i,o,u,h)}function Ld(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ME(i){if(typeof i=="function")return Ld(i)?1:0;if(i!=null){if(i=i.$$typeof,i===z)return 11;if(i===Z)return 14}return 2}function ei(i,o){var u=i.alternate;return u===null?(u=jn(i.tag,o,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=o,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&14680064,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,o=i.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u}function Pl(i,o,u,h,g,x){var C=2;if(h=i,typeof i=="function")Ld(i)&&(C=1);else if(typeof i=="string")C=5;else e:switch(i){case q:return Pi(u.children,g,x,o);case B:C=8,g|=8;break;case D:return i=jn(12,u,o,g|2),i.elementType=D,i.lanes=x,i;case he:return i=jn(13,u,o,g),i.elementType=he,i.lanes=x,i;case J:return i=jn(19,u,o,g),i.elementType=J,i.lanes=x,i;case Se:return Tl(u,g,x,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case I:C=10;break e;case U:C=9;break e;case z:C=11;break e;case Z:C=14;break e;case ve:C=16,h=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=jn(C,u,o,g),o.elementType=i,o.type=h,o.lanes=x,o}function Pi(i,o,u,h){return i=jn(7,i,h,o),i.lanes=u,i}function Tl(i,o,u,h){return i=jn(22,i,h,o),i.elementType=Se,i.lanes=u,i.stateNode={isHidden:!1},i}function jd(i,o,u){return i=jn(6,i,null,o),i.lanes=u,i}function Dd(i,o,u){return o=jn(4,i.children!==null?i.children:[],i.key,o),o.lanes=u,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function NE(i,o,u,h,g){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uc(0),this.expirationTimes=uc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uc(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Od(i,o,u,h,g,x,C,L,O){return i=new NE(i,o,u,L,O),o===1?(o=1,x===!0&&(o|=8)):o=0,x=jn(3,null,null,o),i.current=x,x.stateNode=i,x.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yc(x),i}function LE(i,o,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:h==null?null:""+h,children:i,containerInfo:o,implementation:u}}function Oy(i){if(!i)return Wr;i=i._reactInternals;e:{if(xr(i)!==i||i.tag!==1)throw Error(n(170));var o=i;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(fn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(i.tag===1){var u=i.type;if(fn(u))return dg(i,u,o)}return o}function Fy(i,o,u,h,g,x,C,L,O){return i=Od(u,h,!0,i,g,x,C,L,O),i.context=Oy(null),u=i.current,h=rn(),g=Jr(u),x=Er(h,g),x.callback=o??null,Kr(u,x,g),i.current.lanes=g,to(i,g,h),mn(i,h),i}function Rl(i,o,u,h){var g=o.current,x=rn(),C=Jr(g);return u=Oy(u),o.context===null?o.context=u:o.pendingContext=u,o=Er(x,C),o.payload={element:i},h=h===void 0?null:h,h!==null&&(o.callback=h),i=Kr(g,o,C),i!==null&&(Kn(i,g,C,x),ol(i,g,C)),C}function Al(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Vy(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<o?u:o}}function Fd(i,o){Vy(i,o),(i=i.alternate)&&Vy(i,o)}function jE(){return null}var zy=typeof reportError=="function"?reportError:function(i){console.error(i)};function Vd(i){this._internalRoot=i}Il.prototype.render=Vd.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(n(409));Rl(i,o,null,null)},Il.prototype.unmount=Vd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;bi(function(){Rl(null,i,null,null)}),o[wr]=null}};function Il(i){this._internalRoot=i}Il.prototype.unstable_scheduleHydration=function(i){if(i){var o=Cm();i={blockedOn:null,target:i,priority:o};for(var u=0;u<zr.length&&o!==0&&o<zr[u].priority;u++);zr.splice(u,0,i),u===0&&_m(i)}};function zd(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Ml(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function By(){}function DE(i,o,u,h,g){if(g){if(typeof h=="function"){var x=h;h=function(){var G=Al(C);x.call(G)}}var C=Fy(o,h,i,0,null,!1,!1,"",By);return i._reactRootContainer=C,i[wr]=C.current,go(i.nodeType===8?i.parentNode:i),bi(),C}for(;g=i.lastChild;)i.removeChild(g);if(typeof h=="function"){var L=h;h=function(){var G=Al(O);L.call(G)}}var O=Od(i,0,!1,null,null,!1,!1,"",By);return i._reactRootContainer=O,i[wr]=O.current,go(i.nodeType===8?i.parentNode:i),bi(function(){Rl(o,O,u,h)}),O}function Nl(i,o,u,h,g){var x=u._reactRootContainer;if(x){var C=x;if(typeof g=="function"){var L=g;g=function(){var O=Al(C);L.call(O)}}Rl(o,C,i,g)}else C=DE(u,o,i,g,h);return Al(C)}Sm=function(i){switch(i.tag){case 3:var o=i.stateNode;if(o.current.memoizedState.isDehydrated){var u=eo(o.pendingLanes);u!==0&&(cc(o,u|1),mn(o,Qe()),(Ke&6)===0&&(xs=Qe()+500,qr()))}break;case 13:bi(function(){var h=br(i,1);if(h!==null){var g=rn();Kn(h,i,1,g)}}),Fd(i,1)}},dc=function(i){if(i.tag===13){var o=br(i,134217728);if(o!==null){var u=rn();Kn(o,i,134217728,u)}Fd(i,134217728)}},km=function(i){if(i.tag===13){var o=Jr(i),u=br(i,o);if(u!==null){var h=rn();Kn(u,i,o,h)}Fd(i,o)}},Cm=function(){return Ze},bm=function(i,o){var u=Ze;try{return Ze=i,o()}finally{Ze=u}},wt=function(i,o,u){switch(o){case"input":if(et(i,u),o=u.name,u.type==="radio"&&o!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<u.length;o++){var h=u[o];if(h!==i&&h.form===i.form){var g=Ya(h);if(!g)throw Error(n(90));qe(h),et(h,g)}}}break;case"textarea":He(i,u);break;case"select":o=u.value,o!=null&&tn(i,!!u.multiple,o,!1)}},Tt=Id,Ta=bi;var OE={usingClientEntryPoint:!1,Events:[xo,os,Ya,ht,qt,Id]},No={findFiberByHostInstance:gi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},FE={bundleType:No.bundleType,version:No.version,rendererPackageName:No.rendererPackageName,rendererConfig:No.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ne(i),i===null?null:i.stateNode},findFiberByHostInstance:No.findFiberByHostInstance||jE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ll=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ll.isDisabled&&Ll.supportsFiber)try{Ia=Ll.inject(FE),rr=Ll}catch{}}return gn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=OE,gn.createPortal=function(i,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zd(o))throw Error(n(200));return LE(i,o,null,u)},gn.createRoot=function(i,o){if(!zd(i))throw Error(n(299));var u=!1,h="",g=zy;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onRecoverableError!==void 0&&(g=o.onRecoverableError)),o=Od(i,1,!1,null,null,u,!1,h,g),i[wr]=o.current,go(i.nodeType===8?i.parentNode:i),new Vd(o)},gn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=ne(o),i=i===null?null:i.stateNode,i},gn.flushSync=function(i){return bi(i)},gn.hydrate=function(i,o,u){if(!Ml(o))throw Error(n(200));return Nl(null,i,o,!0,u)},gn.hydrateRoot=function(i,o,u){if(!zd(i))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,g=!1,x="",C=zy;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),o=Fy(o,null,i,1,u??null,g,!1,x,C),i[wr]=o.current,go(i),h)for(i=0;i<h.length;i++)u=h[i],g=u._getVersion,g=g(u._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[u,g]:o.mutableSourceEagerHydrationData.push(u,g);return new Il(o)},gn.render=function(i,o,u){if(!Ml(o))throw Error(n(200));return Nl(null,i,o,!1,u)},gn.unmountComponentAtNode=function(i){if(!Ml(i))throw Error(n(40));return i._reactRootContainer?(bi(function(){Nl(null,null,i,!1,function(){i._reactRootContainer=null,i[wr]=null})}),!0):!1},gn.unstable_batchedUpdates=Id,gn.unstable_renderSubtreeIntoContainer=function(i,o,u,h){if(!Ml(u))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return Nl(i,o,u,!1,h)},gn.version="18.3.1-next-f1338f8080-20240426",gn}var Xy;function aw(){if(Xy)return $d.exports;Xy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$d.exports=qE(),$d.exports}var Yy;function GE(){if(Yy)return jl;Yy=1;var e=aw();return jl.createRoot=e.createRoot,jl.hydrateRoot=e.hydrateRoot,jl}var KE=GE(),S=Zh();const XE=Jh(S),ga=zE({__proto__:null,default:XE},[S]),ep=S.createContext({});function qu(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const YE=typeof window<"u",tp=YE?S.useLayoutEffect:S.useEffect,Gu=S.createContext(null);function np(e,t){e.indexOf(t)===-1&&e.push(t)}function yu(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const mr=(e,t,n)=>n>t?t:n<e?e:n;let Ku=()=>{};const ui={},lw=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),uw=e=>typeof e=="object"&&e!==null,cw=e=>/^0[^.\s]+$/u.test(e);function dw(e){let t;return()=>(t===void 0&&(t=e()),t)}const Vn=e=>e,ya=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ia=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class rp{constructor(){this.subscriptions=[]}add(t){return np(this.subscriptions,t),()=>yu(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const l=this.subscriptions[a];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _n=e=>e*1e3,Fn=e=>e/1e3,fw=(e,t)=>t?e*(1e3/t):0,hw=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,QE=1e-7,JE=12;function ZE(e,t,n,r,s){let a,l,c=0;do l=t+(n-t)/2,a=hw(l,r,s)-e,a>0?n=l:t=l;while(Math.abs(a)>QE&&++c<JE);return l}function va(e,t,n,r){if(e===t&&n===r)return Vn;const s=a=>ZE(a,0,1,e,n);return a=>a===0||a===1?a:hw(s(a),t,r)}const pw=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mw=e=>t=>1-e(1-t),gw=va(.33,1.53,.69,.99),ip=mw(gw),yw=pw(ip),vw=e=>e>=1?1:(e*=2)<1?.5*ip(e):.5*(2-Math.pow(2,-10*(e-1))),sp=e=>1-Math.sin(Math.acos(e)),xw=mw(sp),ww=pw(sp),e_=va(.42,0,1,1),t_=va(0,0,.58,1),Sw=va(.42,0,.58,1),n_=e=>Array.isArray(e)&&typeof e[0]!="number",kw=e=>Array.isArray(e)&&typeof e[0]=="number",r_={linear:Vn,easeIn:e_,easeInOut:Sw,easeOut:t_,circIn:sp,circInOut:ww,circOut:xw,backIn:ip,backInOut:yw,backOut:gw,anticipate:vw},i_=e=>typeof e=="string",Qy=e=>{if(kw(e)){Ku(e.length===4);const[t,n,r,s]=e;return va(t,n,r,s)}else if(i_(e))return r_[e];return e},Dl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function s_(e){let t=new Set,n=new Set,r=!1,s=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(f){a.has(f)&&(d.schedule(f),e()),f(l)}const d={schedule:(f,m=!1,p=!1)=>{const w=p&&r?t:n;return m&&a.add(f),w.add(f),f},cancel:f=>{n.delete(f),a.delete(f)},process:f=>{if(l=f,r){s=!0;return}r=!0;const m=t;t=n,n=m,t.forEach(c),t.clear(),r=!1,s&&(s=!1,d.process(f))}};return d}const o_=40;function Cw(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=Dl.reduce((_,j)=>(_[j]=s_(a),_),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:m,update:p,preRender:y,render:w,postRender:k}=l,b=()=>{const _=ui.useManualTiming,j=_?s.timestamp:performance.now();n=!1,_||(s.delta=r?1e3/60:Math.max(Math.min(j-s.timestamp,o_),1)),s.timestamp=j,s.isProcessing=!0,c.process(s),d.process(s),f.process(s),m.process(s),p.process(s),y.process(s),w.process(s),k.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(b))},E=()=>{n=!0,r=!0,s.isProcessing||e(b)};return{schedule:Dl.reduce((_,j)=>{const A=l[j];return _[j]=(N,q=!1,B=!1)=>(n||E(),A.schedule(N,q,B)),_},{}),cancel:_=>{for(let j=0;j<Dl.length;j++)l[Dl[j]].cancel(_)},state:s,steps:l}}const{schedule:rt,cancel:ci,state:$t,steps:qd}=Cw(typeof requestAnimationFrame<"u"?requestAnimationFrame:Vn,!0);let eu;function a_(){eu=void 0}const an={now:()=>(eu===void 0&&an.set($t.isProcessing||ui.useManualTiming?$t.timestamp:performance.now()),eu),set:e=>{eu=e,queueMicrotask(a_)}},bw=e=>t=>typeof t=="string"&&t.startsWith(e),Ew=bw("--"),l_=bw("var(--"),op=e=>l_(e)?u_.test(e.split("/*")[0].trim()):!1,u_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Jy(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ws={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},sa={...Ws,transform:e=>mr(0,1,e)},Ol={...Ws,default:1},qo=e=>Math.round(e*1e5)/1e5,ap=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function c_(e){return e==null}const d_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lp=(e,t)=>n=>!!(typeof n=="string"&&d_.test(n)&&n.startsWith(e)||t&&!c_(n)&&Object.prototype.hasOwnProperty.call(n,t)),_w=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,l,c]=r.match(ap);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},f_=e=>mr(0,255,e),Gd={...Ws,transform:e=>Math.round(f_(e))},Vi={test:lp("rgb","red"),parse:_w("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Gd.transform(e)+", "+Gd.transform(t)+", "+Gd.transform(n)+", "+qo(sa.transform(r))+")"};function h_(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const $f={test:lp("#"),parse:h_,transform:Vi.transform},xa=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rr=xa("deg"),pr=xa("%"),_e=xa("px"),p_=xa("vh"),m_=xa("vw"),Zy={...pr,parse:e=>pr.parse(e)/100,transform:e=>pr.transform(e*100)},Ms={test:lp("hsl","hue"),parse:_w("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+pr.transform(qo(t))+", "+pr.transform(qo(n))+", "+qo(sa.transform(r))+")"},Pt={test:e=>Vi.test(e)||$f.test(e)||Ms.test(e),parse:e=>Vi.test(e)?Vi.parse(e):Ms.test(e)?Ms.parse(e):$f.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Vi.transform(e):Ms.transform(e),getAnimatableNone:e=>{const t=Pt.parse(e);return t.alpha=0,Pt.transform(t)}},g_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function y_(e){return isNaN(e)&&typeof e=="string"&&(e.match(ap)?.length||0)+(e.match(g_)?.length||0)>0}const Pw="number",Tw="color",v_="var",x_="var(",ev="${}",w_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const c=t.replace(w_,d=>(Pt.test(d)?(r.color.push(a),s.push(Tw),n.push(Pt.parse(d))):d.startsWith(x_)?(r.var.push(a),s.push(v_),n.push(d)):(r.number.push(a),s.push(Pw),n.push(parseFloat(d))),++a,ev)).split(ev);return{values:n,split:c,indexes:r,types:s}}function S_(e){return Vs(e).values}function Rw({split:e,types:t}){const n=e.length;return r=>{let s="";for(let a=0;a<n;a++)if(s+=e[a],r[a]!==void 0){const l=t[a];l===Pw?s+=qo(r[a]):l===Tw?s+=Pt.transform(r[a]):s+=r[a]}return s}}function k_(e){return Rw(Vs(e))}const C_=e=>typeof e=="number"?0:Pt.test(e)?Pt.getAnimatableNone(e):e,b_=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:C_(e);function E_(e){const t=Vs(e);return Rw(t)(t.values.map((r,s)=>b_(r,t.split[s])))}const Jn={test:y_,parse:S_,createTransformer:k_,getAnimatableNone:E_};function Kd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function __({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,l=0;if(!t)s=a=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;s=Kd(d,c,e+1/3),a=Kd(d,c,e),l=Kd(d,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:r}}function vu(e,t){return n=>n>0?t:e}const nt=(e,t,n)=>e+(t-e)*n,Xd=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},P_=[$f,Vi,Ms],T_=e=>P_.find(t=>t.test(e));function tv(e){const t=T_(e);if(!t)return!1;let n=t.parse(e);return t===Ms&&(n=__(n)),n}const nv=(e,t)=>{const n=tv(e),r=tv(t);if(!n||!r)return vu(e,t);const s={...n};return a=>(s.red=Xd(n.red,r.red,a),s.green=Xd(n.green,r.green,a),s.blue=Xd(n.blue,r.blue,a),s.alpha=nt(n.alpha,r.alpha,a),Vi.transform(s))},Hf=new Set(["none","hidden"]);function R_(e,t){return Hf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function A_(e,t){return n=>nt(e,t,n)}function up(e){return typeof e=="number"?A_:typeof e=="string"?op(e)?vu:Pt.test(e)?nv:N_:Array.isArray(e)?Aw:typeof e=="object"?Pt.test(e)?nv:I_:vu}function Aw(e,t){const n=[...e],r=n.length,s=e.map((a,l)=>up(a)(a,t[l]));return a=>{for(let l=0;l<r;l++)n[l]=s[l](a);return n}}function I_(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=up(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function M_(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],l=e.indexes[a][r[a]],c=e.values[l]??0;n[s]=c,r[a]++}return n}const N_=(e,t)=>{const n=Jn.createTransformer(t),r=Vs(e),s=Vs(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Hf.has(e)&&!s.values.length||Hf.has(t)&&!r.values.length?R_(e,t):ya(Aw(M_(r,s),s.values),n):vu(e,t)};function Iw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nt(e,t,n):up(e)(e,t)}const L_=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>rt.update(t,n),stop:()=>ci(t),now:()=>$t.isProcessing?$t.timestamp:an.now()}},Mw=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},xu=2e4;function cp(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<xu;)t+=n,r=e.next(t);return t>=xu?1/0:t}function j_(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(cp(r),xu);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:Fn(s)}}const xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Wf(e,t){return e*Math.sqrt(1-t*t)}const D_=12;function O_(e,t,n){let r=n;for(let s=1;s<D_;s++)r=r-e(r)/t(r);return r}const Yd=.001;function F_({duration:e=xt.duration,bounce:t=xt.bounce,velocity:n=xt.velocity,mass:r=xt.mass}){let s,a,l=1-t;l=mr(xt.minDamping,xt.maxDamping,l),e=mr(xt.minDuration,xt.maxDuration,Fn(e)),l<1?(s=f=>{const m=f*l,p=m*e,y=m-n,w=Wf(f,l),k=Math.exp(-p);return Yd-y/w*k},a=f=>{const p=f*l*e,y=p*n+n,w=Math.pow(l,2)*Math.pow(f,2)*e,k=Math.exp(-p),b=Wf(Math.pow(f,2),l);return(-s(f)+Yd>0?-1:1)*((y-w)*k)/b}):(s=f=>{const m=Math.exp(-f*e),p=(f-n)*e+1;return-Yd+m*p},a=f=>{const m=Math.exp(-f*e),p=(n-f)*(e*e);return m*p});const c=5/e,d=O_(s,a,c);if(e=_n(e),isNaN(d))return{stiffness:xt.stiffness,damping:xt.damping,duration:e};{const f=Math.pow(d,2)*r;return{stiffness:f,damping:l*2*Math.sqrt(r*f),duration:e}}}const V_=["duration","bounce"],z_=["stiffness","damping","mass"];function rv(e,t){return t.some(n=>e[n]!==void 0)}function B_(e){let t={velocity:xt.velocity,stiffness:xt.stiffness,damping:xt.damping,mass:xt.mass,isResolvedFromDuration:!1,...e};if(!rv(e,z_)&&rv(e,V_))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*mr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:xt.mass,stiffness:s,damping:a}}else{const n=F_({...e,velocity:0});t={...t,...n,mass:xt.mass},t.isResolvedFromDuration=!0}return t}function wu(e=xt.visualDuration,t=xt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:a},{stiffness:d,damping:f,mass:m,duration:p,velocity:y,isResolvedFromDuration:w}=B_({...n,velocity:-Fn(n.velocity||0)}),k=y||0,b=f/(2*Math.sqrt(d*m)),E=l-a,P=Fn(Math.sqrt(d/m)),R=Math.abs(E)<5;r||(r=R?xt.restSpeed.granular:xt.restSpeed.default),s||(s=R?xt.restDelta.granular:xt.restDelta.default);let _,j,A,N,q,B;if(b<1)A=Wf(P,b),N=(k+b*P*E)/A,_=I=>{const U=Math.exp(-b*P*I);return l-U*(N*Math.sin(A*I)+E*Math.cos(A*I))},q=b*P*N+E*A,B=b*P*E-N*A,j=I=>Math.exp(-b*P*I)*(q*Math.sin(A*I)+B*Math.cos(A*I));else if(b===1){_=U=>l-Math.exp(-P*U)*(E+(k+P*E)*U);const I=k+P*E;j=U=>Math.exp(-P*U)*(P*I*U-k)}else{const I=P*Math.sqrt(b*b-1);_=J=>{const Z=Math.exp(-b*P*J),ve=Math.min(I*J,300);return l-Z*((k+b*P*E)*Math.sinh(ve)+I*E*Math.cosh(ve))/I};const U=(k+b*P*E)/I,z=b*P*U-E*I,he=b*P*E-U*I;j=J=>{const Z=Math.exp(-b*P*J),ve=Math.min(I*J,300);return Z*(z*Math.sinh(ve)+he*Math.cosh(ve))}}const D={calculatedDuration:w&&p||null,velocity:I=>_n(j(I)),next:I=>{if(!w&&b<1){const z=Math.exp(-b*P*I),he=Math.sin(A*I),J=Math.cos(A*I),Z=l-z*(N*he+E*J),ve=_n(z*(q*he+B*J));return c.done=Math.abs(ve)<=r&&Math.abs(l-Z)<=s,c.value=c.done?l:Z,c}const U=_(I);if(w)c.done=I>=p;else{const z=_n(j(I));c.done=Math.abs(z)<=r&&Math.abs(l-U)<=s}return c.value=c.done?l:U,c},toString:()=>{const I=Math.min(cp(D),xu),U=Mw(z=>D.next(I*z).value,I,30);return I+"ms "+U},toTransition:()=>{}};return D}wu.applyToOptions=e=>{const t=j_(e,100,wu);return e.ease=t.ease,e.duration=_n(t.duration),e.type="keyframes",e};const U_=5;function Nw(e,t,n){const r=Math.max(t-U_,0);return fw(n-e(r),t-r)}function qf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:l,min:c,max:d,restDelta:f=.5,restSpeed:m}){const p=e[0],y={done:!1,value:p},w=B=>c!==void 0&&B<c||d!==void 0&&B>d,k=B=>c===void 0?d:d===void 0||Math.abs(c-B)<Math.abs(d-B)?c:d;let b=n*t;const E=p+b,P=l===void 0?E:l(E);P!==E&&(b=P-p);const R=B=>-b*Math.exp(-B/r),_=B=>P+R(B),j=B=>{const D=R(B),I=_(B);y.done=Math.abs(D)<=f,y.value=y.done?P:I};let A,N;const q=B=>{w(y.value)&&(A=B,N=wu({keyframes:[y.value,k(y.value)],velocity:Nw(_,B,y.value),damping:s,stiffness:a,restDelta:f,restSpeed:m}))};return q(0),{calculatedDuration:null,next:B=>{let D=!1;return!N&&A===void 0&&(D=!0,j(B),q(B)),A!==void 0&&B>=A?N.next(B-A):(!D&&j(B),y)}}}function $_(e,t,n){const r=[],s=n||ui.mix||Iw,a=e.length-1;for(let l=0;l<a;l++){let c=s(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||Vn:t;c=ya(d,c)}r.push(c)}return r}function H_(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(Ku(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=$_(t,r,s),d=c.length,f=m=>{if(l&&m<e[0])return t[0];let p=0;if(d>1)for(;p<e.length-2&&!(m<e[p+1]);p++);const y=ia(e[p],e[p+1],m);return c[p](y)};return n?m=>f(mr(e[0],e[a-1],m)):f}function W_(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ia(0,t,r);e.push(nt(n,1,s))}}function q_(e){const t=[0];return W_(t,e.length-1),t}function G_(e,t){return e.map(n=>n*t)}function K_(e,t){return e.map(()=>t||Sw).splice(0,e.length-1)}function Go({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=n_(r)?r.map(Qy):Qy(r),a={done:!1,value:t[0]},l=G_(n&&n.length===t.length?n:q_(t),e),c=H_(l,t,{ease:Array.isArray(s)?s:K_(t,s)});return{calculatedDuration:e,next:d=>(a.value=c(d),a.done=d>=e,a)}}const X_=e=>e!==null;function Xu(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(X_),c=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!c||r===void 0?a[c]:r}const Y_={decay:qf,inertia:qf,tween:Go,keyframes:Go,spring:wu};function Lw(e){typeof e.type=="string"&&(e.type=Y_[e.type])}class dp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Q_=e=>e/100;class Su extends dp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==an.now()&&this.tick(an.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Lw(t);const{type:n=Go,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:l=0}=t;let{keyframes:c}=t;const d=n||Go;d!==Go&&typeof c[0]!="number"&&(this.mixKeyframes=ya(Q_,Iw(c[0],c[1])),c=[0,100]);const f=d({...t,keyframes:c});a==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),f.calculatedDuration===null&&(f.calculatedDuration=cp(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:m,repeat:p,repeatType:y,repeatDelay:w,type:k,onUpdate:b,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const P=this.currentTime-f*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?P<0:P>s;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let _=this.currentTime,j=r;if(p){const B=Math.min(this.currentTime,s)/c;let D=Math.floor(B),I=B%1;!I&&B>=1&&(I=1),I===1&&D--,D=Math.min(D,p+1),!!(D%2)&&(y==="reverse"?(I=1-I,w&&(I-=w/c)):y==="mirror"&&(j=l)),_=mr(0,1,I)*c}let A;R?(this.delayState.value=m[0],A=this.delayState):A=j.next(_),a&&!R&&(A.value=a(A.value));let{done:N}=A;!R&&d!==null&&(N=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return q&&k!==qf&&(A.value=Xu(m,this.options,E,this.speed)),b&&b(A.value),q&&this.finish(),A}then(t,n){return this.finished.then(t,n)}get duration(){return Fn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(this.currentTime)}set time(t){t=_n(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Nw(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(an.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Fn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=L_,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(an.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function J_(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const zi=e=>e*180/Math.PI,Gf=e=>{const t=zi(Math.atan2(e[1],e[0]));return Kf(t)},Z_={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Gf,rotateZ:Gf,skewX:e=>zi(Math.atan(e[1])),skewY:e=>zi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Kf=e=>(e=e%360,e<0&&(e+=360),e),iv=Gf,sv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ov=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),e2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:sv,scaleY:ov,scale:e=>(sv(e)+ov(e))/2,rotateX:e=>Kf(zi(Math.atan2(e[6],e[5]))),rotateY:e=>Kf(zi(Math.atan2(-e[2],e[0]))),rotateZ:iv,rotate:iv,skewX:e=>zi(Math.atan(e[4])),skewY:e=>zi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Xf(e){return e.includes("scale")?1:0}function Yf(e,t){if(!e||e==="none")return Xf(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=e2,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Z_,s=c}if(!s)return Xf(t);const a=r[t],l=s[1].split(",").map(n2);return typeof a=="function"?a(l):l[a]}const t2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Yf(n,t)};function n2(e){return parseFloat(e.trim())}const qs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gs=new Set([...qs,"pathRotation"]),av=e=>e===Ws||e===_e,r2=new Set(["x","y","z"]),i2=qs.filter(e=>!r2.has(e));function s2(e){const t=[];return i2.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const oi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Yf(t,"x"),y:(e,{transform:t})=>Yf(t,"y")};oi.translateX=oi.x;oi.translateY=oi.y;const Bi=new Set;let Qf=!1,Jf=!1,Zf=!1;function jw(){if(Jf){const e=Array.from(Bi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=s2(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,l])=>{r.getValue(a)?.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Jf=!1,Qf=!1,Bi.forEach(e=>e.complete(Zf)),Bi.clear()}function Dw(){Bi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Jf=!0)})}function o2(){Zf=!0,Dw(),jw(),Zf=!1}class fp{constructor(t,n,r,s,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Bi.add(this),Qf||(Qf=!0,rt.read(Dw),rt.resolveKeyframes(jw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s?.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),s&&a===void 0&&s.set(t[0])}J_(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Bi.delete(this)}cancel(){this.state==="scheduled"&&(Bi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const a2=e=>e.startsWith("--");function Ow(e,t,n){a2(t)?e.style.setProperty(t,n):e.style[t]=n}const l2={};function Fw(e,t){const n=dw(e);return()=>l2[t]??n()}const u2=Fw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Vw=Fw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Uo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,lv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Uo([0,.65,.55,1]),circOut:Uo([.55,0,1,.45]),backIn:Uo([.31,.01,.66,-.59]),backOut:Uo([.33,1.53,.69,.99])};function zw(e,t){if(e)return typeof e=="function"?Vw()?Mw(e,t):"ease-out":kw(e)?Uo(e):Array.isArray(e)?e.map(n=>zw(n,t)||lv.easeOut):lv[e]}function c2(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:l="loop",ease:c="easeOut",times:d}={},f=void 0){const m={[t]:n};d&&(m.offset=d);const p=zw(c,s);Array.isArray(p)&&(m.easing=p);const y={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return f&&(y.pseudoElement=f),e.animate(m,y)}function Bw(e){return typeof e=="function"&&"applyToOptions"in e}function d2({type:e,...t}){return Bw(e)&&Vw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Uw extends dp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,Ku(typeof t.type!="string");const f=d2(t);this.animation=c2(n,r,s,f,a),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const m=Xu(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),Ow(n,r,m),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Fn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_n(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&u2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Vn):s(this)}}const $w={anticipate:vw,backInOut:yw,circInOut:ww};function f2(e){return e in $w}function h2(e){typeof e.ease=="string"&&f2(e.ease)&&(e.ease=$w[e.ease])}const Qd=10;class p2 extends Uw{constructor(t){h2(t),Lw(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Su({...l,autoplay:!1}),d=Math.max(Qd,an.now()-this.startTime),f=mr(0,Qd,d-Qd),m=c.sample(d).value,{name:p}=this.options;a&&p&&Ow(a,p,m),n.setWithVelocity(c.sample(Math.max(0,d-f)).value,m,f),c.stop()}}const uv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Jn.test(e)||e==="0")&&!e.startsWith("url("));function m2(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function g2(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=uv(s,t),c=uv(a,t);return!l||!c?!1:m2(e)||(n==="spring"||Bw(n))&&r}function eh(e){e.duration=0,e.type="keyframes"}const Hw=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),y2=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function v2(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&y2.test(e[t]))return!0;return!1}const x2=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),w2=dw(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function S2(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:l,keyframes:c}=e,d=t?.owner?.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:f,transformTemplate:m}=t.owner.getProps();return w2()&&n&&(Hw.has(n)||x2.has(n)&&v2(c))&&(n!=="transform"||!m)&&!f&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}const k2=40;class C2 extends dp{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:l="loop",keyframes:c,name:d,motionValue:f,element:m,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=an.now();const y={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:l,name:d,motionValue:f,element:m,...p},w=m?.KeyframeResolver||fp;this.keyframeResolver=new w(c,(k,b,E)=>this.onKeyframesResolved(k,b,y,!E),d,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:l,velocity:c,delay:d,isHandoff:f,onUpdate:m}=r;this.resolvedAt=an.now();let p=!0;g2(t,a,l,c)||(p=!1,(ui.instantAnimations||!d)&&m?.(Xu(t,r,n)),t[0]=t[t.length-1],eh(r),r.repeat=0);const w={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>k2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},k=p&&!f&&S2(w),b=w.motionValue?.owner?.current;let E;if(k)try{E=new p2({...w,element:b})}catch{E=new Su(w)}else E=new Su(w);E.finished.then(()=>{this.notifyFinished()}).catch(Vn),this.pendingTimeline&&(this.stopTimeline=E.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=E}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),o2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ww(e,t,n,r=0,s=1){const a=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(a,l):s===1?a*r:c-a*r}const cv=30,b2=e=>!isNaN(parseFloat(e));class E2{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=an.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=an.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=b2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new rp);const r=this.events[t].add(n);return t==="change"?()=>{r(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=an.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>cv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,cv);return fw(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zs(e,t){return new E2(e,t)}function hp(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function pp(e,t){const n=e?.[t]??e?.default??e;return n!==e?hp(n,e):n}const _2={type:"spring",stiffness:500,damping:25,restSpeed:10},P2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),T2={type:"keyframes",duration:.8},R2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},A2=(e,{keyframes:t})=>t.length>2?T2:Gs.has(e)?e.startsWith("scale")?P2(t[1]):_2:R2,I2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function M2(e){for(const t in e)if(!I2.has(t))return!0;return!1}const mp=(e,t,n,r={},s,a)=>l=>{const c=pp(r,e)||{},d=c.delay||r.delay||0;let{elapsed:f=0}=r;f=f-_n(d);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,onUpdate:y=>{t.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:a?void 0:s};M2(c)||Object.assign(m,A2(e,m)),m.duration&&(m.duration=_n(m.duration)),m.repeatDelay&&(m.repeatDelay=_n(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(eh(m),m.delay===0&&(p=!0)),(ui.instantAnimations||ui.skipAnimations||s?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,eh(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,p&&!a&&t.get()!==void 0){const y=Xu(m.keyframes,c);if(y!==void 0){rt.update(()=>{m.onUpdate(y),m.onComplete()});return}}return c.isSync?new Su(m):new C2(m)},N2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function L2(e){const t=N2.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function qw(e,t,n=1){const[r,s]=L2(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const l=a.trim();return lw(l)?parseFloat(l):l}return op(s)?qw(s,t,n+1):s}function dv(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function gp(e,t,n,r){if(typeof t=="function"){const[s,a]=dv(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=dv(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function Ui(e,t,n){const r=e.getProps();return gp(r,t,n!==void 0?n:r.custom,e)}const Gw=new Set(["width","height","top","left","right","bottom",...qs]),th=e=>Array.isArray(e);function j2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zs(n))}function D2(e){return th(e)?e[e.length-1]||0:e}function O2(e,t){const n=Ui(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const l in a){const c=D2(a[l]);j2(e,l,c)}}const Ht=e=>!!(e&&e.getVelocity);function F2(e){return!!(Ht(e)&&e.add)}function nh(e,t){const n=e.getValue("willChange");if(F2(n))return n.add(t);if(!n&&ui.WillChange){const r=new ui.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function yp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const V2="framerAppearId",Kw="data-"+yp(V2);function Xw(e){return e.props[Kw]}function z2({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Yw(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();a=a?hp(a,d):d;const f=a?.reduceMotion,m=a?.skipAnimations;r&&(a=r);const p=[],y=s&&e.animationState&&e.animationState.getState()[s],w=a?.path;w&&w.animateVisualElement(e,c,a,n,p);for(const k in c){const b=e.getValue(k,e.latestValues[k]??null),E=c[k];if(E===void 0||y&&z2(y,k))continue;const P={delay:n,...pp(a||{},k)};m&&(P.skipAnimations=!0);const R=b.get();if(R!==void 0&&!b.isAnimating()&&!Array.isArray(E)&&E===R&&!P.velocity){rt.update(()=>b.set(E));continue}let _=!1;if(window.MotionHandoffAnimation){const N=Xw(e);if(N){const q=window.MotionHandoffAnimation(N,k,rt);q!==null&&(P.startTime=q,_=!0)}}nh(e,k);const j=f??e.shouldReduceMotion;b.start(mp(k,b,E,j&&Gw.has(k)?{type:!1}:P,e,_));const A=b.animation;A&&p.push(A)}if(l){const k=()=>rt.update(()=>{l&&O2(e,l)});p.length?Promise.all(p).then(k):k()}return p}function rh(e,t,n={}){const r=Ui(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(Yw(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:p}=s;return B2(e,t,d,f,m,p,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[d,f]=c==="beforeChildren"?[a,l]:[l,a];return d().then(()=>f())}else return Promise.all([a(),l(n.delay)])}function B2(e,t,n=0,r=0,s=0,a=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(rh(d,t,{...l,delay:n+(typeof r=="function"?0:r)+Ww(e.variantChildren,d,r,s,a)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function U2(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>rh(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=rh(e,t,n);else{const s=typeof t=="function"?Ui(e,t,n.custom):t;r=Promise.all(Yw(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const $2={test:e=>e==="auto",parse:e=>e},Qw=e=>t=>t.test(e),Jw=[Ws,_e,pr,Rr,m_,p_,$2],fv=e=>Jw.find(Qw(e));function H2(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cw(e):!0}const W2=new Set(["brightness","contrast","saturate","opacity"]);function q2(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ap)||[];if(!r)return e;const s=n.replace(r,"");let a=W2.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const G2=/\b([a-z-]*)\(.*?\)/gu,ih={...Jn,getAnimatableNone:e=>{const t=e.match(G2);return t?t.map(q2).join(" "):e}},sh={...Jn,getAnimatableNone:e=>{const t=Jn.parse(e);return Jn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},hv={...Ws,transform:Math.round},K2={rotate:Rr,pathRotation:Rr,rotateX:Rr,rotateY:Rr,rotateZ:Rr,scale:Ol,scaleX:Ol,scaleY:Ol,scaleZ:Ol,skew:Rr,skewX:Rr,skewY:Rr,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:sa,originX:Zy,originY:Zy,originZ:_e},ku={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,inset:_e,insetBlock:_e,insetBlockStart:_e,insetBlockEnd:_e,insetInline:_e,insetInlineStart:_e,insetInlineEnd:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,paddingBlock:_e,paddingBlockStart:_e,paddingBlockEnd:_e,paddingInline:_e,paddingInlineStart:_e,paddingInlineEnd:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,marginBlock:_e,marginBlockStart:_e,marginBlockEnd:_e,marginInline:_e,marginInlineStart:_e,marginInlineEnd:_e,fontSize:_e,backgroundPositionX:_e,backgroundPositionY:_e,...K2,zIndex:hv,fillOpacity:sa,strokeOpacity:sa,numOctaves:hv},X2={...ku,color:Pt,backgroundColor:Pt,outlineColor:Pt,fill:Pt,stroke:Pt,borderColor:Pt,borderTopColor:Pt,borderRightColor:Pt,borderBottomColor:Pt,borderLeftColor:Pt,filter:ih,WebkitFilter:ih,mask:sh,WebkitMask:sh},Zw=e=>X2[e],Y2=new Set([ih,sh]);function e1(e,t){let n=Zw(e);return Y2.has(n)||(n=Jn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Q2=new Set(["auto","none","0"]);function J2(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Q2.has(a)&&Vs(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=e1(n,s)}class Z2 extends fp{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let p=t[m];if(typeof p=="string"&&(p=p.trim(),op(p))){const y=qw(p,n.current);y!==void 0&&(t[m]=y),m===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!Gw.has(r)||t.length!==2)return;const[s,a]=t,l=fv(s),c=fv(a),d=Jy(s),f=Jy(a);if(d!==f&&oi[r]){this.needsMeasurement=!0;return}if(l!==c)if(av(l)&&av(c))for(let m=0;m<t.length;m++){const p=t[m];typeof p=="string"&&(t[m]=parseFloat(p))}else oi[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||H2(t[s]))&&r.push(s);r.length&&J2(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=oi[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,l=r[a];r[a]=oi[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const vp=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function t1(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const oh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function tu(e){return uw(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:xp}=Cw(queueMicrotask,!1),Yn={x:!1,y:!1};function n1(){return Yn.x||Yn.y}function eP(e){return e==="x"||e==="y"?Yn[e]?null:(Yn[e]=!0,()=>{Yn[e]=!1}):Yn.x||Yn.y?null:(Yn.x=Yn.y=!0,()=>{Yn.x=Yn.y=!1})}function r1(e,t){const n=t1(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function tP(e){return!(e.pointerType==="touch"||n1())}function nP(e,t,n={}){const[r,s,a]=r1(e,n);return r.forEach(l=>{let c=!1,d=!1,f;const m=()=>{l.removeEventListener("pointerleave",k)},p=E=>{f&&(f(E),f=void 0),m()},y=E=>{c=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),d&&(d=!1,p(E))},w=()=>{c=!0,window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",y,s)},k=E=>{if(E.pointerType!=="touch"){if(c){d=!0;return}p(E)}},b=E=>{if(!tP(E))return;d=!1;const P=t(l,E);typeof P=="function"&&(f=P,l.addEventListener("pointerleave",k,s))};l.addEventListener("pointerenter",b,s),l.addEventListener("pointerdown",w,s)}),a}const i1=(e,t)=>t?e===t?!0:i1(e,t.parentElement):!1,wp=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,rP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function iP(e){return rP.has(e.tagName)||e.isContentEditable===!0}const sP=new Set(["INPUT","SELECT","TEXTAREA"]);function oP(e){return sP.has(e.tagName)||e.isContentEditable===!0}const nu=new WeakSet;function pv(e){return t=>{t.key==="Enter"&&e(t)}}function Jd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const aP=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=pv(()=>{if(nu.has(n))return;Jd(n,"down");const s=pv(()=>{Jd(n,"up")}),a=()=>Jd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function mv(e){return wp(e)&&!n1()}const gv=new WeakSet;function lP(e,t,n={}){const[r,s,a]=r1(e,n),l=c=>{const d=c.currentTarget;if(!mv(c)||gv.has(c))return;nu.add(d),n.stopPropagation&&gv.add(c);const f=t(d,c),m={...s,capture:!0},p=(k,b)=>{window.removeEventListener("pointerup",y,m),window.removeEventListener("pointercancel",w,m),nu.has(d)&&nu.delete(d),mv(k)&&typeof f=="function"&&f(k,{success:b})},y=k=>{p(k,d===window||d===document||n.useGlobalTarget||i1(d,k.target))},w=k=>{p(k,!1)};window.addEventListener("pointerup",y,m),window.addEventListener("pointercancel",w,m)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,s),tu(c)&&(c.addEventListener("focus",f=>aP(f,s)),!iP(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),a}function Sp(e){return uw(e)&&"ownerSVGElement"in e}const ru=new WeakMap;let iu;const s1=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Sp(r)&&"getBBox"in r?r.getBBox()[t]:r[n],uP=s1("inline","width","offsetWidth"),cP=s1("block","height","offsetHeight");function dP({target:e,borderBoxSize:t}){ru.get(e)?.forEach(n=>{n(e,{get width(){return uP(e,t)},get height(){return cP(e,t)}})})}function fP(e){e.forEach(dP)}function hP(){typeof ResizeObserver>"u"||(iu=new ResizeObserver(fP))}function pP(e,t){iu||hP();const n=t1(e);return n.forEach(r=>{let s=ru.get(r);s||(s=new Set,ru.set(r,s)),s.add(t),iu?.observe(r)}),()=>{n.forEach(r=>{const s=ru.get(r);s?.delete(t),s?.size||iu?.unobserve(r)})}}const su=new Set;let Ns;function mP(){Ns=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};su.forEach(t=>t(e))},window.addEventListener("resize",Ns)}function gP(e){return su.add(e),Ns||mP(),()=>{su.delete(e),!su.size&&typeof Ns=="function"&&(window.removeEventListener("resize",Ns),Ns=void 0)}}function yv(e,t){return typeof e=="function"?gP(e):pP(e,t)}function yP(e){return Sp(e)&&e.tagName==="svg"}const vP=[...Jw,Pt,Jn],xP=e=>vP.find(Qw(e)),vv=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ls=()=>({x:vv(),y:vv()}),xv=()=>({min:0,max:0}),Mt=()=>({x:xv(),y:xv()}),wP=new WeakMap;function Yu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function oa(e){return typeof e=="string"||Array.isArray(e)}const kp=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cp=["initial",...kp];function Qu(e){return Yu(e.animate)||Cp.some(t=>oa(e[t]))}function o1(e){return!!(Qu(e)||e.variants)}function SP(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Ht(s))e.addValue(r,s);else if(Ht(a))e.addValue(r,zs(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(r);e.addValue(r,zs(l!==void 0?l:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ah={current:null},a1={current:!1},kP=typeof window<"u";function CP(){if(a1.current=!0,!!kP)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ah.current=e.matches;e.addEventListener("change",t),t()}else ah.current=!1}const wv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Cu={};function l1(e){Cu=e}function bP(){return Cu}class EP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:a,blockInitialAnimation:l,visualState:c},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=fp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const w=an.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,rt.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=c;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=a,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=Qu(n),this.isVariantNode=o1(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in y){const k=y[w];f[w]!==void 0&&Ht(k)&&k.set(f[w])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,wP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(a1.current||CP(),this.shouldReduceMotion=ah.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ci(this.notifyUpdate),ci(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Hw.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:d,ease:f,duration:m}=n.accelerate,p=new Uw({element:this.current,name:t,keyframes:c,times:d,ease:f,duration:_n(m)}),y=l(p);this.valueSubscriptions.set(t,()=>{y(),p.cancel()});return}const r=Gs.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&rt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Cu){const n=Cu[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<wv.length;r++){const s=wv[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,l=t[a];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=SP(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=zs(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(lw(r)||cw(r))?r=parseFloat(r):!xP(r)&&Jn.test(n)&&(r=e1(t,n)),this.setBaseTarget(t,Ht(r)?r.get():r)),Ht(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=gp(this.props,n,this.presenceContext?.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ht(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new rp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){xp.render(this.render)}}class u1 extends EP{constructor(){super(...arguments),this.KeyframeResolver=Z2}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ht(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class hi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function c1({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function _P({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PP(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Zd(e){return e===void 0||e===1}function lh({scale:e,scaleX:t,scaleY:n}){return!Zd(e)||!Zd(t)||!Zd(n)}function Ai(e){return lh(e)||d1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function d1(e){return Sv(e.x)||Sv(e.y)}function Sv(e){return e&&e!=="0%"}function bu(e,t,n){const r=e-n,s=t*r;return n+s}function kv(e,t,n,r,s){return s!==void 0&&(e=bu(e,s,r)),bu(e,n,r)+t}function uh(e,t=0,n=1,r,s){e.min=kv(e.min,t,n,r,s),e.max=kv(e.max,t,n,r,s)}function f1(e,{x:t,y:n}){uh(e.x,t.translate,t.scale,t.originPoint),uh(e.y,n.translate,n.scale,n.originPoint)}const Cv=.999999999999,bv=1.0000000000001;function TP(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,l;for(let c=0;c<s;c++){a=n[c],l=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(fr(e.x,-a.scroll.offset.x),fr(e.y,-a.scroll.offset.y)),l&&(t.x*=l.x.scale,t.y*=l.y.scale,f1(e,l)),r&&Ai(a.latestValues)&&ou(e,a.latestValues,a.layout?.layoutBox))}t.x<bv&&t.x>Cv&&(t.x=1),t.y<bv&&t.y>Cv&&(t.y=1)}function fr(e,t){e.min+=t,e.max+=t}function Ev(e,t,n,r,s=.5){const a=nt(e.min,e.max,s);uh(e,t,n,a,r)}function _v(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ou(e,t,n){const r=n??e;Ev(e.x,_v(t.x,r.x),t.scaleX,t.scale,t.originX),Ev(e.y,_v(t.y,r.y),t.scaleY,t.scale,t.originY)}function h1(e,t){return c1(PP(e.getBoundingClientRect(),t))}function RP(e,t,n){const r=h1(e,n),{scroll:s}=t;return s&&(fr(r.x,s.offset.x),fr(r.y,s.offset.y)),r}const AP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},IP=qs.length;function MP(e,t,n){let r="",s=!0;for(let l=0;l<IP;l++){const c=qs[l],d=e[c];if(d===void 0)continue;let f=!0;if(typeof d=="number")f=d===(c.startsWith("scale")?1:0);else{const m=parseFloat(d);f=c.startsWith("scale")?m===1:m===0}if(!f||n){const m=oh(d,ku[c]);if(!f){s=!1;const p=AP[c]||c;r+=`${p}(${m}) `}n&&(t[c]=m)}}const a=e.pathRotation;return a&&(s=!1,r+=`rotate(${oh(a,ku.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function bp(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let l=!1,c=!1;for(const d in t){const f=t[d];if(Gs.has(d)){l=!0;continue}else if(Ew(d)){s[d]=f;continue}else{const m=oh(f,ku[d]);d.startsWith("origin")?(c=!0,a[d]=m):r[d]=m}}if(t.transform||(l||n?r.transform=MP(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:m=0}=a;r.transformOrigin=`${d} ${f} ${m}`}}function p1(e,{style:t,vars:n},r,s){const a=e.style;let l;for(l in t)a[l]=t[l];s?.applyProjectionStyles(a,r);for(l in n)a.setProperty(l,n[l])}function Pv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const jo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=Pv(e,t.target.x),r=Pv(e,t.target.y);return`${n}% ${r}%`}},NP={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Jn.parse(e);if(s.length>5)return r;const a=Jn.createTransformer(e),l=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;s[0+l]/=c,s[1+l]/=d;const f=nt(c,d,.5);return typeof s[2+l]=="number"&&(s[2+l]/=f),typeof s[3+l]=="number"&&(s[3+l]/=f),a(s)}},ch={borderRadius:{...jo,applyTo:[...vp]},borderTopLeftRadius:jo,borderTopRightRadius:jo,borderBottomLeftRadius:jo,borderBottomRightRadius:jo,boxShadow:NP};function m1(e,{layout:t,layoutId:n}){return Gs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ch[e]||e==="opacity")}function Ep(e,t,n){const r=e.style,s=t?.style,a={};if(!r)return a;for(const l in r)(Ht(r[l])||s&&Ht(s[l])||m1(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(a[l]=r[l]);return a}function LP(e){return window.getComputedStyle(e)}class jP extends u1{constructor(){super(...arguments),this.type="html",this.renderInstance=p1}mount(t){Ku(!!t.style),super.mount(t)}readValueFromInstance(t,n){if(Gs.has(n))return this.projection?.isProjecting?Xf(n):t2(t,n);{const r=LP(t),s=(Ew(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return h1(t,n)}build(t,n,r){bp(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ep(t,n,r)}}const DP={offset:"stroke-dashoffset",array:"stroke-dasharray"},OP={offset:"strokeDashoffset",array:"strokeDasharray"};function FP(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?DP:OP;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const VP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function g1(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},d,f,m){if(bp(e,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=m?.transformBox??"fill-box",delete p.transformBox);for(const w of VP)p[w]!==void 0&&(y[w]=p[w],delete p[w]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&FP(p,s,a,l,!1)}const y1=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),v1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function zP(e,t,n,r){p1(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(y1.has(s)?s:yp(s),t.attrs[s])}function x1(e,t,n){const r=Ep(e,t,n);for(const s in e)if(Ht(e[s])||Ht(t[s])){const a=qs.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}class BP extends u1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Mt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Gs.has(n)){const r=Zw(n);return r&&r.default||0}return n=y1.has(n)?n:yp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return x1(t,n,r)}build(t,n,r){g1(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){zP(t,n,r,s)}mount(t){this.isSVGTag=v1(t.tagName),super.mount(t)}}const UP=Cp.length;function w1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?w1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<UP;n++){const r=Cp[n],s=e.props[r];(oa(s)||s===!1)&&(t[r]=s)}return t}function S1(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const $P=[...kp].reverse(),HP=kp.length;function WP(e){return t=>Promise.all(t.map(({animation:n,options:r})=>U2(e,n,r)))}function qP(e){let t=WP(e),n=Tv(),r=!0,s=!1;const a=f=>(m,p)=>{const y=Ui(e,p,f==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:w,transitionEnd:k,...b}=y;m={...m,...b,...k}}return m};function l(f){t=f(e)}function c(f){const{props:m}=e,p=w1(e.parent)||{},y=[],w=new Set;let k={},b=1/0;for(let P=0;P<HP;P++){const R=$P[P],_=n[R],j=m[R]!==void 0?m[R]:p[R],A=oa(j),N=R===f?_.isActive:null;N===!1&&(b=P);let q=j===p[R]&&j!==m[R]&&A;if(q&&(r||s)&&e.manuallyAnimateOnMount&&(q=!1),_.protectedKeys={...k},!_.isActive&&N===null||!j&&!_.prevProp||Yu(j)||typeof j=="boolean")continue;if(R==="exit"&&_.isActive&&N!==!0){_.prevResolvedValues&&(k={...k,..._.prevResolvedValues});continue}const B=GP(_.prevProp,j);let D=B||R===f&&_.isActive&&!q&&A||P>b&&A,I=!1;const U=Array.isArray(j)?j:[j];let z=U.reduce(a(R),{});N===!1&&(z={});const{prevResolvedValues:he={}}=_,J={...he,...z},Z=Q=>{D=!0,w.has(Q)&&(I=!0,w.delete(Q)),_.needsAnimating[Q]=!0;const pe=e.getValue(Q);pe&&(pe.liveStyle=!1)};for(const Q in J){const pe=z[Q],T=he[Q];if(k.hasOwnProperty(Q))continue;let F=!1;th(pe)&&th(T)?F=!S1(pe,T)||B:F=pe!==T,F?pe!=null?Z(Q):w.add(Q):pe!==void 0&&w.has(Q)?Z(Q):_.protectedKeys[Q]=!0}_.prevProp=j,_.prevResolvedValues=z,_.isActive&&(k={...k,...z}),(r||s)&&e.blockInitialAnimation&&(D=!1);const ve=q&&B;D&&(!ve||I)&&y.push(...U.map(Q=>{const pe={type:R};if(typeof Q=="string"&&(r||s)&&!ve&&e.manuallyAnimateOnMount&&e.parent){const{parent:T}=e,F=Ui(T,Q);if(T.enteringChildren&&F){const{delayChildren:X}=F.transition||{};pe.delay=Ww(T.enteringChildren,e,X)}}return{animation:Q,options:pe}}))}if(w.size){const P={};if(typeof m.initial!="boolean"){const R=Ui(e,Array.isArray(m.initial)?m.initial[0]:m.initial);R&&R.transition&&(P.transition=R.transition)}w.forEach(R=>{const _=e.getBaseTarget(R),j=e.getValue(R);j&&(j.liveStyle=!0),P[R]=_??null}),y.push({animation:P})}let E=!!y.length;return r&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,s=!1,E?t(y):Promise.resolve()}function d(f,m){if(n[f].isActive===m)return Promise.resolve();e.variantChildren?.forEach(y=>y.animationState?.setActive(f,m)),n[f].isActive=m;const p=c(f);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:c,setActive:d,setAnimateFunction:l,getState:()=>n,reset:()=>{n=Tv(),s=!0}}}function GP(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!S1(t,e):!1}function Ti(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tv(){return{animate:Ti(!0),whileInView:Ti(),whileHover:Ti(),whileTap:Ti(),whileDrag:Ti(),whileFocus:Ti(),exit:Ti()}}function dh(e,t){e.min=t.min,e.max=t.max}function Xn(e,t){dh(e.x,t.x),dh(e.y,t.y)}function Rv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const k1=1e-4,KP=1-k1,XP=1+k1,C1=.01,YP=0-C1,QP=0+C1;function ln(e){return e.max-e.min}function JP(e,t,n){return Math.abs(e-t)<=n}function Av(e,t,n,r=.5){e.origin=r,e.originPoint=nt(t.min,t.max,e.origin),e.scale=ln(n)/ln(t),e.translate=nt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=KP&&e.scale<=XP||isNaN(e.scale))&&(e.scale=1),(e.translate>=YP&&e.translate<=QP||isNaN(e.translate))&&(e.translate=0)}function Ko(e,t,n,r){Av(e.x,t.x,n.x,r?r.originX:void 0),Av(e.y,t.y,n.y,r?r.originY:void 0)}function Iv(e,t,n,r=0){const s=r?nt(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ln(t)}function ZP(e,t,n,r){Iv(e.x,t.x,n.x,r?.x),Iv(e.y,t.y,n.y,r?.y)}function Mv(e,t,n,r=0){const s=r?nt(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ln(t)}function Eu(e,t,n,r){Mv(e.x,t.x,n.x,r?.x),Mv(e.y,t.y,n.y,r?.y)}function Nv(e,t,n,r,s){return e-=t,e=bu(e,1/n,r),s!==void 0&&(e=bu(e,1/s,r)),e}function eT(e,t=0,n=1,r=.5,s,a=e,l=e){if(pr.test(t)&&(t=parseFloat(t),t=nt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=nt(a.min,a.max,r);e===a&&(c-=t),e.min=Nv(e.min,t,n,c,s),e.max=Nv(e.max,t,n,c,s)}function Lv(e,t,[n,r,s],a,l){eT(e,t[n],t[r],t[s],t.scale,a,l)}const tT=["x","scaleX","originX"],nT=["y","scaleY","originY"];function jv(e,t,n,r){Lv(e.x,t,tT,n?n.x:void 0,r?r.x:void 0),Lv(e.y,t,nT,n?n.y:void 0,r?r.y:void 0)}function Dv(e){return e.translate===0&&e.scale===1}function b1(e){return Dv(e.x)&&Dv(e.y)}function Ov(e,t){return e.min===t.min&&e.max===t.max}function rT(e,t){return Ov(e.x,t.x)&&Ov(e.y,t.y)}function Fv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function E1(e,t){return Fv(e.x,t.x)&&Fv(e.y,t.y)}function Vv(e){return ln(e.x)/ln(e.y)}function zv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function cr(e){return[e("x"),e("y")]}function iT(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,l=n?.z||0;if((s||a||l)&&(r=`translate3d(${s}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:m,pathRotation:p,rotateX:y,rotateY:w,skewX:k,skewY:b}=n;f&&(r=`perspective(${f}px) ${r}`),m&&(r+=`rotate(${m}deg) `),p&&(r+=`rotate(${p}deg) `),y&&(r+=`rotateX(${y}deg) `),w&&(r+=`rotateY(${w}deg) `),k&&(r+=`skewX(${k}deg) `),b&&(r+=`skewY(${b}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const sT=vp.length,Bv=e=>typeof e=="string"?parseFloat(e):e,Uv=e=>typeof e=="number"||_e.test(e);function oT(e,t,n,r,s,a){s?(e.opacity=nt(0,n.opacity??1,aT(r)),e.opacityExit=nt(t.opacity??1,0,lT(r))):a&&(e.opacity=nt(t.opacity??1,n.opacity??1,r));for(let l=0;l<sT;l++){const c=vp[l];let d=$v(t,c),f=$v(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||Uv(d)===Uv(f)?(e[c]=Math.max(nt(Bv(d),Bv(f),r),0),(pr.test(f)||pr.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=nt(t.rotate||0,n.rotate||0,r))}function $v(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const aT=_1(0,.5,xw),lT=_1(.5,.95,Vn);function _1(e,t,n){return r=>r<e?0:r>t?1:n(ia(e,t,r))}function uT(e,t,n){const r=Ht(e)?e:zs(e);return r.start(mp("",r,t,n)),r.animation}function aa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const cT=(e,t)=>e.depth-t.depth;class dT{constructor(){this.children=[],this.isDirty=!1}add(t){np(this.children,t),this.isDirty=!0}remove(t){yu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(cT),this.isDirty=!1,this.children.forEach(t)}}function fT(e,t){const n=an.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(ci(r),e(a-t))};return rt.setup(r,!0),()=>ci(r)}function au(e){return Ht(e)?e.get():e}class hT{constructor(){this.members=[]}add(t){np(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(yu(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(yu(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const r=this.members[n];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:a}=t.options;(s===void 0||s!==a)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const lu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ef=["","X","Y","Z"],pT=1e3;let mT=0;function tf(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function P1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xw(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&P1(r)}function T1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(l={},c=t?.()){this.id=mT++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(vT),this.nodes.forEach(bT),this.nodes.forEach(ET),this.nodes.forEach(xT)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new dT)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new rp),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=Sp(l)&&!yP(l),this.instance=l;const{layoutId:c,layout:d,visualElement:f}=this.options;if(f&&!f.current&&f.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let m,p=0;const y=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{p=window.innerWidth}),e(l,()=>{const w=window.innerWidth;w!==p&&(p=w,this.root.updateBlockedByResize=!0,m&&m(),m=fT(y,250),lu.hasAnimatedSinceResize&&(lu.hasAnimatedSinceResize=!1,this.nodes.forEach(qv)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||f.getDefaultTransition()||AT,{onLayoutAnimationStart:b,onLayoutAnimationComplete:E}=f.getProps(),P=!this.targetLayout||!E1(this.targetLayout,w),R=!p&&y;if(this.options.layoutRoot||this.resumeFrom||R||p&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...pp(k,"layout"),onPlay:b,onComplete:E};(f.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(m,R,_.path)}else p||qv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ci(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_T),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&P1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const p=this.path[m];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(ST),this.nodes.forEach(Hv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Wv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(kT),this.nodes.forEach(CT),this.nodes.forEach(gT),this.nodes.forEach(yT)):this.nodes.forEach(Wv),this.clearAllSnapshots();const c=an.now();$t.delta=mr(0,1e3/60,c-$t.timestamp),$t.timestamp=c,$t.isProcessing=!0,qd.update.process($t),qd.preRender.process($t),qd.render.process($t),$t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xp.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(wT),this.sharedNodes.forEach(PT)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ln(this.snapshot.measuredBox.x)&&!ln(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Mt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!b1(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;l&&this.instance&&(c||Ai(this.latestValues)||m)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),IT(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Mt();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(MT))){const{scroll:f}=this.root;f&&(fr(c.x,f.offset.x),fr(c.y,f.offset.y))}return c}removeElementScroll(l){const c=Mt();if(Xn(c,l),this.scroll?.wasRoot)return c;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:m,options:p}=f;f!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&Xn(c,l),fr(c.x,m.offset.x),fr(c.y,m.offset.y))}return c}applyTransform(l,c=!1,d){const f=d||Mt();Xn(f,l);for(let m=0;m<this.path.length;m++){const p=this.path[m];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(fr(f.x,-p.scroll.offset.x),fr(f.y,-p.scroll.offset.y)),Ai(p.latestValues)&&ou(f,p.latestValues,p.layout?.layoutBox)}return Ai(this.latestValues)&&ou(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(l){const c=Mt();Xn(c,l);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Ai(f.latestValues))continue;let m;f.instance&&(lh(f.latestValues)&&f.updateSnapshot(),m=Mt(),Xn(m,f.measurePageBox())),jv(c,f.latestValues,f.snapshot?.layoutBox,m)}return Ai(this.latestValues)&&jv(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==$t.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:p}=this.options;if(!this.layout||!(m||p))return;this.resolvedRelativeTargetAt=$t.timestamp;const y=this.getClosestProjectingParent();y&&this.linkedParentVersion!==y.layoutVersion&&!y.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&y&&y.layout?this.createRelativeTarget(y,this.layout.layoutBox,y.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Mt(),this.targetWithTransforms=Mt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ZP(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Xn(this.target,this.layout.layoutBox),f1(this.target,this.targetDelta)):Xn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?this.createRelativeTarget(y,this.target,y.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||lh(this.parent.latestValues)||d1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mt(),this.relativeTargetOrigin=Mt(),Eu(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),Xn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===$t.timestamp&&(d=!1),d)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;Xn(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;TP(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Mt());const{target:w}=l;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Rv(this.prevProjectionDelta.x,this.projectionDelta.x),Rv(this.prevProjectionDelta.y,this.projectionDelta.y)),Ko(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!zv(this.projectionDelta.x,this.prevProjectionDelta.x)||!zv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ls(),this.projectionDelta=Ls(),this.projectionDeltaWithTransform=Ls()}setAnimationOrigin(l,c=!1,d){const f=this.snapshot,m=f?f.latestValues:{},p={...this.latestValues},y=Ls();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const w=Mt(),k=f?f.source:void 0,b=this.layout?this.layout.source:void 0,E=k!==b,P=this.getStack(),R=!P||P.members.length<=1,_=!!(E&&!R&&this.options.crossfade===!0&&!this.path.some(RT));this.animationProgress=0;let j;const A=d?.interpolateProjection(l);this.mixTargetDelta=N=>{const q=N/1e3,B=A?.(q);B?(y.x.translate=B.x,y.x.scale=nt(l.x.scale,1,q),y.x.origin=l.x.origin,y.x.originPoint=l.x.originPoint,y.y.translate=B.y,y.y.scale=nt(l.y.scale,1,q),y.y.origin=l.y.origin,y.y.originPoint=l.y.originPoint):(Gv(y.x,l.x,q),Gv(y.y,l.y,q)),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Eu(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),TT(this.relativeTarget,this.relativeTargetOrigin,w,q),j&&rT(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=Mt()),Xn(j,this.relativeTarget)),E&&(this.animationValues=p,oT(p,m,this.latestValues,q,_,R)),B&&B.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=B.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=q},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ci(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{lu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zs(0)),this.motionValue.jump(0,!1),this.currentAnimation=uT(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(pT),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:m}=l;if(!(!c||!d||!f)){if(this!==l&&this.layout&&f&&R1(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||Mt();const p=ln(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+p;const y=ln(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+y}Xn(c,d),ou(c,m),Ko(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new hT),this.sharedNodes.get(l).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const f={};d.z&&tf("z",l,f,this.animationValues);for(let m=0;m<ef.length;m++)tf(`rotate${ef[m]}`,l,f,this.animationValues),tf(`skew${ef[m]}`,l,f,this.animationValues);l.render();for(const m in f)l.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=au(c?.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=au(c?.pointerEvents)||""),this.hasProjected&&!Ai(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=iT(this.projectionDeltaWithTransform,this.treeScale,m);d&&(p=d(m,p)),l.transform=p;const{x:y,y:w}=this.projectionDelta;l.transformOrigin=`${y.origin*100}% ${w.origin*100}% 0`,f.animationValues?l.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:l.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const k in ch){if(m[k]===void 0)continue;const{correct:b,applyTo:E,isCSSVariable:P}=ch[k],R=p==="none"?m[k]:b(m[k],f);if(E){const _=E.length;for(let j=0;j<_;j++)l[E[j]]=R}else P?this.options.visualElement.renderState.vars[k]=R:l[k]=R}this.options.layoutId&&(l.pointerEvents=f===this?au(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(Hv),this.root.sharedNodes.clear()}}}function gT(e){e.updateLayout()}function yT(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;if(s==="size")cr(m=>{const p=a?t.measuredBox[m]:t.layoutBox[m],y=ln(p);p.min=n[m].min,p.max=p.min+y});else if(s==="x"||s==="y"){const m=s==="x"?"y":"x";dh(a?t.measuredBox[m]:t.layoutBox[m],n[m])}else R1(s,t.layoutBox,n)&&cr(m=>{const p=a?t.measuredBox[m]:t.layoutBox[m],y=ln(n[m]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+y)});const l=Ls();Ko(l,n,t.layoutBox);const c=Ls();a?Ko(c,e.applyTransform(r,!0),t.measuredBox):Ko(c,n,t.layoutBox);const d=!b1(l);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:y}=m;if(p&&y){const w=e.options.layoutAnchor||void 0,k=Mt();Eu(k,t.layoutBox,p.layoutBox,w);const b=Mt();Eu(b,n,y.layoutBox,w),E1(k,b)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=k,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function vT(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function xT(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wT(e){e.clearSnapshot()}function Hv(e){e.clearMeasurements()}function ST(e){e.isLayoutDirty=!0,e.updateLayout()}function Wv(e){e.isLayoutDirty=!1}function kT(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function CT(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bT(e){e.resolveTargetDelta()}function ET(e){e.calcProjection()}function _T(e){e.resetSkewAndRotation()}function PT(e){e.removeLeadSnapshot()}function Gv(e,t,n){e.translate=nt(t.translate,0,n),e.scale=nt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kv(e,t,n,r){e.min=nt(t.min,n.min,r),e.max=nt(t.max,n.max,r)}function TT(e,t,n,r){Kv(e.x,t.x,n.x,r),Kv(e.y,t.y,n.y,r)}function RT(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const AT={duration:.45,ease:[.4,0,.1,1]},Xv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Yv=Xv("applewebkit/")&&!Xv("chrome/")?Math.round:Vn;function Qv(e){e.min=Yv(e.min),e.max=Yv(e.max)}function IT(e){Qv(e.x),Qv(e.y)}function R1(e,t,n){return e==="position"||e==="preserve-aspect"&&!JP(Vv(t),Vv(n),.2)}function MT(e){return e!==e.root&&e.scroll?.wasRoot}const NT=T1({attachResizeListener:(e,t)=>aa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),nf={current:void 0},A1=T1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!nf.current){const e=new NT({});e.mount(window),e.setOptions({layoutScroll:!0}),nf.current=e}return nf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),la=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Jv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function LT(...e){return t=>{let n=!1;const r=e.map(s=>{const a=Jv(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():Jv(e[s],null)}}}}function jT(...e){return S.useCallback(LT(...e),e)}class DT extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(tu(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=tu(r)&&r.offsetWidth||0,a=tu(r)&&r.offsetHeight||0,l=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(l.height),c.width=parseFloat(l.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=a-c.height-c.top,c.direction=l.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function OT({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:a}){const l=S.useId(),c=S.useRef(null),d=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=S.useContext(la),m=a!==!1?e.props?.ref??e?.ref:void 0,p=jT(c,m);return S.useInsertionEffect(()=>{const{width:y,height:w,top:k,left:b,right:E,bottom:P,direction:R}=d.current;if(t||a===!1||!c.current||!y||!w)return;const _=R==="rtl",j=n==="left"?_?`right: ${E}`:`left: ${b}`:_?`left: ${b}`:`right: ${E}`,A=r==="bottom"?`bottom: ${P}`:`top: ${k}`;c.current.dataset.motionPopId=l;const N=document.createElement("style");f&&(N.nonce=f);const q=s??document.head;return q.appendChild(N),N.sheet&&N.sheet.insertRule(`
|
|
41
|
+
[data-motion-pop-id="${l}"] {
|
|
42
|
+
position: absolute !important;
|
|
43
|
+
width: ${y}px !important;
|
|
44
|
+
height: ${w}px !important;
|
|
45
|
+
${j}px !important;
|
|
46
|
+
${A}px !important;
|
|
47
|
+
}
|
|
48
|
+
`),()=>{c.current?.removeAttribute("data-motion-pop-id"),q.contains(N)&&q.removeChild(N)}},[t]),v.jsx(DT,{isPresent:t,childRef:c,sizeRef:d,pop:a,children:a===!1?e:S.cloneElement(e,{ref:p})})}const FT=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:d,root:f})=>{const m=qu(VT),p=S.useId(),y=S.useRef(n),w=S.useRef(r);tp(()=>{y.current=n,w.current=r});let k=!0,b=S.useMemo(()=>(k=!1,{id:p,initial:t,isPresent:n,custom:s,onExitComplete:E=>{m.set(E,!0);for(const P of m.values())if(!P)return;r&&r()},register:E=>(m.set(E,!1),()=>{m.delete(E),!y.current&&!m.size&&w.current?.()})}),[n,m,r]);return a&&k&&(b={...b}),S.useMemo(()=>{m.forEach((E,P)=>m.set(P,!1))},[n]),S.useEffect(()=>{!n&&!m.size&&r&&r()},[n]),e=v.jsx(OT,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:d,root:f,children:e}),v.jsx(Gu.Provider,{value:b,children:e})};function VT(){return new Map}function I1(e=!0){const t=S.useContext(Gu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=S.useId();S.useEffect(()=>{if(e)return s(a)},[e]);const l=S.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,l]:[!0]}const Fl=e=>e.key||"";function Zv(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const zT=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left",anchorY:d="top",root:f})=>{const[m,p]=I1(l),y=S.useMemo(()=>Zv(e),[e]),w=l&&!m?[]:y.map(Fl),k=S.useRef(!0),b=S.useRef(y),E=qu(()=>new Map),P=S.useRef(new Set),[R,_]=S.useState(y),[j,A]=S.useState(y);tp(()=>{k.current=!1,b.current=y;for(let B=0;B<j.length;B++){const D=Fl(j[B]);w.includes(D)?(E.delete(D),P.current.delete(D)):E.get(D)!==!0&&E.set(D,!1)}},[j,w.length,w.join("-")]);const N=[];if(y!==R){let B=[...y];for(let D=0;D<j.length;D++){const I=j[D],U=Fl(I);w.includes(U)||(B.splice(D,0,I),N.push(I))}return a==="wait"&&N.length&&(B=N),A(Zv(B)),_(y),null}const{forceRender:q}=S.useContext(ep);return v.jsx(v.Fragment,{children:j.map(B=>{const D=Fl(B),I=l&&!m?!1:y===j||w.includes(D),U=()=>{if(P.current.has(D))return;if(E.has(D))P.current.add(D),E.set(D,!0);else return;let z=!0;E.forEach(he=>{he||(z=!1)}),z&&(q?.(),A(b.current),l&&p?.(),r&&r())};return v.jsx(FT,{isPresent:I,initial:!k.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:f,onExitComplete:I?void 0:U,anchorX:c,anchorY:d,children:B},D)})})},M1=S.createContext({strict:!1}),e0={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let t0=!1;function BT(){if(t0)return;const e={};for(const t in e0)e[t]={isEnabled:n=>e0[t].some(r=>!!n[r])};l1(e),t0=!0}function N1(){return BT(),bP()}function UT(e){const t=N1();for(const n in e)t[n]={...t[n],...e[n]};l1(t)}const $T=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function _u(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$T.has(e)}let L1=e=>!_u(e);function j1(e){typeof e=="function"&&(L1=t=>t.startsWith("on")?!_u(t):e(t))}try{j1(require("@emotion/is-prop-valid").default)}catch{}function HT(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Ht(e[s])||(L1(s)||n===!0&&_u(s)||!t&&!_u(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function WT({children:e,isValidProp:t,...n}){t&&j1(t);const r=S.useContext(la);n={...r,...n},n.transition=hp(n.transition,r.transition),n.isStatic=qu(()=>n.isStatic);const s=S.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return v.jsx(la.Provider,{value:s,children:e})}const Ju=S.createContext({});function qT(e,t){if(Qu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||oa(n)?n:void 0,animate:oa(r)?r:void 0}}return e.inherit!==!1?t:{}}function GT(e){const{initial:t,animate:n}=qT(e,S.useContext(Ju));return S.useMemo(()=>({initial:t,animate:n}),[n0(t),n0(n)])}function n0(e){return Array.isArray(e)?e.join(" "):e}const _p=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function D1(e,t,n){for(const r in t)!Ht(t[r])&&!m1(r,n)&&(e[r]=t[r])}function KT({transformTemplate:e},t){return S.useMemo(()=>{const n=_p();return bp(n,t,e),Object.assign({},n.vars,n.style)},[t])}function XT(e,t){const n=e.style||{},r={};return D1(r,n,e),Object.assign(r,KT(e,t)),r}function YT(e,t){const n={},r=XT(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const O1=()=>({..._p(),attrs:{}});function QT(e,t,n,r){const s=S.useMemo(()=>{const a=O1();return g1(a,t,v1(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};D1(a,e.style,e),s.style={...a,...s.style}}return s}const JT=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pp(e){return typeof e!="string"||e.includes("-")?!1:!!(JT.indexOf(e)>-1||/[A-Z]/u.test(e))}function ZT(e,t,n,{latestValues:r},s,a=!1,l){const d=(l??Pp(e)?QT:YT)(t,r,s,e),f=HT(t,typeof e=="string",a),m=e!==S.Fragment?{...f,...d,ref:n}:{},{children:p}=t,y=S.useMemo(()=>Ht(p)?p.get():p,[p]);return S.createElement(e,{...m,children:y})}function eR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:tR(n,r,s,e),renderState:t()}}function tR(e,t,n,r){const s={},a=r(e,{});for(const y in a)s[y]=au(a[y]);let{initial:l,animate:c}=e;const d=Qu(e),f=o1(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const p=m?c:l;if(p&&typeof p!="boolean"&&!Yu(p)){const y=Array.isArray(p)?p:[p];for(let w=0;w<y.length;w++){const k=gp(e,y[w]);if(k){const{transitionEnd:b,transition:E,...P}=k;for(const R in P){let _=P[R];if(Array.isArray(_)){const j=m?_.length-1:0;_=_[j]}_!==null&&(s[R]=_)}for(const R in b)s[R]=b[R]}}}return s}const F1=e=>(t,n)=>{const r=S.useContext(Ju),s=S.useContext(Gu),a=()=>eR(e,t,r,s);return n?a():qu(a)},nR=F1({scrapeMotionValuesFromProps:Ep,createRenderState:_p}),rR=F1({scrapeMotionValuesFromProps:x1,createRenderState:O1}),iR=Symbol.for("motionComponentSymbol");function sR(e,t,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const s=S.useRef(null);return S.useCallback(a=>{a&&e.onMount?.(a),t&&(a?t.mount(a):t.unmount());const l=r.current;if(typeof l=="function")if(a){const c=l(a);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):l(a);else l&&(l.current=a)},[t])}const V1=S.createContext({});function Rs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function oR(e,t,n,r,s,a){const{visualElement:l}=S.useContext(Ju),c=S.useContext(M1),d=S.useContext(Gu),f=S.useContext(la),m=f.reducedMotion,p=f.skipAnimations,y=S.useRef(null),w=S.useRef(!1);r=r||c.renderer,!y.current&&r&&(y.current=r(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:a}),w.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const k=y.current,b=S.useContext(V1);k&&!k.projection&&s&&(k.type==="html"||k.type==="svg")&&aR(y.current,n,s,b);const E=S.useRef(!1);S.useInsertionEffect(()=>{k&&E.current&&k.update(n,d)});const P=n[Kw],R=S.useRef(!!P&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(P)&&window.MotionHasOptimisedAnimation?.(P));return tp(()=>{w.current=!0,k&&(E.current=!0,window.MotionIsMounted=!0,k.updateFeatures(),k.scheduleRenderMicrotask(),R.current&&k.animationState&&k.animationState.animateChanges())}),S.useEffect(()=>{k&&(!R.current&&k.animationState&&k.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(P)}),R.current=!1),k.enteringChildren=void 0)}),k}function aR(e,t,n,r){const{layoutId:s,layout:a,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutAnchor:m,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:z1(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!l||c&&Rs(c),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:d,layoutRoot:f,layoutAnchor:m})}function z1(e){if(e)return e.options.allowProjection!==!1?e.projection:z1(e.parent)}function rf(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&UT(r);const a=n?n==="svg":Pp(e),l=a?rR:nR;function c(f,m){let p;const y={...S.useContext(la),...f,layoutId:lR(f)},{isStatic:w}=y,k=GT(f),b=l(f,w);if(!w&&typeof window<"u"){uR();const E=cR(y);p=E.MeasureLayout,k.visualElement=oR(e,b,y,s,E.ProjectionNode,a)}return v.jsxs(Ju.Provider,{value:k,children:[p&&k.visualElement?v.jsx(p,{visualElement:k.visualElement,...y}):null,ZT(e,f,sR(b,k.visualElement,m),b,w,t,a)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=S.forwardRef(c);return d[iR]=e,d}function lR({layoutId:e}){const t=S.useContext(ep).id;return t&&e!==void 0?t+"-"+e:e}function uR(e,t){S.useContext(M1).strict}function cR(e){const t=N1(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function dR(e,t){if(typeof Proxy>"u")return rf;const n=new Map,r=(a,l)=>rf(a,l,e,t),s=(a,l)=>r(a,l);return new Proxy(s,{get:(a,l)=>l==="create"?r:(n.has(l)||n.set(l,rf(l,void 0,e,t)),n.get(l))})}const fR=(e,t)=>t.isSVG??Pp(e)?new BP(t):new jP(t,{allowProjection:e!==S.Fragment});class hR extends hi{constructor(t){super(t),t.animationState||(t.animationState=qP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let pR=0;class mR extends hi{constructor(){super(...arguments),this.id=pR++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:l}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=Ui(this.node,a,l);if(c){const{transition:d,transitionEnd:f,...m}=c;for(const p in m)this.node.getValue(p)?.jump(m[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const gR={animation:{Feature:hR},exit:{Feature:mR}};function wa(e){return{point:{x:e.pageX,y:e.pageY}}}const yR=e=>t=>wp(t)&&e(t,wa(t));function Xo(e,t,n,r){return aa(e,t,yR(n),r)}const B1=({current:e})=>e?e.ownerDocument.defaultView:null,r0=(e,t)=>Math.abs(e-t);function vR(e,t){const n=r0(e.x,t.x),r=r0(e.y,t.y);return Math.sqrt(n**2+r**2)}const i0=new Set(["auto","scroll"]);class U1{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=k=>{this.handleScroll(k.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Vl(this.lastRawMoveEventInfo,this.transformPagePoint));const k=sf(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,E=vR(k.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!E)return;const{point:P}=k,{timestamp:R}=$t;this.history.push({...P,timestamp:R});const{onStart:_,onMove:j}=this.handlers;b||(_&&_(this.lastMoveEvent,k),this.startEvent=this.lastMoveEvent),j&&j(this.lastMoveEvent,k)},this.handlePointerMove=(k,b)=>{this.lastMoveEvent=k,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=Vl(b,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(k,b)=>{this.end();const{onEnd:E,onSessionEnd:P,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=sf(k.type==="pointercancel"?this.lastMoveEventInfo:Vl(b,this.transformPagePoint),this.history);this.startEvent&&E&&E(k,_),P&&P(k,_)},!wp(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=s||window;const d=wa(t),f=Vl(d,this.transformPagePoint),{point:m}=f,{timestamp:p}=$t;this.history=[{...m,timestamp:p}];const{onSessionStart:y}=n;y&&y(t,sf(f,this.history));const w={passive:!0,capture:!0};this.removeListeners=ya(Xo(this.contextWindow,"pointermove",this.handlePointerMove,w),Xo(this.contextWindow,"pointerup",this.handlePointerUp,w),Xo(this.contextWindow,"pointercancel",this.handlePointerUp,w)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(i0.has(r.overflowX)||i0.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:s.x-n.x,y:s.y-n.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,s),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ci(this.updatePoint)}}function Vl(e,t){return t?{point:t(e.point)}:e}function s0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sf({point:e},t){return{point:e,delta:s0(e,$1(t)),offset:s0(e,xR(t)),velocity:wR(t,.1)}}function xR(e){return e[0]}function $1(e){return e[e.length-1]}function wR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=$1(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>_n(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>_n(t)*2&&(r=e[1]);const a=Fn(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const l={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function SR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?nt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?nt(n,e,r.max):Math.min(e,n)),e}function o0(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function kR(e,{top:t,left:n,bottom:r,right:s}){return{x:o0(e.x,n,s),y:o0(e.y,t,r)}}function a0(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function CR(e,t){return{x:a0(e.x,t.x),y:a0(e.y,t.y)}}function bR(e,t){let n=.5;const r=ln(e),s=ln(t);return s>r?n=ia(t.min,t.max-r,e.min):r>s&&(n=ia(e.min,e.max-s,t.min)),mr(0,1,n)}function ER(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fh=.35;function _R(e=fh){return e===!1?e=0:e===!0&&(e=fh),{x:l0(e,"left","right"),y:l0(e,"top","bottom")}}function l0(e,t,n){return{min:u0(e,t),max:u0(e,n)}}function u0(e,t){return typeof e=="number"?e:e[t]||0}const PR=new WeakMap;class TR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=p=>{n&&this.snapToCursor(wa(p).point),this.stopAnimation()},l=(p,y)=>{const{drag:w,dragPropagation:k,onDragStart:b}=this.getProps();if(w&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=eP(w),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cr(P=>{let R=this.getAxisMotionValue(P).get()||0;if(pr.test(R)){const{projection:_}=this.visualElement;if(_&&_.layout){const j=_.layout.layoutBox[P];j&&(R=ln(j)*(parseFloat(R)/100))}}this.originPoint[P]=R}),b&&rt.update(()=>b(p,y),!1,!0),nh(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:w,dragDirectionLock:k,onDirectionLock:b,onDrag:E}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:P}=y;if(k&&this.currentDirection===null){this.currentDirection=AR(P),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",y.point,P),this.updateAxis("y",y.point,P),this.visualElement.render(),E&&rt.update(()=>E(p,y),!1,!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new U1(t,{onSessionStart:a,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:B1(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&rt.postRender(()=>c(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!zl(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=SR(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&Rs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kR(r.layoutBox,t):this.constraints=!1,this.elastic=_R(n),s!==this.constraints&&!Rs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&cr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=ER(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Rs(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const a=RP(r,s.root,this.visualElement.getTransformPagePoint());let l=CR(s.layout.layoutBox,a);if(n){const c=n(_P(l));this.hasMutatedConstraints=!!c,c&&(l=c1(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=cr(m=>{if(!zl(m,n,this.currentDirection))return;let p=d&&d[m]||{};(l===!0||l===m)&&(p={min:0,max:0});const y=s?200:1e6,w=s?40:1e7,k={type:"inertia",velocity:r?t[m]:0,bounceStiffness:y,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(m,k)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return nh(this.visualElement,t),r.start(mp(t,r,0,n,this.visualElement,!1))}stopAnimation(){cr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){cr(n=>{const{drag:r}=this.getProps();if(!zl(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:c}=s.layout.layoutBox[n],d=a.get()||0;a.set(t[n]-nt(l,c,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Rs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};cr(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();s[l]=bR({min:d,max:d},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),cr(l=>{if(!zl(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(nt(d,f,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;PR.set(this.visualElement,this);const t=this.visualElement.current,n=Xo(t,"pointerdown",f=>{const{drag:m,dragListener:p=!0}=this.getProps(),y=f.target,w=y!==t&&oP(y);m&&p&&!w&&this.start(f)});let r;const s=()=>{const{dragConstraints:f}=this.getProps();Rs(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=RR(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,l=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),rt.read(s);const c=aa(window,"resize",()=>this.scalePositionWithinConstraints()),d=a.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(cr(p=>{const y=this.getAxisMotionValue(p);y&&(this.originPoint[p]+=f[p].translate,y.set(y.get()+f[p].translate))}),this.visualElement.render())});return()=>{c(),n(),l(),d&&d(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:l=fh,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:l,dragMomentum:c}}}function c0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function RR(e,t,n){const r=yv(e,c0(n)),s=yv(t,c0(n));return()=>{r(),s()}}function zl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function AR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class IR extends hi{constructor(t){super(t),this.removeGroupControls=Vn,this.removeListeners=Vn,this.controls=new TR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const of=e=>(t,n)=>{e&&rt.update(()=>e(t,n),!1,!0)};class MR extends hi{constructor(){super(...arguments),this.removePointerDownListener=Vn}onPointerDown(t){this.session=new U1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:B1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:of(t),onStart:of(n),onMove:of(r),onEnd:(a,l)=>{delete this.session,s&&rt.postRender(()=>s(a,l))}}}mount(){this.removePointerDownListener=Xo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let af=!1;class NR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),af&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:l}=r;return l&&(l.isPresent=a,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),af=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||rt.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),xp.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;af=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function H1(e){const[t,n]=I1(),r=S.useContext(ep);return v.jsx(NR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(V1),isPresent:t,safeToRemove:n})}const LR={pan:{Feature:MR},drag:{Feature:IR,ProjectionNode:A1,MeasureLayout:H1}};function d0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&rt.postRender(()=>a(t,wa(t)))}class jR extends hi{mount(){const{current:t}=this.node;t&&(this.unmount=nP(t,(n,r)=>(d0(this.node,r,"Start"),s=>d0(this.node,s,"End"))))}unmount(){}}class DR extends hi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ya(aa(this.node.current,"focus",()=>this.onFocus()),aa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function f0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&rt.postRender(()=>a(t,wa(t)))}class OR extends hi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=lP(t,(s,a)=>(f0(this.node,a,"Start"),(l,{success:c})=>f0(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const hh=new WeakMap,lf=new WeakMap,FR=e=>{const t=hh.get(e.target);t&&t(e)},VR=e=>{e.forEach(FR)};function zR({root:e,...t}){const n=e||document;lf.has(n)||lf.set(n,{});const r=lf.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(VR,{root:e,...t})),r[s]}function BR(e,t,n){const r=zR(t);return hh.set(e,n),r.observe(e),()=>{hh.delete(e),r.unobserve(e)}}const UR={some:0,all:1};class $R extends hi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:UR[s]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,a&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),y=f?m:p;y&&y(d)};this.stopObserver=BR(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(HR(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function HR({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WR={inView:{Feature:$R},tap:{Feature:OR},focus:{Feature:DR},hover:{Feature:jR}},qR={layout:{ProjectionNode:A1,MeasureLayout:H1}},GR={...gR,...WR,...LR,...qR},js=dR(GR,fR);class Pu extends Error{constructor(t,n){super(n),this.status=t}}function KR(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function XR(e=globalThis.fetch.bind(globalThis)){async function t(n,r){const s=(r?.method??"GET").toUpperCase(),l=await e(n,{...r,cache:"no-store",credentials:"same-origin",headers:s!=="GET"&&s!=="HEAD"?{"content-type":"application/json","X-Ours-Messenger-CSRF":"1",...r?.headers}:r?.headers}),c=await l.text();let d=null;if(c)try{d=JSON.parse(c)}catch{throw new Pu(l.status,l.ok?"Server returned an invalid response":`HTTP ${l.status}`)}if(!l.ok){const f=d&&typeof d=="object"&&"error"in d&&d.error&&typeof d.error=="object"&&"message"in d.error&&typeof d.error.message=="string"?d.error.message:`HTTP ${l.status}`;throw new Pu(l.status,f)}return d}return{identity:()=>t("/api/identity"),setBio:n=>t("/api/identity/bio",{method:"POST",body:JSON.stringify({bio:n})}),buildInfo:()=>t("/api/build-info"),identities:()=>t("/api/identities"),contacts:()=>t("/api/contacts"),invites:()=>t("/api/invites"),conversation:(n,r,s)=>t(`/api/conversations/${encodeURIComponent(n)}/page?limit=50${r?`&before=${encodeURIComponent(r)}`:""}`,{signal:s}),markRead:n=>t(`/api/conversations/${encodeURIComponent(n)}/read`,{method:"POST"}),send:(n,r,s,a)=>t("/api/messages/send",{method:"POST",signal:a,body:JSON.stringify({contact:n,text:r,...s?{reply_to_wire_id:s}:{}})}),commands:(n,r)=>t(`/api/contacts/${encodeURIComponent(n)}/commands`,{signal:r}),sendCommand:(n,r,s,a,l,c)=>t("/api/commands/send",{method:"POST",signal:c,body:JSON.stringify({contact:n,recipient_cid:n,command:r,arguments:s,invocation_id:a,catalog_fingerprint:l,confirmed:!0})}),sendFile:async(n,r,s,a,l)=>t("/api/messages/send-file",{method:"POST",body:JSON.stringify({contact:n,data_base64:KR(new Uint8Array(await r.arrayBuffer())),filename:s,mime:a,...l?{reply_to_wire_id:l}:{}})}),files:n=>t(`/api/conversations/${encodeURIComponent(n)}/files`),fetchFiles:n=>t("/api/files/fetch",{method:"POST",body:JSON.stringify({wire_ids:n})}),mediaUrl:n=>`/api/media/${encodeURIComponent(n)}`,createInvite:(n="one_time",r)=>t("/api/invites",{method:"POST",body:JSON.stringify({mode:n,...r?{name:r}:{}})}),addContact:(n,r)=>t("/api/contacts/add",{method:"POST",body:JSON.stringify({invite:n,...r?{name:r}:{}})}),renameContact:(n,r)=>t("/api/contacts/rename",{method:"POST",body:JSON.stringify({contact:n,name:r})}),removeContact:n=>t("/api/contacts/remove",{method:"POST",body:JSON.stringify({contact:n})}),revokeInvite:n=>t("/api/invites/revoke",{method:"POST",body:JSON.stringify({invite_id:n})}),respondToIntroduction:(n,r)=>t("/api/contacts/introductions",{method:"POST",body:JSON.stringify({contact:n,action:r})}),vapidPublicKey:()=>t("/api/push/vapid-public-key"),ensurePush:n=>t("/api/push/subscriptions/ensure",{method:"POST",body:JSON.stringify(n)}),deletePush:n=>t("/api/push/subscriptions/delete",{method:"POST",body:JSON.stringify({binding_id:n})})}}const Xe=XR(),ph="ours-messenger-live-event";function W1(e){window.dispatchEvent(new CustomEvent(ph,{detail:e}))}function YR(e){const t=n=>{const r=n.detail;r?.v===1&&e(r)};return window.addEventListener(ph,t),()=>window.removeEventListener(ph,t)}function QR(e,t){const n=new EventSource("/api/events");let r=!1;t("connecting"),n.onopen=()=>{r=!0,t("live")},n.onerror=()=>t(r?"retrying":"connecting");const s=a=>{n.addEventListener(a,l=>{try{const c=JSON.parse(l.data);c&&c.v===1&&e({...c,type:a})}catch{}})};return s("sync_required"),s("message_received"),s("receipt_received"),s("file_received"),()=>n.close()}function JR(e=window.location){return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/api/presence`}function ZR(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(t.type!=="event"||!t.event||typeof t.event!="object")return null;const n=t.event;return n.v===1?n:null}function eA(e){let t=!1,n=null,r,s=1e3,a=0;const l=()=>{r!==void 0&&clearTimeout(r),r=void 0;const m=n;n=null,m&&m.readyState<WebSocket.CLOSING&&m.close(1e3,"hidden")},c=()=>{if(t||document.visibilityState!=="visible")return;e.onState?.("retrying");const m=s;s=Math.min(3e4,s*2),r=setTimeout(()=>{r=void 0,d()},m)},d=async()=>{if(l(),t||document.visibilityState!=="visible")return;const m=++a;e.onState?.("connecting");try{const[p,y]=await Promise.all([e.identity(),e.registration.pushManager.getSubscription()]);if(t||m!==a||document.visibilityState!=="visible")return;const w=y?.toJSON(),k=y?.endpoint,b=w?.keys?.auth;if(!k||!b)return;const E=new WebSocket(JR());n=E,E.onopen=()=>E.send(JSON.stringify({identity:p.cid,endpoint:k,auth:b})),E.onmessage=P=>{let R;try{R=JSON.parse(String(P.data))}catch{return}if(R?.ok===!0){s=1e3,e.onState?.("live");return}const _=ZR(R);_&&e.onEvent(_)},E.onclose=()=>{n===E&&(n=null),m===a&&c()},E.onerror=()=>E.close()}catch{m===a&&c()}},f=()=>{a++,document.visibilityState==="visible"?(s=1e3,d()):l()};return document.addEventListener("visibilitychange",f),window.addEventListener("pagehide",l),d(),()=>{t=!0,a++,document.removeEventListener("visibilitychange",f),window.removeEventListener("pagehide",l),l()}}function tA(e,t){return t.visibility==="visible"&&t.appRoute==="chats"&&t.selectedContactCid===e&&(t.desktopLayout||t.mobileDetailOpen)&&!t.conversationCoveringDialogOpen}class nA{#e=new Map;request(t,n){let r=this.#e.get(t);return r?.running?(r.rerun=!0,r.running):(r??={running:null,rerun:!1},this.#e.set(t,r),r.running=(async()=>{do r.rerun=!1,await n();while(r.rerun)})().finally(()=>{r.running=null,r.rerun||this.#e.delete(t)}),r.running)}}function uf(e){if(e==="/"||e==="/chats"||e==="/chats/")return{name:"chats",contactCid:null};const t=/^\/chats\/([^/]+)\/contact\/?$/.exec(e);if(t)try{const r=decodeURIComponent(t[1]);if(r)return{name:"contact",contactCid:r}}catch{}const n=/^\/chats\/([^/]+)\/?$/.exec(e);if(n)try{const r=decodeURIComponent(n[1]);if(r)return{name:"chats",contactCid:r}}catch{}return{name:"not_found",pathname:e}}function ni(e){return e?`/chats/${encodeURIComponent(e)}`:"/chats"}function rA(e){return`/chats/${encodeURIComponent(e)}/contact`}function iA(e){return typeof e=="object"&&e!==null&&e.oursMessenger===!0?"back":"replace"}const h0={read:2,delivered:1};function p0(e){return e&&Object.hasOwn(h0,e)?h0[e]:0}function mh(e,t){return p0(t)>p0(e)?t:e}const sA=()=>({contacts:[],pending:[]});function oA(e){return{identity:null,contacts:sA(),route:e,pages:{},pendingSends:{},drafts:{},replies:{},connection:"connecting",search:"",mobileDetailOpen:e.name==="chats"&&e.contactCid!==null||e.name==="contact",coveringDialog:!1,dialogBusy:!1,generatedInvite:null,sendingDialog:null,error:null,loaded:!1}}function Ii(e,t){return`${e}:${t}`}function lr(e){return e.route.name==="chats"||e.route.name==="contact"?e.route.contactCid:null}function ur(e,t){return e.identity?e.pages[Ii(e.identity.cid,t)]??null:null}function aA(e,t){const n=mh(e.receipt,t.receipt);return n===t.receipt?t:{...t,receipt:n}}function Ss(e,t){const n=[...e],r=new Map;n.forEach((s,a)=>{s.wire_id&&r.set(s.wire_id,a)});for(const s of t){const a=s.wire_id?r.get(s.wire_id):void 0;a===void 0?(s.wire_id&&r.set(s.wire_id,n.length),n.push(s)):n[a]=aA(n[a],s)}return n}function m0(e,t){const n=lr(e);return!n||t.contacts.some(r=>r.container_id===n)?{}:{route:{name:"chats",contactCid:null},mobileDetailOpen:!1}}function g0(e,t){switch(t.type){case"snapshot":{const n=e.identity!==null&&e.identity.cid!==t.identity.cid;return{...e,identity:t.identity,contacts:t.contacts,loaded:!0,error:null,...n?{pages:{},pendingSends:{},drafts:{},replies:{},sendingDialog:null,generatedInvite:null,coveringDialog:!1,dialogBusy:!1}:{},...m0(e,t.contacts)}}case"contacts":return{...e,contacts:t.contacts,...m0(e,t.contacts)};case"page":{if(!e.identity)return e;const n=Ii(e.identity.cid,t.contactCid),r=e.pages[n],s=e.pendingSends[n]??[],a=new Set(t.page.messages.map(y=>y.wire_id)),l=s.filter(y=>!a.has(y.wire_id)),c=new Map(r?.messages.map(y=>[y.wire_id,y.receipt])??[]),d=r?t.page.messages.map(y=>{const w=mh(c.get(y.wire_id)??null,y.receipt);return w===y.receipt?y:{...y,receipt:w}}):t.page.messages,f=r&&r.messages.length>50?{...t.page,messages:Ss(r.messages,d),hasMore:r.hasMore,nextBefore:r.nextBefore}:{...t.page,messages:d},m=Ss(f.messages,l),p={...f,messages:m,total:Math.max(f.total+l.length,m.length)};return{...e,pages:{...e.pages,[n]:p},pendingSends:{...e.pendingSends,[n]:l.length?l:void 0}}}case"sent_message":{if(!e.identity)return e;const n=Ii(e.identity.cid,t.contactCid),r=e.pages[n];if(r?.messages.some(l=>l.wire_id===t.message.wire_id))return e;const s=Ss(e.pendingSends[n]??[],[t.message]);if(!r)return{...e,pendingSends:{...e.pendingSends,[n]:s}};const a=Ss(r.messages,[t.message]);return{...e,pages:{...e.pages,[n]:{...r,messages:a,total:Math.max(r.total+1,a.length)}},pendingSends:{...e.pendingSends,[n]:s}}}case"receipt":{if(!e.identity)return e;const n=Ii(e.identity.cid,t.contactCid),r=e.pages[n],s=e.pendingSends[n],a=new Set(t.wireIds),l=f=>{let m=!1;const p=f.map(y=>{if(!y.wire_id||!a.has(y.wire_id))return y;const w=mh(y.receipt,t.kind);return w===y.receipt?y:(m=!0,{...y,receipt:w})});return m?p:f},c=r?l(r.messages):void 0,d=s?l(s):void 0;return c===r?.messages&&d===s?e:{...e,pages:r&&c?{...e.pages,[n]:{...r,messages:c}}:e.pages,pendingSends:s&&d?{...e.pendingSends,[n]:d}:e.pendingSends}}case"older_page":{if(!e.identity)return e;const n=Ii(e.identity.cid,t.contactCid),r=e.pages[n];if(!r)return e;const s=Ss(Ss(t.page.messages,t.newer),r.messages),a={...t.page,preview:r.preview,total:Math.max(t.page.total,r.total,s.length),messages:s};return{...e,pages:{...e.pages,[n]:a}}}case"route":return{...e,route:t.route,mobileDetailOpen:t.mobileDetailOpen??(t.route.name==="chats"&&t.route.contactCid!==null||t.route.name==="contact")};case"connection":return{...e,connection:t.connection};case"search":return{...e,search:t.search};case"draft":return e.identity?{...e,drafts:{...e.drafts,[Ii(e.identity.cid,t.contactCid)]:t.value}}:e;case"reply":return e.identity?{...e,replies:{...e.replies,[Ii(e.identity.cid,t.contactCid)]:t.wireId??void 0}}:e;case"sending":return{...e,sendingDialog:t.dialog};case"dialog":return{...e,coveringDialog:t.open,dialogBusy:t.open?e.dialogBusy:!1,generatedInvite:t.open?e.generatedInvite:null,error:null};case"dialog_busy":return{...e,dialogBusy:t.busy};case"generated_invite":return{...e,generatedInvite:t.blob};case"error":return{...e,error:t.message}}}function lA(e,t,n){return!e||t?"ignore":n?"defer":"reload"}function Sa(){return{api:Xe,notification:globalThis.Notification,navigator}}function si(e,t,n){return new Promise((r,s)=>{const a=setTimeout(()=>s(new Error(`${n} did not complete within ${t/1e3}s — try again`)),t);e.then(l=>{clearTimeout(a),r(l)},l=>{clearTimeout(a),s(l)})})}async function uA(e,t={}){let n=null,r=!1,s=!1;const a="serviceWorker"in navigator&&window.isSecureContext,l=()=>e({supported:a,offline:!navigator.onLine,updateAvailable:r,registration:n}),c=()=>l(),d=()=>l(),f=()=>{document.visibilityState==="visible"&&n?.update().catch(()=>{})},m=w=>{if(w.data?.type==="ours-push-repair-required"){window.dispatchEvent(new Event("ours-push-repair-required"));return}if(w.data?.type==="ours-push-foreground"){const k=w.data.contact_id,b=w.data.wire_id,E=w.data.kind;typeof k=="string"&&typeof b=="string"&&W1({v:1,type:E==="file"?"file_received":"message_received",contact_id:k,wire_id:b,date:new Date().toISOString()})}},p=a&&!!navigator.serviceWorker.controller,y=()=>{const w=lA(p,s,t.shouldDeferReload?.()??!1);if(w!=="ignore"){if(w==="defer"){r=!0,l();return}s=!0,(t.reload??(()=>location.reload()))()}};if(window.addEventListener("online",c),window.addEventListener("offline",d),document.addEventListener("visibilitychange",f),navigator.serviceWorker?.addEventListener("message",m),navigator.serviceWorker?.addEventListener("controllerchange",y),a){n=await navigator.serviceWorker.register("/sw.js",{scope:"/",updateViaCache:"none"}),await navigator.serviceWorker.ready;const w=k=>k?.addEventListener("statechange",()=>{k.state==="installed"&&navigator.serviceWorker.controller&&(r=!0,l())});w(n.installing),n.addEventListener("updatefound",()=>w(n?.installing??null)),n.update().catch(()=>{})}return l(),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",d),document.removeEventListener("visibilitychange",f),navigator.serviceWorker?.removeEventListener("message",m),navigator.serviceWorker?.removeEventListener("controllerchange",y)}}async function y0(e,t=()=>location.reload(),n=navigator.serviceWorker){const r=e.waiting;if(!r){t();return}await si(new Promise(s=>{let a=!1;const l=()=>{a||(a=!0,n.removeEventListener("controllerchange",l),t(),s())};n.addEventListener("controllerchange",l),r.postMessage({type:"SKIP_WAITING"})}),1e4,"service-worker update")}function cA(e){const t="=".repeat((4-e.length%4)%4),n=atob((e+t).replaceAll("-","+").replaceAll("_","/")),r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}function dA(e){return e?e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null}function v0(e,t){const n=dA(e);return!!n&&n.length===t.length&&n.every((r,s)=>r===t[s])}function gh(e=navigator.userAgent){return/iP(?:hone|ad|od)/.test(e)}function yh(e=navigator,t=window){return gh(e.userAgent)&&(e.standalone===!0||t.matchMedia("(display-mode: standalone)").matches)}function fA(){return gh()&&!yh()?"On iPhone or iPad, tap Share → Add to Home Screen, then open messenger from its Home Screen icon (iOS 16.4 or later).":!("Notification"in window)||!window.PushManager||!("serviceWorker"in navigator)?"Notifications require a current secure browser with service-worker and Web Push support.":Notification.permission==="denied"?gh()?"Allow messenger in iOS Settings → Notifications, then return and choose Repair.":"Allow notifications in this site’s browser settings, then return and choose Repair.":null}function hA(e={}){const t=e.notification??Sa().notification;if(!t)return Promise.reject(new Error("notification permission is unavailable"));const n=new Promise((r,s)=>{let a=!1;const l=c=>{if(a)return;const d=c??t.permission;d!=="granted"&&d!=="denied"&&d!=="default"||(a=!0,r(d))};try{const c=t.requestPermission(l);c&&typeof c.then=="function"&&c.then(l,s)}catch(c){s(c)}});return si(n,e.timeoutMs??15e3,"notification permission")}function q1(e,t){return!!e&&!!e.pushManager&&!!t.notification&&!!t.navigator.serviceWorker}function $i(e,t={}){return{status:e,preview:"full",...t}}async function pA(e,t,n){let r=await si(e.pushManager.getSubscription(),5e3,"push subscription lookup");if((n||r?.options.applicationServerKey&&!v0(r.options.applicationServerKey,t))&&(r&&await si(r.unsubscribe(),5e3,"stale push unsubscribe"),r=null),r&&v0(r.options.applicationServerKey,t))return r;try{return await si(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push subscribe")}catch(s){const a=await e.pushManager.getSubscription();if(!a)throw s;return await si(a.unsubscribe(),5e3,"stale push unsubscribe"),si(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push repair")}}async function G1(e,t,n,r){const s=await r.api.vapidPublicKey(),l=await si(Promise.resolve(r.navigator.serviceWorker.ready),1e4,"service-worker readiness")??e,c=cA(s.publicKey),f=(await pA(l,c,n)).toJSON();if(!f.endpoint||!f.keys?.p256dh||!f.keys.auth)throw new Error("browser returned an incomplete push subscription");const m=await r.api.ensurePush({...f,label:r.navigator.userAgent.slice(0,160),...t===void 0?{}:{preview:t}});if(m.status!=="on"||m.fingerprint!==s.fingerprint||m.configEpoch!==s.configEpoch)throw new Error("server did not acknowledge the current Web Push configuration");return $i("on",{bindingId:m.binding_id,fingerprint:m.fingerprint,configEpoch:m.configEpoch,preview:m.preview})}async function x0(e,t=Sa()){return q1(e,t)?t.notification.permission!=="granted"?$i("needs-permission",{blocked:t.notification.permission==="denied"}):await e.pushManager.getSubscription()?G1(e,void 0,!1,t):$i("off"):$i("unsupported")}async function K1(e,t={},n=Sa()){if(!q1(e,n))return $i("unsupported");const r=await hA({notification:n.notification});return r!=="granted"?$i("needs-permission",{blocked:r==="denied"}):G1(e,t.preview??"full",t.forceFresh??!1,n)}const mA=(e,t,n=Sa())=>K1(e,{preview:t,forceFresh:!0},n);async function gA(e,t,n=Sa()){const r=await e.pushManager.getSubscription(),s=[];if(t.bindingId)try{await n.api.deletePush(t.bindingId)}catch(a){s.push(a)}if(r)try{await r.unsubscribe()}catch(a){s.push(a)}if(s.length)throw new Error("notification disable did not fully converge — choose Repair and try again");return $i("off",{preview:t.preview})}function yA(e=15e3){if(!("serviceWorker"in navigator))return()=>{};let t;const n=()=>{const a={type:"ours-visibility",state:document.visibilityState,ts:Date.now(),iosStandalone:yh()};navigator.serviceWorker.ready.then(l=>{(navigator.serviceWorker.controller??l.active)?.postMessage(a)}).catch(()=>{})},r=()=>{n(),t!==void 0&&clearInterval(t),t=document.visibilityState==="visible"?setInterval(n,e):void 0,document.visibilityState==="visible"&&X1()},s=a=>{a.data?.type!=="ours-visibility-query"||!a.ports?.[0]||a.ports[0].postMessage({type:"ours-visibility-reply",state:document.visibilityState,iosStandalone:yh()})};return document.addEventListener("visibilitychange",r),navigator.serviceWorker.addEventListener("message",s),r(),()=>{document.removeEventListener("visibilitychange",r),navigator.serviceWorker.removeEventListener("message",s),t!==void 0&&clearInterval(t)}}async function X1(){try{if(!("serviceWorker"in navigator))return;const t=await(await navigator.serviceWorker.getRegistration())?.getNotifications()??[];for(const n of t)n.close();"clearAppBadge"in navigator&&await navigator.clearAppBadge()}catch{}}/**
|
|
49
|
+
* @license lucide-react v0.468.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const vA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Y1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
54
|
+
* @license lucide-react v0.468.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var xA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
59
|
+
* @license lucide-react v0.468.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const wA=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...c},d)=>S.createElement("svg",{ref:d,...xA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Y1("lucide",s),...c},[...l.map(([f,m])=>S.createElement(f,m)),...Array.isArray(a)?a:[a]]));/**
|
|
64
|
+
* @license lucide-react v0.468.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const Ue=(e,t)=>{const n=S.forwardRef(({className:r,...s},a)=>S.createElement(wA,{ref:a,iconNode:t,className:Y1(`lucide-${vA(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
69
|
+
* @license lucide-react v0.468.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const SA=Ue("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
74
|
+
* @license lucide-react v0.468.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const kA=Ue("Bolt",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
|
|
79
|
+
* @license lucide-react v0.468.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const CA=Ue("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
84
|
+
* @license lucide-react v0.468.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const w0=Ue("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
89
|
+
* @license lucide-react v0.468.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const bA=Ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
94
|
+
* @license lucide-react v0.468.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const EA=Ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
99
|
+
* @license lucide-react v0.468.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const _A=Ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
104
|
+
* @license lucide-react v0.468.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const PA=Ue("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
|
|
109
|
+
* @license lucide-react v0.468.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const TA=Ue("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
|
114
|
+
* @license lucide-react v0.468.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const RA=Ue("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
119
|
+
* @license lucide-react v0.468.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const AA=Ue("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
124
|
+
* @license lucide-react v0.468.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const IA=Ue("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
129
|
+
* @license lucide-react v0.468.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const S0=Ue("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
134
|
+
* @license lucide-react v0.468.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const MA=Ue("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
|
|
139
|
+
* @license lucide-react v0.468.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const NA=Ue("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
144
|
+
* @license lucide-react v0.468.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const LA=Ue("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
149
|
+
* @license lucide-react v0.468.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const jA=Ue("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
|
|
154
|
+
* @license lucide-react v0.468.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const DA=Ue("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
159
|
+
* @license lucide-react v0.468.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const OA=Ue("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
164
|
+
* @license lucide-react v0.468.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const FA=Ue("MessageCircleReply",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}],["path",{d:"M7 12h7a2 2 0 0 1 2 2v1",key:"1gheu4"}]]);/**
|
|
169
|
+
* @license lucide-react v0.468.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const VA=Ue("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
|
|
174
|
+
* @license lucide-react v0.468.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const zA=Ue("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
|
|
179
|
+
* @license lucide-react v0.468.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const BA=Ue("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
184
|
+
* @license lucide-react v0.468.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const UA=Ue("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
189
|
+
* @license lucide-react v0.468.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const $A=Ue("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
194
|
+
* @license lucide-react v0.468.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const HA=Ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
199
|
+
* @license lucide-react v0.468.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const WA=Ue("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
204
|
+
* @license lucide-react v0.468.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const qA=Ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
209
|
+
* @license lucide-react v0.468.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const GA=Ue("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
|
|
214
|
+
* @license lucide-react v0.468.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const KA=Ue("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
219
|
+
* @license lucide-react v0.468.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const XA=Ue("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
224
|
+
* @license lucide-react v0.468.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const YA=Ue("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
229
|
+
* @license lucide-react v0.468.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const QA=Ue("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
234
|
+
* @license lucide-react v0.468.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const JA=Ue("UserRoundPlus",[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]]);/**
|
|
239
|
+
* @license lucide-react v0.468.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const ZA=Ue("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
244
|
+
* @license lucide-react v0.468.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const eI=Ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tI={app:MA,back:SA,bolt:kA,chat:VA,check:bA,chevron:_A,chevronDown:EA,close:eI,clusters:w0,copy:RA,download:AA,edit:$A,inbox:NA,link:LA,lock:jA,mic:zA,maximize:DA,menu:OA,minus:BA,monitor:S0,monitorEye:S0,more:IA,paperclip:UA,pause:PA,play:TA,plus:HA,refresh:WA,reply:FA,search:qA,send:GA,settings:KA,shield:XA,sliders:YA,trash:QA,user:ZA,invite:JA,agent:CA,network:w0};function Ce(e){const{name:t,size:n=18,stroke:r=1.8,fill:s=!1,style:a,className:l}=e,c=tI[t];return c?v.jsx(c,{className:"ic "+(l||""),width:n,height:n,strokeWidth:r,fill:s?"currentColor":"none",style:a,"aria-hidden":"true"}):null}function Q1(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-]\d{2}:\d{2})|\s*\(UTC\))?$/i.exec(e.trim());if(!t)return null;const n=t[7]?t[7].slice(0,3).padEnd(3,"0"):"000",r=`${t[1]}-${t[2]}-${t[3]}T${t[4]}:${t[5]}:${t[6]}.${n}`,s=new Date(`${r}Z`);if(Number.isNaN(s.getTime())||s.getUTCFullYear()!==Number(t[1])||s.getUTCMonth()+1!==Number(t[2])||s.getUTCDate()!==Number(t[3])||s.getUTCHours()!==Number(t[4])||s.getUTCMinutes()!==Number(t[5])||s.getUTCSeconds()!==Number(t[6]))return null;if(t[9]){const a=new Date(`${r}${t[9]}`);return Number.isNaN(a.getTime())?null:a.toISOString()}return s.toISOString()}function Tu(e){const t=Q1(e);if(t){const r=Date.parse(t);if(!Number.isNaN(r))return r}const n=new Date(e).getTime();return Number.isNaN(n)?0:n}function nI(e){const t=Q1(e);if(t){const r=new Date(t);if(!Number.isNaN(r.getTime()))return r}const n=new Date(e);return Number.isNaN(n.getTime())?null:n}const Do="room",rI="room_",Ru="ours-cowork-room:",k0="ours-cowork:",C0="ours-cowork-",b0="cowork-room-",vh=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/,iI=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,sI=25,oI=64,aI=80,E0=1e3,ua=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),sn=e=>typeof e=="string"&&e.length>0;function lI(e,t){if(typeof e!="string")return null;const n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))return null;let r;try{r=JSON.parse(n)}catch{return null}return!ua(r)||r.version!==1||!sn(r.kind)||!r.kind.startsWith(rI)||!sn(r.room_id)||t&&!sn(r.signature)?null:r}function uI(e){const t=ua(e.author)?e.author:{};return{name:sn(t.display_name)?t.display_name:"",role:sn(t.role)?t.role:""}}function cf(e){const n=Array.from(String(e)).slice(0,aI).join("").replace(/^room_/,"").split("_").filter(Boolean);return n.length===0?"Room notice":n.join(" ").replace(/^./,r=>r.toUpperCase())}function cI(e){if(!ua(e))return null;const t=sn(e.kind)?e.kind:"",n=uI(e),r=typeof e.text=="string"?e.text:"",s=Number.isSafeInteger(e.briefing_version)&&e.briefing_version>0?e.briefing_version:null,a={roomName:J1(e.room_name)??"",authoredAt:sn(e.at)?e.at:""};switch(t){case"room_msg":return n.role===Do?ii(t,"Room message",r||"Room notice",{...a,authoredBy:n.name}):{variant:"chat",kind:t,author:n.name||"Unknown member",role:n.role,label:"",text:r,...a};case"room_briefing":return ii(t,s===null?"Room briefing":`Room briefing · v${s}`,r||"The room briefing was updated.",{...a,authoredBy:n.name,presentation:"briefing"});case"room_role_briefing":{const l=sn(e.briefing_role)?e.briefing_role:"",c=["Role briefing",l,s===null?"":`v${s}`].filter(Boolean).join(" · ");return ii(t,c,r||"Your role briefing was updated.",{...a,authoredBy:n.name,presentation:"role",details:l?[`Role: ${l}`]:[]})}case"room_membership":{const l=ua(e.membership)?e.membership:{},c=[sn(l.action)?`Status: ${hI(l.action)}`:"",sn(l.alias)?`Member: ${l.alias}`:"",sn(l.role)?`Role: ${l.role}`:"",Number.isSafeInteger(l.epoch)&&l.epoch>=0?`Epoch: ${l.epoch}`:""].filter(Boolean);return ii(t,"Membership",r||yI(l),{...a,authoredBy:n.name,presentation:"membership",details:c})}case"room_file":{const l=sn(e.filename)?e.filename:"Shared file",c=[sn(e.mime)?`Type: ${e.mime}`:"",Number.isSafeInteger(e.size)&&e.size>=0?`Size: ${pI(e.size)}`:"",sn(e.sha256)?`SHA-256: ${mI(e.sha256)}`:""].filter(Boolean);return ii(t,"Room file",l,{...a,authoredBy:n.name,role:n.role,presentation:"file",details:c})}case"room_not_member":return ii(t,"Room access","You are no longer a member of this room.",{...a,presentation:"lifecycle",details:["Status: Removed"]});default:return r?{variant:n.role&&n.role!==Do?"chat":"system",kind:t,author:n.role&&n.role!==Do?n.name||"Unknown member":"",role:n.role&&n.role!==Do?n.role:"",label:n.role&&n.role!==Do?"":cf(t),text:gI(r),...a}:ii(t,cf(t),`${cf(t)} from the room.`,a)}}function dI(e,t){if(!fI(e))return null;const n=Ap(e)?.roomId??null,r=Tp(e),s=Rp(e),a=lI(t,n===null&&s===null);return a!==null&&n!==null&&a.room_id!==n||a!==null&&r!==null&&a.room_id!==r?_0("Room provenance mismatch"):cI(a)}function J1(e){if(typeof e!="string"||/[\p{Cc}\p{Cf}]/u.test(e))return null;const t=e.trim().normalize("NFC"),n=Array.from(t).length;return n>=1&&n<=oI?t:null}function Tp(e){if(typeof e!="string"||!e.startsWith(b0))return null;const t=e.slice(b0.length);return vh.test(t)?t:null}function Rp(e){return typeof e!="string"||!e.startsWith(k0)?null:J1(e.slice(k0.length))}function Ap(e){if(typeof e!="string"||!e.startsWith(C0))return null;const t=e.slice(C0.length);if(vh.test(t))return{roomId:t,slug:null};const n=t.slice(-26),r=t.at(-27),s=t.slice(0,-27);return r!=="-"||!vh.test(n)||s.length<1||s.length>sI?null:iI.test(s)?{roomId:n,slug:s}:null}function fI(e){const t=String(e??"").trim();return t.startsWith(Ru)&&t.slice(Ru.length).trim().length>0||Rp(e)!==null||Ap(e)!==null||Tp(e)!==null}function ii(e,t,n,r={}){return{variant:"system",kind:e,author:"",role:"",label:t,text:n,...r}}function hI(e){return String(e).replace(/_/g," ").replace(/^./,t=>t.toUpperCase())}function pI(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function mI(e){const t=String(e);return t.length<=20?t:`${t.slice(0,12)}…${t.slice(-6)}`}function gI(e){const t=Array.from(String(e));return t.length<=E0?t.join(""):`${t.slice(0,E0).join("")}…`}function _0(e){return ii("room_invalid","Room notice","This room envelope could not be displayed safely.",{presentation:"lifecycle",details:[`Status: ${e}`]})}function yI(e){if(!ua(e))return"The room membership changed.";const t=sn(e.alias)?e.alias:"A member";return e.action==="remove"?`${t} left the room.`:"The room membership changed."}function vI(e){if(!e)return"";const t=e.variant==="chat"?e.author:e.label,n=xI(e.text);return t?n?`${t} · ${n}`:t:n}function xI(e){return String(e??"").replace(/\s+/g," ").trim()}function wI(e){const t=String(e??"").trim();if(t.startsWith(Ru))return t.slice(Ru.length).trim()||null;const n=Rp(e);if(n!==null)return n;const r=Ap(e);if(r?.slug)return r.slug.replace(/-/g," ").replace(/[a-z]/,l=>l.toUpperCase());if(r)return`Room ${r.roomId.slice(0,8)}`;const s=Tp(e);return s===null?null:`Room ${s.slice(0,8)}`}const Ip=nI;function xh(e){const t=e.trim().split(/\s+/).filter(Boolean);if(!t.length)return"?";const n=r=>Array.from(r).find(s=>/[\p{L}\p{N}]/u.test(s))??Array.from(r)[0]??"";if(t.length===1){const r=Array.from(t[0]),s=r.filter(a=>/[\p{L}\p{N}]/u.test(a));return(s.length?s.slice(0,2).join(""):r[0]??"?").toUpperCase()}return(n(t[0])+n(t.at(-1)??"")).toUpperCase()}function SI(e){const t=Ip(e);if(!t)return"";const n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function Hi(e){const t=Ip(e);return t?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function kI(e){const t=Ip(e);return t?t.toLocaleString():e}function Z1(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}function CI(e){return/^[0-9A-Fa-f]{40,}$/.test(e.trim())}function bI(e,t,n){const r=(e??"").trim(),s=wI(r);return s||(r&&!CI(r)?r:r?Z1(r):"Unnamed")}function Au(e){return e.display_name?.trim()||bI(e.name)}const EI="x-ours-kind=voice-message",eS="voice-message-",$o=20*1024*1024;let ca=null,wh=[];const Mp=new Map;function _I(e){ca=e;for(const t of wh)t(e);wh=[]}function P0(e){for(const t of e)Mp.set(t.wire_id,{id:t.wire_id,dir:t.dir,filename:t.filename,mime:t.mime,size:t.size,date:t.date,available:t.available,logicalName:t.logical_name,version:t.version,transcription:t.transcription})}function PI(){Mp.clear()}function tS(e){return Mp.get(e)??null}function TI(e){return ca?.url(e)??null}function RI(e){return`${e}; ${EI}`}function Bs(e,t){return/x-ours-kind\s*=\s*voice-message/i.test(e)||t.toLowerCase().startsWith(eS)&&e.toLowerCase().startsWith("audio/")}function AI(e,t){const n=e??"file",r=t??"";return Bs(r,n)?"🎤 Voice message":r.toLowerCase().startsWith("image/")?"🖼 Photo":`📎 ${n}`}async function Zu(e){return(ca??await new Promise(n=>wh.push(n))).bytes(e)}async function II(e){if(!ca)throw new Error("Media provider is not ready");await ca.fetch(e)}function di(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function MI(e,t=!1){return e==="read"?{state:"read",label:"read",glyph:"✓✓"}:e==="delivered"?{state:"delivered",label:"delivered",glyph:"✓✓"}:t?{state:"untracked",label:"sent, and cannot report delivery",glyph:"✓"}:{state:"sent",label:"sent",glyph:"✓"}}function Sh({receipt:e,content:t="Message",receiptless:n=!1}){const r=MI(e,n);return v.jsx("span",{className:"ticks"+(r.state==="read"?" read":""),"data-receipt-status":r.state,role:"img","aria-label":`${t} ${r.label}`,title:r.label,children:r.glyph})}function T0(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}const on=pi(/[A-Za-z]/),Jt=pi(/[\dA-Za-z]/),NI=pi(/[#-'*+\--9=?A-Z^-~]/);function Iu(e){return e!==null&&(e<32||e===127)}const kh=pi(/\d/),LI=pi(/[\dA-Fa-f]/),jI=pi(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const ec=pi(/\p{P}|\p{S}/u),Gi=pi(/\s/);function pi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function DI(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const tc=function(e){if(e==null)return zI;if(typeof e=="function")return nc(e);if(typeof e=="object")return Array.isArray(e)?OI(e):FI(e);if(typeof e=="string")return VI(e);throw new Error("Expected function, string, or object as test")};function OI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=tc(e[n]);return nc(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function FI(e){const t=e;return nc(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function VI(e){return nc(t);function t(n){return n&&n.type===e}}function nc(e){return t;function t(n,r,s){return!!(BI(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function zI(){return!0}function BI(e){return e!==null&&typeof e=="object"&&"type"in e}const nS=[],UI=!0,Ch=!1,$I="skip";function rS(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=tc(s),l=r?-1:1;c(e,void 0,[])();function c(d,f,m){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const w=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(w?"<"+w+">":""))+")"})}return y;function y(){let w=nS,k,b,E;if((!t||a(d,f,m[m.length-1]||void 0))&&(w=HI(n(d,m)),w[0]===Ch))return w;if("children"in d&&d.children){const P=d;if(P.children&&w[0]!==$I)for(b=(r?P.children.length:-1)+l,E=m.concat(P);b>-1&&b<P.children.length;){const R=P.children[b];if(k=c(R,b,E)(),k[0]===Ch)return k;b=typeof k[1]=="number"?k[1]:b+l}}return w}}}function HI(e){return Array.isArray(e)?e:typeof e=="number"?[UI,e]:e==null?nS:[e]}function WI(e,t,n){const s=tc((n||{}).ignore||[]),a=qI(t);let l=-1;for(;++l<a.length;)rS(e,"text",c);function c(f,m){let p=-1,y;for(;++p<m.length;){const w=m[p],k=y?y.children:void 0;if(s(w,k?k.indexOf(w):void 0,y))return;y=w}if(y)return d(f,m)}function d(f,m){const p=m[m.length-1],y=a[l][0],w=a[l][1];let k=0;const E=p.children.indexOf(f);let P=!1,R=[];y.lastIndex=0;let _=y.exec(f.value);for(;_;){const j=_.index,A={index:_.index,input:_.input,stack:[...m,f]};let N=w(..._,A);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?y.lastIndex=j+1:(k!==j&&R.push({type:"text",value:f.value.slice(k,j)}),Array.isArray(N)?R.push(...N):N&&R.push(N),k=j+_[0].length,P=!0),!y.global)break;_=y.exec(f.value)}return P?(k<f.value.length&&R.push({type:"text",value:f.value.slice(k)}),p.children.splice(E,1,...R)):R=[f],E+R.length}}function qI(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([GI(s[0]),KI(s[1])])}return t}function GI(e){return typeof e=="string"?new RegExp(DI(e),"g"):e}function KI(e){return typeof e=="function"?e:function(){return e}}const df="phrasing",ff=["autolink","link","image","label"];function XI(){return{transforms:[nM],enter:{literalAutolink:QI,literalAutolinkEmail:hf,literalAutolinkHttp:hf,literalAutolinkWww:hf},exit:{literalAutolink:tM,literalAutolinkEmail:eM,literalAutolinkHttp:JI,literalAutolinkWww:ZI}}}function YI(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:df,notInConstruct:ff},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:df,notInConstruct:ff},{character:":",before:"[ps]",after:"\\/",inConstruct:df,notInConstruct:ff}]}}function QI(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function hf(e){this.config.enter.autolinkProtocol.call(this,e)}function JI(e){this.config.exit.autolinkProtocol.call(this,e)}function ZI(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function eM(e){this.config.exit.autolinkEmail.call(this,e)}function tM(e){this.exit(e)}function nM(e){WI(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rM],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,iM]],{ignore:["link","linkReference"]})}function rM(e,t,n,r,s){let a="";if(!iS(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!sM(n)))return!1;const l=oM(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function iM(e,t,n,r){return!iS(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function oM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=T0(e,"(");let a=T0(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function iS(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gi(n)||ec(n))&&(!t||n!==47)}function Zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}sS.peek=mM;function aM(){this.buffer()}function lM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function uM(){this.buffer()}function cM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fM(e){this.exit(e)}function hM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pM(e){this.exit(e)}function mM(){return"["}function sS(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=s.move("]"),a}function gM(){return{enter:{gfmFootnoteCallString:aM,gfmFootnoteCall:lM,gfmFootnoteDefinitionLabelString:uM,gfmFootnoteDefinition:cM},exit:{gfmFootnoteCallString:dM,gfmFootnoteCall:fM,gfmFootnoteDefinitionLabelString:hM,gfmFootnoteDefinition:pM}}}function yM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:sS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const c=a.createTracker(l);let d=c.move("[^");const f=a.enter("footnoteDefinition"),m=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),m(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
|
|
249
|
+
`:" ")+a.indentLines(a.containerFlow(r,c.current()),t?oS:vM))),f(),d}}function vM(e,t,n){return t===0?e:oS(e,t,n)}function oS(e,t,n){return(n?"":" ")+e}const xM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];aS.peek=bM;function wM(){return{canContainEols:["delete"],enter:{strikethrough:kM},exit:{strikethrough:CM}}}function SM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xM}],handlers:{delete:aS}}}function kM(e){this.enter({type:"delete",children:[]},e)}function CM(e){this.exit(e)}function aS(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function bM(){return"~"}function EM(e){return e.length}function _M(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||EM,a=[],l=[],c=[],d=[];let f=0,m=-1;for(;++m<e.length;){const b=[],E=[];let P=-1;for(e[m].length>f&&(f=e[m].length);++P<e[m].length;){const R=PM(e[m][P]);if(n.alignDelimiters!==!1){const _=s(R);E[P]=_,(d[P]===void 0||_>d[P])&&(d[P]=_)}b.push(R)}l[m]=b,c[m]=E}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<f;)a[p]=R0(r[p]);else{const b=R0(r);for(;++p<f;)a[p]=b}p=-1;const y=[],w=[];for(;++p<f;){const b=a[p];let E="",P="";b===99?(E=":",P=":"):b===108?E=":":b===114&&(P=":");let R=n.alignDelimiters===!1?1:Math.max(1,d[p]-E.length-P.length);const _=E+"-".repeat(R)+P;n.alignDelimiters!==!1&&(R=E.length+R+P.length,R>d[p]&&(d[p]=R),w[p]=R),y[p]=_}l.splice(1,0,y),c.splice(1,0,w),m=-1;const k=[];for(;++m<l.length;){const b=l[m],E=c[m];p=-1;const P=[];for(;++p<f;){const R=b[p]||"";let _="",j="";if(n.alignDelimiters!==!1){const A=d[p]-(E[p]||0),N=a[p];N===114?_=" ".repeat(A):N===99?A%2?(_=" ".repeat(A/2+.5),j=" ".repeat(A/2-.5)):(_=" ".repeat(A/2),j=_):j=" ".repeat(A)}n.delimiterStart!==!1&&!p&&P.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||p)&&P.push(" "),n.alignDelimiters!==!1&&P.push(_),P.push(R),n.alignDelimiters!==!1&&P.push(j),n.padding!==!1&&P.push(" "),(n.delimiterEnd!==!1||p!==f-1)&&P.push("|")}k.push(n.delimiterEnd===!1?P.join("").replace(/ +$/,""):P.join(""))}return k.join(`
|
|
250
|
+
`)}function PM(e){return e==null?"":String(e)}function R0(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function TM(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),RM);return s(),l}function RM(e,t,n){return">"+(n?"":" ")+e}function AM(e,t){return A0(e,t.inConstruct,!0)&&!A0(e,t.notInConstruct,!1)}function A0(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function I0(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
251
|
+
`&&AM(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
252
|
+
`}function IM(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function MM(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function NM(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function LM(e,t,n,r){const s=NM(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(MM(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(a,jM);return p(),y}const c=n.createTracker(r),d=s.repeat(Math.max(IM(a,s)+1,3)),f=n.enter("codeFenced");let m=c.move(d);if(e.lang){const p=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
|
|
253
|
+
`,encode:["`"],...c.current()})),p()}return m+=c.move(`
|
|
254
|
+
`),a&&(m+=c.move(a+`
|
|
255
|
+
`)),m+=c.move(d),f(),m}function jM(e,t,n){return(n?"":" ")+e}function Np(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function DM(e,t,n,r){const s=Np(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
|
|
256
|
+
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,{before:f,after:s,...d.current()})),f+=d.move(s),c()),l(),f}function OM(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function da(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Us(e){if(e===null||it(e)||Gi(e))return 1;if(ec(e))return 2}function Mu(e,t,n){const r=Us(e),s=Us(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}lS.peek=FM;function lS(e,t,n,r){const s=OM(n),a=n.enter("emphasis"),l=n.createTracker(r),c=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const f=d.charCodeAt(0),m=Mu(r.before.charCodeAt(r.before.length-1),f,s);m.inside&&(d=da(f)+d.slice(1));const p=d.charCodeAt(d.length-1),y=Mu(r.after.charCodeAt(0),p,s);y.inside&&(d=d.slice(0,-1)+da(p));const w=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+w}function FM(e,t,n){return n.options.emphasis||"*"}function Lp(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),rS(e,a,c,s);function c(d,f){const m=f[f.length-1],p=m?m.children.indexOf(d):void 0;return l(d,p,m)}}const VM={};function jp(e,t){const n=VM,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return uS(e,r,s)}function uS(e,t,n){if(zM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return M0(e.children,t,n)}return Array.isArray(e)?M0(e,t,n):""}function M0(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=uS(e[s],t,n);return r.join("")}function zM(e){return!!(e&&typeof e=="object")}function BM(e,t){let n=!1;return Lp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ch}),!!((!e.depth||e.depth<3)&&jp(e)&&(t.options.setext||n))}function UM(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(BM(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,{...a.current(),before:`
|
|
257
|
+
`,after:`
|
|
258
|
+
`});return p(),m(),y+`
|
|
259
|
+
`+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
260
|
+
`))+1))}const l="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
|
|
261
|
+
`,...a.current()});return/^[\t ]/.test(f)&&(f=da(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}cS.peek=$M;function cS(e){return e.value||""}function $M(){return"<"}dS.peek=HM;function dS(e,t,n,r){const s=Np(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,{before:f,after:s,...d.current()})),f+=d.move(s),c()),f+=d.move(")"),l(),f}function HM(){return"!"}fS.peek=WM;function fS(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,a(),s==="full"||!f||f!==p?d+=c.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function WM(){return"!"}hS.peek=qM;function hS(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return s+r+s}function qM(){return"`"}function pS(e,t){const n=jp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}mS.peek=GM;function mS(e,t,n,r){const s=Np(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(pS(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),n.stack=m,p}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),f+=l.move(" "+s),f+=l.move(n.safe(e.title,{before:f,after:s,...l.current()})),f+=l.move(s),d()),f+=l.move(")"),c(),f}function GM(e,t,n){return pS(e,n)?"<":"["}gS.peek=KM;function gS(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,a(),s==="full"||!f||f!==p?d+=c.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function KM(){return"["}function Dp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function XM(e){const t=Dp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function YM(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function yS(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function QM(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?YM(n):Dp(n);const c=e.ordered?l==="."?")":".":XM(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),yS(n)===l&&m){let p=-1;for(;++p<e.children.length;){const y=e.children[p];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const f=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),f}function JM(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ZM(e,t,n,r){const s=JM(n);let a=n.bulletCurrent||Dp(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),m);return d(),f;function m(p,y,w){return y?(w?"":" ".repeat(l))+p:(w?a:a+" ".repeat(l-a.length))+p}}function eN(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const tN=tc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function nN(e,t,n,r){return(e.children.some(function(l){return tN(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function rN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}vS.peek=iN;function vS(e,t,n,r){const s=rN(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const f=d.charCodeAt(0),m=Mu(r.before.charCodeAt(r.before.length-1),f,s);m.inside&&(d=da(f)+d.slice(1));const p=d.charCodeAt(d.length-1),y=Mu(r.after.charCodeAt(0),p,s);y.inside&&(d=d.slice(0,-1)+da(p));const w=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+w}function iN(e,t,n){return n.options.strong||"*"}function sN(e,t,n,r){return n.safe(e.value,r)}function oN(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function aN(e,t,n){const r=(yS(n)+(n.options.ruleSpaces?" ":"")).repeat(oN(n));return n.options.ruleSpaces?r.slice(0,-1):r}const xS={blockquote:TM,break:I0,code:LM,definition:DM,emphasis:lS,hardBreak:I0,heading:UM,html:cS,image:dS,imageReference:fS,inlineCode:hS,link:mS,linkReference:gS,list:QM,listItem:ZM,paragraph:eN,root:nN,strong:vS,text:sN,thematicBreak:aN},N0=document.createElement("i");function Op(e){const t="&"+e+";";N0.innerHTML=t;const n=N0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function wS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const lN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uN(e){return e.replace(lN,cN)}function cN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return wS(n.slice(a?2:1),a?16:10)}return Op(n)||e}function dN(){return{enter:{table:fN,tableData:L0,tableHeader:L0,tableRow:pN},exit:{codeText:mN,table:hN,tableData:pf,tableHeader:pf,tableRow:pf}}}function fN(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function hN(e){this.exit(e),this.data.inTable=void 0}function pN(e){this.enter({type:"tableRow",children:[]},e)}function pf(e){this.exit(e)}function L0(e){this.enter({type:"tableCell",children:[]},e)}function mN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gN));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gN(e,t){return t==="|"?t:e}function yN(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
262
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:d,tableRow:c}};function l(w,k,b,E){return f(m(w,b,E),w.align)}function c(w,k,b,E){const P=p(w,b,E),R=f([P]);return R.slice(0,R.indexOf(`
|
|
263
|
+
`))}function d(w,k,b,E){const P=b.enter("tableCell"),R=b.enter("phrasing"),_=b.containerPhrasing(w,{...E,before:a,after:a});return R(),P(),_}function f(w,k){return _M(w,{align:k,alignDelimiters:r,padding:n,stringLength:s})}function m(w,k,b){const E=w.children;let P=-1;const R=[],_=k.enter("table");for(;++P<E.length;)R[P]=p(E[P],k,b);return _(),R}function p(w,k,b){const E=w.children;let P=-1;const R=[],_=k.enter("tableRow");for(;++P<E.length;)R[P]=d(E[P],w,k,b);return _(),R}function y(w,k,b){let E=xS.inlineCode(w,k,b);return b.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function vN(){return{exit:{taskListCheckValueChecked:j0,taskListCheckValueUnchecked:j0,paragraph:wN}}}function xN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SN}}}function j0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wN(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const c=s[a];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function SN(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let d=xS.listItem(e,t,n,{...r,...c.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(m){return m+l}}function SS(){return[XI(),gM(),wM(),dN(),vN()]}function kN(e){return{extensions:[YI(),yM(e),SM(),yN(e),xN()]}}function Pn(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Dn(e,t){return e.length>0?(Pn(e,e.length,0,t),e):t}const D0={}.hasOwnProperty;function kS(e){const t={};let n=-1;for(;++n<e.length;)CN(t,e[n]);return t}function CN(e,t){let n;for(n in t){const s=(D0.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){D0.call(s,l)||(s[l]=[]);const c=a[l];bN(s[l],Array.isArray(c)?c:c?[c]:[])}}}function bN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Pn(e,0,0,r)}function Ks(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Jt(e.charCodeAt(n+1))&&Jt(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function We(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Be(d)?(e.enter(n),c(d)):t(d)}function c(d){return Be(d)&&a++<s?(e.consume(d),c):(e.exit(n),t(d))}}const EN={tokenize:_N};function _N(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),We(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ne(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const PN={tokenize:TN},O0={tokenize:RN};function TN(e){const t=this,n=[];let r=0,s,a,l;return c;function c(_){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&R();const j=t.events.length;let A=j,N;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){N=t.events[A][1].end;break}P(r);let q=j;for(;q<t.events.length;)t.events[q][1].end={...N},q++;return Pn(t.events,A+1,0,t.events.slice(j)),t.events.length=q,f(_)}return c(_)}function f(_){if(r===n.length){if(!s)return y(_);if(s.currentConstruct&&s.currentConstruct.concrete)return k(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(O0,m,p)(_)}function m(_){return s&&R(),P(r),y(_)}function p(_){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,k(_)}function y(_){return t.containerState={},e.attempt(O0,w,k)(_)}function w(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function k(_){if(_===null){s&&R(),P(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),b(_)}function b(_){if(_===null){E(e.exit("chunkFlow"),!0),P(0),e.consume(_);return}return Ne(_)?(e.consume(_),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(_),b)}function E(_,j){const A=t.sliceStream(_);if(j&&A.push(null),_.previous=a,a&&(a.next=_),a=_,s.defineSkip(_.start),s.write(A),t.parser.lazy[_.start.line]){let N=s.events.length;for(;N--;)if(s.events[N][1].start.offset<l&&(!s.events[N][1].end||s.events[N][1].end.offset>l))return;const q=t.events.length;let B=q,D,I;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(D){I=t.events[B][1].end;break}D=!0}for(P(r),N=q;N<t.events.length;)t.events[N][1].end={...I},N++;Pn(t.events,B+1,0,t.events.slice(q)),t.events.length=N}}function P(_){let j=n.length;for(;j-- >_;){const A=n[j];t.containerState=A[1],A[0].exit.call(t,e)}n.length=_}function R(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function RN(e,t,n){return We(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rc(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const bh={name:"attention",resolveAll:AN,tokenize:IN};function AN(e,t){let n=-1,r,s,a,l,c,d,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},y={...e[n][1].start};F0(p,-d),F0(y,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Dn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Dn(f,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=Dn(f,rc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Dn(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Dn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Pn(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function IN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Us(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),m=Us(d),p=!m||m===2&&s||n.includes(d),y=!s||s===2&&m||n.includes(r);return f._open=!!(a===42?p:p&&(s||!y)),f._close=!!(a===42?y:y&&(m||!p)),t(d)}}function F0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const MN={name:"autolink",tokenize:NN};function NN(e,t,n){let r=0;return s;function s(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(w){return on(w)?(e.consume(w),l):w===64?n(w):f(w)}function l(w){return w===43||w===45||w===46||Jt(w)?(r=1,c(w)):f(w)}function c(w){return w===58?(e.consume(w),r=0,d):(w===43||w===45||w===46||Jt(w))&&r++<32?(e.consume(w),c):(r=0,f(w))}function d(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||Iu(w)?n(w):(e.consume(w),d)}function f(w){return w===64?(e.consume(w),m):NI(w)?(e.consume(w),f):n(w)}function m(w){return Jt(w)?p(w):n(w)}function p(w){return w===46?(e.consume(w),r=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):y(w)}function y(w){if((w===45||Jt(w))&&r++<63){const k=w===45?y:p;return e.consume(w),k}return n(w)}}const ka={partial:!0,tokenize:LN};function LN(e,t,n){return r;function r(a){return Be(a)?We(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ne(a)?t(a):n(a)}}const CS={continuation:{tokenize:DN},exit:ON,name:"blockQuote",tokenize:jN};function jN(e,t,n){const r=this;return s;function s(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Be(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function DN(e,t,n){const r=this;return s;function s(l){return Be(l)?We(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(CS,t,n)(l)}}function ON(e){e.exit("blockQuote")}const bS={name:"characterEscape",tokenize:FN};function FN(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return jI(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const ES={name:"characterReference",tokenize:VN};function VN(e,t,n){const r=this;let s=0,a,l;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=Jt,m(p))}function f(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=LI,m):(e.enter("characterReferenceValue"),a=7,l=kh,m(p))}function m(p){if(p===59&&s){const y=e.exit("characterReferenceValue");return l===Jt&&!Op(r.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&s++<a?(e.consume(p),m):n(p)}}const V0={partial:!0,tokenize:BN},z0={concrete:!0,name:"codeFenced",tokenize:zN};function zN(e,t,n){const r=this,s={partial:!0,tokenize:A};let a=0,l=0,c;return d;function d(N){return f(N)}function f(N){const q=r.events[r.events.length-1];return a=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(N)}function m(N){return N===c?(l++,e.consume(N),m):l<3?n(N):(e.exit("codeFencedFenceSequence"),Be(N)?We(e,p,"whitespace")(N):p(N))}function p(N){return N===null||Ne(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(V0,b,j)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(N))}function y(N){return N===null||Ne(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(N)):Be(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),We(e,w,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),y)}function w(N){return N===null||Ne(N)?p(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(N))}function k(N){return N===null||Ne(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(N)):N===96&&N===c?n(N):(e.consume(N),k)}function b(N){return e.attempt(s,j,E)(N)}function E(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),P}function P(N){return a>0&&Be(N)?We(e,R,"linePrefix",a+1)(N):R(N)}function R(N){return N===null||Ne(N)?e.check(V0,b,j)(N):(e.enter("codeFlowValue"),_(N))}function _(N){return N===null||Ne(N)?(e.exit("codeFlowValue"),R(N)):(e.consume(N),_)}function j(N){return e.exit("codeFenced"),t(N)}function A(N,q,B){let D=0;return I;function I(Z){return N.enter("lineEnding"),N.consume(Z),N.exit("lineEnding"),U}function U(Z){return N.enter("codeFencedFence"),Be(Z)?We(N,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):z(Z)}function z(Z){return Z===c?(N.enter("codeFencedFenceSequence"),he(Z)):B(Z)}function he(Z){return Z===c?(D++,N.consume(Z),he):D>=l?(N.exit("codeFencedFenceSequence"),Be(Z)?We(N,J,"whitespace")(Z):J(Z)):B(Z)}function J(Z){return Z===null||Ne(Z)?(N.exit("codeFencedFence"),q(Z)):B(Z)}}}function BN(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const mf={name:"codeIndented",tokenize:$N},UN={partial:!0,tokenize:HN};function $N(e,t,n){const r=this;return s;function s(f){return e.enter("codeIndented"),We(e,a,"linePrefix",5)(f)}function a(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):Ne(f)?e.attempt(UN,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ne(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function HN(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):We(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ne(l)?s(l):n(l)}}const WN={name:"codeText",previous:GN,resolve:qN,tokenize:KN};function qN(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function GN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KN(e,t,n){let r=0,s,a;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),r++,c):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(a=e.enter("codeTextSequence"),s=0,m(p)):Ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(p))}function f(p){return p===null||p===32||p===96||Ne(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),f)}function m(p){return p===96?(e.consume(p),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",f(p))}}class XN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Oo(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Oo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Oo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Oo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Oo(this.left,n.reverse())}}}function Oo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _S(e){const t={};let n=-1,r,s,a,l,c,d,f;const m=new XN(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,YN(m,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...m.get(s)[1].start},c=m.slice(s,n),c.unshift(r),m.splice(s,n-s+1,c))}}return Pn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function YN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let m,p,y=-1,w=n,k=0,b=0;const E=[b];for(;w;){for(;e.get(++s)[1]!==w;);a.push(s),w._tokenizer||(m=r.sliceStream(w),w.next||m.push(null),p&&l.defineSkip(w.start),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=w,w=w.next}for(w=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(b=y+1,E.push(b),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(l.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),y=E.length;y--;){const P=c.slice(E[y],E[y+1]),R=a.pop();d.push([R,R+P.length-1]),e.splice(R,2,P)}for(d.reverse(),y=-1;++y<d.length;)f[k+d[y][0]]=k+d[y][1],k+=d[y][1]-d[y][0]-1;return f}const QN={resolve:ZN,tokenize:eL},JN={partial:!0,tokenize:tL};function ZN(e){return _S(e),e}function eL(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?a(c):Ne(c)?e.check(JN,l,a)(c):(e.consume(c),s)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function tL(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),We(e,a,"linePrefix")}function a(l){if(l===null||Ne(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function PS(e,t,n,r,s,a,l,c,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(P){return P===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(P),e.exit(a),y):P===null||P===32||P===41||Iu(P)?n(P):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),b(P))}function y(P){return P===62?(e.enter(a),e.consume(P),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),w(P))}function w(P){return P===62?(e.exit("chunkString"),e.exit(c),y(P)):P===null||P===60||Ne(P)?n(P):(e.consume(P),P===92?k:w)}function k(P){return P===60||P===62||P===92?(e.consume(P),w):w(P)}function b(P){return!m&&(P===null||P===41||it(P))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(P)):m<f&&P===40?(e.consume(P),m++,b):P===41?(e.consume(P),m--,b):P===null||P===32||P===40||Iu(P)?n(P):(e.consume(P),P===92?E:b)}function E(P){return P===40||P===41||P===92?(e.consume(P),b):b(P)}}function TS(e,t,n,r,s,a){const l=this;let c=0,d;return f;function f(w){return e.enter(r),e.enter(s),e.consume(w),e.exit(s),e.enter(a),m}function m(w){return c>999||w===null||w===91||w===93&&!d||w===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(w):w===93?(e.exit(a),e.enter(s),e.consume(w),e.exit(s),e.exit(r),t):Ne(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||w===91||w===93||Ne(w)||c++>999?(e.exit("chunkString"),m(w)):(e.consume(w),d||(d=!Be(w)),w===92?y:p)}function y(w){return w===91||w===92||w===93?(e.consume(w),c++,p):p(w)}}function RS(e,t,n,r,s,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(s),e.consume(y),e.exit(s),l=y===40?41:y,d):n(y)}function d(y){return y===l?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===l?(e.exit(a),d(l)):y===null?n(y):Ne(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),We(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||Ne(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?p:m)}function p(y){return y===l||y===92?(e.consume(y),m):m(y)}}function Yo(e,t){let n;return r;function r(s){return Ne(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Be(s)?We(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const nL={name:"definition",tokenize:iL},rL={partial:!0,tokenize:sL};function iL(e,t,n){const r=this;let s;return a;function a(w){return e.enter("definition"),l(w)}function l(w){return TS.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function c(w){return s=Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),d):n(w)}function d(w){return it(w)?Yo(e,f)(w):f(w)}function f(w){return PS(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(rL,p,p)(w)}function p(w){return Be(w)?We(e,y,"whitespace")(w):y(w)}function y(w){return w===null||Ne(w)?(e.exit("definition"),r.parser.defined.push(s),t(w)):n(w)}}function sL(e,t,n){return r;function r(c){return it(c)?Yo(e,s)(c):n(c)}function s(c){return RS(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Be(c)?We(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ne(c)?t(c):n(c)}}const oL={name:"hardBreakEscape",tokenize:aL};function aL(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ne(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const lL={name:"headingAtx",resolve:uL,tokenize:cL};function uL(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Pn(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function cL(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||it(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Ne(m)?(e.exit("atxHeading"),t(m)):Be(m)?We(e,c,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function f(m){return m===null||m===35||it(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),f)}}const dL=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],B0=["pre","script","style","textarea"],fL={concrete:!0,name:"htmlFlow",resolveTo:mL,tokenize:gL},hL={partial:!0,tokenize:vL},pL={partial:!0,tokenize:yL};function mL(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gL(e,t,n){const r=this;let s,a,l,c,d;return f;function f(M){return m(M)}function m(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),p}function p(M){return M===33?(e.consume(M),y):M===47?(e.consume(M),a=!0,b):M===63?(e.consume(M),s=3,r.interrupt?t:T):on(M)?(e.consume(M),l=String.fromCharCode(M),E):n(M)}function y(M){return M===45?(e.consume(M),s=2,w):M===91?(e.consume(M),s=5,c=0,k):on(M)?(e.consume(M),s=4,r.interrupt?t:T):n(M)}function w(M){return M===45?(e.consume(M),r.interrupt?t:T):n(M)}function k(M){const oe="CDATA[";return M===oe.charCodeAt(c++)?(e.consume(M),c===oe.length?r.interrupt?t:z:k):n(M)}function b(M){return on(M)?(e.consume(M),l=String.fromCharCode(M),E):n(M)}function E(M){if(M===null||M===47||M===62||it(M)){const oe=M===47,ue=l.toLowerCase();return!oe&&!a&&B0.includes(ue)?(s=1,r.interrupt?t(M):z(M)):dL.includes(l.toLowerCase())?(s=6,oe?(e.consume(M),P):r.interrupt?t(M):z(M)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):a?R(M):_(M))}return M===45||Jt(M)?(e.consume(M),l+=String.fromCharCode(M),E):n(M)}function P(M){return M===62?(e.consume(M),r.interrupt?t:z):n(M)}function R(M){return Be(M)?(e.consume(M),R):I(M)}function _(M){return M===47?(e.consume(M),I):M===58||M===95||on(M)?(e.consume(M),j):Be(M)?(e.consume(M),_):I(M)}function j(M){return M===45||M===46||M===58||M===95||Jt(M)?(e.consume(M),j):A(M)}function A(M){return M===61?(e.consume(M),N):Be(M)?(e.consume(M),A):_(M)}function N(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),d=M,q):Be(M)?(e.consume(M),N):B(M)}function q(M){return M===d?(e.consume(M),d=null,D):M===null||Ne(M)?n(M):(e.consume(M),q)}function B(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||it(M)?A(M):(e.consume(M),B)}function D(M){return M===47||M===62||Be(M)?_(M):n(M)}function I(M){return M===62?(e.consume(M),U):n(M)}function U(M){return M===null||Ne(M)?z(M):Be(M)?(e.consume(M),U):n(M)}function z(M){return M===45&&s===2?(e.consume(M),ve):M===60&&s===1?(e.consume(M),Se):M===62&&s===4?(e.consume(M),F):M===63&&s===3?(e.consume(M),T):M===93&&s===5?(e.consume(M),pe):Ne(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(hL,X,he)(M)):M===null||Ne(M)?(e.exit("htmlFlowData"),he(M)):(e.consume(M),z)}function he(M){return e.check(pL,J,X)(M)}function J(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Z}function Z(M){return M===null||Ne(M)?he(M):(e.enter("htmlFlowData"),z(M))}function ve(M){return M===45?(e.consume(M),T):z(M)}function Se(M){return M===47?(e.consume(M),l="",Q):z(M)}function Q(M){if(M===62){const oe=l.toLowerCase();return B0.includes(oe)?(e.consume(M),F):z(M)}return on(M)&&l.length<8?(e.consume(M),l+=String.fromCharCode(M),Q):z(M)}function pe(M){return M===93?(e.consume(M),T):z(M)}function T(M){return M===62?(e.consume(M),F):M===45&&s===2?(e.consume(M),T):z(M)}function F(M){return M===null||Ne(M)?(e.exit("htmlFlowData"),X(M)):(e.consume(M),F)}function X(M){return e.exit("htmlFlow"),t(M)}}function yL(e,t,n){const r=this;return s;function s(l){return Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function vL(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ka,t,n)}}const xL={name:"htmlText",tokenize:wL};function wL(e,t,n){const r=this;let s,a,l;return c;function c(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),d}function d(T){return T===33?(e.consume(T),f):T===47?(e.consume(T),A):T===63?(e.consume(T),_):on(T)?(e.consume(T),B):n(T)}function f(T){return T===45?(e.consume(T),m):T===91?(e.consume(T),a=0,k):on(T)?(e.consume(T),R):n(T)}function m(T){return T===45?(e.consume(T),w):n(T)}function p(T){return T===null?n(T):T===45?(e.consume(T),y):Ne(T)?(l=p,Se(T)):(e.consume(T),p)}function y(T){return T===45?(e.consume(T),w):p(T)}function w(T){return T===62?ve(T):T===45?y(T):p(T)}function k(T){const F="CDATA[";return T===F.charCodeAt(a++)?(e.consume(T),a===F.length?b:k):n(T)}function b(T){return T===null?n(T):T===93?(e.consume(T),E):Ne(T)?(l=b,Se(T)):(e.consume(T),b)}function E(T){return T===93?(e.consume(T),P):b(T)}function P(T){return T===62?ve(T):T===93?(e.consume(T),P):b(T)}function R(T){return T===null||T===62?ve(T):Ne(T)?(l=R,Se(T)):(e.consume(T),R)}function _(T){return T===null?n(T):T===63?(e.consume(T),j):Ne(T)?(l=_,Se(T)):(e.consume(T),_)}function j(T){return T===62?ve(T):_(T)}function A(T){return on(T)?(e.consume(T),N):n(T)}function N(T){return T===45||Jt(T)?(e.consume(T),N):q(T)}function q(T){return Ne(T)?(l=q,Se(T)):Be(T)?(e.consume(T),q):ve(T)}function B(T){return T===45||Jt(T)?(e.consume(T),B):T===47||T===62||it(T)?D(T):n(T)}function D(T){return T===47?(e.consume(T),ve):T===58||T===95||on(T)?(e.consume(T),I):Ne(T)?(l=D,Se(T)):Be(T)?(e.consume(T),D):ve(T)}function I(T){return T===45||T===46||T===58||T===95||Jt(T)?(e.consume(T),I):U(T)}function U(T){return T===61?(e.consume(T),z):Ne(T)?(l=U,Se(T)):Be(T)?(e.consume(T),U):D(T)}function z(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,he):Ne(T)?(l=z,Se(T)):Be(T)?(e.consume(T),z):(e.consume(T),J)}function he(T){return T===s?(e.consume(T),s=void 0,Z):T===null?n(T):Ne(T)?(l=he,Se(T)):(e.consume(T),he)}function J(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||it(T)?D(T):(e.consume(T),J)}function Z(T){return T===47||T===62||it(T)?D(T):n(T)}function ve(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Se(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),Q}function Q(T){return Be(T)?We(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):pe(T)}function pe(T){return e.enter("htmlTextData"),l(T)}}const Fp={name:"labelEnd",resolveAll:bL,resolveTo:EL,tokenize:_L},SL={tokenize:PL},kL={tokenize:TL},CL={tokenize:RL};function bL(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Pn(e,0,e.length,n),e}function EL(e,t){let n=e.length,r=0,s,a,l,c;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Dn(c,e.slice(a+1,a+r+3)),c=Dn(c,[["enter",m,t]]),c=Dn(c,rc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Dn(c,[["exit",m,t],e[l-2],e[l-1],["exit",f,t]]),c=Dn(c,e.slice(l+1)),c=Dn(c,[["exit",d,t]]),Pn(e,a,e.length,c),e}function _L(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return c;function c(y){return a?a._inactive?p(y):(l=r.parser.defined.includes(Zn(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(SL,m,l?m:p)(y):y===91?e.attempt(kL,m,l?f:p)(y):l?m(y):p(y)}function f(y){return e.attempt(CL,m,p)(y)}function m(y){return t(y)}function p(y){return a._balanced=!0,n(y)}}function PL(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return it(p)?Yo(e,a)(p):a(p)}function a(p){return p===41?m(p):PS(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return it(p)?Yo(e,d)(p):m(p)}function c(p){return n(p)}function d(p){return p===34||p===39||p===40?RS(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function f(p){return it(p)?Yo(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function TL(e,t,n){const r=this;return s;function s(c){return TS.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function RL(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const AL={name:"labelStartImage",resolveAll:Fp.resolveAll,tokenize:IL};function IL(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const ML={name:"labelStartLink",resolveAll:Fp.resolveAll,tokenize:NL};function NL(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const gf={name:"lineEnding",tokenize:LL};function LL(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),We(e,t,"linePrefix")}}const uu={name:"thematicBreak",tokenize:jL};function jL(e,t,n){let r=0,s;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return s=f,c(f)}function c(f){return f===s?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ne(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===s?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Be(f)?We(e,c,"whitespace")(f):c(f))}}const yn={continuation:{tokenize:VL},exit:BL,name:"list",tokenize:FL},DL={partial:!0,tokenize:UL},OL={partial:!0,tokenize:zL};function FL(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return c;function c(w){const k=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:kh(w)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(uu,n,f)(w):f(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(w)}return n(w)}function d(w){return kh(w)&&++l<10?(e.consume(w),d):(!r.interrupt||l<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),f(w)):n(w)}function f(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(ka,r.interrupt?n:m,e.attempt(DL,y,p))}function m(w){return r.containerState.initialBlankLine=!0,a++,y(w)}function p(w){return Be(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),y):n(w)}function y(w){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function VL(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ka,s,a);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,We(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Be(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(OL,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,We(e,e.attempt(yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function zL(e,t,n){const r=this;return We(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function BL(e){e.exit(this.containerState.type)}function UL(e,t,n){const r=this;return We(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!Be(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const U0={name:"setextUnderline",resolveTo:$L,tokenize:HL};function $L(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function HL(e,t,n){const r=this;let s;return a;function a(f){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===s?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Be(f)?We(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ne(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const WL={tokenize:qL};function qL(e){const t=this,n=e.attempt(ka,r,e.attempt(this.parser.constructs.flowInitial,s,We(e,e.attempt(this.parser.constructs.flow,s,e.attempt(QN,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const GL={resolveAll:IS()},KL=AS("string"),XL=AS("text");function AS(e){return{resolveAll:IS(e==="text"?YL:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,c);return l;function l(m){return f(m)?a(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),a(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const p=s[m];let y=-1;if(p)for(;++y<p.length;){const w=p[y];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function IS(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function YL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,c=0,d;for(;a--;){const f=s[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const QL={42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:CS},JL={91:nL},ZL={[-2]:mf,[-1]:mf,32:mf},ej={35:lL,42:uu,45:[U0,uu],60:fL,61:U0,95:uu,96:z0,126:z0},tj={38:ES,92:bS},nj={[-5]:gf,[-4]:gf,[-3]:gf,33:AL,38:ES,42:bh,60:[MN,xL],91:ML,92:[oL,bS],93:Fp,95:bh,96:WN},rj={null:[bh,GL]},ij={null:[42,95]},sj={null:[]},oj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ij,contentInitial:JL,disable:sj,document:QL,flow:ej,flowInitial:ZL,insideSpan:rj,string:tj,text:nj},Symbol.toStringTag,{value:"Module"}));function aj(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],c=[];const d={attempt:q(A),check:q(N),consume:R,enter:_,exit:j,interrupt:q(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:w,write:p};let m=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function p(U){return l=Dn(l,U),E(),l[l.length-1]!==null?[]:(B(t,0),f.events=rc(a,f.events,f),f.events)}function y(U,z){return uj(w(U),z)}function w(U){return lj(l,U)}function k(){const{_bufferIndex:U,_index:z,line:he,column:J,offset:Z}=r;return{_bufferIndex:U,_index:z,line:he,column:J,offset:Z}}function b(U){s[U.line]=U.column,I()}function E(){let U;for(;r._index<l.length;){const z=l[r._index];if(typeof z=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<z.length;)P(z.charCodeAt(r._bufferIndex));else P(z)}}function P(U){m=m(U)}function R(U){Ne(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,I()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function _(U,z){const he=z||{};return he.type=U,he.start=k(),f.events.push(["enter",he,f]),c.push(he),he}function j(U){const z=c.pop();return z.end=k(),f.events.push(["exit",z,f]),z}function A(U,z){B(U,z.from)}function N(U,z){z.restore()}function q(U,z){return he;function he(J,Z,ve){let Se,Q,pe,T;return Array.isArray(J)?X(J):"tokenize"in J?X([J]):F(J);function F(ae){return me;function me(ke){const xe=ke!==null&&ae[ke],$e=ke!==null&&ae.null,Fe=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray($e)?$e:$e?[$e]:[]];return X(Fe)(ke)}}function X(ae){return Se=ae,Q=0,ae.length===0?ve:M(ae[Q])}function M(ae){return me;function me(ke){return T=D(),pe=ae,ae.partial||(f.currentConstruct=ae),ae.name&&f.parser.constructs.disable.null.includes(ae.name)?ue():ae.tokenize.call(z?Object.assign(Object.create(f),z):f,d,oe,ue)(ke)}}function oe(ae){return U(pe,T),Z}function ue(ae){return T.restore(),++Q<Se.length?M(Se[Q]):ve}}}function B(U,z){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Pn(f.events,z,f.events.length-z,U.resolve(f.events.slice(z),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function D(){const U=k(),z=f.previous,he=f.currentConstruct,J=f.events.length,Z=Array.from(c);return{from:J,restore:ve};function ve(){r=U,f.previous=z,f.currentConstruct=he,f.events.length=J,c=Z,I()}}function I(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function lj(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function uj(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
264
|
+
`;break}case-3:{l=`\r
|
|
265
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function cj(e){const r={constructs:kS([oj,...(e||{}).extensions||[]]),content:s(EN),defined:[],document:s(PN),flow:s(WL),lazy:{},string:s(KL),text:s(XL)};return r;function s(a){return l;function l(c){return aj(r,a,c)}}}function dj(e){for(;!_S(e););return e}const $0=/[\0\t\n\r]/g;function fj(){let e=1,t="",n=!0,r;return s;function s(a,l,c){const d=[];let f,m,p,y,w;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if($0.lastIndex=p,f=$0.exec(a),y=f&&f.index!==void 0?f.index:a.length,w=a.charCodeAt(y),!f){t=a.slice(p);break}if(w===10&&p===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<y&&(d.push(a.slice(p,y)),e+=y-p),w){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}function Qo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?H0(e.position):"start"in e||"end"in e?H0(e):"line"in e||"column"in e?Eh(e):""}function Eh(e){return W0(e&&e.line)+":"+W0(e&&e.column)}function H0(e){return Eh(e&&e.start)+"-"+Eh(e&&e.end)}function W0(e){return e&&typeof e=="number"?e:1}const MS={}.hasOwnProperty;function NS(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),hj(n)(dj(cj(n).document().write(fj()(e,t,!0))))}function hj(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Tn),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(Vt),blockQuote:a($e),characterEscape:D,characterReference:D,codeFenced:a(Fe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Fe,l),codeText:a(qe,l),codeTextData:D,data:D,codeFlowValue:D,definition:a(st),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ot),hardBreakEscape:a(en),hardBreakTrailing:a(en),htmlFlow:a(et,l),htmlFlowData:D,htmlText:a(et,l),htmlTextData:D,image:a(Wt),label:l,link:a(Tn),listItem:a(tn),listItemValue:y,listOrdered:a(zt,p),listUnordered:a(zt),paragraph:a(bt),reference:M,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Vt),strong:a(tr),thematicBreak:a(Lr)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:xe,autolinkProtocol:ke,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ae,characterReference:me,codeFenced:d(E),codeFencedFence:b,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:d(P),codeText:d(Z),codeTextData:I,data:I,definition:d(),definitionDestinationString:j,definitionLabelString:R,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(z),hardBreakTrailing:d(z),htmlFlow:d(he),htmlFlowData:I,htmlText:d(J),htmlTextData:I,image:d(Se),label:pe,labelText:Q,lineEnding:U,link:d(ve),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:oe,resourceDestinationString:T,resourceTitleString:F,resource:X,setextHeading:d(B),setextHeadingLineSequence:q,setextHeadingText:N,strong:d(),thematicBreak:d()}};LS(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let ee={type:"root",children:[]};const Te={stack:[ee],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:m,data:n},Ae=[];let Ve=-1;for(;++Ve<Y.length;)if(Y[Ve][1].type==="listOrdered"||Y[Ve][1].type==="listUnordered")if(Y[Ve][0]==="enter")Ae.push(Ve);else{const at=Ae.pop();Ve=s(Y,at,Ve)}for(Ve=-1;++Ve<Y.length;){const at=t[Y[Ve][0]];MS.call(at,Y[Ve][1].type)&&at[Y[Ve][1].type].call(Object.assign({sliceSerialize:Y[Ve][2].sliceSerialize},Te),Y[Ve][1])}if(Te.tokenStack.length>0){const at=Te.tokenStack[Te.tokenStack.length-1];(at[1]||q0).call(Te,void 0,at[0])}for(ee.position={start:ri(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:ri(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)ee=t.transforms[Ve](ee)||ee;return ee}function s(Y,ee,Te){let Ae=ee-1,Ve=-1,at=!1,Nt,H,ge,ie;for(;++Ae<=Te;){const ye=Y[Ae];switch(ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ye[0]==="enter"?Ve++:Ve--,ie=void 0;break}case"lineEndingBlank":{ye[0]==="enter"&&(Nt&&!ie&&!Ve&&!ge&&(ge=Ae),ie=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ie=void 0}if(!Ve&&ye[0]==="enter"&&ye[1].type==="listItemPrefix"||Ve===-1&&ye[0]==="exit"&&(ye[1].type==="listUnordered"||ye[1].type==="listOrdered")){if(Nt){let Le=Ae;for(H=void 0;Le--;){const fe=Y[Le];if(fe[1].type==="lineEnding"||fe[1].type==="lineEndingBlank"){if(fe[0]==="exit")continue;H&&(Y[H][1].type="lineEndingBlank",at=!0),fe[1].type="lineEnding",H=Le}else if(!(fe[1].type==="linePrefix"||fe[1].type==="blockQuotePrefix"||fe[1].type==="blockQuotePrefixWhitespace"||fe[1].type==="blockQuoteMarker"||fe[1].type==="listItemIndent"))break}ge&&(!H||ge<H)&&(Nt._spread=!0),Nt.end=Object.assign({},H?Y[H][1].start:ye[1].end),Y.splice(H||Ae,0,["exit",Nt,ye[2]]),Ae++,Te++}if(ye[1].type==="listItemPrefix"){const Le={type:"listItem",_spread:!1,start:Object.assign({},ye[1].start),end:void 0};Nt=Le,Y.splice(Ae,0,["enter",Le,ye[2]]),Ae++,Te++,ge=void 0,ie=!0}}}return Y[ee][1]._spread=at,Te}function a(Y,ee){return Te;function Te(Ae){c.call(this,Y(Ae),Ae),ee&&ee.call(this,Ae)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(Y,ee,Te){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([ee,Te||void 0]),Y.position={start:ri(ee.start),end:void 0}}function d(Y){return ee;function ee(Te){Y&&Y.call(this,Te),f.call(this,Te)}}function f(Y,ee){const Te=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==Y.type&&(ee?ee.call(this,Y,Ae[0]):(Ae[1]||q0).call(this,Y,Ae[0]));else throw new Error("Cannot close `"+Y.type+"` ("+Qo({start:Y.start,end:Y.end})+"): it’s not open");Te.position.end=ri(Y.end)}function m(){return jp(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(Y){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function w(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=Y}function k(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=Y}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function P(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y.replace(/(\r?\n|\r)$/g,"")}function R(Y){const ee=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ee,Te.identifier=Zn(this.sliceSerialize(Y)).toLowerCase()}function _(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.title=Y}function j(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.url=Y}function A(Y){const ee=this.stack[this.stack.length-1];if(!ee.depth){const Te=this.sliceSerialize(Y).length;ee.depth=Te}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function q(Y){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function D(Y){const Te=this.stack[this.stack.length-1].children;let Ae=Te[Te.length-1];(!Ae||Ae.type!=="text")&&(Ae=He(),Ae.position={start:ri(Y.start),end:void 0},Te.push(Ae)),this.stack.push(Ae)}function I(Y){const ee=this.stack.pop();ee.value+=this.sliceSerialize(Y),ee.position.end=ri(Y.end)}function U(Y){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ee.children[ee.children.length-1];Te.position.end=ri(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(D.call(this,Y),I.call(this,Y))}function z(){this.data.atHardBreak=!0}function he(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y}function J(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y}function Z(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.value=Y}function ve(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ee,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function Se(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ee,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function Q(Y){const ee=this.sliceSerialize(Y),Te=this.stack[this.stack.length-2];Te.label=uN(ee),Te.identifier=Zn(ee).toLowerCase()}function pe(){const Y=this.stack[this.stack.length-1],ee=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Ae=Y.children;Te.children=Ae}else Te.alt=ee}function T(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.url=Y}function F(){const Y=this.resume(),ee=this.stack[this.stack.length-1];ee.title=Y}function X(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function oe(Y){const ee=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ee,Te.identifier=Zn(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function ue(Y){this.data.characterReferenceType=Y.type}function ae(Y){const ee=this.sliceSerialize(Y),Te=this.data.characterReferenceType;let Ae;Te?(Ae=wS(ee,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=Op(ee);const Ve=this.stack[this.stack.length-1];Ve.value+=Ae}function me(Y){const ee=this.stack.pop();ee.position.end=ri(Y.end)}function ke(Y){I.call(this,Y);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(Y)}function xe(Y){I.call(this,Y);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(Y)}function $e(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function qe(){return{type:"inlineCode",value:""}}function st(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ot(){return{type:"emphasis",children:[]}}function Vt(){return{type:"heading",depth:0,children:[]}}function en(){return{type:"break"}}function et(){return{type:"html",value:""}}function Wt(){return{type:"image",title:null,url:"",alt:null}}function Tn(){return{type:"link",title:null,url:"",children:[]}}function zt(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function tn(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function bt(){return{type:"paragraph",children:[]}}function tr(){return{type:"strong",children:[]}}function He(){return{type:"text",value:""}}function Lr(){return{type:"thematicBreak"}}}function ri(e){return{line:e.line,column:e.column,offset:e.offset}}function LS(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LS(e,r):pj(e,r)}}function pj(e,t){let n;for(n in t)if(MS.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function q0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is still open")}const mj={tokenize:Sj,partial:!0},jS={tokenize:kj,partial:!0},DS={tokenize:Cj,partial:!0},OS={tokenize:bj,partial:!0},gj={tokenize:Ej,partial:!0},FS={name:"wwwAutolink",tokenize:xj,previous:zS},VS={name:"protocolAutolink",tokenize:wj,previous:BS},Nr={name:"emailAutolink",tokenize:vj,previous:US},gr={};function yj(){return{text:gr}}let Ri=48;for(;Ri<123;)gr[Ri]=Nr,Ri++,Ri===58?Ri=65:Ri===91&&(Ri=97);gr[43]=Nr;gr[45]=Nr;gr[46]=Nr;gr[95]=Nr;gr[72]=[Nr,VS];gr[104]=[Nr,VS];gr[87]=[Nr,FS];gr[119]=[Nr,FS];function vj(e,t,n){const r=this;let s,a;return l;function l(p){return!_h(p)||!US.call(r,r.previous)||Vp(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return _h(p)?(e.consume(p),c):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(gj,m,f)(p):p===45||p===95||Jt(p)?(a=!0,e.consume(p),d):m(p)}function f(p){return e.consume(p),s=!0,d}function m(p){return a&&s&&on(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function xj(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!zS.call(r,r.previous)||Vp(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(mj,e.attempt(jS,e.attempt(DS,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function wj(e,t,n){const r=this;let s="",a=!1;return l;function l(p){return(p===72||p===104)&&BS.call(r,r.previous)&&!Vp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(on(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),a?f:(a=!0,d)):n(p)}function f(p){return p===null||Iu(p)||it(p)||Gi(p)||ec(p)?n(p):e.attempt(jS,e.attempt(DS,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function Sj(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function kj(e,t,n){let r,s,a;return l;function l(f){return f===46||f===95?e.check(OS,d,c)(f):f===null||it(f)||Gi(f)||f!==45&&ec(f)?d(f):(a=!0,e.consume(f),l)}function c(f){return f===95?r=!0:(s=r,r=void 0),e.consume(f),l}function d(f){return s||r||!a?n(f):t(f)}}function Cj(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(OS,t,a)(l):l===null||it(l)||Gi(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function bj(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),s):c===60||c===null||it(c)||Gi(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||it(c)||Gi(c)?t(c):r(c)}function a(c){return on(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):on(c)?(e.consume(c),l):n(c)}}function Ej(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return Jt(a)?n(a):t(a)}}function zS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||it(e)}function BS(e){return!on(e)}function US(e){return!(e===47||_h(e))}function _h(e){return e===43||e===45||e===46||e===95||Jt(e)}function Vp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const _j={tokenize:Lj,partial:!0};function Pj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ij,continuation:{tokenize:Mj},exit:Nj}},text:{91:{name:"gfmFootnoteCall",tokenize:Aj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Tj,resolveTo:Rj}}}}function Tj(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const f=Zn(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function Rj(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function Aj(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(p){if(a>999||p===93&&!l||p===null||p===91||it(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(Zn(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return it(p)||(l=!0),a++,e.consume(p),p===92?m:f}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function Ij(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return d;function d(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(k)}function m(k){if(l>999||k===93&&!c||k===null||k===91||it(k))return n(k);if(k===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return a=Zn(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return it(k)||(c=!0),l++,e.consume(k),k===92?p:m}function p(k){return k===91||k===92||k===93?(e.consume(k),l++,m):m(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(a)||s.push(a),We(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function Mj(e,t,n){return e.check(ka,t,e.attempt(_j,t,n))}function Nj(e){e.exit("gfmFootnoteDefinition")}function Lj(e,t,n){const r=this;return We(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function jj(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},p={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},y=[["enter",m,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",p,c]],w=c.parser.constructs.insideSpan.null;w&&Pn(y,y.length,0,rc(w,l.slice(f+1,d),c)),Pn(y,y.length,0,[["exit",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",m,c]]),Pn(l,f-1,d-f+3,y),d=f+y.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,c,d){const f=this.previous,m=this.events;let p=0;return y;function y(k){return f===126&&m[m.length-1][1].type!=="characterEscape"?d(k):(l.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const b=Us(f);if(k===126)return p>1?d(k):(l.consume(k),p++,w);if(p<2&&!n)return d(k);const E=l.exit("strikethroughSequenceTemporary"),P=Us(k);return E._open=!P||P===2&&!!b,E._close=!b||b===2&&!!P,c(k)}}}class Dj{constructor(){this.map=[]}add(t,n,r){Oj(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function Oj(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function Fj(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Vj(){return{flow:{null:{name:"table",tokenize:zj,resolveAll:Bj}}}}function zj(e,t,n){const r=this;let s=0,a=0,l;return c;function c(I){let U=r.events.length-1;for(;U>-1;){const J=r.events[U][1].type;if(J==="lineEnding"||J==="linePrefix")U--;else break}const z=U>-1?r.events[U][1].type:null,he=z==="tableHead"||z==="tableRow"?N:d;return he===N&&r.parser.lazy[r.now().line]?n(I):he(I)}function d(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(l=!0,a+=1),m(I)}function m(I){return I===null?n(I):Ne(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):n(I):Be(I)?We(e,m,"whitespace")(I):(a+=1,l&&(l=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(I)))}function p(I){return I===null||I===124||it(I)?(e.exit("data"),m(I)):(e.consume(I),I===92?y:p)}function y(I){return I===92||I===124?(e.consume(I),p):p(I)}function w(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),l=!1,Be(I)?We(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):k(I))}function k(I){return I===45||I===58?E(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),b):A(I)}function b(I){return Be(I)?We(e,E,"whitespace")(I):E(I)}function E(I){return I===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),P):I===45?(a+=1,P(I)):I===null||Ne(I)?j(I):A(I)}function P(I){return I===45?(e.enter("tableDelimiterFiller"),R(I)):A(I)}function R(I){return I===45?(e.consume(I),R):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return Be(I)?We(e,j,"whitespace")(I):j(I)}function j(I){return I===124?k(I):I===null||Ne(I)?!l||s!==a?A(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):A(I)}function A(I){return n(I)}function N(I){return e.enter("tableRow"),q(I)}function q(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),q):I===null||Ne(I)?(e.exit("tableRow"),t(I)):Be(I)?We(e,q,"whitespace")(I):(e.enter("data"),B(I))}function B(I){return I===null||I===124||it(I)?(e.exit("data"),q(I)):(e.consume(I),I===92?D:B)}function D(I){return I===92||I===124?(e.consume(I),B):B(I)}}function Bj(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,m,p;const y=new Dj;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(c=!1,d!==0&&(G0(y,t,d,f,m),m=void 0,d=0),f={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",f,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",m,t]])),s=k.type==="tableDelimiterRow"?2:m?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=Bl(y,t,a,s,void 0,p),a=[0,0,0,0]),l[2]=n)):k.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],p=Bl(y,t,a,s,void 0,p)),a=l,l=[a[1],n,0,0])):k.type==="tableHead"?(c=!0,d=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],p=Bl(y,t,a,s,n,p)):l[1]!==0&&(p=Bl(y,t,l,s,n,p)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&G0(y,t,d,f,m),y.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=Fj(t.events,n))}return e}function Bl(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},As(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=As(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=As(t.events,n[2]),m=As(t.events,n[3]),p={type:c,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const y=t.events[n[2]],w=t.events[n[3]];if(y[1].end=Object.assign({},w[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,b=n[3]-n[2]-1;e.add(k,b,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},As(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function G0(e,t,n,r,s){const a=[],l=As(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function As(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Uj={name:"tasklistCheck",tokenize:Hj};function $j(){return{text:{91:Uj}}}function Hj(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return it(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Ne(d)?t(d):Be(d)?e.check({tokenize:Wj},t,n)(d):n(d)}}function Wj(e,t,n){return We(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function $S(e){return kS([yj(),Pj(),jj(e),Vj(),$j()])}function HS(e){return typeof e=="string"&&/\.md$/i.test(e.trim())}function qj(e,t){const n=String(e??"").trim().split(/\r?\n/).map(s=>`> ${s}`).join(`
|
|
266
|
+
`),r=String(t??"").trim();return n&&r?`${n}
|
|
267
|
+
|
|
268
|
+
${r}`:n||r}function Gj(e){const t=String(e??""),n=t.lastIndexOf(".");return`${n>0?t.slice(0,n):t}_review.md`}function Kj(e,t,n){const r=String(e??""),s=String(t??""),a=Math.max(0,Number(n)||0);if(!s)return 0;let l=0,c=0;for(;c<=r.length;){const d=r.indexOf(s,c);if(d<0||d>=a)return l;l+=1,c=d+Math.max(s.length,1)}return l}function Xj(e){return(String(e??"").match(/https?:\/\/[^\s<>()\[\]{}"']+/gi)??[]).map(n=>n.replace(/[.,!?;:]+$/,""))}function Ph(e){return e?.kind!=="file"?null:String(e.mime??"").toLowerCase().startsWith("image/")?"photo":"file"}function Yj(e){const t=r=>{const s=Date.parse(String(r??""));return Number.isFinite(s)?s:0},n=new Map;for(const r of e??[]){const s=String(r?.message?.filename||"file"),a=n.get(s)??[];a.push(r),n.set(s,a)}return[...n.entries()].map(([r,s])=>({filename:r,versions:s.sort((a,l)=>t(l.message?.date)-t(a.message?.date))})).sort((r,s)=>t(s.versions[0]?.message?.date)-t(r.versions[0]?.message?.date))}const Qj=new Set(["delete","emphasis","inlineCode","link","linkReference","strong"]);function Jj(e){const t=NS(e,{extensions:[$S()],mdastExtensions:[SS()]}),n=[],r=[],s=[],a=(c,d)=>{const f=String(c??""),m=d.position?.start?.offset,p=d.position?.end?.offset;if(!f||!Number.isInteger(m)||!Number.isInteger(p))return;const y=e.slice(m,p),w=y.indexOf(f);if(w>=0){for(let b=0;b<f.length;b+=1)n.push(f[b]),r.push(m+w+b+1);return}let k=0;for(const b of f){const E=y.indexOf(b,k),P=E>=0?E:Math.min(k,Math.max(y.length-1,0));n.push(b),r.push(m+P+1),k=P+1}},l=c=>{const d=n.length;if(c.type==="text"||c.type==="inlineCode"||c.type==="code")a(c.value,c);else for(const p of c.children??[])l(p);const f=n.length,m=c.position?.end?.offset;f>d&&Qj.has(c.type)&&Number.isInteger(m)&&s.push({visibleEnd:f,rawEnd:m})};return l(t),{text:n.join(""),rawEnds:r,trailingRanges:s}}function Zj(e,t,n){let r=-1,s=0;for(let a=0;a<=n;a+=1){if(r=e.indexOf(t,s),r<0)return-1;s=r+Math.max(t.length,1)}return r}function eD(e,t){const n=String(e??""),r=Jj(n),s=new Map,a=[];for(const[d,f]of(t??[]).entries()){const m=String(f?.selection??"").trim(),p=String(f?.comment??"").trim().replace(/\s+/g," ").replace(/\]\]/g,"] ]");if(!p)continue;const y=`[[REVIEW COMMENT ${d+1}: ${p}]]`,w=Number.isInteger(f?.occurrence)&&f.occurrence>=0?f.occurrence:0,k=m?Zj(r.text,m,w):-1,b=k+m.length;let E=k>=0?r.rawEnds[b-1]:void 0;if(!Number.isInteger(E)){a.push(`[[REVIEW COMMENT ${d+1} — ANCHOR NOT FOUND: ${p}]]`);continue}for(const R of r.trailingRanges)R.visibleEnd===b&&(E=Math.max(E,R.rawEnd));const P=s.get(E)??[];P.push(y),s.set(E,P)}let l=n;const c=[...s.keys()].sort((d,f)=>f-d);for(const d of c)l=`${l.slice(0,d)} ${s.get(d).join(" ")}${l.slice(d)}`;return a.length>0&&(l=`${l.trimEnd()}
|
|
269
|
+
|
|
270
|
+
${a.join(`
|
|
271
|
+
`)}
|
|
272
|
+
`),l}const tD="",nD="application/octet-stream",rD=/\.([A-Za-z0-9]{1,12})$/;function WS(e){return String(e??"").split(";")[0].trim().toLowerCase()}function qS(e){const t=rD.exec(String(e??"").trim());return t?t[1].toLowerCase():""}function iD(e){const t=qS(e);return t==="html"||t==="htm"}function Ca(e,t){return iD(e)?!0:qS(e)?!1:WS(t)==="text/html"}function zp(e,t){const n=WS(e);return n==="text/html"||Ca(t,e)?nD:n}const Th=48e3,sD=Object.freeze([{rec:"audio/webm;codecs=opus",base:"audio/webm",ext:"webm"},{rec:"audio/ogg;codecs=opus",base:"audio/ogg",ext:"ogg"},{rec:"audio/webm",base:"audio/webm",ext:"webm"},{rec:"audio/mp4",base:"audio/mp4",ext:"m4a"}]),GS="x-ours-duration",oD=4e3;function aD(e){return!Number.isFinite(e)||e<=0?null:String(Math.round(e*100)/100)}function lD(e,t){const n=t===null?null:aD(t);return n===null?e:`${e};${GS}=${n}`}function uD(e){if(!e)return null;const t=new RegExp(`${GS}\\s*=\\s*([0-9]*\\.?[0-9]+)`,"i").exec(e);if(!t)return null;const n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}function cD(e,t=oD){return typeof Audio!="function"||typeof URL?.createObjectURL!="function"?Promise.resolve(null):new Promise(n=>{const r=URL.createObjectURL(e),s=new Audio;let a=!1;const l=d=>{a||(a=!0,clearTimeout(c),s.removeAttribute("src"),s.load(),URL.revokeObjectURL(r),n(Number.isFinite(d)&&(d??0)>0?d:null))},c=setTimeout(()=>l(null),t);s.addEventListener("loadedmetadata",()=>{Number.isFinite(s.duration)&&s.duration>0?l(s.duration):s.currentTime=Number.MAX_SAFE_INTEGER},{once:!0}),s.addEventListener("durationchange",()=>{Number.isFinite(s.duration)&&s.duration>0&&l(s.duration)}),s.addEventListener("error",()=>l(null),{once:!0}),s.preload="metadata",s.src=r})}const KS=40,dD=44,XS=.14,fD=.5,hD=e=>e<0?0:e>1?1:e;function YS(e,{floor:t=XS,gamma:n=fD}={}){const r=Math.pow(hD(Number.isFinite(e)?e:0),n);return t+(1-t)*r}function pD(e,t=KS){const n=Math.max(1,Math.floor(t)),r=new Array(n).fill(0);if(!e||e.length===0)return r;const s=e.length/n;for(let a=0;a<n;a++){const l=Math.floor(a*s),c=Math.min(e.length,Math.max(l+1,Math.floor((a+1)*s)));let d=0;for(let f=l;f<c;f++)d+=e[f]*e[f];r[a]=Math.sqrt(d/(c-l))}return r}function mD(e,t={}){const{silenceFloor:n=1e-4}=t,r=e.reduce((s,a)=>a>s?a:s,0);return r>n?e.map(s=>YS(s/r,t)):e.map(()=>XS)}function gD({decay:e=.995,minReference:t=.02}={}){let n=t;return{push(r){const s=Number.isFinite(r)&&r>0?r:0;return n=Math.max(t,n*e,s),YS(s/n)},get reference(){return n}}}function QS(e){return zp(e.mime,e.filename)}function Bp(e){const[t,n]=S.useState({url:null,size:0,loaded:!1});return S.useEffect(()=>{let r=null,s=!1;n({url:null,size:0,loaded:!1});const a=e.available?TI(e.id):null;return a?(n({url:a,size:e.size,loaded:!0}),()=>{}):(Zu(e.id).then(l=>{if(s)return;if(!l){n({url:null,size:0,loaded:!0});return}const c=URL.createObjectURL(new Blob([l],{type:QS(e)}));r=c,n({url:c,size:l.byteLength,loaded:!0})}),()=>{s=!0,r&&URL.revokeObjectURL(r)})},[e.id,e.available]),t}function Up({label:e}){return v.jsxs("div",{className:"file-offdevice",children:[v.jsx("div",{className:"file-offdevice-ic",children:v.jsx(Ce,{name:"inbox",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e,children:e}),v.jsx("div",{className:"filecard-sub",children:"Available on your original device"})]})]})}function K0({rec:e}){if(!e.transcription)return null;const t=e.transcription.text?.trim();return v.jsx("div",{className:"voice-transcript",children:t||`Transcription ${e.transcription.status??"unavailable"}${e.transcription.error_category?` · ${e.transcription.error_category}`:""}`})}function yD({rec:e,receipt:t,receiptless:n,onPreview:r,onFetch:s}){const a=e.dir==="out",l=`bubble file-bubble${a?" me":""}`,c=Bs(e.mime,e.filename)?"Voice message":"File",d=v.jsxs("div",{className:"bubble-at",children:[Hi(e.date),a&&v.jsx(Sh,{receipt:t,content:c,receiptless:n})]});return e.mime.startsWith("image/")?v.jsx(vD,{rec:e,cls:l,footer:d,onFetch:s}):Bs(e.mime,e.filename)?v.jsx(xD,{rec:e,cls:l,footer:d,onFetch:s}):v.jsx(wD,{rec:e,cls:l,footer:d,onPreview:r,onFetch:s})}function $p({rec:e,onFetch:t}){const[n,r]=S.useState(!1),[s,a]=S.useState(!1);return v.jsxs("div",{className:"file-offdevice",children:[v.jsx("div",{className:"file-offdevice-ic",children:v.jsx(Ce,{name:"inbox",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e.filename,children:Bs(e.mime,e.filename)?"Voice message":e.filename}),v.jsx("div",{className:"filecard-sub",children:s?"Could not fetch media":"Available after explicit fetch"})]}),v.jsx("button",{className:"btn sm",disabled:n,onClick:()=>{r(!0),a(!1),(t?.(e.id)??II(e.id)).catch(()=>a(!0)).finally(()=>r(!1))},children:n?"Fetching…":"Fetch"})]})}function vD({rec:e,cls:t,footer:n,onFetch:r}){const{url:s,loaded:a}=Bp(e);return a&&!s?v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx($p,{rec:e,onFetch:r}):v.jsx(Up,{label:e.filename&&e.filename!=="file"?e.filename:"Photo"}),n]}):v.jsxs("div",{className:t+" image-bubble",children:[s?v.jsx("a",{href:s,target:"_blank",rel:"noreferrer",title:e.filename,children:v.jsx("img",{src:s,alt:e.filename})}):v.jsx("div",{className:"file-loading",children:"loading…"}),n]})}function xD({rec:e,cls:t,footer:n,onFetch:r}){const{url:s,loaded:a}=Bp(e),l=S.useRef(null),c=S.useRef(null),[d,f]=S.useState(!1),[m,p]=S.useState(0),[y,w]=S.useState(()=>uD(e.mime)),[k,b]=S.useState(!1),[E,P]=S.useState(null);if(S.useEffect(()=>{if(!s)return;let B=!1;const D=typeof window>"u"?void 0:window.AudioContext||window.webkitAudioContext;if(!D)return;const I=new D,U=()=>{try{I.close()?.catch?.(()=>{})}catch{}};return(async()=>{try{const z=await fetch(s).then(J=>J.arrayBuffer()),he=await I.decodeAudioData(z);if(B)return;P(mD(pD(he.getChannelData(0),KS)))}catch{}finally{U()}})(),()=>{B=!0,U()}},[s]),a&&!s)return v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx($p,{rec:e,onFetch:r}):v.jsx(Up,{label:"Voice message"}),n,v.jsx(K0,{rec:e})]});const R=()=>{const B=l.current;B&&(d?B.pause():B.play())},_=B=>{const D=c.current;if(!D)return 0;const I=D.getBoundingClientRect();return Math.max(0,Math.min(1,(B-I.left)/I.width))},j=B=>{const D=l.current;p(B),D&&y&&isFinite(y)&&(D.currentTime=B*y)},A=B=>{s&&(B.currentTarget.setPointerCapture?.(B.pointerId),b(!0),j(_(B.clientX)))},N=B=>{k&&j(_(B.clientX))},q=B=>{k&&(B.currentTarget.releasePointerCapture?.(B.pointerId),b(!1))};return v.jsxs("div",{className:t+" voice-bubble",children:[v.jsx("button",{className:"voice-play",onClick:R,disabled:!s,title:d?"Pause":"Play",children:v.jsx(Ce,{name:d?"pause":"play",size:14})}),v.jsxs("div",{className:"voice-track"+(s?" seekable":"")+(k?" scrubbing":"")+(E?" has-wave":""),ref:c,onPointerDown:A,onPointerMove:N,onPointerUp:q,onPointerCancel:q,role:s?"slider":void 0,"aria-label":s?"Seek":void 0,"aria-valuenow":Math.round(m*100),children:[E?v.jsx("div",{className:"voice-wave","aria-hidden":!0,children:E.map((B,D)=>v.jsx("span",{className:"voice-wave-bar"+(D/E.length<m?" played":""),style:{height:`${Math.round(B*100)}%`}},D))}):v.jsx("div",{className:"voice-track-fill",style:{width:`${m*100}%`}}),s&&v.jsx("span",{className:"voice-track-knob",style:{left:`${m*100}%`}})]}),v.jsx("span",{className:"voice-dur mono",children:y!==null?`${Math.floor(y/60)}:${String(Math.floor(y%60)).padStart(2,"0")}`:"·:··"}),s&&v.jsx("audio",{ref:l,src:s,onPlay:()=>f(!0),onPause:()=>f(!1),onEnded:()=>{f(!1),p(0)},onTimeUpdate:B=>{const D=B.currentTarget;!k&&D.duration>0&&isFinite(D.duration)&&p(D.currentTime/D.duration)},onLoadedMetadata:B=>{const D=B.currentTarget.duration;isFinite(D)&&D>0&&w(D)}}),n,v.jsx(K0,{rec:e})]})}function wD({rec:e,cls:t,footer:n,onPreview:r,onFetch:s}){const{url:a,size:l,loaded:c}=Bp(e);return c&&!a?v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx($p,{rec:e,onFetch:s}):v.jsx(Up,{label:e.filename}),n]}):v.jsxs("div",{className:t+" filecard-bubble",children:[v.jsxs("div",{className:"filecard",children:[v.jsx("div",{className:"filecard-ic",children:v.jsx(Ce,{name:"copy",size:18})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e.filename,children:e.filename}),v.jsx("div",{className:"filecard-sub",children:l?di(l):e.size?di(e.size):""})]}),HS(e.filename)&&a&&r&&v.jsx("button",{className:"icon-btn",onClick:()=>r(e),title:"Preview markdown",children:v.jsx(Ce,{name:"monitor",size:16})}),Ca(e.filename,e.mime)&&a&&r&&v.jsx("button",{className:"icon-btn",onClick:()=>r(e),title:"Preview HTML",children:v.jsx(Ce,{name:"monitor",size:16})}),v.jsx("a",{className:"icon-btn"+(a?"":" disabled"),href:a??void 0,download:e.filename,title:"Download",children:v.jsx(Ce,{name:"download",size:16})})]}),n]})}function JS(e){const{att:t}=e,[n,r]=S.useState(null);return S.useEffect(()=>{const s=QS({mime:t.mime,filename:t.filename}),a=URL.createObjectURL(new Blob([t.bytes],{type:s}));return r(a),()=>URL.revokeObjectURL(a)},[t]),v.jsxs("div",{className:"attach-preview",children:[t.mime.startsWith("image/")&&n?v.jsx("img",{className:"attach-thumb",src:n,alt:t.filename}):t.voice&&n?v.jsx("audio",{className:"attach-audio",src:n,controls:!0}):v.jsx("div",{className:"filecard-ic",children:v.jsx(Ce,{name:"copy",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:t.filename,children:t.voice?"Voice message":t.filename}),v.jsxs("div",{className:"filecard-sub",children:[di(t.bytes.length),t.originalSize&&t.originalSize>t.bytes.length?` · optimized from ${di(t.originalSize)}`:""]})]}),v.jsx("button",{className:"btn primary sm",disabled:e.sending,onClick:e.onSend,children:e.sending?"Sending…":"Send"}),v.jsx("button",{className:"icon-btn",title:"Discard",disabled:e.sending,onClick:e.onDiscard,children:v.jsx(Ce,{name:"close"})})]})}const SD={channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},kD=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`,X0=84,Y0=120,CD=550,bD=Math.floor($o/(Th/8)),ED=Math.min(300,bD),_D=dD;function ZS(e){const[t,n]=S.useState("idle"),[r,s]=S.useState(0),[a,l]=S.useState([]),[c,d]=S.useState(0),[f,m]=S.useState(0),p=S.useRef("idle"),y=S.useRef(null),w=S.useRef(null),k=S.useRef([]),b=S.useRef("webm"),E=S.useRef("audio/webm"),P=S.useRef(!1),R=S.useRef({x:0,y:0}),_=S.useRef(0),j=S.useRef(!1),A=S.useRef(null),N=S.useRef(null),q=S.useRef(null),B=S.useRef(e.onReady),D=S.useRef(e.onError),I=S.useRef(e.onActiveChange);B.current=e.onReady,D.current=e.onError,I.current=e.onActiveChange;const U=oe=>{p.current=oe,n(oe),I.current?.(oe==="recording"||oe==="locked"||oe==="arming")},z=()=>{N.current!=null&&cancelAnimationFrame(N.current),N.current=null,q.current&&clearInterval(q.current),q.current=null,A.current?.close().catch(()=>{}),A.current=null,w.current?.getTracks().forEach(oe=>oe.stop()),w.current=null},he=()=>{window.removeEventListener("pointermove",Se),window.removeEventListener("pointerup",Q),window.removeEventListener("pointercancel",Q)},J=oe=>{P.current=oe;const ue=y.current;ue&&ue.state!=="inactive"?ue.stop():Z(),he()},Z=()=>{z(),U("idle"),s(0),l([]),d(0),m(0)},ve=()=>{p.current==="recording"&&(he(),m(0),U("locked"))};function Se(oe){if(p.current!=="recording")return;const ue=R.current.y-oe.clientY,ae=R.current.x-oe.clientX,me=Math.max(0,Math.min(1,ue/X0)),ke=Math.max(0,Math.min(1,ae/Y0));d(me),m(ke),ue>=X0?ve():ae>=Y0&&J(!0)}function Q(){if(p.current==="arming"){j.current=!0,he();return}if(p.current!=="recording")return;const oe=Date.now()-_.current<CD;J(oe)}const pe=oe=>{e.disabled||p.current!=="idle"||(oe.preventDefault(),R.current={x:oe.clientX,y:oe.clientY},j.current=!1,P.current=!1,k.current=[],d(0),m(0),U("arming"),window.addEventListener("pointermove",Se),window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q),T())};async function T(){let oe;try{oe=await navigator.mediaDevices.getUserMedia({audio:SD})}catch{D.current("Microphone unavailable — check the browser permission."),he(),U("idle");return}if(j.current||p.current==="idle"){oe.getTracks().forEach(me=>me.stop()),U("idle");return}w.current=oe;const ue=sD.find(me=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(me.rec));b.current=ue?.ext??"webm",E.current=ue?.base??"audio/webm";const ae=ue?new MediaRecorder(oe,{mimeType:ue.rec,audioBitsPerSecond:Th}):new MediaRecorder(oe,{audioBitsPerSecond:Th});y.current=ae,ae.ondataavailable=me=>{me.data.size>0&&k.current.push(me.data)},ae.onstop=()=>{if(P.current){Z();return}const ke=new Blob(k.current,{type:E.current});Promise.all([ke.arrayBuffer(),cD(ke)]).then(([xe,$e])=>{if(Z(),xe.byteLength===0)return;const Fe=new Date().toISOString().replace(/[-:]/g,"").replace(/\..+/,"").replace("T","-");B.current({filename:`${eS}${Fe}.${b.current}`,mime:lD(RI(E.current),$e),bytes:new Uint8Array(xe),voice:!0})})},ae.start(),_.current=Date.now(),U("recording"),s(0),q.current=setInterval(()=>{s(me=>{const ke=me+1;return ke>=ED&&J(!1),ke})},1e3),F(oe)}function F(oe){try{const ue=window.AudioContext||window.webkitAudioContext,ae=new ue;A.current=ae;const me=ae.createMediaStreamSource(oe),ke=ae.createAnalyser();ke.fftSize=256,me.connect(ke);const xe=new Uint8Array(ke.fftSize),$e=gD();let Fe=0;const qe=st=>{if(N.current=requestAnimationFrame(qe),st-Fe<80)return;Fe=st,ke.getByteTimeDomainData(xe);let ot=0;for(let et=0;et<xe.length;et++){const Wt=(xe[et]-128)/128;ot+=Wt*Wt}const Vt=Math.sqrt(ot/xe.length),en=$e.push(Vt);l(et=>{const Wt=et.length>=_D?et.slice(1):et.slice();return Wt.push(en),Wt})};N.current=requestAnimationFrame(qe)}catch{}}S.useEffect(()=>()=>{P.current=!0,y.current?.stop(),he(),z()},[]);const X=t==="recording"||t==="locked"||t==="arming",M=v.jsx("div",{className:"vr-wave","aria-hidden":!0,children:a.map((oe,ue)=>v.jsx("span",{className:"vr-bar",style:{height:`${Math.round(oe*100)}%`}},ue))});return v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"icon-btn composer-tool vr-mic",title:"Hold to record a voice message",disabled:e.disabled,onPointerDown:pe,onContextMenu:oe=>oe.preventDefault(),children:v.jsx(Ce,{name:"mic",size:18})}),X&&v.jsxs("div",{className:"voice-rec-overlay","data-mode":t,children:[t==="recording"&&v.jsxs("div",{className:"vr-lock",style:{"--p":c},"aria-hidden":!0,children:[v.jsx(Ce,{name:"lock",size:13}),v.jsx(Ce,{name:"chevronDown",size:12})]}),v.jsx("span",{className:"voice-rec-dot"}),v.jsx("span",{className:"vr-time mono",children:kD(r)}),t==="locked"?v.jsxs(v.Fragment,{children:[M,v.jsx("button",{className:"icon-btn vr-trash",title:"Cancel",onClick:()=>J(!0),children:v.jsx(Ce,{name:"trash",size:16})}),v.jsxs("button",{className:"btn primary sm vr-stop",onClick:()=>J(!1),children:[v.jsx(Ce,{name:"check",size:13}),"Stop"]})]}):v.jsxs("div",{className:"vr-slide",style:{opacity:1-f},children:[M,v.jsx("span",{className:"vr-hint",children:"‹ slide to cancel · slide up to lock"})]})]})]})}function PD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AD={};function Q0(e,t){return(AD.jsx?RD:TD).test(e)}const ID=/[ \t\n\f\r]/g;function MD(e){return typeof e=="object"?e.type==="text"?J0(e.value):!1:J0(e)}function J0(e){return e.replace(ID,"")===""}class ba{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ba.prototype.normal={};ba.prototype.property={};ba.prototype.space=void 0;function ek(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ba(n,r,t)}function Rh(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let ND=0;const De=Ki(),_t=Ki(),Ah=Ki(),le=Ki(),tt=Ki(),Wi=Ki(),bn=Ki();function Ki(){return 2**++ND}const Ih=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:_t,commaOrSpaceSeparated:bn,commaSeparated:Wi,number:le,overloadedBoolean:Ah,spaceSeparated:tt},Symbol.toStringTag,{value:"Module"})),yf=Object.keys(Ih);class Hp extends vn{constructor(t,n,r,s){let a=-1;if(super(t,n),Z0(this,"space",s),typeof r=="number")for(;++a<yf.length;){const l=yf[a];Z0(this,yf[a],(r&Ih[l])===Ih[l])}}}Hp.prototype.defined=!0;function Z0(e,t,n){n&&(e[t]=n)}function Xs(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new Hp(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Rh(r)]=r,n[Rh(a.attribute)]=r}return new ba(t,n,e.space)}const tk=Xs({properties:{ariaActiveDescendant:null,ariaAtomic:_t,ariaAutoComplete:null,ariaBusy:_t,ariaChecked:_t,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:tt,ariaCurrent:null,ariaDescribedBy:tt,ariaDetails:null,ariaDisabled:_t,ariaDropEffect:tt,ariaErrorMessage:null,ariaExpanded:_t,ariaFlowTo:tt,ariaGrabbed:_t,ariaHasPopup:null,ariaHidden:_t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tt,ariaLevel:le,ariaLive:null,ariaModal:_t,ariaMultiLine:_t,ariaMultiSelectable:_t,ariaOrientation:null,ariaOwns:tt,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:_t,ariaReadOnly:_t,ariaRelevant:null,ariaRequired:_t,ariaRoleDescription:tt,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:_t,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function nk(e,t){return t in e?e[t]:t}function rk(e,t){return nk(e,t.toLowerCase())}const LD=Xs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wi,acceptCharset:tt,accessKey:tt,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alpha:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:tt,autoFocus:De,autoPlay:De,blocking:tt,capture:null,charSet:null,checked:De,cite:null,className:tt,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:_t,controls:De,controlsList:tt,coords:le|Wi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Ah,draggable:_t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:tt,height:le,hidden:Ah,high:le,href:null,hrefLang:null,htmlFor:tt,httpEquiv:tt,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:tt,itemRef:tt,itemScope:De,itemType:tt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:De,optimum:le,pattern:null,ping:tt,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:tt,required:De,reversed:De,rows:le,rowSpan:le,sandbox:tt,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootCustomElementRegistry:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shadowRootSerializable:De,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:_t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:_t,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tt,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:_t,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:De,disablePictureInPicture:De,disableRemotePlayback:De,exportParts:Wi,part:tt,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:rk}),jD=Xs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:tt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wi,g2:Wi,glyphName:Wi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nk}),ik=Xs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),sk=Xs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rk}),ok=Xs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),DD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},OD=/[A-Z]/g,ex=/-[a-z]/g,FD=/^data[-\w.:]+$/i;function VD(e,t){const n=Rh(t);let r=t,s=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&FD.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ex,BD);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ex.test(a)){let l=a.replace(OD,zD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Hp}return new s(r,t)}function zD(e){return"-"+e.toLowerCase()}function BD(e){return e.charAt(1).toUpperCase()}const UD=ek([tk,LD,ik,sk,ok],"html"),Wp=ek([tk,jD,ik,sk,ok],"svg");function $D(e){return e.join(" ").trim()}var ks={},vf,tx;function HD(){if(tx)return vf;tx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
273
|
+
`,f="/",m="*",p="",y="comment",w="declaration";function k(E,P){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];P=P||{};var R=1,_=1;function j(J){var Z=J.match(t);Z&&(R+=Z.length);var ve=J.lastIndexOf(d);_=~ve?J.length-ve:_+J.length}function A(){var J={line:R,column:_};return function(Z){return Z.position=new N(J),D(),Z}}function N(J){this.start=J,this.end={line:R,column:_},this.source=P.source}N.prototype.content=E;function q(J){var Z=new Error(P.source+":"+R+":"+_+": "+J);if(Z.reason=J,Z.filename=P.source,Z.line=R,Z.column=_,Z.source=E,!P.silent)throw Z}function B(J){var Z=J.exec(E);if(Z){var ve=Z[0];return j(ve),E=E.slice(ve.length),Z}}function D(){B(n)}function I(J){var Z;for(J=J||[];Z=U();)Z!==!1&&J.push(Z);return J}function U(){var J=A();if(!(f!=E.charAt(0)||m!=E.charAt(1))){for(var Z=2;p!=E.charAt(Z)&&(m!=E.charAt(Z)||f!=E.charAt(Z+1));)++Z;if(Z+=2,p===E.charAt(Z-1))return q("End of comment missing");var ve=E.slice(2,Z-2);return _+=2,j(ve),E=E.slice(Z),_+=2,J({type:y,comment:ve})}}function z(){var J=A(),Z=B(r);if(Z){if(U(),!B(s))return q("property missing ':'");var ve=B(a),Se=J({type:w,property:b(Z[0].replace(e,p)),value:ve?b(ve[0].replace(e,p)):p});return B(l),Se}}function he(){var J=[];I(J);for(var Z;Z=z();)Z!==!1&&(J.push(Z),I(J));return J}return D(),he()}function b(E){return E?E.replace(c,p):p}return vf=k,vf}var nx;function WD(){if(nx)return ks;nx=1;var e=ks&&ks.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=n;const t=e(HD());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;c?s(f,m,d):m&&(a=a||{},a[f]=m)}),a}return ks}var Fo={},rx;function qD(){if(rx)return Fo;rx=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,m){return m.toUpperCase()},c=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),a(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(s,c):f=f.replace(r,c),f.replace(t,l))};return Fo.camelCase=d,Fo}var Vo,ix;function GD(){if(ix)return Vo;ix=1;var e=Vo&&Vo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(WD()),n=qD();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,Vo=r,Vo}var KD=GD();const XD=Jh(KD),ak=lk("end"),qp=lk("start");function lk(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function YD(e){const t=qp(e),n=ak(e);if(t&&n)return{start:t,end:n}}class Zt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=Qo(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zt.prototype.file="";Zt.prototype.name="";Zt.prototype.reason="";Zt.prototype.message="";Zt.prototype.stack="";Zt.prototype.column=void 0;Zt.prototype.line=void 0;Zt.prototype.ancestors=void 0;Zt.prototype.cause=void 0;Zt.prototype.fatal=void 0;Zt.prototype.place=void 0;Zt.prototype.ruleId=void 0;Zt.prototype.source=void 0;const Gp={}.hasOwnProperty,QD=new Map,JD=/[A-Z]/g,ZD=new Set(["table","tbody","thead","tfoot","tr"]),eO=new Set(["td","th"]),uk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=uO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=lO(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Wp:UD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ck(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function ck(e,t,n){if(t.type==="element")return nO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sO(e,t,n);if(t.type==="mdxjsEsm")return iO(e,t);if(t.type==="root")return oO(e,t,n);if(t.type==="text")return aO(e,t)}function nO(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Wp,e.schema=s),e.ancestors.push(t);const a=fk(e,t.tagName,!1),l=cO(e,t);let c=Xp(e,t);return ZD.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!MD(d):!0})),dk(e,l,a,t),Kp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function rO(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}fa(e,t.position)}function iO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fa(e,t.position)}function sO(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Wp,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:fk(e,t.name,!0),l=dO(e,t),c=Xp(e,t);return dk(e,l,a,t),Kp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function oO(e,t,n){const r={};return Kp(r,Xp(e,t)),e.create(t,e.Fragment,r,n)}function aO(e,t){return t.value}function dk(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Kp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lO(e,t,n){return r;function r(s,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function uO(e,t){return n;function n(r,s,a,l){const c=Array.isArray(a.children),d=qp(r);return t(s,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function cO(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Gp.call(t.properties,s)){const a=fO(e,s,t.properties[s]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&eO.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function dO(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else fa(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else fa(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Xp(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:QD;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=s.get(d)||0;l=d+"-"+f,s.set(d,f+1)}}const c=ck(e,a,l);c!==void 0&&n.push(c)}return n}function fO(e,t,n){const r=VD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?PD(n):$D(n)),r.property==="style"){let s=typeof n=="object"?n:hO(e,String(n));return e.stylePropertyNameCase==="css"&&(s=pO(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?DD[r.property]||r.property:r.attribute,n]}}function hO(e,t){try{return XD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Zt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=uk+"#cannot-parse-style-attribute",s}}function fk(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const c=Q0(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=Q0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Gp.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);fa(e)}function fa(e,t){const n=new Zt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=uk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pO(e){const t={};let n;for(n in e)Gp.call(e,n)&&(t[mO(n)]=e[n]);return t}function mO(e){let t=e.replace(JD,gO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function gO(e){return"-"+e.toLowerCase()}const xf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};function yO(e){const t=this;t.parser=n;function n(r){return NS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function vO(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function xO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
274
|
+
`}]}function wO(e,t){const n=t.value?t.value+`
|
|
275
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function SO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Ks(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function bO(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hk(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function _O(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hk(e,t);const s={src:Ks(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function PO(e,t){const n={src:Ks(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function TO(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function RO(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hk(e,t);const s={href:Ks(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function AO(e,t){const n={href:Ks(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function IO(e,t,n){const r=e.all(t),s=n?MO(n):pk(t),a={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(s||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
276
|
+
`}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
277
|
+
`});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function MO(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=pk(n[r])}return t}function pk(e){const t=e.spread;return t??e.children.length>1}function NO(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function LO(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jO(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function DO(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OO(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=qp(t.children[1]),d=ak(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function FO(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const p=t.children[d],y={},w=l?l[d]:void 0;w&&(y.align=w);let k={type:"element",tagName:a,properties:y,children:[]};p&&(k.children=e.all(p),e.patch(p,k),k=e.applyData(p,k)),f.push(k)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function VO(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const sx=9,ox=32;function zO(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(ax(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(ax(t.slice(s),s>0,!1)),a.join("")}function ax(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===sx||a===ox;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===sx||a===ox;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function BO(e,t){const n={type:"text",value:zO(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function UO(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $O={blockquote:vO,break:xO,code:wO,delete:SO,emphasis:kO,footnoteReference:CO,heading:bO,html:EO,imageReference:_O,image:PO,inlineCode:TO,linkReference:RO,link:AO,listItem:IO,list:NO,paragraph:LO,root:jO,strong:DO,table:OO,tableCell:VO,tableRow:FO,text:BO,thematicBreak:UO,toml:Ul,yaml:Ul,definition:Ul,footnoteDefinition:Ul};function Ul(){}const mk=-1,ic=0,Jo=1,Nu=2,Yp=3,Qp=4,Jp=5,Zp=6,gk=7,yk=8,vk=typeof self=="object"?self:globalThis,lx=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new vk[e](t)},HO=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case ic:case mk:return n(l,s);case Jo:{const c=n([],s);for(const d of l)c.push(r(d));return c}case Nu:{const c=n({},s);for(const[d,f]of l)c[r(d)]=r(f);return c}case Yp:return n(new Date(l),s);case Qp:{const{source:c,flags:d}=l;return n(new RegExp(c,d),s)}case Jp:{const c=n(new Map,s);for(const[d,f]of l)c.set(r(d),r(f));return c}case Zp:{const c=n(new Set,s);for(const d of l)c.add(r(d));return c}case gk:{const{name:c,message:d}=l;return n(typeof vk[c]=="function"?lx(c,d):new Error(d),s)}case yk:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(lx(a,l),s)};return r},ux=e=>HO(new Map,e)(0),Mi="",{toString:WO}={},{keys:qO}=Object,zo=e=>{const t=typeof e;if(t!=="object"||!e)return[ic,t];const n=WO.call(e).slice(8,-1);switch(n){case"Array":return[Jo,Mi];case"Object":return[Nu,Mi];case"Date":return[Yp,Mi];case"RegExp":return[Qp,Mi];case"Map":return[Jp,Mi];case"Set":return[Zp,Mi];case"DataView":return[Jo,n]}return n.includes("Array")?[Jo,n]:e instanceof Error?[gk,e.name||"Error"]:[Nu,n]},$l=([e,t])=>e===ic&&(t==="function"||t==="symbol"),GO=(e,t,n,r)=>{const s=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},a=l=>{if(n.has(l))return n.get(l);let[c,d]=zo(l);switch(c){case ic:{let m=l;switch(d){case"bigint":c=yk,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return s([mk],l)}return s([c,m],l)}case Jo:{if(d){let y=l;return d==="DataView"?y=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(l)),s([d,[...y]],l)}const m=[],p=s([c,m],l);for(const y of l)m.push(a(y));return p}case Nu:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const m=[],p=s([c,m],l);for(const y of qO(l))(e||!$l(zo(l[y])))&&m.push([a(y),a(l[y])]);return p}case Yp:return s([c,isNaN(l.getTime())?Mi:l.toISOString()],l);case Qp:{const{source:m,flags:p}=l;return s([c,{source:m,flags:p}],l)}case Jp:{const m=[],p=s([c,m],l);for(const[y,w]of l)(e||!($l(zo(y))||$l(zo(w))))&&m.push([a(y),a(w)]);return p}case Zp:{const m=[],p=s([c,m],l);for(const y of l)(e||!$l(zo(y)))&&m.push(a(y));return p}}const{message:f}=l;return s([c,{name:d,message:f}],l)};return a},cx=(e,{json:t,lossy:n}={})=>{const r=[];return GO(!(t||n),!!t,new Map,r)(e),r},Lu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ux(cx(e,t)):structuredClone(e):(e,t)=>ux(cx(e,t));function KO(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function XO(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function YO(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KO,r=e.options.footnoteBackLabel||XO,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const m=e.all(f),p=String(f.identifier).toUpperCase(),y=Ks(p.toLowerCase());let w=0;const k=[],b=e.footnoteCounts.get(p);for(;b!==void 0&&++w<=b;){k.length>0&&k.push({type:"text",value:" "});let R=typeof n=="string"?n:n(d,w);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,w),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const E=m[m.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const R=E.children[E.children.length-1];R&&R.type==="text"?R.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else m.push(...k);const P={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(f,P),c.push(P)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Lu(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
278
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
279
|
+
`}]}}const Mh={}.hasOwnProperty,QO={};function JO(e,t){const n=t||QO,r=new Map,s=new Map,a=new Map,l={...$O,...n.handlers},c={all:f,applyData:e3,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:ZO,wrap:n3};return Lp(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:s,y=String(m.identifier).toUpperCase();p.has(y)||p.set(y,m)}}),c;function d(m,p){const y=m.type,w=c.handlers[y];if(Mh.call(c.handlers,y)&&w)return w(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:b,...E}=m,P=Lu(E);return P.children=c.all(m),P}return Lu(m)}return(c.options.unknownHandler||t3)(c,m,p)}function f(m){const p=[];if("children"in m){const y=m.children;let w=-1;for(;++w<y.length;){const k=c.one(y[w],m);if(k){if(w&&y[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=dx(k.value)),!Array.isArray(k)&&k.type==="element")){const b=k.children[0];b&&b.type==="text"&&(b.value=dx(b.value))}Array.isArray(k)?p.push(...k):p.push(k)}}}return p}}function ZO(e,t){e.position&&(t.position=YD(e))}function e3(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Lu(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function t3(e,t){const n=t.data||{},r="value"in t&&!(Mh.call(n,"hProperties")||Mh.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function n3(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
280
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
281
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
282
|
+
`}),n}function dx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fx(e,t){const n=JO(e,t),r=n.one(e,void 0),s=YO(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
|
|
283
|
+
`},s),a}function r3(e,t){return e&&"run"in e?async function(n,r){const s=fx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return fx(n,{file:r,...e||t})}}function hx(e){if(e)throw e}var wf,px;function i3(){if(px)return wf;px=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),p=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!p)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},l=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},c=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return wf=function d(){var f,m,p,y,w,k,b=arguments[0],E=1,P=arguments.length,R=!1;for(typeof b=="boolean"&&(R=b,b=arguments[1]||{},E=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});E<P;++E)if(f=arguments[E],f!=null)for(m in f)p=c(b,m),y=c(f,m),b!==y&&(R&&y&&(a(y)||(w=s(y)))?(w?(w=!1,k=p&&s(p)?p:[]):k=p&&a(p)?p:{},l(b,{name:m,newValue:d(R,k,y)})):typeof y<"u"&&l(b,{name:m,newValue:y}));return b},wf}var s3=i3();const Sf=Jh(s3);function Nh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function o3(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...s);function c(d,...f){const m=e[++a];let p=-1;if(d){l(d);return}for(;++p<s.length;)(f[p]===null||f[p]===void 0)&&(f[p]=s[p]);s=f,m?a3(m,c)(...f):l(null,...f)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function a3(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(s);try{d=e.apply(this,l)}catch(f){const m=f;if(c&&n)throw m;return s(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...c){n||(n=!0,t(l,...c))}function a(l){s(null,l)}}const dr={basename:l3,dirname:u3,extname:c3,join:d3,sep:"/"};function l3(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ea(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function u3(e){if(Ea(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function c3(e){Ea(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function d3(...e){let t=-1,n;for(;++t<e.length;)Ea(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":f3(n)}function f3(e){Ea(e);const t=e.codePointAt(0)===47;let n=h3(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function h3(e,t){let n="",r=0,s=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function Ea(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const p3={cwd:m3};function m3(){return"/"}function Lh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function g3(e){if(typeof e=="string")e=new URL(e);else if(!Lh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return y3(e)}function y3(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const kf=["history","path","basename","stem","extname","dirname"];class xk{constructor(t){let n;t?Lh(t)?n={path:t}:typeof t=="string"||v3(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":p3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<kf.length;){const a=kf[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)kf.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?dr.basename(this.path):void 0}set basename(t){bf(t,"basename"),Cf(t,"basename"),this.path=dr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?dr.dirname(this.path):void 0}set dirname(t){mx(this.basename,"dirname"),this.path=dr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?dr.extname(this.path):void 0}set extname(t){if(Cf(t,"extname"),mx(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=dr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Lh(t)&&(t=g3(t)),bf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?dr.basename(this.path,this.extname):void 0}set stem(t){bf(t,"stem"),Cf(t,"stem"),this.path=dr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Zt(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Cf(e,t){if(e&&e.includes(dr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+dr.sep+"`")}function bf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function v3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const x3=function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},w3={}.hasOwnProperty;class em extends x3{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=o3()}copy(){const t=new em;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Sf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Pf("data",this.frozen),this.namespace[t]=n,this):w3.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Hl(t),r=this.parser||this.Parser;return Ef("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ef("process",this.parser||this.Parser),_f("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const c=Hl(t),d=r.parse(c);r.run(d,c,function(m,p,y){if(m||!p||!y)return f(m);const w=p,k=r.stringify(w,y);C3(k)?y.value=k:y.result=k,f(m,y)});function f(m,p){m||!p?l(m):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),Ef("processSync",this.parser||this.Parser),_f("processSync",this.compiler||this.Compiler),this.process(t,s),yx("processSync","process",n),r;function s(a,l){n=!0,hx(a),r=l}}run(t,n,r){gx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const d=Hl(n);s.run(t,d,f);function f(m,p,y){const w=p||t;m?c(m):l?l(w):r(void 0,w,y)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),yx("runSync","run",r),s;function a(l,c){hx(l),s=c,r=!0}}stringify(t,n){this.freeze();const r=Hl(n),s=this.compiler||this.Compiler;return _f("stringify",s),gx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Pf("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...p]=f;d(m,p)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(s.settings=Sf(!0,s.settings,f.settings))}function c(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const p=f[m];a(p)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,m){let p=-1,y=-1;for(;++p<r.length;)if(r[p][0]===f){y=p;break}if(y===-1)r.push([f,...m]);else if(m.length>0){let[w,...k]=m;const b=r[y][1];Nh(b)&&Nh(w)&&(w=Sf(!0,b,w)),r[y]=[f,w,...k]}}}}const S3=new em().freeze();function Ef(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _f(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gx(e){if(!Nh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Hl(e){return k3(e)?e:new xk(e)}function k3(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function C3(e){return typeof e=="string"||b3(e)}function b3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const E3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vx=[],xx={allowDangerousHtml:!0},_3=/^(https?|ircs?|mailto|xmpp)$/i,P3=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wk(e){const t=T3(e),n=R3(e);return A3(t.runSync(t.parse(n),n),e)}function T3(e){const t=e.rehypePlugins||vx,n=e.remarkPlugins||vx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xx}:xx;return S3().use(yO).use(n).use(r3,r).use(t)}function R3(e){const t=e.children||"",n=new xk;return typeof t=="string"&&(n.value=t),n}function A3(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||I3;for(const m of P3)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+E3+m.id,void 0);return Lp(e,f),tO(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function f(m,p,y){if(m.type==="raw"&&y&&typeof p=="number")return l?y.children.splice(p,1):y.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let w;for(w in xf)if(Object.hasOwn(xf,w)&&Object.hasOwn(m.properties,w)){const k=m.properties[w],b=xf[w];(b===null||b.includes(m.tagName))&&(m.properties[w]=d(String(k||""),w,m))}}if(m.type==="element"){let w=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!w&&r&&typeof p=="number"&&(w=!r(m,p,y)),w&&y&&typeof p=="number")return c&&m.children?y.children.splice(p,1,...m.children):y.children.splice(p,1),p}}}function I3(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||_3.test(e.slice(0,t))?e:""}const M3={};function Sk(e){const t=this,n=e||M3,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push($S(n)),a.push(SS()),l.push(kN(n))}var N3=Object.defineProperty,Ys=(e,t)=>N3(e,"name",{value:t,configurable:!0}),kk=!!(typeof window<"u"&&window.document&&window.document.createElement);function li(e,t,{checkForDefaultPrevented:n=!0}={}){return Ys(function(s){if(e?.(s),n===!1||!s||!s.defaultPrevented)return t?.(s)},"handleEvent")}Ys(li,"composeEventHandlers");function L3(e){if(!kk)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Ys(L3,"getOwnerWindow");function jh(e){if(!kk)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Ys(jh,"getOwnerDocument");function Ck(e,t=!1){const{activeElement:n}=jh(e);if(!n?.nodeName)return null;if(bk(n)&&n.contentDocument)return Ck(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const s=jh(n).getElementById(r);if(s)return s}}return n}Ys(Ck,"getActiveElement");function bk(e){return e.tagName==="IFRAME"}Ys(bk,"isFrame");var j3=Object.defineProperty,tm=(e,t)=>j3(e,"name",{value:t,configurable:!0});function Dh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}tm(Dh,"setRef");function Ek(...e){return t=>{let n=!1;const r=e.map(s=>{const a=Dh(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():Dh(e[s],null)}}}}tm(Ek,"composeRefs");function Qs(...e){return S.useCallback(Ek(...e),e)}tm(Qs,"useComposedRefs");var D3=Object.defineProperty,On=(e,t)=>D3(e,"name",{value:t,configurable:!0});function O3(e,t){const n=S.createContext(t);n.displayName=e+"Context";const r=On(a=>{const{children:l,...c}=a,d=S.useMemo(()=>c,Object.values(c));return v.jsx(n.Provider,{value:d,children:l})},"Provider");r.displayName=e+"Provider";function s(a,l={}){const{optional:c=!1}=l,d=S.useContext(n);if(d)return d;if(t!==void 0)return t;if(!c)throw new Error(`\`${a}\` must be used within \`${e}\``)}return On(s,"useContext"),[r,s]}On(O3,"createContext");function _k(e,t=[]){let n=[];function r(a,l){const c=S.createContext(l);c.displayName=a+"Context";const d=n.length;n=[...n,l];const f=On(p=>{const{scope:y,children:w,...k}=p,b=y?.[e]?.[d]||c,E=S.useMemo(()=>k,Object.values(k));return v.jsx(b.Provider,{value:E,children:w})},"Provider");f.displayName=a+"Provider";function m(p,y,w={}){const{optional:k=!1}=w,b=y?.[e]?.[d]||c,E=S.useContext(b);if(E)return E;if(l!==void 0)return l;if(!k)throw new Error(`\`${p}\` must be used within \`${a}\``)}return On(m,"useContext"),[f,m]}On(r,"createContext");const s=On(()=>{const a=n.map(l=>S.createContext(l));return On(function(c){const d=c?.[e]||a;return S.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])},"useScope")},"createScope");return s.scopeName=e,[r,Pk(s,...t)]}On(_k,"createContextScope");function Pk(...e){const t=e[0];if(e.length===1)return t;const n=On(()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return On(function(a){const l=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(a)[`__scope${f}`];return{...c,...p}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}On(Pk,"composeContextScopes");var fi=globalThis?.document?S.useLayoutEffect:()=>{},F3=Object.defineProperty,V3=(e,t)=>F3(e,"name",{value:t,configurable:!0}),z3=ga[" useId ".trim().toString()]||(()=>{}),B3=0;function cu(e){const[t,n]=S.useState(z3());return fi(()=>{e||n(r=>r??String(B3++))},[e]),e||(t?`radix-${t}`:"")}V3(cu,"useId");var U3=Object.defineProperty,$3=(e,t)=>U3(e,"name",{value:t,configurable:!0}),wx=ga[" useEffectEvent ".trim().toString()],Sx=ga[" useInsertionEffect ".trim().toString()];function Tk(e){if(typeof wx=="function")return wx(e);const t=S.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Sx=="function"?Sx(()=>{t.current=e}):fi(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}$3(Tk,"useEffectEvent");var H3=Object.defineProperty,_a=(e,t)=>H3(e,"name",{value:t,configurable:!0}),W3=ga[" useInsertionEffect ".trim().toString()]||fi;function Rk({prop:e,defaultProp:t,onChange:n=_a(()=>{},"onChange"),caller:r}){const[s,a,l]=Ak({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s,f=S.useCallback(m=>{if(c){const p=Ik(m)?m(e):m;p!==e&&l.current?.(p)}else a(m)},[c,e,a,l]);return[d,f]}_a(Rk,"useControllableState");function Ak({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),s=S.useRef(n),a=S.useRef(t);return W3(()=>{a.current=t},[t]),S.useEffect(()=>{s.current!==n&&(a.current?.(n),s.current=n)},[n,s]),[n,r,a]}_a(Ak,"useUncontrolledState");function Ik(e){return typeof e=="function"}_a(Ik,"isFunction");var kx=Symbol("RADIX:SYNC_STATE");function q3(e,t,n,r){const{prop:s,defaultProp:a,onChange:l,caller:c}=t,d=s!==void 0,f=Tk(l),m=[{...n,state:a}];r&&m.push(r);const[p,y]=S.useReducer((E,P)=>{if(P.type===kx)return{...E,state:P.state};const R=e(E,P);return d&&!Object.is(R.state,E.state)&&f(R.state),R},...m),w=p.state,k=S.useRef(w);S.useEffect(()=>{k.current!==w&&(k.current=w,d||f(w))},[w,k,d]);const b=S.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return S.useEffect(()=>{d&&!Object.is(s,p.state)&&y({type:kx,state:s})},[s,p.state,d]),[b,y]}_a(q3,"useControllableStateReducer");var Mk=aw(),G3=Object.defineProperty,er=(e,t)=>G3(e,"name",{value:t,configurable:!0});function nm(e){const t=S.forwardRef((n,r)=>{let{children:s,...a}=n,l=null,c=!1;const d=[];Oh(s)&&typeof Wl=="function"&&(s=Wl(s._payload)),S.Children.forEach(s,y=>{if(Dk(y)){c=!0;const w=y;let k="child"in w.props?w.props.child:w.props.children;Oh(k)&&typeof Wl=="function"&&(k=Wl(k._payload)),l=X3(w,k),d.push(l?.props?.children)}else d.push(y)}),l?l=S.cloneElement(l,void 0,d):!c&&S.Children.count(s)===1&&S.isValidElement(s)&&(l=s);const f=l?jk(l):void 0,m=Qs(r,f);if(!l){if(s||s===0)throw new Error(c?J3(e):Q3(e));return s}const p=Lk(a,l.props??{});return l.type!==S.Fragment&&(p.ref=r?m:f),S.cloneElement(l,p)});return t.displayName=`${e}.Slot`,t}er(nm,"createSlot");var Nk=Symbol.for("radix.slottable");function K3(e){const t=er(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Nk,t}er(K3,"createSlottable");var X3=er((e,t)=>{if("child"in e.props){const n=e.props.child;return S.isValidElement(n)?S.cloneElement(n,void 0,e.props.children(n.props.children)):null}return S.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Lk(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...c)=>{const d=a(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}er(Lk,"mergeProps");function jk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}er(jk,"getElementRef");function Dk(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nk}er(Dk,"isSlottable");var Y3=Symbol.for("react.lazy");function Oh(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Y3&&"_payload"in e&&Ok(e._payload)}er(Oh,"isLazyComponent");function Ok(e){return typeof e=="object"&&e!==null&&"then"in e}er(Ok,"isPromiseLike");var Q3=er(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),J3=er(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Wl=ga[" use ".trim().toString()],Z3=Object.defineProperty,eF=(e,t)=>Z3(e,"name",{value:t,configurable:!0}),tF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xi=tF.reduce((e,t)=>{const n=nm(`Primitive.${t}`),r=S.forwardRef((s,a)=>{const{asChild:l,...c}=s,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fk(e,t){e&&Mk.flushSync(()=>e.dispatchEvent(t))}eF(Fk,"dispatchDiscreteCustomEvent");var nF=Object.defineProperty,rF=(e,t)=>nF(e,"name",{value:t,configurable:!0});function $s(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}rF($s,"useCallbackRef");var iF=Object.defineProperty,Ft=(e,t)=>iF(e,"name",{value:t,configurable:!0}),Fh="dismissableLayer.update",sF="dismissableLayer.pointerDownOutside",oF="dismissableLayer.focusOutside",Cx,Vk=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),aF=S.forwardRef(Ft(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...m}=t,p=S.useContext(Vk),[y,w]=S.useState(null),k=y?.ownerDocument??globalThis?.document,[,b]=S.useState({}),E=Qs(n,w),P=Array.from(p.layers),[R]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),_=R?P.indexOf(R):-1,j=y?P.indexOf(y):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,N=j>=_,q=S.useRef(!1),B=Bk(z=>{l?.(z),d?.(z),z.defaultPrevented||f?.()},{ownerDocument:k,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:q,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(z=>{if(!(z instanceof Node))return!1;const he=[...p.branches].some(J=>J.contains(z));return N&&!he},[p.branches,N])}),D=Uk(z=>{if(s&&q.current)return;const he=z.target;[...p.branches].some(Z=>Z.contains(he))||(c?.(z),d?.(z),z.defaultPrevented||f?.())},k),I=y?j===P.length-1:!1,U=$s(z=>{z.key==="Escape"&&(a?.(z),!z.defaultPrevented&&f&&(z.preventDefault(),f()))});return S.useEffect(()=>{if(I)return k.addEventListener("keydown",U,{capture:!0}),()=>k.removeEventListener("keydown",U,{capture:!0})},[k,I,U]),S.useEffect(()=>{if(y)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Cx=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),Vh(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(y),p.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=Cx))}},[y,k,r,p]),S.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),Vh())},[y,p]),S.useEffect(()=>{const z=Ft(()=>b({}),"handleUpdate");return document.addEventListener(Fh,z),()=>document.removeEventListener(Fh,z)},[]),v.jsx(Xi.div,{...m,ref:E,style:{pointerEvents:A?N?"auto":"none":void 0,...t.style},onFocusCapture:li(t.onFocusCapture,D.onFocusCapture),onBlurCapture:li(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:li(t.onPointerDownCapture,B.onPointerDownCapture)})},"DismissableLayer"));function zk(){const e=S.useContext(Vk),[t,n]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ft(zk,"useDismissableLayerSurface");var lF=Ft(()=>!0,"IS_TRUE");function Bk(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:a,shouldHandlePointerDownOutside:l=lF}=t,c=$s(e),d=S.useRef(!1),f=S.useRef(!1),m=S.useRef(new Map),p=S.useRef(()=>{});return S.useEffect(()=>{function y(){f.current=!1,s.current=!1,m.current.clear()}Ft(y,"resetOutsideInteraction");function w(){return Array.from(m.current.values()).some(Boolean)}Ft(w,"isOutsideInteractionIntercepted");function k(_){if(!f.current)return;const j=_.target;j instanceof Node&&[...a].some(N=>N.contains(j))||m.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}Ft(k,"handleInteractionCapture");function b(_){f.current&&m.current.set(_.type,!1)}Ft(b,"handleInteractionBubble");const E=Ft(_=>{if(_.target&&!d.current){let j=function(){n.removeEventListener("click",p.current);const N=w();y(),N||rm(sF,c,A,{discrete:!0})};if(Ft(j,"handleAndDispatchPointerDownOutsideEvent"),!l(_.target)){n.removeEventListener("click",p.current),y(),d.current=!1;return}const A={originalEvent:_};f.current=!0,s.current=r&&_.button===0,m.current.clear(),!r||_.button!==0?j():(n.removeEventListener("click",p.current),p.current=j,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),y();d.current=!1},"handlePointerDown"),P=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of P)n.addEventListener(_,k,!0),n.addEventListener(_,b);const R=window.setTimeout(()=>{n.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(R),n.removeEventListener("pointerdown",E),n.removeEventListener("click",p.current);for(const _ of P)n.removeEventListener(_,k,!0),n.removeEventListener(_,b)}},[n,c,r,s,a,l]),{onPointerDownCapture:Ft(()=>d.current=!0,"onPointerDownCapture")}}Ft(Bk,"usePointerDownOutside");function Uk(e,t=globalThis?.document){const n=$s(e),r=S.useRef(!1);return S.useEffect(()=>{const s=Ft(a=>{a.target&&!r.current&&rm(oF,n,{originalEvent:a},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:Ft(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ft(()=>r.current=!1,"onBlurCapture")}}Ft(Uk,"useFocusOutside");function Vh(){const e=new CustomEvent(Fh);document.dispatchEvent(e)}Ft(Vh,"dispatchUpdate");function rm(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Fk(s,a):s.dispatchEvent(a)}Ft(rm,"handleAndDispatchCustomEvent");var uF=Object.defineProperty,un=(e,t)=>uF(e,"name",{value:t,configurable:!0}),Tf="focusScope.autoFocusOnMount",Rf="focusScope.autoFocusOnUnmount",bx={bubbles:!1,cancelable:!0},cF=S.forwardRef(un(function(t,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=t,[d,f]=S.useState(null),m=$s(a),p=$s(l),y=S.useRef(null),w=Qs(n,f),k=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(s){let E=function(j){if(k.paused||!d)return;const A=j.target;d.contains(A)?y.current=A:Ar(y.current,{select:!0})},P=function(j){if(k.paused||!d)return;const A=j.relatedTarget;A!==null&&(d.contains(A)||Ar(y.current,{select:!0}))},R=function(j){if(document.activeElement===document.body)for(const N of j)N.removedNodes.length>0&&Ar(d)};un(E,"handleFocusIn"),un(P,"handleFocusOut"),un(R,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",P);const _=new MutationObserver(R);return d&&_.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",P),_.disconnect()}}},[s,d,k.paused]),S.useEffect(()=>{if(d){Ex.add(k);const E=document.activeElement;if(!d.contains(E)){const R=new CustomEvent(Tf,bx);d.addEventListener(Tf,m),d.dispatchEvent(R),R.defaultPrevented||($k(Kk(im(d)),{select:!0}),document.activeElement===E&&Ar(d))}return()=>{d.removeEventListener(Tf,m),setTimeout(()=>{const R=new CustomEvent(Rf,bx);d.addEventListener(Rf,p),d.dispatchEvent(R),R.defaultPrevented||Ar(E??document.body,{select:!0}),d.removeEventListener(Rf,p),Ex.remove(k)},0)}}},[d,m,p,k]);const b=S.useCallback(E=>{if(!r&&!s||k.paused)return;const P=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,R=document.activeElement;if(P&&R){const _=E.currentTarget,[j,A]=Hk(_);j&&A?!E.shiftKey&&R===A?(E.preventDefault(),r&&Ar(j,{select:!0})):E.shiftKey&&R===j&&(E.preventDefault(),r&&Ar(A,{select:!0})):R===_&&E.preventDefault()}},[r,s,k.paused]);return v.jsx(Xi.div,{tabIndex:-1,...c,ref:w,onKeyDown:b})},"FocusScope"));function $k(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ar(r,{select:t}),document.activeElement!==n)return}un($k,"focusFirst");function Hk(e){const t=im(e),n=zh(t,e),r=zh(t.reverse(),e);return[n,r]}un(Hk,"getTabbableEdges");function im(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:un(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}un(im,"getTabbableCandidates");function zh(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Wk(r,{upTo:t})))return r}un(zh,"findVisible");function Wk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}un(Wk,"isHidden");function qk(e){return e instanceof HTMLInputElement&&"select"in e}un(qk,"isSelectableInput");function Ar(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qk(e)&&t&&e.select()}}un(Ar,"focus");var Ex=Gk();function Gk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Bh(e,t),e.unshift(t)},remove(t){e=Bh(e,t),e[0]?.resume()}}}un(Gk,"createFocusScopesStack");function Bh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}un(Bh,"arrayRemove");function Kk(e){return e.filter(t=>t.tagName!=="A")}un(Kk,"removeLinks");var dF=Object.defineProperty,fF=(e,t)=>dF(e,"name",{value:t,configurable:!0}),hF=S.forwardRef(fF(function(t,n){const{container:r,...s}=t,[a,l]=S.useState(!1);fi(()=>l(!0),[]);const c=r||a&&globalThis?.document?.body;return c?Mk.createPortal(v.jsx(Xi.div,{...s,ref:n}),c):null},"Portal")),pF=Object.defineProperty,Mr=(e,t)=>pF(e,"name",{value:t,configurable:!0});function Xk(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}Mr(Xk,"useStateMachine");var sm=Mr(e=>{const{present:t,children:n}=e,r=Yk(t),s=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),a=Qk(r.ref,Jk(s));return typeof n=="function"||r.isPresent?S.cloneElement(s,{ref:a}):null},"Presence");function Yk(e){const[t,n]=S.useState(),r=S.useRef(null),s=S.useRef(e),a=S.useRef("none"),l=S.useRef(void 0),c=e?"mounted":"unmounted",[d,f]=Xk(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{d==="mounted"?(a.current=l.current??Is(r.current),l.current=void 0):a.current="none"},[d]),fi(()=>{const m=r.current,p=s.current;if(p!==e){const w=a.current,k=Is(m);e?(l.current=k,f("MOUNT")):k==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&w!==k?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),fi(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,y=Mr(k=>{const E=Is(r.current).includes(CSS.escape(k.animationName));if(k.target===t&&E&&(f("ANIMATION_END"),!s.current)){const P=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=P)})}},"handleAnimationEnd"),w=Mr(k=>{k.target===t&&(a.current=Is(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:S.useCallback(m=>{if(m){const p=getComputedStyle(m);r.current=p,l.current=Is(p)}else r.current=null;n(m)},[])}}Mr(Yk,"usePresence");function Uh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Mr(Uh,"setRef");function Qk(...e){const t=S.useRef(e);return t.current=e,S.useCallback(n=>{const r=t.current;let s=!1;const a=r.map(l=>{const c=Uh(l,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let l=0;l<a.length;l++){const c=a[l];typeof c=="function"?c():Uh(r[l],null)}}},[])}Mr(Qk,"useStableComposedRefs");function Is(e){return e?.animationName||"none"}Mr(Is,"getAnimationName");function Jk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Mr(Jk,"getElementRef");var mF=Object.defineProperty,om=(e,t)=>mF(e,"name",{value:t,configurable:!0}),ql=0,Cs=null;function gF(e){return am(),e.children}om(gF,"FocusGuards");function am(){S.useEffect(()=>{Cs||(Cs={start:$h(),end:$h()});const{start:e,end:t}=Cs;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ql++,()=>{ql===1&&(Cs?.start.remove(),Cs?.end.remove(),Cs=null),ql=Math.max(0,ql-1)}},[])}om(am,"useFocusGuards");function $h(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}om($h,"createFocusGuard");var hr=function(){return hr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},hr.apply(this,arguments)};function Zk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function yF(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var du="right-scroll-bar-position",fu="width-before-scroll-bar",vF="with-scroll-bars-hidden",xF="--removed-body-scroll-bar-size";function Af(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wF(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var SF=typeof window<"u"?S.useLayoutEffect:S.useEffect,_x=new WeakMap;function kF(e,t){var n=wF(null,function(r){return e.forEach(function(s){return Af(s,r)})});return SF(function(){var r=_x.get(n);if(r){var s=new Set(r),a=new Set(e),l=n.current;s.forEach(function(c){a.has(c)||Af(c,null)}),a.forEach(function(c){s.has(c)||Af(c,l)})}_x.set(n,e)},[e]),n}function CF(e){return e}function bF(e,t){t===void 0&&(t=CF);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var d=function(){var m=l;l=[],m.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(m){l.push(m),f()},filter:function(m){return l=l.filter(m),n}}}};return s}function EF(e){e===void 0&&(e={});var t=bF(null);return t.options=hr({async:!0,ssr:!1},e),t}var eC=function(e){var t=e.sideCar,n=Zk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,hr({},n))};eC.isSideCarExport=!0;function _F(e,t){return e.useMedium(t),eC}var tC=EF(),If=function(){},sc=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:If,onWheelCapture:If,onTouchMoveCapture:If}),s=r[0],a=r[1],l=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,m=e.enabled,p=e.shards,y=e.sideCar,w=e.noRelative,k=e.noIsolation,b=e.inert,E=e.allowPinchZoom,P=e.as,R=P===void 0?"div":P,_=e.gapMode,j=Zk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,N=kF([n,t]),q=hr(hr({},j),s);return S.createElement(S.Fragment,null,m&&S.createElement(A,{sideCar:tC,removeScrollBar:f,shards:p,noRelative:w,noIsolation:k,inert:b,setCallbacks:a,allowPinchZoom:!!E,lockRef:n,gapMode:_}),l?S.cloneElement(S.Children.only(c),hr(hr({},q),{ref:N})):S.createElement(R,hr({},q,{className:d,ref:N}),c))});sc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sc.classNames={fullWidth:fu,zeroRight:du};var PF=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function TF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=PF();return t&&e.setAttribute("nonce",t),e}function RF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var IF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=TF())&&(RF(t,n),AF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},MF=function(){var e=IF();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nC=function(){var e=MF(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},NF={left:0,top:0,right:0,gap:0},Mf=function(e){return parseInt(e||"",10)||0},LF=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Mf(n),Mf(r),Mf(s)]},jF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return NF;var t=LF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},DF=nC(),Os="data-scroll-locked",OF=function(e,t,n,r){var s=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
284
|
+
.`.concat(vF,` {
|
|
285
|
+
overflow: hidden `).concat(r,`;
|
|
286
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
287
|
+
}
|
|
288
|
+
body[`).concat(Os,`] {
|
|
289
|
+
overflow: hidden `).concat(r,`;
|
|
290
|
+
overscroll-behavior: contain;
|
|
291
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
292
|
+
padding-left: `.concat(s,`px;
|
|
293
|
+
padding-top: `).concat(a,`px;
|
|
294
|
+
padding-right: `).concat(l,`px;
|
|
295
|
+
margin-left:0;
|
|
296
|
+
margin-top:0;
|
|
297
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
298
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.`).concat(du,` {
|
|
302
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.`).concat(fu,` {
|
|
306
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.`).concat(du," .").concat(du,` {
|
|
310
|
+
right: 0 `).concat(r,`;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.`).concat(fu," .").concat(fu,` {
|
|
314
|
+
margin-right: 0 `).concat(r,`;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
body[`).concat(Os,`] {
|
|
318
|
+
`).concat(xF,": ").concat(c,`px;
|
|
319
|
+
}
|
|
320
|
+
`)},Px=function(){var e=parseInt(document.body.getAttribute(Os)||"0",10);return isFinite(e)?e:0},FF=function(){S.useEffect(function(){return document.body.setAttribute(Os,(Px()+1).toString()),function(){var e=Px()-1;e<=0?document.body.removeAttribute(Os):document.body.setAttribute(Os,e.toString())}},[])},VF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;FF();var a=S.useMemo(function(){return jF(s)},[s]);return S.createElement(DF,{styles:OF(a,!t,s,n?"":"!important")})},Hh=!1;if(typeof window<"u")try{var Gl=Object.defineProperty({},"passive",{get:function(){return Hh=!0,!0}});window.addEventListener("test",Gl,Gl),window.removeEventListener("test",Gl,Gl)}catch{Hh=!1}var bs=Hh?{passive:!1}:!1,zF=function(e){return e.tagName==="TEXTAREA"},rC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zF(e)&&n[t]==="visible")},BF=function(e){return rC(e,"overflowY")},UF=function(e){return rC(e,"overflowX")},Tx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=iC(e,r);if(s){var a=sC(e,r),l=a[1],c=a[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$F=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},HF=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},iC=function(e,t){return e==="v"?BF(t):UF(t)},sC=function(e,t){return e==="v"?$F(t):HF(t)},WF=function(e,t){return e==="h"&&t==="rtl"?-1:1},qF=function(e,t,n,r,s){var a=WF(e,window.getComputedStyle(t).direction),l=a*r,c=n.target,d=t.contains(c),f=!1,m=l>0,p=0,y=0;do{if(!c)break;var w=sC(e,c),k=w[0],b=w[1],E=w[2],P=b-E-a*k;(k||P)&&iC(e,c)&&(p+=P,y+=k);var R=c.parentNode;c=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(m&&Math.abs(p)<1||!m&&Math.abs(y)<1)&&(f=!0),f},Kl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rx=function(e){return[e.deltaX,e.deltaY]},Ax=function(e){return e&&"current"in e?e.current:e},GF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},KF=function(e){return`
|
|
321
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
322
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
323
|
+
`)},XF=0,Es=[];function YF(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),s=S.useState(XF++)[0],a=S.useState(nC)[0],l=S.useRef(e);S.useEffect(function(){l.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var b=yF([e.lockRef.current],(e.shards||[]).map(Ax),!0).filter(Boolean);return b.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=S.useCallback(function(b,E){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var P=Kl(b),R=n.current,_="deltaX"in b?b.deltaX:R[0]-P[0],j="deltaY"in b?b.deltaY:R[1]-P[1],A,N=b.target,q=Math.abs(_)>Math.abs(j)?"h":"v";if("touches"in b&&q==="h"&&N.type==="range")return!1;var B=window.getSelection(),D=B&&B.anchorNode,I=D?D===N||D.contains(N):!1;if(I)return!1;var U=Tx(q,N);if(!U)return!0;if(U?A=q:(A=q==="v"?"h":"v",U=Tx(q,N)),!U)return!1;if(!r.current&&"changedTouches"in b&&(_||j)&&(r.current=A),!A)return!0;var z=r.current||A;return qF(z,E,b,z==="h"?_:j)},[]),d=S.useCallback(function(b){var E=b;if(!(!Es.length||Es[Es.length-1]!==a)){var P="deltaY"in E?Rx(E):Kl(E),R=t.current.filter(function(A){return A.name===E.type&&(A.target===E.target||E.target===A.shadowParent)&&GF(A.delta,P)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var _=(l.current.shards||[]).map(Ax).filter(Boolean).filter(function(A){return A.contains(E.target)}),j=_.length>0?c(E,_[0]):!l.current.noIsolation;j&&E.cancelable&&E.preventDefault()}}},[]),f=S.useCallback(function(b,E,P,R){var _={name:b,delta:E,target:P,should:R,shadowParent:QF(P)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(j){return j!==_})},1)},[]),m=S.useCallback(function(b){n.current=Kl(b),r.current=void 0},[]),p=S.useCallback(function(b){f(b.type,Rx(b),b.target,c(b,e.lockRef.current))},[]),y=S.useCallback(function(b){f(b.type,Kl(b),b.target,c(b,e.lockRef.current))},[]);S.useEffect(function(){return Es.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",d,bs),document.addEventListener("touchmove",d,bs),document.addEventListener("touchstart",m,bs),function(){Es=Es.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,bs),document.removeEventListener("touchmove",d,bs),document.removeEventListener("touchstart",m,bs)}},[]);var w=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(a,{styles:KF(s)}):null,w?S.createElement(VF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JF=_F(tC,YF);var oC=S.forwardRef(function(e,t){return S.createElement(sc,hr({},e,{ref:t,sideCar:JF}))});oC.classNames=sc.classNames;var ZF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_s=new WeakMap,Xl=new WeakMap,Yl={},Nf=0,aC=function(e){return e&&(e.host||aC(e.parentNode))},e4=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=aC(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},t4=function(e,t,n,r){var s=e4(t,Array.isArray(e)?e:[e]);Yl[n]||(Yl[n]=new WeakMap);var a=Yl[n],l=[],c=new Set,d=new Set(s),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};s.forEach(f);var m=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(y){if(c.has(y))m(y);else try{var w=y.getAttribute(r),k=w!==null&&w!=="false",b=(_s.get(y)||0)+1,E=(a.get(y)||0)+1;_s.set(y,b),a.set(y,E),l.push(y),b===1&&k&&Xl.set(y,!0),E===1&&y.setAttribute(n,"true"),k||y.setAttribute(r,"true")}catch(P){console.error("aria-hidden: cannot operate on ",y,P)}})};return m(t),c.clear(),Nf++,function(){l.forEach(function(p){var y=_s.get(p)-1,w=a.get(p)-1;_s.set(p,y),a.set(p,w),y||(Xl.has(p)||p.removeAttribute(r),Xl.delete(p)),w||p.removeAttribute(n)}),Nf--,Nf||(_s=new WeakMap,_s=new WeakMap,Xl=new WeakMap,Yl={})}},n4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=ZF(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),t4(r,s,n,"aria-hidden")):function(){return null}},r4=Object.defineProperty,zn=(e,t)=>r4(e,"name",{value:t,configurable:!0}),lm="Dialog",[lC,qz]=_k(lm),[i4,yr]=lC(lm),uC=zn(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=S.useRef(null),d=S.useRef(null),[f,m]=Rk({prop:r,defaultProp:s??!1,onChange:a,caller:lm}),[p,y]=S.useState(0),[w,k]=S.useState(0);return v.jsx(i4,{scope:t,triggerRef:c,contentRef:d,contentId:cu(),titleId:cu(),descriptionId:cu(),titlePresent:p>0,descriptionPresent:w>0,setTitleCount:y,setDescriptionCount:k,open:f,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(b=>!b),[m]),modal:l,children:n})},"Dialog"),cC="DialogPortal",[s4,dC]=lC(cC,{forceMount:void 0}),fC=zn(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=yr(cC,t);return v.jsx(s4,{scope:t,forceMount:n,children:S.Children.map(r,l=>v.jsx(sm,{present:n||a.open,children:v.jsx(hF,{asChild:!0,container:s,children:l})}))})},"DialogPortal"),Wh="DialogOverlay",hC=S.forwardRef(zn(function(t,n){const r=dC(Wh,t.__scopeDialog),{forceMount:s=r.forceMount,...a}=t,l=yr(Wh,t.__scopeDialog);return l.modal?v.jsx(sm,{present:s||l.open,children:v.jsx(a4,{...a,ref:n})}):null},"DialogOverlay")),o4=nm("DialogOverlay.RemoveScroll"),a4=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=yr(Wh,r),l=zk(),c=Qs(n,l);return v.jsx(oC,{as:o4,allowPinchZoom:!0,shards:[a.contentRef],children:v.jsx(Xi.div,{"data-state":um(a.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),ha="DialogContent",pC=S.forwardRef(zn(function(t,n){const r=dC(ha,t.__scopeDialog),{forceMount:s=r.forceMount,...a}=t,l=yr(ha,t.__scopeDialog);return v.jsx(sm,{present:s||l.open,children:l.modal?v.jsx(l4,{...a,ref:n}):v.jsx(u4,{...a,ref:n})})},"DialogContent")),l4=S.forwardRef(zn(function(t,n){const r=yr(ha,t.__scopeDialog),s=S.useRef(null),a=Qs(n,r.contentRef,s);return S.useEffect(()=>{const l=s.current;if(l)return n4(l)},[]),v.jsx(mC,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:li(t.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:li(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:li(t.onFocusOutside,l=>l.preventDefault())})},"DialogContentModal")),u4=S.forwardRef(zn(function(t,n){const r=yr(ha,t.__scopeDialog),s=S.useRef(!1),a=S.useRef(!1);return v.jsx(mC,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),l.defaultPrevented||(s.current||r.triggerRef.current?.focus(),l.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;r.triggerRef.current?.contains(c)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})},"DialogContentNonModal")),mC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=t,d=yr(ha,r);return am(),v.jsx(v.Fragment,{children:v.jsx(cF,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:l,children:v.jsx(aF,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionPresent?d.descriptionId:void 0,"aria-labelledby":d.titlePresent?d.titleId:void 0,"data-state":um(d.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})},"DialogContentImpl")),c4="DialogTitle",gC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=yr(c4,r),{setTitleCount:l}=a;return fi(()=>(l(c=>c+1),()=>l(c=>c-1)),[l]),v.jsx(Xi.h2,{id:a.titleId,...s,ref:n})},"DialogTitle")),d4="DialogDescription",yC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=yr(d4,r),{setDescriptionCount:l}=a;return fi(()=>(l(c=>c+1),()=>l(c=>c-1)),[l]),v.jsx(Xi.p,{id:a.descriptionId,...s,ref:n})},"DialogDescription")),f4="DialogClose",vC=S.forwardRef(zn(function(t,n){const{__scopeDialog:r,...s}=t,a=yr(f4,r);return v.jsx(Xi.button,{type:"button",...s,ref:n,onClick:li(t.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function um(e){return e?"open":"closed"}zn(um,"getState");function Pa(e){const t=S.useRef(null);return S.useEffect(()=>(t.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>{const n=t.current;n?.isConnected&&requestAnimationFrame(()=>n.focus())}),[]),v.jsx(uC,{open:!0,onOpenChange:n=>{n||e.onClose()},children:v.jsxs(fC,{children:[v.jsx(hC,{className:"modal-backdrop"}),v.jsxs(pC,{id:e.contentId,className:"modal"+(e.wide?" modal-wide":"")+(e.className?` ${e.className}`:""),children:[v.jsxs("div",{className:"modal-head",children:[v.jsxs("div",{children:[v.jsx(gC,{asChild:!0,children:v.jsx("h3",{children:e.title})}),e.description&&v.jsx(yC,{className:"modal-description",children:e.description})]}),v.jsx(vC,{asChild:!0,children:v.jsx("button",{className:"icon-btn","aria-label":`Close ${e.title}`,children:v.jsx(Ce,{name:"close"})})})]}),e.tabs,v.jsx("div",{className:"modal-body",children:e.children})]})]})})}const h4="modulepreload",p4=function(e){return"/"+e},Ix={},cm=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=l(n.map(f=>{if(f=p4(f),f in Ix)return;Ix[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":h4,m||(y.as="script"),y.crossOrigin="",y.href=f,d&&y.setAttribute("nonce",d),document.head.appendChild(y),m)return new Promise((w,k)=>{y.addEventListener("load",w),y.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};let m4=0;const g4=.25,y4=8;let Mx=Promise.resolve();function Nx(){return typeof document<"u"&&document.documentElement.classList.contains("theme-dark")?"dark":"default"}function v4(){const[e,t]=S.useState(Nx);return S.useEffect(()=>{const n=document.documentElement,r=()=>t(Nx()),s=new MutationObserver(r);return s.observe(n,{attributes:!0,attributeFilter:["class"]}),r(),()=>s.disconnect()},[]),e}function x4(e,t,n,r){const s=Mx.then(async()=>{if(!r())return"";const{default:a}=await cm(async()=>{const{default:c}=await import("./mermaid.core-11YjnhKz.js").then(d=>d.bp);return{default:c}},[]);if(!r())return"";if(a.initialize({startOnLoad:!1,securityLevel:"strict",theme:n,fontFamily:"Arial, sans-serif",htmlLabels:!1,flowchart:{htmlLabels:!1},suppressErrorRendering:!0}),t.length>5e4)throw new Error("Diagram exceeds the rendering limit.");if(/^\s*---(?:\r?\n|$)|%%\s*\{/.test(t))throw new Error("Diagram configuration overrides are not supported.");if(await document.fonts.ready,!r())return"";const l=document.createElement("div");l.style.fontFamily="Arial, sans-serif",l.style.fontSize="16px",l.style.lineHeight="normal",l.style.position="absolute",l.style.visibility="hidden",document.body.append(l);try{const c=await a.render(e,t,l),f=new DOMParser().parseFromString(c.svg,"image/svg+xml").documentElement,m=f.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number);if(f.localName!=="svg"||!m||m.length!==4||!m.every(Number.isFinite)||m[2]<=0||m[3]<=0)throw new Error("Diagram has no usable dimensions.");return f.setAttribute("width",String(m[2])),f.setAttribute("height",String(m[3])),URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(f)],{type:"image/svg+xml"}))}finally{l.remove()}});return Mx=s.then(()=>{},()=>{}),s}function w4(e){return Math.min(y4,Math.max(g4,e))}function S4(e){const t=S.useRef(null),n=S.useRef(null),[r,s]=S.useState(1),[a,l]=S.useState({x:0,y:0}),[c,d]=S.useState(!1),f=()=>{s(1),l({x:0,y:0})},m=(p,y,w)=>{const k=w4(p);if(k===r)return;const b=t.current?.getBoundingClientRect();if(b){const E=(y??b.left+b.width/2)-b.left-b.width/2,P=(w??b.top+b.height/2)-b.top-b.height/2,R=k/r;l(_=>({x:E-R*(E-_.x),y:P-R*(P-_.y)}))}s(k)};return S.useEffect(()=>{const p=y=>{y.key==="+"||y.key==="="?(y.preventDefault(),m(r*1.25)):y.key==="-"?(y.preventDefault(),m(r/1.25)):y.key==="0"&&(y.preventDefault(),f())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)}),v.jsx(uC,{open:!0,onOpenChange:p=>{p||e.onClose()},children:v.jsxs(fC,{children:[v.jsx(hC,{className:"mermaid-fullscreen-backdrop"}),v.jsxs(pC,{className:"mermaid-fullscreen","data-mermaid-theme":e.theme,"aria-describedby":"mermaid-fullscreen-help",children:[v.jsx(gC,{className:"mermaid-fullscreen-title",children:"Diagram viewer"}),v.jsxs("div",{className:"mermaid-fullscreen-tools",children:[v.jsx("button",{className:"icon-btn","aria-label":"Zoom out",title:"Zoom out (−)",onClick:()=>m(r/1.25),children:v.jsx(Ce,{name:"minus"})}),v.jsxs("button",{className:"mermaid-zoom-value",onClick:f,title:"Reset zoom and position",children:[Math.round(r*100),"%"]}),v.jsx("button",{className:"icon-btn","aria-label":"Zoom in",title:"Zoom in (+)",onClick:()=>m(r*1.25),children:v.jsx(Ce,{name:"plus"})}),v.jsx(vC,{asChild:!0,children:v.jsx("button",{className:"icon-btn","aria-label":"Close diagram viewer",title:"Close (Esc)",children:v.jsx(Ce,{name:"close"})})})]}),v.jsx("div",{ref:t,tabIndex:0,role:"region","aria-label":"Diagram navigation; use arrow keys to pan",onKeyDown:p=>{const y={ArrowLeft:[40,0],ArrowRight:[-40,0],ArrowUp:[0,40],ArrowDown:[0,-40]}[p.key];y&&(p.preventDefault(),l(w=>({x:w.x+y[0],y:w.y+y[1]})))},className:"mermaid-fullscreen-viewport"+(c?" dragging":""),onWheel:p=>{p.preventDefault(),m(r*Math.exp(-p.deltaY*.0015),p.clientX,p.clientY)},onDoubleClick:p=>m(r*1.5,p.clientX,p.clientY),onPointerDown:p=>{p.button===0&&(n.current={pointerId:p.pointerId,startX:p.clientX,startY:p.clientY,panX:a.x,panY:a.y},p.currentTarget.setPointerCapture(p.pointerId),d(!0))},onPointerMove:p=>{const y=n.current;!y||y.pointerId!==p.pointerId||l({x:y.panX+p.clientX-y.startX,y:y.panY+p.clientY-y.startY})},onPointerUp:p=>{n.current?.pointerId===p.pointerId&&(n.current=null,d(!1),p.currentTarget.releasePointerCapture(p.pointerId))},onPointerCancel:()=>{n.current=null,d(!1)},children:v.jsx("div",{className:"mermaid-fullscreen-canvas",style:{transform:`translate(${a.x}px, ${a.y}px) scale(${r})`},children:v.jsx("img",{src:e.svg,alt:"Mermaid diagram"})})}),v.jsx(yC,{id:"mermaid-fullscreen-help",className:"mermaid-fullscreen-help",children:"Scroll or +/− to zoom · drag or arrow keys to move · 0 to reset"})]})]})})}function xC({source:e}){const t=S.useId(),[n,r]=S.useState(""),[s,a]=S.useState(""),[l,c]=S.useState("default"),[d,f]=S.useState(!1),m=v4();return S.useEffect(()=>{let p=!0,y="";const w=`mermaid-${++m4}-${t.replace(/[^a-zA-Z0-9_-]/g,"")}`;return r(""),a(""),f(!1),x4(w,e,m,()=>p).then(k=>{p?(c(m),y=k,r(k)):URL.revokeObjectURL(k)}).catch(k=>{p&&a(k instanceof Error?k.message:String(k))}),()=>{p=!1,y&&URL.revokeObjectURL(y)}},[t,e,m]),v.jsxs("div",{className:"mermaid-block",children:[s?v.jsxs("p",{className:"markdown-mermaid-error",role:"status",children:["Unable to render diagram: ",s]}):n?v.jsxs("div",{className:"markdown-mermaid","data-mermaid-theme":l,children:[v.jsx("button",{className:"icon-btn markdown-mermaid-expand","aria-label":"View diagram fullscreen",title:"View diagram fullscreen",onClick:()=>f(!0),children:v.jsx(Ce,{name:"maximize"})}),v.jsx("div",{className:"markdown-mermaid-diagram",tabIndex:0,role:"region","aria-label":"Scrollable Mermaid diagram",children:v.jsx("img",{src:n,alt:"Mermaid diagram; original source follows",onError:()=>a("Diagram image could not be displayed.")})})]}):v.jsx("div",{className:"markdown-mermaid-loading",role:"status",children:"Rendering diagram…"}),v.jsxs("details",{className:"mermaid-source",open:s?!0:void 0,children:[v.jsx("summary",{children:"Mermaid source"}),v.jsx("pre",{children:v.jsx("code",{children:e})})]}),d&&n&&!s&&v.jsx(S4,{svg:n,theme:l,onClose:()=>f(!1)})]})}const k4=S.memo(function(t){return v.jsx("article",{className:"markdown-body",ref:t.contentRef,children:v.jsx(wk,{remarkPlugins:[Sk],components:{a:({children:n,...r})=>v.jsx("a",{...r,target:"_blank",rel:"noreferrer",children:n}),pre:({children:n})=>{const r=S.isValidElement(n)?n:null;return r?.props.className==="language-mermaid"?v.jsx(xC,{source:String(r.props.children).replace(/\n$/,"")}):v.jsx("pre",{children:n})}},children:t.markdown})})});function wC(e){const{rec:t}=e,n=S.useRef(null),[r,s]=S.useState(""),[a,l]=S.useState(!1),[c,d]=S.useState(null),[f,m]=S.useState("loading"),[p,y]=S.useState(""),[w,k]=S.useState(0),[b,E]=S.useState(""),[P,R]=S.useState(0),[_,j]=S.useState(!1),[A,N]=S.useState(""),[q,B]=S.useState(!1),[D,I]=S.useState(!1),[U,z]=S.useState([]),[he,J]=S.useState(!1),[Z,ve]=S.useState(null),[Se,Q]=S.useState(!1),[pe,T]=S.useState("");S.useEffect(()=>{let ue=!0,ae=null;return m("loading"),Zu(t.id).then(me=>{if(ue){if(!me){m("missing");return}s(new TextDecoder("utf-8").decode(me)),ae=URL.createObjectURL(new Blob([me],{type:"text/markdown;charset=utf-8"})),d(ae),m("ready")}}).catch(()=>{ue&&m("error")}),()=>{ue=!1,ae&&URL.revokeObjectURL(ae)}},[t.id]),S.useEffect(()=>{const ue=()=>{const ae=window.getSelection(),me=n.current;if(!ae||ae.isCollapsed||!me){y(""),k(0);return}if(!me.contains(ae.anchorNode)||!me.contains(ae.focusNode)){y(""),k(0);return}const ke=ae.getRangeAt(0),xe=ae.toString(),$e=xe.length-xe.trimStart().length,Fe=xe.trim().slice(0,4e3),qe=document.createRange();qe.selectNodeContents(me),qe.setEnd(ke.startContainer,ke.startOffset);const st=qe.toString().length+$e;y(Fe),k(Kj(me.textContent,Fe,st))};return document.addEventListener("selectionchange",ue),()=>document.removeEventListener("selectionchange",ue)},[]);const F=()=>{p&&(E(p),R(w),j(!0),T(""))},X=async()=>{if(D){if(!b||!A.trim())return;z(ae=>[...ae,{selection:b,comment:A.trim(),occurrence:P}]),N(""),j(!1),T("Comment added to review");return}const ue=qj(b,A);if(!(!ue||!A.trim()||q)){B(!0),T("");try{await e.onSendText(ue,t.id||void 0),N(""),j(!1),T("Feedback sent")}catch(ae){T(`Send failed: ${String(ae)}`)}finally{B(!1)}}},M=async()=>{if(U.length===0||he)return;const ue=eD(r,U);J(!0),T("");try{e.onSendFile?await e.onSendFile({filename:Gj(t.filename),mime:"text/markdown",bytes:new TextEncoder().encode(ue)},t.id||void 0):await e.onSendText(ue,t.id||void 0),z([]),I(!1),T("Review submitted")}catch(ae){T(`Review send failed: ${String(ae)}`)}finally{J(!1)}},oe=async()=>{if(!(!Z||!e.onSendFile||Se)){Q(!0),T("");try{await e.onSendFile(Z,t.id||void 0),ve(null),T("Voice feedback sent")}catch(ue){T(`Voice send failed: ${String(ue)}`)}finally{Q(!1)}}};return v.jsx(Pa,{title:t.filename,description:"Markdown preview · select text to send precise feedback",onClose:e.onClose,wide:!0,className:"markdown-modal"+(a?" markdown-reader-fullscreen":""),children:v.jsxs("div",{className:"markdown-preview",children:[v.jsxs("div",{className:"markdown-review-toolbar",children:[v.jsxs("button",{className:"btn sm",type:"button","aria-label":a?"Exit reader fullscreen":"View reader fullscreen","aria-pressed":a,onMouseDown:ue=>ue.preventDefault(),onClick:()=>l(ue=>!ue),children:[v.jsx(Ce,{name:"maximize",size:14}),a?"Exit fullscreen":"Fullscreen"]}),v.jsxs("button",{className:"btn sm",disabled:!p,onMouseDown:ue=>ue.preventDefault(),onClick:F,children:[v.jsx(Ce,{name:"reply",size:14}),D?"Add review comment":"Quick message",p?` (${p.length})`:""]}),D?v.jsx("button",{className:"btn sm",onClick:()=>{I(!1),z([]),j(!1),T("Review discarded")},children:"Cancel review"}):v.jsxs("button",{className:"btn sm",onClick:()=>{I(!0),z([]),T("Review started — select passages to add comments")},children:[v.jsx(Ce,{name:"edit",size:14}),"Start review"]}),c&&v.jsxs("a",{className:"btn sm",href:c,download:t.filename,children:[v.jsx(Ce,{name:"download",size:14}),"Download"]}),e.onSendFile&&v.jsx(ZS,{disabled:!!Z||Se,onReady:ve,onError:T}),v.jsx("span",{className:"markdown-review-hint",children:p?"Selection ready for feedback":"Highlight any passage to comment on it"})]}),_&&v.jsxs("div",{className:"markdown-feedback",children:[v.jsx("blockquote",{children:b}),v.jsx("textarea",{className:"field",rows:3,autoFocus:!0,placeholder:"What should change?",value:A,onChange:ue=>N(ue.target.value)}),v.jsxs("div",{className:"markdown-feedback-actions",children:[v.jsx("button",{className:"btn sm",onClick:()=>j(!1),children:"Cancel"}),v.jsxs("button",{className:"btn sm primary",disabled:!A.trim()||q,onClick:()=>void X(),children:[v.jsx(Ce,{name:"send",size:14}),D?"Add to review":q?"Sending…":"Send feedback"]})]})]}),D&&v.jsxs("div",{className:"markdown-review-draft",children:[v.jsxs("div",{className:"markdown-review-draft-head",children:[v.jsxs("strong",{children:["Review · ",U.length," comment",U.length===1?"":"s"]}),v.jsxs("button",{className:"btn sm primary",disabled:U.length===0||he,onClick:()=>void M(),children:[v.jsx(Ce,{name:"send",size:14}),he?"Submitting…":"Submit review"]})]}),U.map((ue,ae)=>v.jsxs("div",{className:"markdown-review-comment",children:[v.jsx("span",{children:ae+1}),v.jsxs("div",{children:[v.jsx("blockquote",{children:ue.selection}),v.jsx("p",{children:ue.comment})]}),v.jsx("button",{className:"icon-btn",title:"Remove comment",onClick:()=>z(me=>me.filter((ke,xe)=>xe!==ae)),children:v.jsx(Ce,{name:"close",size:14})})]},`${ae}-${ue.selection.slice(0,24)}`))]}),Z&&v.jsx(JS,{att:Z,sending:Se,onSend:()=>void oe(),onDiscard:()=>ve(null)}),pe&&v.jsx("div",{className:"markdown-review-status",role:"status",children:pe}),v.jsxs("div",{className:"markdown-preview-scroll",children:[f==="loading"&&v.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),f==="missing"&&v.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),f==="error"&&v.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),f==="ready"&&v.jsx(k4,{markdown:r,contentRef:n})]})]})})}function SC(e){const{rec:t}=e,[n,r]=S.useState(null),[s,a]=S.useState(0),[l,c]=S.useState(!1),[d,f]=S.useState("loading");return S.useEffect(()=>{let m=!0,p=null;return f("loading"),Zu(t.id).then(y=>{if(m){if(!y){f("missing");return}a(y.byteLength),p=URL.createObjectURL(new Blob([y],{type:zp(t.mime,t.filename)})),r(p),f("ready")}}).catch(()=>{m&&f("error")}),()=>{m=!1,p&&URL.revokeObjectURL(p)}},[t.id,t.mime,t.filename]),v.jsx(Pa,{title:t.filename,description:"Transformed safe preview · external navigation disabled",onClose:e.onClose,wide:!0,className:"markdown-modal html-modal"+(l?" html-modal-fullscreen":""),children:v.jsxs("div",{className:"html-preview",children:[v.jsxs("div",{className:"html-preview-toolbar",children:[v.jsxs("span",{className:"html-preview-shield",children:[v.jsx(Ce,{name:"shield",size:14}),"Scripts, forms and network requests are blocked"]}),v.jsxs("span",{className:"html-preview-actions",children:[d==="ready"&&v.jsxs("button",{className:"btn sm",type:"button",title:"View HTML fullscreen","aria-label":"View HTML fullscreen",onClick:()=>c(!0),children:[v.jsx(Ce,{name:"maximize",size:14}),"Fullscreen"]}),n&&v.jsxs("a",{className:"btn sm",href:n,download:t.filename,children:[v.jsx(Ce,{name:"download",size:14}),"Download original",s?` · ${di(s)}`:""]})]})]}),v.jsxs("div",{className:"html-preview-frame",children:[d==="loading"&&v.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),d==="missing"&&v.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),d==="error"&&v.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),d==="ready"&&v.jsx("iframe",{className:"html-preview-iframe",title:`Sandboxed preview of ${t.filename}`,sandbox:tD,referrerPolicy:"no-referrer",src:`/api/html-preview/${encodeURIComponent(t.id)}`},t.id)]})]})})}function kC(e){const t=(n,r)=>{const{key:s}=n;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(s))return;n.preventDefault();const a=e.options.length-1,l=s==="Home"?0:s==="End"?a:s==="ArrowLeft"||s==="ArrowUp"?(r-1+e.options.length)%e.options.length:(r+1)%e.options.length,c=e.options[l];c&&(e.onChange(c.id),document.getElementById(`${e.idPrefix}-${c.id}`)?.focus())};return v.jsx("div",{className:e.className,role:"tablist","aria-label":e.label,children:e.options.map((n,r)=>v.jsxs("button",{id:`${e.idPrefix}-${n.id}`,type:"button",role:"tab","aria-selected":e.value===n.id,"aria-controls":e.panelId,tabIndex:e.value===n.id?0:-1,className:"tab"+(e.value===n.id?" active":""),onClick:()=>e.onChange(n.id),onKeyDown:s=>t(s,r),children:[n.label,n.count===void 0?null:v.jsxs(v.Fragment,{children:[" ",v.jsx("span",{children:n.count})]})]},n.id))})}function qh(e){const{message:t}=e,[n,r]=S.useState(null),[s,a]=S.useState(0),l=tS(t.wireId)??{id:t.wireId,dir:t.dir,filename:t.filename??"file",mime:t.mime??"application/octet-stream",size:s,date:t.date};S.useEffect(()=>{let f=!0,m=null;if(t.wireId)return Zu(t.wireId).then(p=>{!f||!p||(a(p.byteLength),m=URL.createObjectURL(new Blob([p],{type:zp(l.mime,l.filename)})),r(m))}).catch(()=>{}),()=>{f=!1,m&&URL.revokeObjectURL(m)}},[t.wireId,l.mime,l.filename]);const c=Ph(t)==="photo",d=Bs(l.mime,l.filename);return v.jsxs("div",{className:"shared-media-item"+(c?" shared-photo-item":""),children:[v.jsxs("button",{className:"shared-media-jump",onClick:()=>e.onJump(e.messageKey),children:[c&&n?v.jsx("img",{src:n,alt:l.filename}):v.jsx("span",{className:"shared-media-icon",children:v.jsx(Ce,{name:d?"mic":"copy",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:c?l.filename||"Photo":d?"Voice message":l.filename}),v.jsxs("span",{children:[e.versionLabel?`${e.versionLabel} · `:"",Hi(l.date),s?` · ${di(s)}`:""]})]})]}),v.jsxs("span",{className:"shared-media-actions",children:[HS(l.filename)&&n&&v.jsx("button",{className:"icon-btn",title:"Preview markdown",onClick:()=>e.onPreview(l),children:v.jsx(Ce,{name:"monitor",size:16})}),Ca(l.filename,l.mime)&&n&&v.jsx("button",{className:"icon-btn",title:"Preview HTML",onClick:()=>e.onPreview(l),children:v.jsx(Ce,{name:"monitor",size:16})}),v.jsx("a",{className:"icon-btn"+(n?"":" disabled"),href:n??void 0,download:l.filename,title:"Download",children:v.jsx(Ce,{name:"download",size:16})})]})]})}function C4(e){const[t,n]=S.useState(!1);if(e.versions.length===1){const r=e.versions[0];return v.jsx(qh,{message:r.message,messageKey:r.key,onJump:e.onJump,onPreview:e.onPreview})}return v.jsxs("div",{className:"file-version-stack"+(t?" expanded":""),children:[v.jsxs("button",{className:"file-version-stack-head",onClick:()=>n(r=>!r),children:[v.jsx("span",{className:"shared-media-icon",children:v.jsx(Ce,{name:"copy",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:e.filename}),v.jsxs("span",{children:[e.versions.length," versions · newest ",Hi(e.versions[0].message.date)]})]}),v.jsx(Ce,{name:t?"chevronDown":"chevron",size:16})]}),t&&v.jsx("div",{className:"file-version-stack-list",children:e.versions.map((r,s)=>v.jsx(qh,{message:r.message,messageKey:r.key,versionLabel:`Version ${e.versions.length-s}`,onJump:e.onJump,onPreview:e.onPreview},r.key))})]})}function b4(e){const[t,n]=S.useState("photo"),r=e.messages.map((f,m)=>({message:f,key:f.wireId||`${f.date}-${(e.indexOffset??0)+m}`})),s=r.filter(({message:f})=>Ph(f)==="photo"),a=r.filter(({message:f})=>Ph(f)==="file"),l=Yj(a),c=r.flatMap(({message:f,key:m})=>f.kind==="file"?[]:Xj(f.text).map(p=>({url:p,message:f,key:m}))),d=[{id:"photo",label:"Photos",count:s.length},{id:"file",label:"Files",count:a.length},{id:"link",label:"Links",count:c.length}];return v.jsx(Pa,{title:"Shared media",description:"Photos, files, and links from this conversation",onClose:e.onClose,wide:!0,className:"shared-media-modal",tabs:v.jsx(kC,{className:"shared-media-tabs",label:"Shared media type",options:d,value:t,onChange:n,idPrefix:"shared-media-tab",panelId:"shared-media-panel"}),children:v.jsxs("div",{id:"shared-media-panel",role:"tabpanel","aria-labelledby":`shared-media-tab-${t}`,className:"shared-media-list"+(t==="photo"?" photos":""),children:[t==="photo"&&s.map(f=>v.jsx(qh,{message:f.message,messageKey:f.key,onJump:e.onJump,onPreview:e.onPreview},f.key)),t==="file"&&l.map(f=>v.jsx(C4,{filename:f.filename,versions:f.versions,onJump:e.onJump,onPreview:e.onPreview},f.filename)),t==="link"&&c.map((f,m)=>v.jsxs("div",{className:"shared-media-item",children:[v.jsxs("a",{className:"shared-media-jump",href:f.url,target:"_blank",rel:"noreferrer",children:[v.jsx("span",{className:"shared-media-icon",children:v.jsx(Ce,{name:"link",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:f.url}),v.jsx("span",{children:Hi(f.message.date)})]})]}),v.jsx("button",{className:"icon-btn",title:"Jump to message",onClick:()=>e.onJump(f.key),children:v.jsx(Ce,{name:"reply",size:16})})]},`${f.key}-${f.url}-${m}`)),(t==="photo"&&s.length===0||t==="file"&&a.length===0||t==="link"&&c.length===0)&&v.jsxs("div",{className:"markdown-empty",children:["No ",t==="photo"?"photos":`${t}s`," in this chat yet."]})]})})}const E4=Object.freeze(["image/avif","image/bmp","image/heic","image/heif","image/jpeg","image/jpg","image/png","image/webp"]),_4=/\.(avif|bmp|heic|heif|jpe?g|png|webp)$/i;function CC(e,t=""){return E4.includes(String(e??"").toLowerCase())||_4.test(String(t??""))}function P4(e){return`${(String(e||"photo").trim()||"photo").replace(/\.[^./\\]+$/,"")||"photo"}.jpg`}function T4(e,t,n){const r=Math.max(1,Number(e)||1),s=Math.max(1,Number(t)||1),a=Math.max(1,Number(n)||1),l=Math.min(1,a/Math.max(r,s));return{width:Math.max(1,Math.round(r*l)),height:Math.max(1,Math.round(s*l))}}const R4=2048,A4=640,I4=.82,M4=[.84,.7,.56,.44],N4=.94;function L4(e){return new Promise((t,n)=>{const r=URL.createObjectURL(e),s=new Image,a=()=>URL.revokeObjectURL(r);s.onload=()=>t({image:s,release:a}),s.onerror=()=>{a(),n(new Error("This browser could not decode the selected image."))},s.src=r})}function j4(e,t){return new Promise((n,r)=>{e.toBlob(s=>s?n(s):r(new Error("This browser could not encode the optimized photo.")),"image/jpeg",t)})}async function D4(e,t){if(!CC(e.type,e.name))throw new Error("This image format cannot be optimized safely in this browser.");const n=Math.max(1,Math.floor(t*N4)),{image:r,release:s}=await L4(e),a=document.createElement("canvas"),l=a.getContext("2d",{alpha:!1});if(!l)throw s(),new Error("Photo optimization is unavailable in this browser.");try{let c=Math.min(R4,Math.max(r.naturalWidth,r.naturalHeight));for(;c>=A4;){const d=T4(r.naturalWidth,r.naturalHeight,c);a.width=d.width,a.height=d.height,l.fillStyle="#fff",l.fillRect(0,0,a.width,a.height),l.drawImage(r,0,0,a.width,a.height);for(const f of M4){const m=await j4(a,f);if(m.size<=n)return{filename:P4(e.name),mime:"image/jpeg",bytes:new Uint8Array(await m.arrayBuffer()),width:a.width,height:a.height,originalSize:e.size}}c=Math.floor(c*I4)}}finally{s(),a.width=1,a.height=1}throw new Error("The photo is still too large after optimization.")}const O4=5e4,F4=new Set(["http:","https:","mailto:"]);function bC(e){if(!(!e||e!==e.trim()||/[\u0000-\u001f\u007f]/u.test(e)))try{const t=new URL(e);return F4.has(t.protocol.toLowerCase())?e:void 0}catch{return}}function EC(e){const t="language-";return e?.startsWith(t)&&e.slice(t.length)||void 0}function Lx(e){return e.split(/(\n[ \t]*\n)/).map(t=>{if(/^\n[ \t]*\n$/.test(t))return t;const n=t.split(`
|
|
324
|
+
`),r=n.filter(l=>l.trim().length>0);if(r.length===0)return t;const s=r.map(l=>l.match(/^[ \t]+/)?.[0]??"");if(s.some(l=>l.length===0))return t;const a=Math.min(...s.map(l=>l.length));return n.map(l=>l.trim().length>0?l.slice(a):l).join(`
|
|
325
|
+
`)}).join("")}function V4(e){const t=[];let n=[],r="";for(const s of e.split(`
|
|
326
|
+
`))if(r){n.push(s);const a=/^ {0,3}(`+|~+)[ \t]*$/.exec(s);a&&a[1][0]===r[0]&&a[1].length>=r.length&&(t.push(n.join(`
|
|
327
|
+
`)),n=[],r="")}else{const a=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(s);a&&!(a[1][0]==="`"&&a[2].includes("`"))?(n.length&&t.push(Lx(n.join(`
|
|
328
|
+
`))),n=[s],r=a[1]):n.push(s)}return n.length&&t.push(r?n.join(`
|
|
329
|
+
`):Lx(n.join(`
|
|
330
|
+
`))),t.join(`
|
|
331
|
+
`)}function z4({children:e}){const t=S.isValidElement(e)?e:null,n=EC(t?.props.className);return n==="mermaid"?v.jsx(xC,{source:String(t?.props.children??"").replace(/\n$/,"")}):v.jsxs("div",{className:"message-code-block","data-language":n||void 0,children:[n&&v.jsx("div",{className:"message-code-language",children:n}),v.jsx("pre",{children:e})]})}const B4=[Sk],U4={a:({node:e,children:t,href:n,...r})=>{const s=bC(n);return s?v.jsx("a",{...r,href:s,target:"_blank",rel:"noopener noreferrer",children:t}):v.jsx("span",{className:"message-link-blocked",children:t})},img:({alt:e})=>v.jsxs("span",{className:"message-image-placeholder",children:["[image: ",e||"remote image blocked","]"]}),pre:z4,code:({node:e,className:t,children:n,...r})=>v.jsx("code",{className:t,"data-language":EC(t),...r,children:n})},jx=S.memo(function({text:t,className:n="bubble-text message-markdown"}){return t.length>O4?v.jsx("div",{className:`${n} message-markdown-plaintext`,"data-render-mode":"plaintext",children:t}):v.jsx("div",{className:n,"data-render-mode":"markdown",children:v.jsx(wk,{remarkPlugins:B4,components:U4,urlTransform:r=>bC(r)??"",children:V4(t)})})}),_C=2025;let Ql,Jl;function $4(e){return e<65?!1:e<91?!0:e<97?!1:e<123?!0:TC(e)}function PC(e){return e<48?!1:e<58?!0:e<65?!1:e<91||e===95?!0:e<97?!1:e<123?!0:TC(e)||H4(e)}function TC(e){return RC(e,Ql??(Ql=W4()))}function H4(e){return RC(e,Jl??(Jl=q4()))}function W4(){return AC("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 6 h 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 2 1 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 v 2 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 a 6 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 29 l g 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 7 p 13 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 5 1l s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 o 17 79 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r x o 3 o 19 22 6 0 1v c 1t 1 2 0 f 4 a 5p1 16 v 2q 36 6pq 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r 6d t 3 0 5s u 2 2 2 1 2 6 3 4 a 1 69 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 3dp 3 4gd 3 5rk g h9 1wj f1 15v 3t6 6 6jt")}function q4(){return AC("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1o 8 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 u 3 b l 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r el 1 1e 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 2p 0 n51 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 12 0 ig 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 7 9 w 4 8u 1 26 5 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 1w 8 2 0 3 0 2 3 2 4 2 0 f 1 2b h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 7 j 1m e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f 5j 7 3t 9 1i 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 1j 9 7e 3 a 1 2 0 1d 6 4 4 e a 44m 0 7 e 8uh r 1t3 9 2f 9 13 4 1o 6 q 9 ev 9 d2 0 2 1i 8 3 2a 0 c 1 f58 1 382 9 ef 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d 6t 1 2 9 6h 0 3 0 8 1 6 0 d7 6 32 6 6 9 3o7 9 gvt3 6n")}function RC(e,t){let n=0,r=t.length/2|0,s=0,a=0,l=0;for(;n<r;)if(s=(n+r)/2|0,a=t[2*s],l=t[2*s+1],e<a)r=s;else if(e>l)n=s+1;else return!0;return!1}function AC(e){let t=0;return e.split(" ").map(n=>t+=parseInt(n,36)|0)}class oc{constructor(t,n,r,s,a,l,c,d,f){this._raw2018=t,this._raw2019=n,this._raw2020=r,this._raw2021=s,this._raw2022=a,this._raw2023=l,this._raw2024=c,this._raw2025=d,this._raw2026=f}get es2018(){var t;return(t=this._set2018)!==null&&t!==void 0?t:this._set2018=new Set(this._raw2018.split(" "))}get es2019(){var t;return(t=this._set2019)!==null&&t!==void 0?t:this._set2019=new Set(this._raw2019.split(" "))}get es2020(){var t;return(t=this._set2020)!==null&&t!==void 0?t:this._set2020=new Set(this._raw2020.split(" "))}get es2021(){var t;return(t=this._set2021)!==null&&t!==void 0?t:this._set2021=new Set(this._raw2021.split(" "))}get es2022(){var t;return(t=this._set2022)!==null&&t!==void 0?t:this._set2022=new Set(this._raw2022.split(" "))}get es2023(){var t;return(t=this._set2023)!==null&&t!==void 0?t:this._set2023=new Set(this._raw2023.split(" "))}get es2024(){var t;return(t=this._set2024)!==null&&t!==void 0?t:this._set2024=new Set(this._raw2024.split(" "))}get es2025(){var t;return(t=this._set2025)!==null&&t!==void 0?t:this._set2025=new Set(this._raw2025.split(" "))}get es2026(){var t;return(t=this._set2026)!==null&&t!==void 0?t:this._set2026=new Set(this._raw2026.split(" "))}}const G4=new Set(["General_Category","gc"]),K4=new Set(["Script","Script_Extensions","sc","scx"]),X4=new oc("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct","","","","","","","",""),Ps=new oc("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy","Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo","Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho","Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi","Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi","Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz","","",""),Lf=new oc("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space","Extended_Pictographic","","EBase EComp EMod EPres ExtPict","","","","",""),Y4=new oc("","","","","","","Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence","","");function Dx(e,t,n){return G4.has(t)?e>=2018&&X4.es2018.has(n):K4.has(t)?e>=2018&&Ps.es2018.has(n)||e>=2019&&Ps.es2019.has(n)||e>=2020&&Ps.es2020.has(n)||e>=2021&&Ps.es2021.has(n)||e>=2022&&Ps.es2022.has(n)||e>=2023&&Ps.es2023.has(n):!1}function Q4(e,t){return e>=2018&&Lf.es2018.has(t)||e>=2019&&Lf.es2019.has(t)||e>=2021&&Lf.es2021.has(t)}function J4(e,t){return e>=2024&&Y4.es2024.has(t)}const Ox=8,Z4=9,IC=10,eV=11,tV=12,MC=13,ju=33,NC=35,Hs=36,LC=37,Ni=38,Li=40,ji=41,Zo=42,Du=43,dm=44,En=45,Ou=46,Ho=47,ai=48,nV=49,rV=55,Fu=57,Vu=58,jC=59,ea=60,ta=61,fm=62,Qn=63,DC=64,zu=65,iV=66,sV=68,OC=70,oV=80,aV=83,lV=87,uV=90,hm=95,Bu=97,jf=98,Ts=99,Gh=100,pm=102,FC=103,mm=105,Fx=107,gm=109,cV=110,dV=112,fV=113,hV=114,Uu=115,pV=116,hu=117,Kh=118,mV=119,gV=120,VC=121,yV=122,Di=91,Ct=92,Ir=93,Ds=94,zC=96,Oi=123,na=124,Fi=125,BC=126,vV=8204,xV=8205,wV=8232,SV=8233,kV=0,CV=1114111;function UC(e){return e>=zu&&e<=uV||e>=Bu&&e<=yV}function pu(e){return e>=ai&&e<=Fu}function bV(e){return e>=ai&&e<=rV}function Vx(e){return e>=ai&&e<=Fu||e>=zu&&e<=OC||e>=Bu&&e<=pm}function EV(e){return e===IC||e===MC||e===wV||e===SV}function _V(e){return e>=kV&&e<=CV}function Df(e){return e>=Bu&&e<=pm?e-Bu+10:e>=zu&&e<=OC?e-zu+10:e-ai}function Of(e){return e>=55296&&e<=56319}function Ff(e){return e>=56320&&e<=57343}function Vf(e,t){return(e-55296)*1024+(t-56320)+65536}class PV{constructor(){this.groupName=new Set}clear(){this.groupName.clear()}isEmpty(){return!this.groupName.size}hasInPattern(t){return this.groupName.has(t)}hasInScope(t){return this.hasInPattern(t)}addToScope(t){this.groupName.add(t)}enterDisjunction(){}enterAlternative(){}leaveDisjunction(){}}class pa{constructor(t,n){this.parent=t,this.base=n??this}separatedFrom(t){var n,r;return this.base===t.base&&this!==t||t.parent&&this.separatedFrom(t.parent)?!0:(r=(n=this.parent)===null||n===void 0?void 0:n.separatedFrom(t))!==null&&r!==void 0?r:!1}child(){return new pa(this,null)}sibling(){return new pa(this.parent,this.base)}}class TV{constructor(){this.branchID=new pa(null,null),this.groupNames=new Map}clear(){this.branchID=new pa(null,null),this.groupNames.clear()}isEmpty(){return!this.groupNames.size}enterDisjunction(){this.branchID=this.branchID.child()}enterAlternative(t){t!==0&&(this.branchID=this.branchID.sibling())}leaveDisjunction(){this.branchID=this.branchID.parent}hasInPattern(t){return this.groupNames.has(t)}hasInScope(t){const n=this.groupNames.get(t);if(!n)return!1;for(const r of n)if(!r.separatedFrom(this.branchID))return!0;return!1}addToScope(t){const n=this.groupNames.get(t);if(n){n.push(this.branchID);return}this.groupNames.set(t,[this.branchID])}}const zx={at(e,t,n){return n<t?e.charCodeAt(n):-1},width(e){return 1}},RV={at(e,t,n){return n<t?e.codePointAt(n):-1},width(e){return e>65535?2:1}};class AV{constructor(){this._impl=zx,this._s="",this._i=0,this._end=0,this._cp1=-1,this._w1=1,this._cp2=-1,this._w2=1,this._cp3=-1,this._w3=1,this._cp4=-1}get source(){return this._s}get index(){return this._i}get currentCodePoint(){return this._cp1}get nextCodePoint(){return this._cp2}get nextCodePoint2(){return this._cp3}get nextCodePoint3(){return this._cp4}reset(t,n,r,s){this._impl=s?RV:zx,this._s=t,this._end=r,this.rewind(n)}rewind(t){const n=this._impl;this._i=t,this._cp1=n.at(this._s,this._end,t),this._w1=n.width(this._cp1),this._cp2=n.at(this._s,this._end,t+this._w1),this._w2=n.width(this._cp2),this._cp3=n.at(this._s,this._end,t+this._w1+this._w2),this._w3=n.width(this._cp3),this._cp4=n.at(this._s,this._end,t+this._w1+this._w2+this._w3)}advance(){if(this._cp1!==-1){const t=this._impl;this._i+=this._w1,this._cp1=this._cp2,this._w1=this._w2,this._cp2=this._cp3,this._w2=t.width(this._cp2),this._cp3=this._cp4,this._w3=t.width(this._cp3),this._cp4=t.at(this._s,this._end,this._i+this._w1+this._w2+this._w3)}}eat(t){return this._cp1===t?(this.advance(),!0):!1}eat2(t,n){return this._cp1===t&&this._cp2===n?(this.advance(),this.advance(),!0):!1}eat3(t,n,r){return this._cp1===t&&this._cp2===n&&this._cp3===r?(this.advance(),this.advance(),this.advance(),!0):!1}}class IV extends SyntaxError{constructor(t,n){super(t),this.index=n}}function MV(e,t,n,r){let s="";if(e.kind==="literal"){const a=e.source.slice(e.start,e.end);a&&(s=`: ${a}`)}else if(e.kind==="pattern"){const a=e.source.slice(e.start,e.end),l=`${t.unicode?"u":""}${t.unicodeSets?"v":""}`;s=`: /${a}/${l}`}return new IV(`Invalid regular expression${s}: ${r}`,n)}const NV=new Set([Ds,Hs,Ct,Ou,Zo,Du,Qn,Li,ji,Di,Ir,Oi,Fi,na]),LV=new Set([Ni,ju,NC,Hs,LC,Zo,Du,dm,Ou,Vu,jC,ea,ta,fm,Qn,DC,Ds,zC,BC]),jV=new Set([Li,ji,Di,Ir,Oi,Fi,Ho,En,Ct,na]),DV=new Set([Ni,En,ju,NC,LC,dm,Vu,jC,ea,ta,fm,DC,zC,BC]),$C={global:FC,ignoreCase:mm,multiline:gm,unicode:hu,sticky:VC,dotAll:Uu,hasIndices:Gh,unicodeSets:Kh},OV=Object.fromEntries(Object.entries($C).map(([e,t])=>[t,e]));function Bx(e){return NV.has(e)}function Ux(e){return LV.has(e)}function FV(e){return jV.has(e)}function VV(e){return DV.has(e)}function zV(e){return $4(e)||e===Hs||e===hm}function BV(e){return PC(e)||e===Hs||e===vV||e===xV}function HC(e){return UC(e)||e===hm}function UV(e){return HC(e)||pu(e)}function $V(e){return e===mm||e===gm||e===Uu}class HV{constructor(t){this._reader=new AV,this._unicodeMode=!1,this._unicodeSetsMode=!1,this._nFlag=!1,this._lastIntValue=0,this._lastRange={min:0,max:Number.POSITIVE_INFINITY},this._lastStrValue="",this._lastAssertionIsQuantifiable=!1,this._numCapturingParens=0,this._backreferenceNames=new Set,this._srcCtx=null,this._options=t??{},this._groupSpecifiers=this.ecmaVersion>=2025?new TV:new PV}validateLiteral(t,n=0,r=t.length){if(this._srcCtx={source:t,start:n,end:r,kind:"literal"},this._unicodeSetsMode=this._unicodeMode=this._nFlag=!1,this.reset(t,n,r),this.onLiteralEnter(n),this.eat(Ho)&&this.eatRegExpBody()&&this.eat(Ho)){const s=this.index,a=t.includes("u",s),l=t.includes("v",s);this.validateFlagsInternal(t,s,r),this.validatePatternInternal(t,n+1,s-1,{unicode:a,unicodeSets:l})}else if(n>=r)this.raise("Empty");else{const s=String.fromCodePoint(this.currentCodePoint);this.raise(`Unexpected character '${s}'`)}this.onLiteralLeave(n,r)}validateFlags(t,n=0,r=t.length){this._srcCtx={source:t,start:n,end:r,kind:"flags"},this.validateFlagsInternal(t,n,r)}validatePattern(t,n=0,r=t.length,s=void 0){this._srcCtx={source:t,start:n,end:r,kind:"pattern"},this.validatePatternInternal(t,n,r,s)}validatePatternInternal(t,n=0,r=t.length,s=void 0){const a=this._parseFlagsOptionToMode(s,r);this._unicodeMode=a.unicodeMode,this._nFlag=a.nFlag,this._unicodeSetsMode=a.unicodeSetsMode,this.reset(t,n,r),this.consumePattern(),!this._nFlag&&this.ecmaVersion>=2018&&!this._groupSpecifiers.isEmpty()&&(this._nFlag=!0,this.rewind(n),this.consumePattern())}validateFlagsInternal(t,n,r){const s=this.parseFlags(t,n,r);this.onRegExpFlags(n,r,s)}_parseFlagsOptionToMode(t,n){let r=!1,s=!1;t&&this.ecmaVersion>=2015&&(typeof t=="object"?(r=!!t.unicode,this.ecmaVersion>=2024&&(s=!!t.unicodeSets)):r=t),r&&s&&this.raise("Invalid regular expression flags",{index:n+1,unicode:r,unicodeSets:s});const a=r||s,l=r&&this.ecmaVersion>=2018||s||!!(this._options.strict&&this.ecmaVersion>=2023);return{unicodeMode:a,nFlag:l,unicodeSetsMode:s}}get strict(){return!!this._options.strict||this._unicodeMode}get ecmaVersion(){var t;return(t=this._options.ecmaVersion)!==null&&t!==void 0?t:_C}onLiteralEnter(t){this._options.onLiteralEnter&&this._options.onLiteralEnter(t)}onLiteralLeave(t,n){this._options.onLiteralLeave&&this._options.onLiteralLeave(t,n)}onRegExpFlags(t,n,r){this._options.onRegExpFlags&&this._options.onRegExpFlags(t,n,r),this._options.onFlags&&this._options.onFlags(t,n,r.global,r.ignoreCase,r.multiline,r.unicode,r.sticky,r.dotAll,r.hasIndices)}onPatternEnter(t){this._options.onPatternEnter&&this._options.onPatternEnter(t)}onPatternLeave(t,n){this._options.onPatternLeave&&this._options.onPatternLeave(t,n)}onDisjunctionEnter(t){this._options.onDisjunctionEnter&&this._options.onDisjunctionEnter(t)}onDisjunctionLeave(t,n){this._options.onDisjunctionLeave&&this._options.onDisjunctionLeave(t,n)}onAlternativeEnter(t,n){this._options.onAlternativeEnter&&this._options.onAlternativeEnter(t,n)}onAlternativeLeave(t,n,r){this._options.onAlternativeLeave&&this._options.onAlternativeLeave(t,n,r)}onGroupEnter(t){this._options.onGroupEnter&&this._options.onGroupEnter(t)}onGroupLeave(t,n){this._options.onGroupLeave&&this._options.onGroupLeave(t,n)}onModifiersEnter(t){this._options.onModifiersEnter&&this._options.onModifiersEnter(t)}onModifiersLeave(t,n){this._options.onModifiersLeave&&this._options.onModifiersLeave(t,n)}onAddModifiers(t,n,r){this._options.onAddModifiers&&this._options.onAddModifiers(t,n,r)}onRemoveModifiers(t,n,r){this._options.onRemoveModifiers&&this._options.onRemoveModifiers(t,n,r)}onCapturingGroupEnter(t,n){this._options.onCapturingGroupEnter&&this._options.onCapturingGroupEnter(t,n)}onCapturingGroupLeave(t,n,r){this._options.onCapturingGroupLeave&&this._options.onCapturingGroupLeave(t,n,r)}onQuantifier(t,n,r,s,a){this._options.onQuantifier&&this._options.onQuantifier(t,n,r,s,a)}onLookaroundAssertionEnter(t,n,r){this._options.onLookaroundAssertionEnter&&this._options.onLookaroundAssertionEnter(t,n,r)}onLookaroundAssertionLeave(t,n,r,s){this._options.onLookaroundAssertionLeave&&this._options.onLookaroundAssertionLeave(t,n,r,s)}onEdgeAssertion(t,n,r){this._options.onEdgeAssertion&&this._options.onEdgeAssertion(t,n,r)}onWordBoundaryAssertion(t,n,r,s){this._options.onWordBoundaryAssertion&&this._options.onWordBoundaryAssertion(t,n,r,s)}onAnyCharacterSet(t,n,r){this._options.onAnyCharacterSet&&this._options.onAnyCharacterSet(t,n,r)}onEscapeCharacterSet(t,n,r,s){this._options.onEscapeCharacterSet&&this._options.onEscapeCharacterSet(t,n,r,s)}onUnicodePropertyCharacterSet(t,n,r,s,a,l,c){this._options.onUnicodePropertyCharacterSet&&this._options.onUnicodePropertyCharacterSet(t,n,r,s,a,l,c)}onCharacter(t,n,r){this._options.onCharacter&&this._options.onCharacter(t,n,r)}onBackreference(t,n,r){this._options.onBackreference&&this._options.onBackreference(t,n,r)}onCharacterClassEnter(t,n,r){this._options.onCharacterClassEnter&&this._options.onCharacterClassEnter(t,n,r)}onCharacterClassLeave(t,n,r){this._options.onCharacterClassLeave&&this._options.onCharacterClassLeave(t,n,r)}onCharacterClassRange(t,n,r,s){this._options.onCharacterClassRange&&this._options.onCharacterClassRange(t,n,r,s)}onClassIntersection(t,n){this._options.onClassIntersection&&this._options.onClassIntersection(t,n)}onClassSubtraction(t,n){this._options.onClassSubtraction&&this._options.onClassSubtraction(t,n)}onClassStringDisjunctionEnter(t){this._options.onClassStringDisjunctionEnter&&this._options.onClassStringDisjunctionEnter(t)}onClassStringDisjunctionLeave(t,n){this._options.onClassStringDisjunctionLeave&&this._options.onClassStringDisjunctionLeave(t,n)}onStringAlternativeEnter(t,n){this._options.onStringAlternativeEnter&&this._options.onStringAlternativeEnter(t,n)}onStringAlternativeLeave(t,n,r){this._options.onStringAlternativeLeave&&this._options.onStringAlternativeLeave(t,n,r)}get index(){return this._reader.index}get currentCodePoint(){return this._reader.currentCodePoint}get nextCodePoint(){return this._reader.nextCodePoint}get nextCodePoint2(){return this._reader.nextCodePoint2}get nextCodePoint3(){return this._reader.nextCodePoint3}reset(t,n,r){this._reader.reset(t,n,r,this._unicodeMode)}rewind(t){this._reader.rewind(t)}advance(){this._reader.advance()}eat(t){return this._reader.eat(t)}eat2(t,n){return this._reader.eat2(t,n)}eat3(t,n,r){return this._reader.eat3(t,n,r)}raise(t,n){var r,s,a;throw MV(this._srcCtx,{unicode:(r=n?.unicode)!==null&&r!==void 0?r:this._unicodeMode&&!this._unicodeSetsMode,unicodeSets:(s=n?.unicodeSets)!==null&&s!==void 0?s:this._unicodeSetsMode},(a=n?.index)!==null&&a!==void 0?a:this.index,t)}eatRegExpBody(){const t=this.index;let n=!1,r=!1;for(;;){const s=this.currentCodePoint;if(s===-1||EV(s)){const a=n?"character class":"regular expression";this.raise(`Unterminated ${a}`)}if(r)r=!1;else if(s===Ct)r=!0;else if(s===Di)n=!0;else if(s===Ir)n=!1;else if(s===Ho&&!n||s===Zo&&this.index===t)break;this.advance()}return this.index!==t}consumePattern(){const t=this.index;this._numCapturingParens=this.countCapturingParens(),this._groupSpecifiers.clear(),this._backreferenceNames.clear(),this.onPatternEnter(t),this.consumeDisjunction();const n=this.currentCodePoint;if(this.currentCodePoint!==-1){n===ji&&this.raise("Unmatched ')'"),n===Ct&&this.raise("\\ at end of pattern"),(n===Ir||n===Fi)&&this.raise("Lone quantifier brackets");const r=String.fromCodePoint(n);this.raise(`Unexpected character '${r}'`)}for(const r of this._backreferenceNames)this._groupSpecifiers.hasInPattern(r)||this.raise("Invalid named capture referenced");this.onPatternLeave(t,this.index)}countCapturingParens(){const t=this.index;let n=!1,r=!1,s=0,a=0;for(;(a=this.currentCodePoint)!==-1;)r?r=!1:a===Ct?r=!0:a===Di?n=!0:a===Ir?n=!1:a===Li&&!n&&(this.nextCodePoint!==Qn||this.nextCodePoint2===ea&&this.nextCodePoint3!==ta&&this.nextCodePoint3!==ju)&&(s+=1),this.advance();return this.rewind(t),s}consumeDisjunction(){const t=this.index;let n=0;this._groupSpecifiers.enterDisjunction(),this.onDisjunctionEnter(t);do this.consumeAlternative(n++);while(this.eat(na));this.consumeQuantifier(!0)&&this.raise("Nothing to repeat"),this.eat(Oi)&&this.raise("Lone quantifier brackets"),this.onDisjunctionLeave(t,this.index),this._groupSpecifiers.leaveDisjunction()}consumeAlternative(t){const n=this.index;for(this._groupSpecifiers.enterAlternative(t),this.onAlternativeEnter(n,t);this.currentCodePoint!==-1&&this.consumeTerm(););this.onAlternativeLeave(n,this.index,t)}consumeTerm(){return this._unicodeMode||this.strict?this.consumeAssertion()||this.consumeAtom()&&this.consumeOptionalQuantifier():this.consumeAssertion()&&(!this._lastAssertionIsQuantifiable||this.consumeOptionalQuantifier())||this.consumeExtendedAtom()&&this.consumeOptionalQuantifier()}consumeOptionalQuantifier(){return this.consumeQuantifier(),!0}consumeAssertion(){const t=this.index;if(this._lastAssertionIsQuantifiable=!1,this.eat(Ds))return this.onEdgeAssertion(t,this.index,"start"),!0;if(this.eat(Hs))return this.onEdgeAssertion(t,this.index,"end"),!0;if(this.eat2(Ct,iV))return this.onWordBoundaryAssertion(t,this.index,"word",!0),!0;if(this.eat2(Ct,jf))return this.onWordBoundaryAssertion(t,this.index,"word",!1),!0;if(this.eat2(Li,Qn)){const n=this.ecmaVersion>=2018&&this.eat(ea);let r=!1;if(this.eat(ta)||(r=this.eat(ju))){const s=n?"lookbehind":"lookahead";return this.onLookaroundAssertionEnter(t,s,r),this.consumeDisjunction(),this.eat(ji)||this.raise("Unterminated group"),this._lastAssertionIsQuantifiable=!n&&!this.strict,this.onLookaroundAssertionLeave(t,this.index,s,r),!0}this.rewind(t)}return!1}consumeQuantifier(t=!1){const n=this.index;let r=0,s=0,a=!1;if(this.eat(Zo))r=0,s=Number.POSITIVE_INFINITY;else if(this.eat(Du))r=1,s=Number.POSITIVE_INFINITY;else if(this.eat(Qn))r=0,s=1;else if(this.eatBracedQuantifier(t))({min:r,max:s}=this._lastRange);else return!1;return a=!this.eat(Qn),t||this.onQuantifier(n,this.index,r,s,a),!0}eatBracedQuantifier(t){const n=this.index;if(this.eat(Oi)){if(this.eatDecimalDigits()){const r=this._lastIntValue;let s=r;if(this.eat(dm)&&(s=this.eatDecimalDigits()?this._lastIntValue:Number.POSITIVE_INFINITY),this.eat(Fi))return!t&&s<r&&this.raise("numbers out of order in {} quantifier"),this._lastRange={min:r,max:s},!0}!t&&(this._unicodeMode||this.strict)&&this.raise("Incomplete quantifier"),this.rewind(n)}return!1}consumeAtom(){return this.consumePatternCharacter()||this.consumeDot()||this.consumeReverseSolidusAtomEscape()||!!this.consumeCharacterClass()||this.consumeCapturingGroup()||this.consumeUncapturingGroup()}consumeDot(){return this.eat(Ou)?(this.onAnyCharacterSet(this.index-1,this.index,"any"),!0):!1}consumeReverseSolidusAtomEscape(){const t=this.index;if(this.eat(Ct)){if(this.consumeAtomEscape())return!0;this.rewind(t)}return!1}consumeUncapturingGroup(){const t=this.index;return this.eat2(Li,Qn)?(this.onGroupEnter(t),this.ecmaVersion>=2025&&this.consumeModifiers(),this.eat(Vu)||(this.rewind(t+1),this.raise("Invalid group")),this.consumeDisjunction(),this.eat(ji)||this.raise("Unterminated group"),this.onGroupLeave(t,this.index),!0):!1}consumeModifiers(){const t=this.index,n=this.eatModifiers(),r=this.index,s=this.eat(En);if(!n&&!s)return!1;this.onModifiersEnter(t);const a=this.parseModifiers(t,r);if(this.onAddModifiers(t,r,a),s){const l=this.index;!this.eatModifiers()&&!n&&this.currentCodePoint===Vu&&this.raise("Invalid empty flags");const c=this.parseModifiers(l,this.index);for(const[d]of Object.entries(c).filter(([,f])=>f))a[d]&&this.raise(`Duplicated flag '${String.fromCodePoint($C[d])}'`);this.onRemoveModifiers(l,this.index,c)}return this.onModifiersLeave(t,this.index),!0}consumeCapturingGroup(){const t=this.index;if(this.eat(Li)){let n=null;if(this.ecmaVersion>=2018){if(this.consumeGroupSpecifier())n=this._lastStrValue;else if(this.currentCodePoint===Qn)return this.rewind(t),!1}else if(this.currentCodePoint===Qn)return this.rewind(t),!1;return this.onCapturingGroupEnter(t,n),this.consumeDisjunction(),this.eat(ji)||this.raise("Unterminated group"),this.onCapturingGroupLeave(t,this.index,n),!0}return!1}consumeExtendedAtom(){return this.consumeDot()||this.consumeReverseSolidusAtomEscape()||this.consumeReverseSolidusFollowedByC()||!!this.consumeCharacterClass()||this.consumeCapturingGroup()||this.consumeUncapturingGroup()||this.consumeInvalidBracedQuantifier()||this.consumeExtendedPatternCharacter()}consumeReverseSolidusFollowedByC(){const t=this.index;return this.currentCodePoint===Ct&&this.nextCodePoint===Ts?(this._lastIntValue=this.currentCodePoint,this.advance(),this.onCharacter(t,this.index,Ct),!0):!1}consumeInvalidBracedQuantifier(){return this.eatBracedQuantifier(!0)&&this.raise("Nothing to repeat"),!1}consumePatternCharacter(){const t=this.index,n=this.currentCodePoint;return n!==-1&&!Bx(n)?(this.advance(),this.onCharacter(t,this.index,n),!0):!1}consumeExtendedPatternCharacter(){const t=this.index,n=this.currentCodePoint;return n!==-1&&n!==Ds&&n!==Hs&&n!==Ct&&n!==Ou&&n!==Zo&&n!==Du&&n!==Qn&&n!==Li&&n!==ji&&n!==Di&&n!==na?(this.advance(),this.onCharacter(t,this.index,n),!0):!1}consumeGroupSpecifier(){const t=this.index;if(this.eat(Qn)){if(this.eatGroupName()){if(!this._groupSpecifiers.hasInScope(this._lastStrValue))return this._groupSpecifiers.addToScope(this._lastStrValue),!0;this.raise("Duplicate capture group name")}this.rewind(t)}return!1}consumeAtomEscape(){return this.consumeBackreference()||this.consumeCharacterClassEscape()||this.consumeCharacterEscape()||this._nFlag&&this.consumeKGroupName()?!0:((this.strict||this._unicodeMode)&&this.raise("Invalid escape"),!1)}consumeBackreference(){const t=this.index;if(this.eatDecimalEscape()){const n=this._lastIntValue;if(n<=this._numCapturingParens)return this.onBackreference(t-1,this.index,n),!0;(this.strict||this._unicodeMode)&&this.raise("Invalid escape"),this.rewind(t)}return!1}consumeCharacterClassEscape(){var t;const n=this.index;if(this.eat(Gh))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"digit",!1),{};if(this.eat(sV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"digit",!0),{};if(this.eat(Uu))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"space",!1),{};if(this.eat(aV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"space",!0),{};if(this.eat(mV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"word",!1),{};if(this.eat(lV))return this._lastIntValue=-1,this.onEscapeCharacterSet(n-1,this.index,"word",!0),{};let r=!1;if(this._unicodeMode&&this.ecmaVersion>=2018&&(this.eat(dV)||(r=this.eat(oV)))){this._lastIntValue=-1;let s=null;if(this.eat(Oi)&&(s=this.eatUnicodePropertyValueExpression())&&this.eat(Fi))return r&&s.strings&&this.raise("Invalid property name"),this.onUnicodePropertyCharacterSet(n-1,this.index,"property",s.key,s.value,r,(t=s.strings)!==null&&t!==void 0?t:!1),{mayContainStrings:s.strings};this.raise("Invalid property name")}return null}consumeCharacterEscape(){const t=this.index;return this.eatControlEscape()||this.eatCControlLetter()||this.eatZero()||this.eatHexEscapeSequence()||this.eatRegExpUnicodeEscapeSequence()||!this.strict&&!this._unicodeMode&&this.eatLegacyOctalEscapeSequence()||this.eatIdentityEscape()?(this.onCharacter(t-1,this.index,this._lastIntValue),!0):!1}consumeKGroupName(){const t=this.index;if(this.eat(Fx)){if(this.eatGroupName()){const n=this._lastStrValue;return this._backreferenceNames.add(n),this.onBackreference(t-1,this.index,n),!0}this.raise("Invalid named reference")}return!1}consumeCharacterClass(){const t=this.index;if(this.eat(Di)){const n=this.eat(Ds);this.onCharacterClassEnter(t,n,this._unicodeSetsMode);const r=this.consumeClassContents();return this.eat(Ir)||(this.currentCodePoint===-1&&this.raise("Unterminated character class"),this.raise("Invalid character in character class")),n&&r.mayContainStrings&&this.raise("Negated character class may contain strings"),this.onCharacterClassLeave(t,this.index,n),r}return null}consumeClassContents(){if(this._unicodeSetsMode)return this.currentCodePoint===Ir?{}:this.consumeClassSetExpression();const t=this.strict||this._unicodeMode;for(;;){const n=this.index;if(!this.consumeClassAtom())break;const r=this._lastIntValue;if(!this.eat(En))continue;if(this.onCharacter(this.index-1,this.index,En),!this.consumeClassAtom())break;const s=this._lastIntValue;if(r===-1||s===-1){t&&this.raise("Invalid character class");continue}r>s&&this.raise("Range out of order in character class"),this.onCharacterClassRange(n,this.index,r,s)}return{}}consumeClassAtom(){const t=this.index,n=this.currentCodePoint;if(n!==-1&&n!==Ct&&n!==Ir)return this.advance(),this._lastIntValue=n,this.onCharacter(t,this.index,this._lastIntValue),!0;if(this.eat(Ct)){if(this.consumeClassEscape())return!0;if(!this.strict&&this.currentCodePoint===Ts)return this._lastIntValue=Ct,this.onCharacter(t,this.index,this._lastIntValue),!0;(this.strict||this._unicodeMode)&&this.raise("Invalid escape"),this.rewind(t)}return!1}consumeClassEscape(){const t=this.index;if(this.eat(jf))return this._lastIntValue=Ox,this.onCharacter(t-1,this.index,this._lastIntValue),!0;if(this._unicodeMode&&this.eat(En))return this._lastIntValue=En,this.onCharacter(t-1,this.index,this._lastIntValue),!0;let n=0;return!this.strict&&!this._unicodeMode&&this.currentCodePoint===Ts&&(pu(n=this.nextCodePoint)||n===hm)?(this.advance(),this.advance(),this._lastIntValue=n%32,this.onCharacter(t-1,this.index,this._lastIntValue),!0):!!this.consumeCharacterClassEscape()||this.consumeCharacterEscape()}consumeClassSetExpression(){const t=this.index;let n=!1,r=null;if(this.consumeClassSetCharacter()){if(this.consumeClassSetRangeFromOperator(t))return this.consumeClassUnionRight({}),{};n=!1}else if(r=this.consumeClassSetOperand())n=r.mayContainStrings;else{const s=this.currentCodePoint;s===Ct&&(this.advance(),this.raise("Invalid escape")),s===this.nextCodePoint&&Ux(s)&&this.raise("Invalid set operation in character class"),this.raise("Invalid character in character class")}if(this.eat2(Ni,Ni)){for(;this.currentCodePoint!==Ni&&(r=this.consumeClassSetOperand());)if(this.onClassIntersection(t,this.index),r.mayContainStrings||(n=!1),!this.eat2(Ni,Ni))return{mayContainStrings:n};this.raise("Invalid character in character class")}if(this.eat2(En,En)){for(;this.consumeClassSetOperand();)if(this.onClassSubtraction(t,this.index),!this.eat2(En,En))return{mayContainStrings:n};this.raise("Invalid character in character class")}return this.consumeClassUnionRight({mayContainStrings:n})}consumeClassUnionRight(t){let n=t.mayContainStrings;for(;;){const r=this.index;if(this.consumeClassSetCharacter()){this.consumeClassSetRangeFromOperator(r);continue}const s=this.consumeClassSetOperand();if(s){s.mayContainStrings&&(n=!0);continue}break}return{mayContainStrings:n}}consumeClassSetRangeFromOperator(t){const n=this.index,r=this._lastIntValue;if(this.eat(En)){if(this.consumeClassSetCharacter()){const s=this._lastIntValue;return(r===-1||s===-1)&&this.raise("Invalid character class"),r>s&&this.raise("Range out of order in character class"),this.onCharacterClassRange(t,this.index,r,s),!0}this.rewind(n)}return!1}consumeClassSetOperand(){let t=null;return(t=this.consumeNestedClass())||(t=this.consumeClassStringDisjunction())?t:this.consumeClassSetCharacter()?{}:null}consumeNestedClass(){const t=this.index;if(this.eat(Di)){const n=this.eat(Ds);this.onCharacterClassEnter(t,n,!0);const r=this.consumeClassContents();return this.eat(Ir)||this.raise("Unterminated character class"),n&&r.mayContainStrings&&this.raise("Negated character class may contain strings"),this.onCharacterClassLeave(t,this.index,n),r}if(this.eat(Ct)){const n=this.consumeCharacterClassEscape();if(n)return n;this.rewind(t)}return null}consumeClassStringDisjunction(){const t=this.index;if(this.eat3(Ct,fV,Oi)){this.onClassStringDisjunctionEnter(t);let n=0,r=!1;do this.consumeClassString(n++).mayContainStrings&&(r=!0);while(this.eat(na));if(this.eat(Fi))return this.onClassStringDisjunctionLeave(t,this.index),{mayContainStrings:r};this.raise("Unterminated class string disjunction")}return null}consumeClassString(t){const n=this.index;let r=0;for(this.onStringAlternativeEnter(n,t);this.currentCodePoint!==-1&&this.consumeClassSetCharacter();)r++;return this.onStringAlternativeLeave(n,this.index,t),{mayContainStrings:r!==1}}consumeClassSetCharacter(){const t=this.index,n=this.currentCodePoint;if((n!==this.nextCodePoint||!Ux(n))&&n!==-1&&!FV(n))return this._lastIntValue=n,this.advance(),this.onCharacter(t,this.index,this._lastIntValue),!0;if(this.eat(Ct)){if(this.consumeCharacterEscape())return!0;if(VV(this.currentCodePoint))return this._lastIntValue=this.currentCodePoint,this.advance(),this.onCharacter(t,this.index,this._lastIntValue),!0;if(this.eat(jf))return this._lastIntValue=Ox,this.onCharacter(t,this.index,this._lastIntValue),!0;this.rewind(t)}return!1}eatGroupName(){if(this.eat(ea)){if(this.eatRegExpIdentifierName()&&this.eat(fm))return!0;this.raise("Invalid capture group name")}return!1}eatRegExpIdentifierName(){if(this.eatRegExpIdentifierStart()){for(this._lastStrValue=String.fromCodePoint(this._lastIntValue);this.eatRegExpIdentifierPart();)this._lastStrValue+=String.fromCodePoint(this._lastIntValue);return!0}return!1}eatRegExpIdentifierStart(){const t=this.index,n=!this._unicodeMode&&this.ecmaVersion>=2020;let r=this.currentCodePoint;return this.advance(),r===Ct&&this.eatRegExpUnicodeEscapeSequence(n)?r=this._lastIntValue:n&&Of(r)&&Ff(this.currentCodePoint)&&(r=Vf(r,this.currentCodePoint),this.advance()),zV(r)?(this._lastIntValue=r,!0):(this.index!==t&&this.rewind(t),!1)}eatRegExpIdentifierPart(){const t=this.index,n=!this._unicodeMode&&this.ecmaVersion>=2020;let r=this.currentCodePoint;return this.advance(),r===Ct&&this.eatRegExpUnicodeEscapeSequence(n)?r=this._lastIntValue:n&&Of(r)&&Ff(this.currentCodePoint)&&(r=Vf(r,this.currentCodePoint),this.advance()),BV(r)?(this._lastIntValue=r,!0):(this.index!==t&&this.rewind(t),!1)}eatCControlLetter(){const t=this.index;if(this.eat(Ts)){if(this.eatControlLetter())return!0;this.rewind(t)}return!1}eatZero(){return this.currentCodePoint===ai&&!pu(this.nextCodePoint)?(this._lastIntValue=0,this.advance(),!0):!1}eatControlEscape(){return this.eat(pm)?(this._lastIntValue=tV,!0):this.eat(cV)?(this._lastIntValue=IC,!0):this.eat(hV)?(this._lastIntValue=MC,!0):this.eat(pV)?(this._lastIntValue=Z4,!0):this.eat(Kh)?(this._lastIntValue=eV,!0):!1}eatControlLetter(){const t=this.currentCodePoint;return UC(t)?(this.advance(),this._lastIntValue=t%32,!0):!1}eatRegExpUnicodeEscapeSequence(t=!1){const n=this.index,r=t||this._unicodeMode;if(this.eat(hu)){if(r&&this.eatRegExpUnicodeSurrogatePairEscape()||this.eatFixedHexDigits(4)||r&&this.eatRegExpUnicodeCodePointEscape())return!0;(this.strict||r)&&this.raise("Invalid unicode escape"),this.rewind(n)}return!1}eatRegExpUnicodeSurrogatePairEscape(){const t=this.index;if(this.eatFixedHexDigits(4)){const n=this._lastIntValue;if(Of(n)&&this.eat(Ct)&&this.eat(hu)&&this.eatFixedHexDigits(4)){const r=this._lastIntValue;if(Ff(r))return this._lastIntValue=Vf(n,r),!0}this.rewind(t)}return!1}eatRegExpUnicodeCodePointEscape(){const t=this.index;return this.eat(Oi)&&this.eatHexDigits()&&this.eat(Fi)&&_V(this._lastIntValue)?!0:(this.rewind(t),!1)}eatIdentityEscape(){const t=this.currentCodePoint;return this.isValidIdentityEscape(t)?(this._lastIntValue=t,this.advance(),!0):!1}isValidIdentityEscape(t){return t===-1?!1:this._unicodeMode?Bx(t)||t===Ho:this.strict?!PC(t):this._nFlag?!(t===Ts||t===Fx):t!==Ts}eatDecimalEscape(){this._lastIntValue=0;let t=this.currentCodePoint;if(t>=nV&&t<=Fu){do this._lastIntValue=10*this._lastIntValue+(t-ai),this.advance();while((t=this.currentCodePoint)>=ai&&t<=Fu);return!0}return!1}eatUnicodePropertyValueExpression(){const t=this.index;if(this.eatUnicodePropertyName()&&this.eat(ta)){const n=this._lastStrValue;if(this.eatUnicodePropertyValue()){const r=this._lastStrValue;if(Dx(this.ecmaVersion,n,r))return{key:n,value:r||null};this.raise("Invalid property name")}}if(this.rewind(t),this.eatLoneUnicodePropertyNameOrValue()){const n=this._lastStrValue;if(Dx(this.ecmaVersion,"General_Category",n))return{key:"General_Category",value:n||null};if(Q4(this.ecmaVersion,n))return{key:n,value:null};if(this._unicodeSetsMode&&J4(this.ecmaVersion,n))return{key:n,value:null,strings:!0};this.raise("Invalid property name")}return null}eatUnicodePropertyName(){for(this._lastStrValue="";HC(this.currentCodePoint);)this._lastStrValue+=String.fromCodePoint(this.currentCodePoint),this.advance();return this._lastStrValue!==""}eatUnicodePropertyValue(){for(this._lastStrValue="";UV(this.currentCodePoint);)this._lastStrValue+=String.fromCodePoint(this.currentCodePoint),this.advance();return this._lastStrValue!==""}eatLoneUnicodePropertyNameOrValue(){return this.eatUnicodePropertyValue()}eatHexEscapeSequence(){const t=this.index;if(this.eat(gV)){if(this.eatFixedHexDigits(2))return!0;(this._unicodeMode||this.strict)&&this.raise("Invalid escape"),this.rewind(t)}return!1}eatDecimalDigits(){const t=this.index;for(this._lastIntValue=0;pu(this.currentCodePoint);)this._lastIntValue=10*this._lastIntValue+Df(this.currentCodePoint),this.advance();return this.index!==t}eatHexDigits(){const t=this.index;for(this._lastIntValue=0;Vx(this.currentCodePoint);)this._lastIntValue=16*this._lastIntValue+Df(this.currentCodePoint),this.advance();return this.index!==t}eatLegacyOctalEscapeSequence(){if(this.eatOctalDigit()){const t=this._lastIntValue;if(this.eatOctalDigit()){const n=this._lastIntValue;t<=3&&this.eatOctalDigit()?this._lastIntValue=t*64+n*8+this._lastIntValue:this._lastIntValue=t*8+n}else this._lastIntValue=t;return!0}return!1}eatOctalDigit(){const t=this.currentCodePoint;return bV(t)?(this.advance(),this._lastIntValue=t-ai,!0):(this._lastIntValue=0,!1)}eatFixedHexDigits(t){const n=this.index;this._lastIntValue=0;for(let r=0;r<t;++r){const s=this.currentCodePoint;if(!Vx(s))return this.rewind(n),!1;this._lastIntValue=16*this._lastIntValue+Df(s),this.advance()}return!0}eatModifiers(){let t=!1;for(;$V(this.currentCodePoint);)this.advance(),t=!0;return t}parseModifiers(t,n){const{ignoreCase:r,multiline:s,dotAll:a}=this.parseFlags(this._reader.source,t,n);return{ignoreCase:r,multiline:s,dotAll:a}}parseFlags(t,n,r){const s={global:!1,ignoreCase:!1,multiline:!1,unicode:!1,sticky:!1,dotAll:!1,hasIndices:!1,unicodeSets:!1},a=new Set;a.add(FC),a.add(mm),a.add(gm),this.ecmaVersion>=2015&&(a.add(hu),a.add(VC),this.ecmaVersion>=2018&&(a.add(Uu),this.ecmaVersion>=2022&&(a.add(Gh),this.ecmaVersion>=2024&&a.add(Kh))));for(let l=n;l<r;++l){const c=t.charCodeAt(l);if(a.has(c)){const d=OV[c];s[d]&&this.raise(`Duplicated flag '${t[l]}'`,{index:n}),s[d]=!0}else this.raise(`Invalid flag '${t[l]}'`,{index:n})}return s}}const WV={},qV={},GV={};function Zl(e){return e.type==="Character"||e.type==="CharacterSet"||e.type==="CharacterClass"||e.type==="ExpressionCharacterClass"||e.type==="ClassStringDisjunction"}class KV{constructor(t){var n;this._node=WV,this._expressionBufferMap=new Map,this._flags=qV,this._backreferences=[],this._capturingGroups=[],this.source="",this.strict=!!t?.strict,this.ecmaVersion=(n=t?.ecmaVersion)!==null&&n!==void 0?n:_C}get pattern(){if(this._node.type!=="Pattern")throw new Error("UnknownError");return this._node}get flags(){if(this._flags.type!=="Flags")throw new Error("UnknownError");return this._flags}onRegExpFlags(t,n,{global:r,ignoreCase:s,multiline:a,unicode:l,sticky:c,dotAll:d,hasIndices:f,unicodeSets:m}){this._flags={type:"Flags",parent:null,start:t,end:n,raw:this.source.slice(t,n),global:r,ignoreCase:s,multiline:a,unicode:l,sticky:c,dotAll:d,hasIndices:f,unicodeSets:m}}onPatternEnter(t){this._node={type:"Pattern",parent:null,start:t,end:t,raw:"",alternatives:[]},this._backreferences.length=0,this._capturingGroups.length=0}onPatternLeave(t,n){this._node.end=n,this._node.raw=this.source.slice(t,n);for(const r of this._backreferences){const s=r.ref,a=typeof s=="number"?[this._capturingGroups[s-1]]:this._capturingGroups.filter(l=>l.name===s);if(a.length===1){const l=a[0];r.ambiguous=!1,r.resolved=l}else r.ambiguous=!0,r.resolved=a;for(const l of a)l.references.push(r)}}onAlternativeEnter(t){const n=this._node;if(n.type!=="Assertion"&&n.type!=="CapturingGroup"&&n.type!=="Group"&&n.type!=="Pattern")throw new Error("UnknownError");this._node={type:"Alternative",parent:n,start:t,end:t,raw:"",elements:[]},n.alternatives.push(this._node)}onAlternativeLeave(t,n){const r=this._node;if(r.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onGroupEnter(t){const n=this._node;if(n.type!=="Alternative")throw new Error("UnknownError");const r={type:"Group",parent:n,start:t,end:t,raw:"",modifiers:null,alternatives:[]};this._node=r,n.elements.push(this._node)}onGroupLeave(t,n){const r=this._node;if(r.type!=="Group"||r.parent.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onModifiersEnter(t){const n=this._node;if(n.type!=="Group")throw new Error("UnknownError");this._node={type:"Modifiers",parent:n,start:t,end:t,raw:"",add:null,remove:null},n.modifiers=this._node}onModifiersLeave(t,n){const r=this._node;if(r.type!=="Modifiers"||r.parent.type!=="Group")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onAddModifiers(t,n,{ignoreCase:r,multiline:s,dotAll:a}){const l=this._node;if(l.type!=="Modifiers")throw new Error("UnknownError");l.add={type:"ModifierFlags",parent:l,start:t,end:n,raw:this.source.slice(t,n),ignoreCase:r,multiline:s,dotAll:a}}onRemoveModifiers(t,n,{ignoreCase:r,multiline:s,dotAll:a}){const l=this._node;if(l.type!=="Modifiers")throw new Error("UnknownError");l.remove={type:"ModifierFlags",parent:l,start:t,end:n,raw:this.source.slice(t,n),ignoreCase:r,multiline:s,dotAll:a}}onCapturingGroupEnter(t,n){const r=this._node;if(r.type!=="Alternative")throw new Error("UnknownError");this._node={type:"CapturingGroup",parent:r,start:t,end:t,raw:"",name:n,alternatives:[],references:[]},r.elements.push(this._node),this._capturingGroups.push(this._node)}onCapturingGroupLeave(t,n){const r=this._node;if(r.type!=="CapturingGroup"||r.parent.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onQuantifier(t,n,r,s,a){const l=this._node;if(l.type!=="Alternative")throw new Error("UnknownError");const c=l.elements.pop();if(c==null||c.type==="Quantifier"||c.type==="Assertion"&&c.kind!=="lookahead")throw new Error("UnknownError");const d={type:"Quantifier",parent:l,start:c.start,end:n,raw:this.source.slice(c.start,n),min:r,max:s,greedy:a,element:c};l.elements.push(d),c.parent=d}onLookaroundAssertionEnter(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");const a=this._node={type:"Assertion",parent:s,start:t,end:t,raw:"",kind:n,negate:r,alternatives:[]};s.elements.push(a)}onLookaroundAssertionLeave(t,n){const r=this._node;if(r.type!=="Assertion"||r.parent.type!=="Alternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onEdgeAssertion(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");s.elements.push({type:"Assertion",parent:s,start:t,end:n,raw:this.source.slice(t,n),kind:r})}onWordBoundaryAssertion(t,n,r,s){const a=this._node;if(a.type!=="Alternative")throw new Error("UnknownError");a.elements.push({type:"Assertion",parent:a,start:t,end:n,raw:this.source.slice(t,n),kind:r,negate:s})}onAnyCharacterSet(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");s.elements.push({type:"CharacterSet",parent:s,start:t,end:n,raw:this.source.slice(t,n),kind:r})}onEscapeCharacterSet(t,n,r,s){const a=this._node;if(a.type!=="Alternative"&&a.type!=="CharacterClass")throw new Error("UnknownError");a.elements.push({type:"CharacterSet",parent:a,start:t,end:n,raw:this.source.slice(t,n),kind:r,negate:s})}onUnicodePropertyCharacterSet(t,n,r,s,a,l,c){const d=this._node;if(d.type!=="Alternative"&&d.type!=="CharacterClass")throw new Error("UnknownError");const f={type:"CharacterSet",parent:null,start:t,end:n,raw:this.source.slice(t,n),kind:r,strings:null,key:s};if(c){if(d.type==="CharacterClass"&&!d.unicodeSets||l||a!==null)throw new Error("UnknownError");d.elements.push(Object.assign(Object.assign({},f),{parent:d,strings:c,value:a,negate:l}))}else d.elements.push(Object.assign(Object.assign({},f),{parent:d,strings:c,value:a,negate:l}))}onCharacter(t,n,r){const s=this._node;if(s.type!=="Alternative"&&s.type!=="CharacterClass"&&s.type!=="StringAlternative")throw new Error("UnknownError");s.elements.push({type:"Character",parent:s,start:t,end:n,raw:this.source.slice(t,n),value:r})}onBackreference(t,n,r){const s=this._node;if(s.type!=="Alternative")throw new Error("UnknownError");const a={type:"Backreference",parent:s,start:t,end:n,raw:this.source.slice(t,n),ref:r,ambiguous:!1,resolved:GV};s.elements.push(a),this._backreferences.push(a)}onCharacterClassEnter(t,n,r){const s=this._node,a={type:"CharacterClass",parent:s,start:t,end:t,raw:"",unicodeSets:r,negate:n,elements:[]};if(s.type==="Alternative"){const l=Object.assign(Object.assign({},a),{parent:s});this._node=l,s.elements.push(l)}else if(s.type==="CharacterClass"&&s.unicodeSets&&r){const l=Object.assign(Object.assign({},a),{parent:s,unicodeSets:r});this._node=l,s.elements.push(l)}else throw new Error("UnknownError")}onCharacterClassLeave(t,n){const r=this._node;if(r.type!=="CharacterClass"||r.parent.type!=="Alternative"&&r.parent.type!=="CharacterClass")throw new Error("UnknownError");const s=r.parent;r.end=n,r.raw=this.source.slice(t,n),this._node=s;const a=this._expressionBufferMap.get(r);if(!a)return;if(r.elements.length>0)throw new Error("UnknownError");this._expressionBufferMap.delete(r);const l={type:"ExpressionCharacterClass",parent:s,start:r.start,end:r.end,raw:r.raw,negate:r.negate,expression:a};if(a.parent=l,r!==s.elements.pop())throw new Error("UnknownError");s.elements.push(l)}onCharacterClassRange(t,n){const r=this._node;if(r.type!=="CharacterClass")throw new Error("UnknownError");const s=r.elements,a=s.pop();if(!a||a.type!=="Character")throw new Error("UnknownError");if(!r.unicodeSets){const d=s.pop();if(!d||d.type!=="Character"||d.value!==En)throw new Error("UnknownError")}const l=s.pop();if(!l||l.type!=="Character")throw new Error("UnknownError");const c={type:"CharacterClassRange",parent:r,start:t,end:n,raw:this.source.slice(t,n),min:l,max:a};l.parent=c,a.parent=c,s.push(c)}onClassIntersection(t,n){var r;const s=this._node;if(s.type!=="CharacterClass"||!s.unicodeSets)throw new Error("UnknownError");const a=s.elements.pop(),l=(r=this._expressionBufferMap.get(s))!==null&&r!==void 0?r:s.elements.pop();if(!l||!a||l.type==="ClassSubtraction"||l.type!=="ClassIntersection"&&!Zl(l)||!Zl(a))throw new Error("UnknownError");const c={type:"ClassIntersection",parent:s,start:t,end:n,raw:this.source.slice(t,n),left:l,right:a};l.parent=c,a.parent=c,this._expressionBufferMap.set(s,c)}onClassSubtraction(t,n){var r;const s=this._node;if(s.type!=="CharacterClass"||!s.unicodeSets)throw new Error("UnknownError");const a=s.elements.pop(),l=(r=this._expressionBufferMap.get(s))!==null&&r!==void 0?r:s.elements.pop();if(!l||!a||l.type==="ClassIntersection"||l.type!=="ClassSubtraction"&&!Zl(l)||!Zl(a))throw new Error("UnknownError");const c={type:"ClassSubtraction",parent:s,start:t,end:n,raw:this.source.slice(t,n),left:l,right:a};l.parent=c,a.parent=c,this._expressionBufferMap.set(s,c)}onClassStringDisjunctionEnter(t){const n=this._node;if(n.type!=="CharacterClass"||!n.unicodeSets)throw new Error("UnknownError");this._node={type:"ClassStringDisjunction",parent:n,start:t,end:t,raw:"",alternatives:[]},n.elements.push(this._node)}onClassStringDisjunctionLeave(t,n){const r=this._node;if(r.type!=="ClassStringDisjunction"||r.parent.type!=="CharacterClass")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}onStringAlternativeEnter(t){const n=this._node;if(n.type!=="ClassStringDisjunction")throw new Error("UnknownError");this._node={type:"StringAlternative",parent:n,start:t,end:t,raw:"",elements:[]},n.alternatives.push(this._node)}onStringAlternativeLeave(t,n){const r=this._node;if(r.type!=="StringAlternative")throw new Error("UnknownError");r.end=n,r.raw=this.source.slice(t,n),this._node=r.parent}}class XV{constructor(t){this._state=new KV(t),this._validator=new HV(this._state)}parseLiteral(t,n=0,r=t.length){this._state.source=t,this._validator.validateLiteral(t,n,r);const s=this._state.pattern,a=this._state.flags,l={type:"RegExpLiteral",parent:null,start:n,end:r,raw:t,pattern:s,flags:a};return s.parent=l,a.parent=l,l}parseFlags(t,n=0,r=t.length){return this._state.source=t,this._validator.validateFlags(t,n,r),this._state.flags}parsePattern(t,n=0,r=t.length,s=void 0){return this._state.source=t,this._validator.validatePattern(t,n,r,s),this._state.pattern}}const $x=256,zf=256,Hx=24,YV=64;class WC extends Error{}function QV(){return{remaining:1e5}}function Tr(e){if(--e.remaining<0)throw new WC("pattern validation work limit exceeded")}const Bo=new Map;function qC(e){const t=Bo.get(e);if(t!==void 0)return t;if(e.length>$x)return`pattern exceeds ${$x} characters`;if(!e.startsWith("^")||!e.endsWith("$"))return"pattern must be anchored with ^ and $";let n;try{const r=new XV({ecmaVersion:2024}).parsePattern(e,0,e.length,{unicode:!0}),s=new Map,a=(l,c)=>{if(c>Hx)throw Error(`pattern depth exceeds ${Hx}`);switch(l.type){case"Pattern":case"Group":case"CapturingGroup":if(l.type==="Group"&&l.modifiers)throw Error("pattern group modifiers are not supported");for(const d of l.alternatives)a(d,c+1);break;case"Alternative":for(const d of l.elements)a(d,c+1);break;case"Quantifier":if(l.min>zf||Number.isFinite(l.max)&&l.max>zf)throw Error(`pattern repetition must not exceed ${zf}`);a(l.element,c+1);break;case"Assertion":if(l.kind==="lookbehind")throw Error("pattern lookbehind is not supported");if(l.kind==="lookahead")for(const d of l.alternatives)a(d,c+1);break;case"Character":case"CharacterSet":case"CharacterClass":s.set(l,new RegExp(`^(?:${l.raw})$`,"u"));break;default:throw Error(`pattern ${l.type} is not supported`)}};a(r,0),n={root:r,atoms:s}}catch(r){n=r instanceof SyntaxError?"pattern has invalid Unicode syntax":r.message}return Bo.size>=YV&&Bo.delete(Bo.keys().next().value),Bo.set(e,n),n}function JV(e){if(typeof e!="string")return"pattern must be a string";const t=qC(e);return typeof t=="string"?t:null}function ZV(e,t,n){const r=qC(e);if(typeof r=="string")throw Error(r);const s=Array.from(t),a=(m,p)=>{Tr(n),m.add(p)},l=(m,p)=>{for(const y of p)a(m,y)},c=(m,p)=>{const y=new Set;for(const w of m)Tr(n),l(y,f(w,p));return y},d=(m,p)=>{const y=new Set;for(const w of p)Tr(n),l(y,f(m,w));return y},f=(m,p)=>{switch(Tr(n),m.type){case"Pattern":case"Group":case"CapturingGroup":return c(m.alternatives,p);case"Alternative":{let y=new Set([p]);for(const w of m.elements)if(Tr(n),y=d(w,y),!y.size)break;return y}case"Quantifier":{let y=new Set([p]);for(let k=0;k<m.min;k++)if(Tr(n),y=d(m.element,y),!y.size)return y;const w=new Set;l(w,y);for(let k=m.min;k<m.max&&y.size;k++){Tr(n);const b=d(m.element,y);if(m.max===1/0)for(const E of b)Tr(n),w.has(E)&&b.delete(E);l(w,b),y=b}return w}case"Assertion":{let y;if(m.kind==="start")y=p===0;else if(m.kind==="end")y=p===s.length;else if(m.kind==="word"){const w=k=>k!==void 0&&/^[a-zA-Z0-9_]$/.test(k);y=w(s[p-1])!==w(s[p])!==m.negate}else if(m.kind==="lookahead")y=c(m.alternatives,p).size>0!==m.negate;else throw Error("unsupported assertion");return new Set(y?[p]:[])}default:{const y=r.atoms.get(m);return new Set(p<s.length&&y.test(s[p])?[p+1]:[])}}};for(let m=0;m<=s.length;m++)if(Tr(n),f(r.root,m).size>0)return!0;return!1}const ez=new Set(["type","title","description","default","enum","const","minimum","maximum","minLength","maxLength","pattern","properties","required","items","minItems","maxItems","additionalProperties","anyOf","uniqueItems"]),Wx=6,qx=64,Gx=12,Kx=2048,Xx=64*1024;function Fs(e,t=0,n={value:0}){if(t>Wx)return`Schema depth exceeds ${Wx}`;if(n.value++,n.value>qx)return`Schema exceeds ${qx} controls`;const r=Object.keys(e).find(a=>!ez.has(a));if(r)return`Unsupported JSON Schema keyword: ${r}`;if(e.title!==void 0&&typeof e.title!="string")return"title must be a string";if(e.description!==void 0&&typeof e.description!="string")return"description must be a string";if(e.enum!==void 0&&(!Array.isArray(e.enum)||e.enum.length===0))return"enum must be a non-empty array";const s=e.type;if(s===void 0&&e.enum===void 0&&!Object.hasOwn(e,"const")&&e.anyOf===void 0)return"An explicit type, enum, or const is required";if(e.anyOf!==void 0){if(!Array.isArray(e.anyOf)||e.anyOf.length===0)return"anyOf must be a non-empty array of schemas";for(let a=0;a<e.anyOf.length;a++){const l=e.anyOf[a];if(!l||typeof l!="object"||Array.isArray(l))return`anyOf[${a}] must be a schema object`;const c=Fs(l,t+1,n);if(c)return`anyOf[${a}]: ${c}`}}if(e.uniqueItems!==void 0){if(typeof e.uniqueItems!="boolean")return"uniqueItems must be boolean";if(s!=="array")return"uniqueItems requires array type"}if(s!==void 0&&(typeof s!="string"||!["object","array","string","number","integer","boolean","null"].includes(s)))return`Unsupported JSON Schema type: ${String(s)}`;for(const a of["minimum","maximum"])if(e[a]!==void 0&&(typeof e[a]!="number"||!Number.isFinite(e[a])))return`${a} must be a finite number`;for(const a of["minLength","maxLength","minItems","maxItems"])if(e[a]!==void 0&&(typeof e[a]!="number"||!Number.isInteger(e[a])||e[a]<0))return`${a} must be a non-negative integer`;if((e.minimum!==void 0||e.maximum!==void 0)&&s!=="number"&&s!=="integer")return"minimum/maximum require a numeric type";if((e.minLength!==void 0||e.maxLength!==void 0)&&s!=="string")return"minLength/maxLength require string type";if(e.pattern!==void 0){if(s!=="string")return"pattern requires a string type";const a=JV(e.pattern);if(a)return a}if((e.minItems!==void 0||e.maxItems!==void 0)&&s!=="array")return"minItems/maxItems require array type";if(e.additionalProperties!==void 0){if(s!=="object")return"additionalProperties requires an object type";if(e.additionalProperties===!0)return"additionalProperties: true is not supported";if(e.additionalProperties!==!1)return e.additionalProperties&&typeof e.additionalProperties=="object"&&!Array.isArray(e.additionalProperties)?"Schema-valued additionalProperties is not supported":"additionalProperties must be false"}if((e.properties!==void 0||e.required!==void 0)&&s!=="object")return"properties/required require object type";if(e.items!==void 0&&s!=="array")return"items requires array type";if(s==="object"){const a=e.properties;if(a!==void 0&&(!a||typeof a!="object"||Array.isArray(a)))return"properties must be an object";if(e.required!==void 0&&(!Array.isArray(e.required)||e.required.some(l=>typeof l!="string")))return"required must be an array of property names";for(const l of Object.values(a??{})){if(!l||typeof l!="object"||Array.isArray(l))return"property schema must be an object";const c=Fs(l,t+1,n);if(c)return c}}return s==="array"&&e.items!==void 0?!e.items||typeof e.items!="object"||Array.isArray(e.items)?"items must be one schema object":Fs(e.items,t+1,n):null}function $u(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((s,a)=>$u(s,t[a]));const n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((s,a)=>s===r[a]&&$u(e[s],t[s]))}function tz(e,t){let n=0;const r=(a,l)=>{if(l>Gx)return`${t} exceeds depth ${Gx}`;if(n++,n>Kx)return`${t} exceeds ${Kx} JSON values`;if(a===null||typeof a!="object")return null;for(const c of Array.isArray(a)?a:Object.values(a)){const d=r(c,l+1);if(d)return d}return null},s=r(e,0);return s||(new TextEncoder().encode(JSON.stringify(e)).byteLength>Xx?`${t} exceeds ${Xx} UTF-8 bytes`:null)}function mu(e,t,n,r){if(Array.isArray(e.anyOf)&&!e.anyOf.some(s=>mu(s,t,n,r)===null))return`${n} must match at least one anyOf alternative`;if(Object.hasOwn(e,"const")&&!$u(e.const,t))return`${n} must use the fixed value`;if(Array.isArray(e.enum)&&!e.enum.some(s=>$u(s,t)))return`${n} is not an allowed value`;if(e.type==="null")return t===null?null:`${n} must be null`;if(e.type==="boolean")return typeof t=="boolean"?null:`${n} must be boolean`;if(e.type==="string")return typeof t!="string"?`${n} must be text`:typeof e.minLength=="number"&&Array.from(t).length<e.minLength?`${n} is too short`:typeof e.maxLength=="number"&&Array.from(t).length>e.maxLength?`${n} is too long`:e.pattern!==void 0&&!ZV(e.pattern,t,r)?`${n} does not match the required format`:null;if(e.type==="number"||e.type==="integer")return typeof t!="number"||!Number.isFinite(t)?`${n} must be a finite number`:e.type==="integer"&&!Number.isInteger(t)?`${n} must be an integer`:typeof e.minimum=="number"&&t<e.minimum?`${n} is below the minimum`:typeof e.maximum=="number"&&t>e.maximum?`${n} is above the maximum`:null;if(e.type==="array"){if(!Array.isArray(t))return`${n} must be an array`;if(typeof e.minItems=="number"&&t.length<e.minItems)return`${n} has too few items`;if(typeof e.maxItems=="number"&&t.length>e.maxItems)return`${n} has too many items`;if(e.uniqueItems===!0){const s=new Set;for(const a of t){const l=Xh(a);if(s.has(l))return`${n} must contain unique items`;s.add(l)}}if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items))for(let s=0;s<t.length;s++){const a=mu(e.items,t[s],`${n}[${s}]`,r);if(a)return a}return null}if(e.type==="object"){if(!t||typeof t!="object"||Array.isArray(t))return`${n} must be an object`;const s=e.properties??{};for(const l of Object.keys(t))if(e.additionalProperties===!1&&!Object.hasOwn(s,l))return`${n}.${l||"(empty key)"} is not declared by the schema`;const a=Array.isArray(e.required)?e.required:[];for(const l of a)if(!Object.hasOwn(t,l))return`${n}.${l||"(empty key)"} is required`;for(const[l,c]of Object.entries(s)){if(!Object.hasOwn(t,l))continue;const d=mu(c,t[l],`${n}.${l||"(empty key)"}`,r);if(d)return d}}return null}function Hu(e,t,n="Arguments"){const r=Fs(e);if(r)return`${n} cannot be validated safely: ${r}`;try{return tz(t,n)??mu(e,t,n,QV())}catch(s){if(s instanceof WC)return`${n} cannot be validated safely: ${s.message}`;throw s}}function Xh(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(Xh).join(",")}]`:`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${Xh(e[t])}`).join(",")}}`}function ym(e){if(e.type!==void 0)return e.type;if(Array.isArray(e.anyOf)&&e.anyOf.length){const t=e.anyOf.map(n=>ym(n));if(t.every(n=>n===t[0])&&["string","number","integer","boolean","null"].includes(String(t[0])))return t[0]}}function qi(e){if(Object.hasOwn(e,"const"))return e.const;if(e.default!==void 0)return e.default;if(Array.isArray(e.enum)&&e.enum.length)return e.enum[0];if(Array.isArray(e.anyOf)&&e.anyOf.length&&!e.type)return qi(e.anyOf[0]);if(e.type==="object"){const t=Object.create(null),n=new Set(Array.isArray(e.required)?e.required.filter(r=>typeof r=="string"):[]);for(const[r,s]of Object.entries(e.properties??{})){const a=s;(n.has(r)||a.default!==void 0)&&(t[r]=qi(a))}return t}return e.type==="array"?[]:e.type==="boolean"?!1:e.type==="number"||e.type==="integer"?0:e.type==="null"?null:""}function Yx(e,t){return typeof e.title=="string"&&e.title?e.title:t||"(empty key)"}function Qx(e,t,n){const r=Object.create(null);for(const[s,a]of Object.entries(e))r[s]=a;return r[t]=n,r}function nz(e,t){const n=Object.create(null);for(const[r,s]of Object.entries(e))r!==t&&(n[r]=s);return n}function Jx(e){const{schema:t,label:n,path:r,value:s,required:a,description:l,arrayOnly:c,onChange:d,onValidityChange:f}=e,m=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),y=`command-json-${r.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"root"}-${m}-help`,[w,k]=S.useState(()=>JSON.stringify(s,null,2)),[b,E]=S.useState(null),P=S.useRef(JSON.stringify(s));S.useEffect(()=>{const _=JSON.stringify(s);_!==P.current&&(P.current=_,k(JSON.stringify(s,null,2)),E(null),f(r,null))},[f,r,s]),S.useEffect(()=>()=>f(r,null),[f,r]);const R=_=>{k(_);let j;try{j=JSON.parse(_)}catch{const N=`${n} must contain valid JSON`;E(N),f(r,N);return}if(c&&!Array.isArray(j)){const N=`${n} must be a JSON array`;E(N),f(r,N);return}const A=Hu(t,j,n);E(A),f(r,A),P.current=JSON.stringify(j),d(j)};return v.jsxs("label",{className:"command-field",children:[v.jsxs("span",{children:[n,a?" *":""]}),v.jsx("textarea",{value:w,rows:3,"aria-describedby":y,"aria-invalid":b?"true":void 0,onChange:_=>R(_.target.value)}),v.jsx("small",{id:y,children:l??(c?"JSON array":"JSON value matching any allowed alternative")}),b&&v.jsx("span",{className:"command-field-error",role:"alert",children:b})]})}function rz(e){const{schema:t,label:n,path:r,value:s,required:a,description:l,numeric:c,onChange:d,onValidityChange:f}=e,m=Hu(t,s,n);return S.useEffect(()=>(f(r,m),()=>f(r,null)),[m,f,r]),v.jsxs("label",{className:"command-field",children:[v.jsxs("span",{children:[n,a?" *":""]}),v.jsx("input",{type:c?"number":"text",value:String(s??""),min:typeof t.minimum=="number"?t.minimum:void 0,max:typeof t.maximum=="number"?t.maximum:void 0,step:ym(t)==="integer"?1:c?"any":void 0,required:a,"aria-invalid":m?"true":void 0,onChange:p=>d(c?Number(p.target.value):p.target.value)}),l&&v.jsx("small",{children:l}),m&&v.jsx("span",{className:"command-field-error",role:"alert",children:m})]})}function GC(e){const{schema:t,name:n,path:r,value:s,required:a,onChange:l,onValidityChange:c}=e,d=Yx(t,n),f=typeof t.description=="string"?t.description:void 0;if(Object.hasOwn(t,"const"))return v.jsxs("div",{className:"command-field",children:[v.jsxs("span",{children:[d,a?" *":""]}),v.jsxs("small",{children:["Fixed value: ",JSON.stringify(t.const)]})]});if(Array.isArray(t.enum))return v.jsxs("label",{className:"command-field",children:[v.jsxs("span",{children:[d,a?" *":""]}),v.jsx("select",{value:JSON.stringify(s),onChange:y=>l(JSON.parse(y.target.value)),children:t.enum.map((y,w)=>v.jsx("option",{value:JSON.stringify(y),children:String(y)},w))}),f&&v.jsx("small",{children:f})]});const m=ym(t);if(t.anyOf&&(m===void 0||m==="object"||m==="array"))return v.jsx(Jx,{schema:t,label:d,path:r,value:s,required:a,description:f,onChange:l,onValidityChange:c});if(m==="object"){const y=s&&typeof s=="object"&&!Array.isArray(s)?s:{},w=new Set(Array.isArray(t.required)?t.required.filter(k=>typeof k=="string"):[]);return v.jsxs("fieldset",{className:"command-object",children:[v.jsx("legend",{children:d}),f&&v.jsx("p",{children:f}),Object.entries(t.properties??{}).map(([k,b])=>{const E=b,P=Object.hasOwn(y,k),R=Yx(E,k),_=`${r}.${k||"(empty key)"}`;return!P&&!w.has(k)?v.jsxs("button",{type:"button",className:"linkbtn command-property-add",onClick:()=>l(Qx(y,k,qi(E))),children:["Add ",R]},k):v.jsxs("div",{className:"command-property",children:[v.jsx(GC,{schema:E,name:k,path:_,value:P?y[k]:qi(E),required:w.has(k),onValidityChange:c,onChange:j=>l(Qx(y,k,j))}),!w.has(k)&&v.jsx("button",{type:"button",className:"linkbtn command-property-remove","aria-label":`Remove ${R}`,onClick:()=>l(nz(y,k)),children:"Remove"})]},k)})]})}if(m==="array")return v.jsx(Jx,{arrayOnly:!0,schema:t,label:d,path:r,value:s,required:a,description:f,onChange:l,onValidityChange:c});if(m==="boolean")return v.jsxs("label",{className:"command-check",children:[v.jsx("input",{type:"checkbox",checked:s===!0,onChange:y=>l(y.target.checked)})," ",d]});if(m==="null")return v.jsxs("div",{className:"command-field",children:[v.jsx("span",{children:d}),v.jsx("small",{children:"Null value"})]});const p=m==="number"||m==="integer";return v.jsx(rz,{schema:t,label:d,path:r,value:s,required:a,description:f,numeric:p,onChange:l,onValidityChange:c})}function iz(e){const t=e.catalog.commands.find(_=>_.name===e.initialCommandName)??e.catalog.commands[0],[n,r]=S.useState(t?.name??""),s=e.catalog.commands.find(_=>_.name===n)??t,a=S.useMemo(()=>s?Fs(s.input_schema):null,[s]),[l,c]=S.useState(()=>t&&!a?qi(t.input_schema):null),[d,f]=S.useState(""),[m,p]=S.useState("idle"),[y,w]=S.useState({}),k=S.useRef(0),b=S.useCallback((_,j)=>{w(A=>{if(j===null){if(!Object.hasOwn(A,_))return A;const N={...A};return delete N[_],N}return A[_]===j?A:{...A,[_]:j}})},[]),E=_=>{const j=e.catalog.commands.find(A=>A.name===_);r(_),c(j&&!Fs(j.input_schema)?qi(j.input_schema):null),f(""),p("idle"),w({})},P=_=>{if(_.preventDefault(),!s||a||e.busy)return;const A=Object.values(y)[0]??Hu(s.input_schema,l);if(A){f(`Validation denied: ${A}`),p("error");return}const N=++k.current,q=s,B=l;c(qi(q.input_schema)),w({}),f(`Sending ${q.name}…`),p("pending"),e.onSend(q,B,crypto.randomUUID(),e.catalog.fingerprint).then(D=>{k.current===N&&(D.status==="failed"?(f(`${q.name} was refused before delivery.`),p("error")):D.status==="pending"?(f(`${q.name} delivery is pending.`),p("warning")):D.status==="indeterminate"||!D.wire_id?(f(`${q.name} delivery could not be confirmed.`),p("indeterminate")):(f(`${q.name} sent. Its result will appear in the conversation.`),p("success")))}).catch(()=>{k.current===N&&(f(`${q.name} could not be sent. You can try it again.`),p("error"))})},R=s&&!a?Hu(s.input_schema,l):null;return v.jsxs("form",{noValidate:!0,className:"command-panel","aria-label":"Send a typed command",onSubmit:P,onKeyDown:_=>{_.key==="Escape"&&e.onClose()},children:[v.jsxs("div",{className:"command-panel-head",children:[v.jsxs("div",{className:"command-panel-recipient",children:[v.jsxs("strong",{children:["Commands for ",e.recipientName]}),v.jsxs("span",{className:"mono",title:e.catalog.recipient_cid,children:[e.catalog.recipient_cid.slice(0,12),"…"]})]}),v.jsx("button",{type:"button",className:"linkbtn",onClick:e.onRefresh,children:"Refresh"}),v.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close commands",onClick:e.onClose,children:"×"})]}),e.catalog.commands.length===0?v.jsx("p",{role:"status",children:"This recipient does not advertise commands."}):v.jsxs(v.Fragment,{children:[v.jsxs("label",{className:"command-field",children:[v.jsx("span",{children:"Command"}),v.jsx("select",{autoFocus:!0,value:n,onChange:_=>E(_.target.value),children:e.catalog.commands.map(_=>v.jsx("option",{value:_.name,children:_.name},_.name))})]}),s?.description&&v.jsx("p",{children:s.description}),a?v.jsxs("div",{className:"banner error",role:"alert",children:["Cannot render this command safely: ",a]}):s&&v.jsx(GC,{schema:s.input_schema,name:"Arguments",path:"Arguments",value:l,onChange:c,onValidityChange:b},s.name),R?.includes("cannot be validated safely")&&!Object.values(y).some(_=>_.includes("cannot be validated safely"))&&v.jsx("div",{className:"banner error",role:"alert",children:R}),s&&v.jsx("button",{className:"btn primary",disabled:!!a||e.busy||!!R||Object.keys(y).length>0,children:"Send command"}),v.jsx("div",{className:`command-status ${m}`,"data-state":m,role:"status","aria-live":"polite",children:d})]})]})}const Wo={type:"spring",stiffness:430,damping:38,mass:.72},Zx=10,KC=56,sz=18,oz=650;function az(e,t){return Math.abs(e)<Zx&&Math.abs(t)<Zx?"pending":Math.abs(e)>Math.abs(t)&&e>0?"drag":"reject"}function lz(e){const t=e.at(-1),n=t?e.slice(0,-1).reverse().find(r=>r.x!==t.x&&t.time-r.time<=100):void 0;return n&&t&&t.time>n.time?(t.x-n.x)/(t.time-n.time)*1e3:0}function uz(e,t){const n=lz(t);return n>=0&&(e>=KC||e>=sz&&n>=oz)}const Yh="ours.chats.listMode",ra="recent";function XC(){try{return globalThis.localStorage}catch{return}}function cz(e=XC()){try{return e?.getItem(Yh)==="identity"?"identity":ra}catch{return ra}}function dz(e,t=XC()){const n=e==="identity"?"identity":ra;try{return t?.setItem(Yh,n),t?.getItem(Yh)===n?n:ra}catch{return ra}}function ma(e){return typeof e=="string"?e:""}function Wu(e,t){const n=ma(e),r=ma(t),s=n.normalize().toLowerCase(),a=r.normalize().toLowerCase();return s<a?-1:s>a?1:n<r?-1:n>r?1:0}function fz(e,t){const n=Tu(ma(t.activityAt))-Tu(ma(e.activityAt));if(n!==0)return n;const r=Wu(e.name,t.name);return r!==0?r:Wu(e.id,t.id)}function Qh(e){return[...e].sort(fz)}function ew(e){return e.contacts.length>0?Tu(ma(e.contacts[0].activityAt)):0}function hz(e,t){const n=new Map,r=[];for(const a of e){const l=a.root||(t?.[a.id]?a.id:null);if(!l){r.push(a);continue}const c=t?.[l]||{label:l,note:""};let d=n.get(l);d||(d={id:`root:${l}`,rootId:l,label:c.label,note:c.note,contacts:[]},n.set(l,d)),d.contacts.push(a)}const s=[...n.values()].map(a=>({...a,contacts:Qh(a.contacts)}));return r.length>0&&s.push({id:"rootless",rootId:null,label:"Independent identities",note:"People, agents and apps without a verified Human/root group",contacts:Qh(r)}),s.sort((a,l)=>{const c=ew(l)-ew(a);if(c!==0)return c;const d=Wu(a.label,l.label);return d!==0?d:Wu(a.id,l.id)})}const pz=15e3;function Bf(e){const{c:t,active:n,grouped:r}=e,[s,a]=S.useState(!1),l=async(f,m)=>{if(!(!f||s)){a(!0);try{const p=await f();requestAnimationFrame(()=>{p?document.getElementById("chat-list-title")?.focus():m.focus()})}finally{a(!1)}}},c=v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"contact-avatar","aria-hidden":!0,children:t.initials}),v.jsxs("span",{className:"contact-copy",children:[v.jsxs("span",{className:"contact-row-topline",children:[v.jsx("span",{className:"contact-name",children:t.name}),t.when&&v.jsx("span",{className:"contact-time",children:t.when})]}),v.jsxs("span",{className:"contact-row-bottomline",children:[v.jsx("span",{className:"contact-last",children:t.last}),t.status==="pending"&&v.jsx("span",{className:"chip",children:"pending approval"}),!!t.unread&&v.jsx("span",{className:"contact-unread",children:t.unread})]})]}),t.status==="pending"&&v.jsxs("span",{className:"pending-actions",role:"group","aria-label":`Decide whether to accept ${t.name}`,children:[v.jsx("button",{type:"button",className:"linkbtn",disabled:s,onClick:f=>void l(e.onApprove,f.currentTarget),children:"Approve"}),v.jsx("button",{type:"button",className:"linkbtn quiet",disabled:s,onClick:f=>void l(e.onReject,f.currentTarget),children:"Reject"})]}),n&&v.jsx(js.span,{className:"contact-active-glow",layoutId:"active-contact",transition:Wo})]}),d="contact-row"+(n?" active":"")+(r?" grouped":"")+(t.status==="pending"?" pending":"");return t.status==="pending"?v.jsx("div",{className:d,children:c}):v.jsx(js.button,{type:"button",className:d,onClick:e.onClick,children:c})}function mz(e){const{contacts:t,roots:n,selected:r}=e,[s,a]=S.useState(""),l=S.useRef(null),c=S.useRef(null),[d,f]=S.useState(()=>cz()),m=D=>D.name.toLowerCase().includes(s.toLowerCase()),p=t.filter(D=>D.status!=="pending"&&m(D)),y=t.filter(D=>D.status==="pending"&&m(D)),w=Qh(p),k=hz(p,n),b=p.length===0&&y.length===0,E=D=>{f(dz(D))},P=[{id:"recent",label:"Recent"},{id:"identity",label:"By identity"}],R=S.useRef(null),_=S.useRef({id:-1,x0:0,y0:0,mode:"idle"}),j=S.useRef(!1),A=(D,I)=>{const U=_.current;if(U.id!==D)return;const z=R.current;if(I&&U.mode==="drag"&&z){const he=parseFloat(z.style.getPropertyValue("--mode-drag-x"))||0,J=Math.max(0,(z.clientWidth-8)/2);E(he>=J/2?"identity":"recent"),j.current=!0,window.setTimeout(()=>{j.current=!1},0)}_.current={id:-1,x0:0,y0:0,mode:"idle"},z?.hasPointerCapture?.(D)&&z.releasePointerCapture(D),z?.classList.remove("dragging"),z?.style.removeProperty("--mode-drag-x")},N=D=>{!D.isPrimary||_.current.id!==-1||(_.current={id:D.pointerId,x0:D.clientX,y0:D.clientY,mode:"pending"})},q=D=>{const I=_.current;if(I.id!==D.pointerId||I.mode==="idle")return;const U=D.clientX-I.x0,z=D.clientY-I.y0;if(I.mode==="pending"){if(Math.abs(U)<10&&Math.abs(z)<10)return;if(Math.abs(z)>Math.abs(U)){A(D.pointerId,!1);return}I.mode="drag",D.currentTarget.setPointerCapture?.(D.pointerId),D.currentTarget.classList.add("dragging")}D.preventDefault();const he=Math.max(0,(D.currentTarget.clientWidth-8)/2),J=d==="identity"?he:0;D.currentTarget.style.setProperty("--mode-drag-x",`${Math.min(he,Math.max(0,J+U))}px`)},B=(D,I)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(D.key))return;D.preventDefault();const z=D.key==="Home"?"recent":D.key==="End"||I==="recent"?"identity":"recent";E(z),document.getElementById(`conversation-list-${z}`)?.focus()};return S.useLayoutEffect(()=>{const D=l.current,I=c.current;if(!D||!I)return;const U=()=>D.style.setProperty("--list-bottom-chrome-height",`${I.getBoundingClientRect().height}px`);U();const z=new ResizeObserver(U);return z.observe(I),()=>{z.disconnect(),D.style.removeProperty("--list-bottom-chrome-height")}},[]),v.jsxs("div",{className:"listcol",ref:l,children:[v.jsxs("div",{className:"listcol-head",children:[v.jsxs("div",{className:"listcol-titlebar",children:[v.jsxs("h2",{id:"chat-list-title",className:"listcol-title messenger-lockup",tabIndex:-1,children:[v.jsx("span",{className:"messenger-brand-ours",children:"Ours"}),v.jsx("span",{className:"messenger-brand-product",children:"messenger"})]}),v.jsxs("div",{className:"listcol-actions",children:[v.jsx("button",{className:"btn icon-btn desktop-invite","aria-label":"Invite",title:"Invite",onClick:e.onInvite,children:v.jsx(Ce,{name:"invite",size:18})}),v.jsx("button",{className:"icon-btn","aria-label":"Settings",title:"Settings",onClick:e.onSettings,children:v.jsx(Ce,{name:"settings",size:18})})]})]}),v.jsx("div",{ref:R,className:"conversation-list-modes",role:"tablist","aria-label":"Conversation list layout","data-mode":d,onPointerDown:N,onPointerMove:q,onPointerUp:D=>A(D.pointerId,!0),onPointerCancel:D=>A(D.pointerId,!1),onLostPointerCapture:D=>A(D.pointerId,!1),children:P.map(D=>v.jsx("button",{id:`conversation-list-${D.id}`,type:"button",role:"tab","aria-selected":d===D.id,"aria-controls":"conversation-list-panel",tabIndex:d===D.id?0:-1,className:d===D.id?"active":"",onClick:I=>{if(j.current){I.preventDefault();return}E(D.id)},onKeyDown:I=>B(I,D.id),children:D.label},D.id))})]}),v.jsxs("div",{id:"conversation-list-panel",className:"listcol-scroll",role:"tabpanel","aria-labelledby":`conversation-list-${d}`,children:[d==="recent"&&w.length>0&&v.jsx("div",{className:"conversation-group",children:w.map(D=>v.jsx(Bf,{c:D,active:r===D.id,onClick:()=>e.onSelect(D.id)},D.id))}),d==="identity"&&k.map(D=>v.jsxs("div",{children:[v.jsxs("div",{className:"group-label",title:D.note,children:[D.rootId&&v.jsx(Ce,{name:"clusters"}),v.jsx("span",{children:D.label}),D.note&&v.jsxs("span",{className:"gl-note",children:["· ",D.note]})]}),v.jsx("div",{className:"conversation-group",children:D.contacts.map(I=>v.jsx(Bf,{c:I,grouped:D.rootId!==null,active:r===I.id,onClick:()=>e.onSelect(I.id)},I.id))})]},D.id)),y.length>0&&v.jsxs("div",{children:[v.jsx("div",{className:"group-label",children:v.jsx("span",{children:"Pending"})}),v.jsx("div",{className:"conversation-group",children:y.map(D=>v.jsx(Bf,{c:D,active:!1,onClick:()=>{},onApprove:()=>e.onApprovePending(D.id.slice(8)),onReject:()=>e.onRejectPending(D.id.slice(8))},D.id))})]}),b&&v.jsx("p",{className:"muted",style:{padding:"14px 10px",fontSize:"0.85rem"},children:"No contacts yet — share an invite to start."})]}),v.jsxs("div",{className:"list-bottom-chrome",ref:c,children:[v.jsxs("div",{className:"search adaptive-search",role:"search",children:[v.jsx("span",{className:"adaptive-search-icon","aria-hidden":!0,children:v.jsx(Ce,{name:"search"})}),v.jsx("input",{className:"field",placeholder:"Search people, agents, apps…",value:s,onChange:D=>a(D.target.value),onKeyDown:D=>{D.key==="Escape"&&(D.preventDefault(),a(""))}})]}),v.jsx("button",{type:"button",className:"icon-btn list-bottom-invite","aria-label":"Invite",title:"Invite",onClick:e.onInvite,children:v.jsx(Ce,{name:"invite",size:20})})]})]})}function gz(e){const[t,n]=S.useState(!1),[r,s]=S.useState(e.contact.name),[a,l]=S.useState(!1),[c,d]=S.useState(null),f=S.useRef(!1);S.useEffect(()=>{const p=y=>{y.key!=="Escape"||a||c||t||(y.preventDefault(),e.onBack())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,c,e.onBack,a]);const m=()=>{if(f.current)return;f.current=!0;const p=r.trim();p&&p!==e.contact.name?e.onRename(p):s(e.contact.name),n(!1)};return v.jsxs("div",{className:"detail contact-screen",children:[v.jsxs("div",{className:"detail-head contact-screen-head",children:[v.jsx("button",{type:"button",className:"icon-btn detail-back contact-back","aria-label":"Back to conversation",onClick:e.onBack,children:v.jsx(Ce,{name:"back"})}),v.jsx("strong",{children:"Contact"})]}),v.jsxs("div",{className:"contact-screen-scroll",children:[v.jsxs("section",{className:"contact-hero","aria-labelledby":"contact-screen-name",children:[v.jsx("div",{className:"avatar accent contact-avatar-large","aria-hidden":!0,children:e.contact.initials}),t?v.jsx("input",{id:"contact-screen-name",className:"field contact-name-input",value:r,autoFocus:!0,onChange:p=>s(p.target.value),onBlur:m,onKeyDown:p=>{p.key==="Enter"&&m(),p.key==="Escape"&&(f.current=!0,s(e.contact.name),n(!1))}}):v.jsx("h2",{id:"contact-screen-name",children:e.contact.name}),v.jsxs("p",{children:[v.jsx(Ce,{name:"lock",size:13})," End-to-end encrypted connection"]})]}),v.jsxs("section",{className:"contact-action-group","aria-label":"Contact actions",children:[v.jsxs("button",{type:"button",onClick:()=>l(!0),children:[v.jsxs("span",{children:[v.jsx(Ce,{name:"paperclip"}),"Shared photos, files, and links"]}),v.jsx(Ce,{name:"chevron"})]}),v.jsxs("button",{type:"button",onClick:()=>{f.current=!1,s(e.contact.name),n(!0)},children:[v.jsxs("span",{children:[v.jsx(Ce,{name:"edit"}),"Rename contact"]}),v.jsx(Ce,{name:"chevron"})]})]}),v.jsxs("section",{className:"contact-identity","aria-labelledby":"contact-identity-title",children:[v.jsx("h3",{id:"contact-identity-title",children:"Verified identity"}),e.contact.roleId&&v.jsxs("p",{children:["Role ",v.jsx("strong",{children:e.contact.roleId})," of ",v.jsx("strong",{children:e.contact.rootName})]}),v.jsx("code",{children:e.contact.id}),v.jsxs("button",{type:"button",className:"btn sm",onClick:()=>void navigator.clipboard.writeText(e.contact.id),children:[v.jsx(Ce,{name:"copy",size:14}),"Copy identity"]})]}),v.jsxs("button",{type:"button",className:"contact-remove",onClick:e.onRemove,children:[v.jsx(Ce,{name:"trash"}),"Remove contact"]})]}),a&&v.jsx(b4,{messages:e.messages,indexOffset:e.indexOffset,onClose:()=>l(!1),onJump:e.onOpenMessage,onPreview:p=>{l(!1),d(p)}}),c&&(Ca(c.filename,c.mime)?v.jsx(SC,{rec:c,onClose:()=>d(null)}):v.jsx(wC,{rec:c,onClose:()=>d(null),onSendText:e.onSendText,onSendFile:e.onSendFile}))]})}const gu=e=>`chat-message-${encodeURIComponent(e)}`,YC=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Uf(e){const{dir:t,canReply:n,onReply:r}=e,s=S.useRef(null),a=S.useRef(null),l=S.useRef(null),c=S.useRef(r);c.current=r;const d=t==="in"?1:-1,f=KC,m=84,p=()=>({id:-1,x0:0,y0:0,mode:"idle",armed:!1,distance:0,samples:[]}),y=S.useRef(p()),w=R=>{const _=a.current,j=l.current,A=YC();if(_&&(_.style.transform=R&&!A?`translateX(${R}px)`:""),j){const N=Math.min(1,Math.abs(R)/f);j.style.opacity=String(N),j.style.transform=A?"scale(1)":`scale(${.5+.5*N})`}},k=(R,_)=>{const j=y.current;if(j.id!==R)return;const A=_&&j.mode==="drag"&&uz(j.distance,j.samples);y.current=p(),a.current?.classList.remove("swiping"),l.current?.classList.remove("armed"),w(0);const N=s.current;N?.hasPointerCapture?.(R)&&N.releasePointerCapture(R),A&&c.current()};S.useEffect(()=>{const R=s.current;if(!R)return;const _=j=>k(j.pointerId,!1);return R.addEventListener("lostpointercapture",_),()=>{R.removeEventListener("lostpointercapture",_);const j=y.current.id;j!==-1&&k(j,!1)}},[]);const b=R=>{const _=R.target,j=window.getSelection?.();!n||!R.isPrimary||R.pointerType==="mouse"||R.pointerType==="pen"&&R.button!==0||y.current.id!==-1||j&&!j.isCollapsed||_.closest('a, button, input, textarea, select, [role="button"], audio, video, img, [draggable="true"], .filecard, .filecard-bubble, .image-bubble, .voice-bubble, .ours-message-file, .attachment')||(y.current={id:R.pointerId,x0:R.clientX,y0:R.clientY,mode:"maybe",armed:!1,distance:0,samples:[{x:R.clientX*d,time:R.timeStamp}]},w(0))},E=R=>{const _=y.current;if(_.id!==R.pointerId||_.mode==="idle")return;const j=R.clientX-_.x0,A=R.clientY-_.y0,N=window.getSelection?.();if(N&&!N.isCollapsed){k(R.pointerId,!1);return}if(_.mode==="maybe"){const U=az(j*d,A);if(U==="pending")return;if(U==="drag")_.mode="drag",R.currentTarget.setPointerCapture?.(R.pointerId),a.current?.classList.add("swiping");else{_.mode="idle";return}}R.preventDefault();const q=R.timeStamp;_.samples.push({x:R.clientX*d,time:q}),_.samples=_.samples.filter(U=>q-U.time<=120);let B=j*d;B<0&&(B=0),B>f&&(B=f+(B-f)*.35),B=Math.min(B,m),_.distance=B;const D=B*d,I=Math.abs(D)>=f;I!==_.armed&&(_.armed=I,l.current?.classList.toggle("armed",I),I&&navigator.vibrate?.(10)),w(D)},P=R=>{const _=y.current;_.id===R.pointerId&&_.mode==="drag"&&(_.samples.push({x:R.clientX*d,time:R.timeStamp}),_.distance=Math.max(0,(R.clientX-_.x0)*d),_.armed=_.distance>=f),k(R.pointerId,!0)};return v.jsxs("div",{ref:s,className:"msg-row "+(e.rowClass??t),style:n?{touchAction:"pan-y"}:void 0,onPointerDown:b,onPointerMove:E,onPointerUp:P,onPointerCancel:R=>k(R.pointerId,!1),onLostPointerCapture:R=>k(R.pointerId,!1),children:[n&&v.jsx("span",{className:"swipe-cue",ref:l,"aria-hidden":!0,children:v.jsx(Ce,{name:"reply",size:16})}),v.jsx("div",{className:"bubble-wrap",ref:a,children:e.children}),e.after]})}const yz=S.memo(function(t){const{messages:n,optimisticSend:r,sentKeys:s,hiddenEarlier:a,unreadWireId:l,roomLines:c,contactCid:d,contactName:f,onStartReply:m,onRevealMessage:p,onPreview:y,onFetchFile:w}=t,k=new Map;for(const A of n)A.wireId&&k.set(A.wireId,A);const b=A=>c.get(A)??null,E=A=>{if(A.dir==="out")return"You";const N=b(A);return N&&N.variant==="chat"?N.author:f},P=A=>{if(A.kind==="file")return A.mime?.startsWith("image/")?"Photo":Bs(A.mime??"",A.filename??"")?"Voice message":A.filename||"File";const N=b(A);return N?N.text||vI(N):A.text},R=A=>{if(!A.replyTo)return null;const N=k.get(A.replyTo.wireId);return N?{author:E(N),text:P(N)}:{author:"",text:"Original message"}},_=A=>{A.wireId&&m({wireId:A.wireId,author:E(A),text:P(A)})},j=A=>{if(!A)return null;const N=b(A);return N?N.variant==="system"?"room:system":`room:chat:${N.author}${N.role}`:A.dir};return v.jsx(zT,{initial:!1,children:n.map((A,N)=>{const q=A===r?.message?r.key:A.wireId&&s.get(A.wireId)||A.wireId||`${A.date}-${a+N}`,B=gu(A.wireId||q),D=n[N-1],I=n[N+1],U=b(A),z=j(A),he=!!D&&j(D)===z&&z!=="room:system",J=!!I&&j(I)===z&&z!=="room:system",Z=(A.dir==="out"?"out":"in")+(he?" cont-top":"")+(J?" cont-bot":""),ve=A.wireId?v.jsx("button",{className:"msg-reply",title:"Reply",onClick:()=>_(A),children:v.jsx(Ce,{name:"reply",size:15})}):null,Se=R(A),Q=Se&&A.replyTo?v.jsxs("button",{type:"button",className:"quote","aria-label":`Show original message${Se.author?` from ${Se.author}`:""}`,onClick:()=>p(A.replyTo.wireId),children:[Se.author&&v.jsx("span",{className:"quote-author",children:Se.author}),v.jsx("span",{className:"quote-text",children:Se.text})]}):null,pe=A.wireId===l?v.jsx("div",{id:`unread-${B}`,className:"unread-divider",role:"separator",children:v.jsx("span",{children:"Unread messages"})}):null;if(U&&U.variant==="system"){const T=U.presentation??"system";return v.jsxs(js.div,{className:"message-motion",id:B,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:Wo,children:[pe,v.jsxs("div",{className:`room-system room-${T}-card`,role:"note",children:[Q,U.label&&v.jsx("span",{className:"room-system-label",children:U.label}),U.roomName&&v.jsx("strong",{className:"room-card-name",children:U.roomName}),v.jsx(jx,{text:U.text,className:"room-system-text message-markdown"}),!!U.details?.length&&v.jsx("ul",{className:"room-card-details","aria-label":"Room event details",children:U.details.map(F=>v.jsx("li",{children:F},F))}),v.jsxs("span",{className:"room-card-provenance",children:[U.authoredBy&&v.jsx("span",{className:"room-card-author",children:U.authoredBy}),v.jsx("span",{className:"room-system-at",children:Hi(A.date)})]})]})]},q)}if(A.kind==="file"){const T=tS(A.wireId)??{id:A.wireId,dir:A.dir,filename:A.filename??"file",mime:A.mime??"application/octet-stream",size:0,date:A.date};return v.jsxs(js.div,{className:"message-motion",id:B,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:Wo,children:[pe,v.jsx(Uf,{dir:A.dir==="out"?"out":"in",rowClass:Z,canReply:!!A.wireId,onReply:()=>_(A),after:ve,children:v.jsxs("div",{className:`ours-message ours-message-file ours-message--${A.dir}`,children:[Q,v.jsx(yD,{rec:T,receipt:A.receipt,receiptless:A.receiptless,onPreview:y,onFetch:w})]})})]},q)}if(A.typed){const T=A.typed.kind==="command_result"&&A.replyTo?k.get(A.replyTo.wireId):void 0,F=A.typed.kind==="command_result"&&A.dir==="in"&&A.peerCid===d&&T?.dir==="out"&&T.peerCid===d&&T.typed?.kind==="command",X=A.typed.kind==="command_result"&&!A.typed.outcome.ok?A.typed.outcome.error.toLowerCase():"",M=A.typed.kind==="command"?A.dir==="out"?"Accepted · pending result":"Received command":A.typed.kind==="unknown"?"Safe failure":A.dir==="out"?"Result sent":F?X==="validation_denied"||X==="validation_failed"?"Validation denied":X==="policy_denied"||X==="unauthorized"||X==="forbidden"?"Policy denied":A.typed.outcome.ok?"Completed":"Failed":"Unmatched result · safe failure",oe=A.typed.kind==="command"?A.typed.command:A.typed.kind==="command_result"?`Result for ${F&&T?.typed?.kind==="command"?T.typed.command:"unmatched command"}`:`Unsupported ${A.typed.wire_kind}`,ue=A.typed.kind==="command"?A.typed.arguments:A.typed.kind==="command_result"?A.typed.outcome:{safe_failure:A.typed.malformed?"Malformed typed message":"Future typed message preserved"};return v.jsxs(js.div,{className:"message-motion",id:B,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0},transition:Wo,children:[pe,v.jsx(Uf,{dir:A.dir,rowClass:Z,canReply:!!A.wireId,onReply:()=>_(A),after:ve,children:v.jsxs("div",{className:`ours-message typed-message ours-message--${A.dir}`,children:[Q,v.jsx("div",{className:"typed-message-kind",children:A.typed.kind==="command"?"Command":A.typed.kind==="command_result"?"Result":"Typed message"}),v.jsx("strong",{children:oe}),v.jsx("div",{className:"typed-message-state",role:"status",children:M}),v.jsx("pre",{children:JSON.stringify(ue,null,2)}),v.jsxs("div",{className:"bubble-at",children:[Hi(A.date),A.dir==="out"&&v.jsx(Sh,{receipt:A.receipt,receiptless:A.receiptless})]})]})})]},q)}return v.jsxs(js.div,{className:"message-motion",id:B,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:Wo,children:[pe,v.jsx(Uf,{dir:A.dir==="out"?"out":"in",rowClass:Z,canReply:!!A.wireId,onReply:()=>_(A),after:ve,children:v.jsxs("div",{className:`ours-message ours-message--${A.dir}`,children:[Q,U&&!he&&v.jsxs(v.Fragment,{children:[U.roomName&&v.jsx("div",{className:"room-message-room",children:U.roomName}),v.jsxs("div",{className:"room-author",children:[v.jsx("span",{className:"room-author-name",children:U.author}),U.role&&v.jsx("span",{className:"room-author-role",children:U.role})]})]}),v.jsx(jx,{text:U?U.text:A.text}),v.jsxs("div",{className:"bubble-at",children:[Hi(A.date),A.dir==="out"&&v.jsx(Sh,{receipt:A.receipt,receiptless:A.receiptless})]})]})})]},q)})})});function vz(e){const{contact:t,messages:n}=e,[r,s]=S.useState(""),[a,l]=S.useState(!1),[c,d]=S.useState(null),[f,m]=S.useState(null),[p,y]=S.useState(null),[w,k]=S.useState(null),[b,E]=S.useState(null),[P,R]=S.useState(!1),[_,j]=S.useState(!1),[A,N]=S.useState(!1),[q,B]=S.useState(null),[D,I]=S.useState(null),[U,z]=S.useState(!1),[he,J]=S.useState(!1),[Z,ve]=S.useState(!1),[Se,Q]=S.useState(!1),[pe,T]=S.useState(!1),[F,X]=S.useState(null),[M,oe]=S.useState(null),ue=S.useRef(null),ae=S.useRef(null),me=S.useRef(null),ke=D?.recipient_cid===t?.id?D:null,$e=/^\/[^\s/]*$/.test(r)&&Z&&!U&&!Se&&!pe,Fe=$e&&e.onSendCommand?ke?.commands.filter(K=>K.name.toLowerCase().startsWith(r.slice(1).toLowerCase()))??[]:[],qe=JSON.stringify([t?.id,ke?.fingerprint,r]),st=F?.key===qe?Fe.findIndex(K=>K.name===F.name):-1,ot=S.useRef(null),Vt=S.useRef(null),en=S.useRef(null),et=S.useRef(null),Wt=S.useRef(null),Tn=S.useRef(null),zt=S.useRef(null),tn=S.useRef(!1),bt=S.useRef(null),tr=S.useRef(!1),[He,Lr]=S.useState(!1),[Y,ee]=S.useState(0),Te=S.useRef(null),Ae=S.useRef(!0),Ve=S.useRef(null),at=S.useRef(0),Nt=S.useRef(null),H=S.useRef(new Map),ge=S.useRef(0),ie=S.useRef(null),ye=S.useRef(null),Le=S.useRef(0),fe=S.useRef(null),Ge=S.useRef(null),wt=S.useRef(null),dt=S.useRef(null),[Je,yt]=S.useState(null),[ht,qt]=S.useState(""),Tt=S.useCallback(()=>{Ge.current?.abort(),Ge.current=null,dt.current!==null&&clearTimeout(dt.current),dt.current=null,wt.current?.classList.remove("reply-highlight"),wt.current=null,yt(null),qt("")},[]);S.useLayoutEffect(()=>(Tt(),Tt),[t?.id,Tt]);const Ta=S.useCallback(async K=>{Tt();const ne=new AbortController;Ge.current=ne;const ce=bt.current;ie.current=null,ye.current=null,Ae.current=!1,tr.current=!0,Nt.current=null,ce&&ce.scrollTo({top:ce.scrollTop,behavior:"instant"}),window.location.hash.startsWith("#chat-message-")&&window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search);const Oe=setTimeout(()=>{ne.abort(),qt("Could not load the original message. Please try again.")},1e4);try{let pt="found";const Rt=document.getElementById(gu(K));if((!Rt||!ce?.contains(Rt))&&(qt("Finding original message…"),pt=await e.onRevealMessage?.(K,ne.signal)??"unavailable"),ne.signal.aborted)return;if(pt!=="found"){qt(pt==="limit"?"Original message is beyond the search limit. Load earlier messages and try again.":"Original message is unavailable.");return}qt(""),yt({wireId:K,controller:ne})}catch{ne.signal.aborted||qt("Could not load the original message. Please try again.")}finally{clearTimeout(Oe)}},[Tt,e.onRevealMessage]);S.useLayoutEffect(()=>{if(!Je)return;const K=requestAnimationFrame(()=>{if(Je.controller.signal.aborted)return;const ne=document.getElementById(gu(Je.wireId)),ce=bt.current;if(!ne||!ce?.contains(ne)){qt("Original message is unavailable."),yt(null);return}Nt.current=null,Ae.current=!1;const Oe=ne.getBoundingClientRect(),pt=ce.getBoundingClientRect(),Rt=Math.max(16,(ce.clientHeight-Oe.height)/2);ce.scrollTo({top:ce.scrollTop+Oe.top-pt.top-Rt,behavior:"instant"}),ne.classList.remove("reply-highlight"),ne.offsetWidth,ne.classList.add("reply-highlight"),wt.current=ne,ne.setAttribute("tabindex","-1"),ne.focus({preventScroll:!0}),dt.current=setTimeout(()=>{ne.classList.remove("reply-highlight"),wt.current=null,dt.current=null},1500),yt(null),vr()});return()=>cancelAnimationFrame(K)},[Je]);const Yi=S.useRef("");S.useLayoutEffect(()=>{const K=Wt.current,ne=Tn.current,ce=zt.current;if(!K||!ne||!ce)return;let Oe=-1,pt=-1,Rt=null;const Rn=()=>{const Gt=Math.round(ne.getBoundingClientRect().height),cn=Math.round(ce.getBoundingClientRect().height);if(Gt!==Oe&&(Oe=Gt,K.style.setProperty("--conversation-head-height",`${Gt}px`)),cn!==pt){const St=Ae.current;pt=cn,K.style.setProperty("--conversation-compose-height",`${cn}px`),St&&(Rt!==null&&cancelAnimationFrame(Rt),Rt=requestAnimationFrame(()=>{Rt=null;const Bn=bt.current;Bn&&Ae.current&&(Bn.scrollTop=Math.max(0,Bn.scrollHeight-Bn.clientHeight))}))}};Rn();const Qe=new ResizeObserver(Rn);return Qe.observe(ne),Qe.observe(ce),()=>{Qe.disconnect(),Rt!==null&&cancelAnimationFrame(Rt),K.style.removeProperty("--conversation-head-height"),K.style.removeProperty("--conversation-compose-height")}},[t?.id]),S.useEffect(()=>{s(""),m(null),y(null),d(null),k(null),E(null),R(!1),j(!1),N(!1),at.current+=1,B(null),ot.current?.abort(),I(null),z(!1),J(!1),X(null),T(!1),Q(!1),H.current.clear(),ie.current=null,ye.current=null},[t?.id]);const mi=async(K=!0,ne=!0)=>{if(!t||!e.onLoadCommands)return;ot.current?.abort();const ce=new AbortController;ot.current=ce,J(!0),ne&&m(null);try{const Oe=await e.onLoadCommands(t.id,ce.signal);!ce.signal.aborted&&Oe.recipient_cid===t.id?(I(Oe),Oe.commands.length===0?(z(!1),U&&requestAnimationFrame(()=>et.current?.focus({preventScroll:!0}))):K&&z(!0)):ce.signal.aborted||(I(null),z(!1),ne&&m("Command discovery was refused because the authenticated recipient changed."))}catch(Oe){ce.signal.aborted||(I(null),z(!1),ne&&m(Oe instanceof Pu?`Command discovery failed: ${Oe.message}`:"Command discovery failed safely. The recipient may be offline or unsupported."))}finally{ot.current===ce&&J(!1)}};S.useEffect(()=>(mi(!1,!1),()=>ot.current?.abort()),[t?.id]);const jr=()=>{z(!1),Vt.current?.focus()},Qi=S.useRef(mi);Qi.current=mi,S.useEffect(()=>{if(!$e||!e.onLoadCommands)return;let K=!1,ne;const ce=async()=>{await Qi.current(!1,!1),K||(ne=setTimeout(ce,2e3))};return ce(),()=>{K=!0,clearTimeout(ne),ot.current?.abort()}},[$e,t?.id]),S.useEffect(()=>{me.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest",behavior:"instant"})},[st,qe]);const xn=()=>{ue.current=null,oe(null)};S.useLayoutEffect(xn,[$e,qe]),S.useLayoutEffect(()=>{ae.current!==null&&(et.current?.setSelectionRange(ae.current,ae.current),ae.current=null)},[r]);const Ra=K=>{if(!$e||!Fe.some(ce=>ce.name===K))return;const ne=`/${K} `;ae.current=ne.length,s(ne),X(null),T(!0),xn(),et.current?.focus({preventScroll:!0})};S.useEffect(()=>{if(!p)return;const K=p.reply?.wireId;n.some(ce=>ce.kind!=="file"&&ce.dir==="out"&&!!ce.wireId&&!p.wireIds.has(ce.wireId)&&ce.text===p.text&&(ce.replyTo?.wireId??void 0)===K)&&(y(null),m(null),s(ce=>ce===p.draft?"":ce),k(ce=>ce===p.reply?null:ce))},[n,p]);const nr=!!c?.wireId&&n.some(K=>K.wireId===c.wireId),Lt=S.useMemo(()=>c&&!nr?[...n,c.message]:n,[n,c,nr]);S.useEffect(()=>{nr&&d(null)},[nr]),S.useLayoutEffect(()=>{const K=et.current;if(!K)return;r.startsWith(Yi.current)||(K.style.height="0px");const ce=K.scrollHeight,pt=`${Math.max(44,Math.min(ce,132))}px`;K.style.height!==pt&&(K.style.height=pt),K.style.overflowY=ce>132?"auto":"hidden",Yi.current=r},[r,t?.id]);const Dr=K=>{const ne=bt.current;if(!ne)return;const ce=Math.max(0,ne.scrollHeight-ne.clientHeight);if(Math.abs(ne.scrollTop-ce)<1){ie.current=null,ye.current=null;return}const Oe=K&&!YC();ie.current=Oe?ce:null,ye.current=Oe?ne.scrollTop:null,Oe?ne.scrollTo({top:ce,behavior:"smooth"}):ne.scrollTop=ce},vr=()=>{Te.current===null&&(Te.current=requestAnimationFrame(()=>{Te.current=null;const K=bt.current;if(!K)return;const ne=K.scrollHeight-K.clientHeight-K.scrollTop>48;Lr(ne),ne||ee(0)}))};S.useLayoutEffect(()=>{if(!t){Ve.current=null,Ae.current=!0,Le.current=0;return}const K=bt.current;if(!K)return;const ne=Ve.current!==t.id,ce=Le.current,Oe=Lt.length!==ce,pt=Lt.at(-1),Rt=pt?pt.wireId||`${pt.date}:${pt.text}`:null,Rn=fe.current;if(Le.current=Lt.length,fe.current=Rt,!ne&&!Oe&&ie.current===null&&(Ae.current=K.scrollHeight-K.clientHeight-K.scrollTop<=48),ne||Ae.current)Dr(Oe&&!ne&&Ve.current!==null),Ae.current=!0;else if(Oe&&Lt.length>ce&&Rt!==Rn){const Qe=Rn===null?-1:Lt.findIndex(Gt=>(Gt.wireId||`${Gt.date}:${Gt.text}`)===Rn);ee(Gt=>Gt+Math.max(1,Lt.length-Math.max(0,Qe+1)))}Ve.current=t.id,vr()},[t,Lt.length]),S.useLayoutEffect(()=>{if(tr.current||!e.unreadOpen||window.location.hash.startsWith("#chat-message-"))return;const K=bt.current,ne=document.getElementById(`unread-${gu(e.unreadOpen.wireId)}`);!K||!ne||(K.scrollTop=Math.max(0,ne.offsetTop-16),Ae.current=!1,tr.current=!0,vr())},[e.unreadOpen,Lt.length]),S.useLayoutEffect(()=>{const K=window.location.hash;if(!K.startsWith("#chat-message-"))return;const ne=document.getElementById(K.slice(1));ne&&(ne.scrollIntoView({block:"center"}),Ae.current=!1)},[t?.id,Lt.length]),S.useLayoutEffect(()=>{const K=Nt.current,ne=bt.current;if(K===null||!ne)return;const ce=requestAnimationFrame(()=>{Nt.current===K&&(ne.scrollTop=K.top+ne.scrollHeight-K.height,Nt.current=null)});return()=>cancelAnimationFrame(ce)},[Lt.length]),S.useEffect(()=>{const K=bt.current;if(!K||typeof ResizeObserver>"u")return;const ne=K.firstElementChild;if(!ne)return;const ce=new ResizeObserver(()=>{Ae.current&&Dr(ie.current!==null),vr()});return ce.observe(ne),ce.observe(K),()=>{ce.disconnect(),Te.current!==null&&cancelAnimationFrame(Te.current)}},[t?.id]);const Aa=async K=>{const ne=++at.current;m(null),N(!0);try{if(K.size>$o&&CC(K.type,K.name)){const Oe=await D4(K,$o);if(ne!==at.current)return;E({filename:Oe.filename,mime:Oe.mime,bytes:Oe.bytes,originalSize:Oe.originalSize});return}if(K.size>$o){m(`"${K.name}" is ${di(K.size)} — files up to ${di($o)} can be sent.`);return}const ce=await K.arrayBuffer();if(ne!==at.current)return;E({filename:K.name||"file",mime:K.type||"application/octet-stream",bytes:new Uint8Array(ce)})}catch(ce){ne===at.current&&m(`Photo optimization failed: ${ce instanceof Error?ce.message:String(ce)}`)}finally{ne===at.current&&N(!1)}},ac=()=>{!b||!e.onSendFile||_||(j(!0),e.onSendFile(b,w?.wireId).then(()=>{E(null),k(null)}).catch(K=>m(`File send failed: ${String(K)} — it was not delivered.`)).finally(()=>j(!1)))},Js=e.onDraftChange;S.useEffect(()=>(Js?.(r.trim().length>0||a),()=>Js?.(!1)),[r,a,Js]);const xr=S.useMemo(()=>{const K=new Map;for(const ne of Lt)K.set(ne,ne.kind==="file"?null:ne.dir==="in"?dI(t?.announcedName??"",ne.text):null);return K},[Lt,t?.announcedName]);if(!t)return e.emptyOverride?v.jsx(v.Fragment,{children:e.emptyOverride}):v.jsx("div",{className:"detail",children:v.jsxs("div",{className:"detail-empty",children:[v.jsx(Ce,{name:"chat"}),v.jsxs("div",{children:[v.jsx("div",{style:{fontWeight:650,color:"var(--text-2)"},children:"Select a conversation"}),v.jsx("div",{style:{fontSize:"0.85rem"},children:"Chat with people, agents and apps across ours."})]})]})});const Ji=async()=>{const K=r,ne=K.trim(),ce=!!p&&K===p.draft&&(w?.wireId??void 0)===p.reply?.wireId;if(!ne||tn.current||ce)return;p&&y(null),tn.current=!0,l(!0),m(null);const Oe=w,pt=Oe?.wireId,Rt=new AbortController;let Rn=!1,Qe=0;s(""),k(null);const Gt=`optimistic-${++ge.current}`;d({key:Gt,wireId:null,message:{dir:"out",text:ne,date:new Date().toISOString(),read:!0,wireId:"",replyTo:pt?{wireId:pt}:null}});try{const cn=await Promise.race([e.onSend(ne,pt,Rt.signal),new Promise((St,Bn)=>{Qe=window.setTimeout(()=>{Rn=!0,Rt.abort(),Bn(new Error("send timeout"))},pz)})]);cn?(H.current.set(cn,Gt),d(St=>St?.key===Gt?{...St,wireId:cn}:St)):d(St=>St?.key===Gt?null:St),y(null)}catch(cn){d(null),s(St=>St===""?K:St),k(St=>St===null?Oe:St),Rn||!(cn instanceof Pu)?(y({draft:K,text:ne,reply:Oe,wireIds:new Set(n.flatMap(St=>St.wireId?[St.wireId]:[]))}),m(`${Rn?"Send timed out":"Send connection was interrupted"} — delivery status is unknown. Check the conversation; edit the draft before sending again.`)):m(`Send failed: ${String(cn)} — the message was not delivered.`)}finally{window.clearTimeout(Qe),tn.current=!1,l(!1)}},Zs=!!p&&r===p.draft&&(w?.wireId??void 0)===p.reply?.wireId;return v.jsxs("div",{className:"detail detail-chat",ref:Wt,children:[v.jsx("div",{className:"detail-head",ref:Tn,children:v.jsxs("div",{className:"conv-peer",children:[v.jsx("button",{className:"icon-btn detail-back","aria-label":"Back to conversations",onClick:e.onBack,children:v.jsx(Ce,{name:"back"})}),v.jsxs("div",{className:"conv-peer-status",children:[v.jsx("span",{className:"conv-peer-name",children:t.name}),e.syncing&&v.jsxs("div",{className:"conv-sync",role:"status","aria-live":"polite",children:[v.jsx("span",{className:"conv-sync-dot","aria-hidden":!0}),e.syncing==="connecting"?"Connecting…":"Updating…"]}),!e.syncing&&v.jsxs("span",{className:"conv-contact-status",children:[v.jsx(Ce,{name:"lock",size:11}),"Encrypted connection"]})]}),v.jsx("button",{type:"button",className:"conv-contact-trigger conv-contact-avatar","data-contact-trigger":!0,onClick:e.onOpenContact,disabled:!e.onOpenContact,"aria-label":`Open contact details for ${t.name}`,children:v.jsx("span",{className:"conv-contact-initials","aria-hidden":!0,children:t.initials})})]})}),v.jsx("div",{className:"messages",ref:bt,tabIndex:-1,"aria-label":"Conversation timeline",onScroll:K=>{const ne=K.currentTarget,ce=ne.scrollHeight-ne.clientHeight-ne.scrollTop;if(ie.current!==null){const Oe=ye.current;if(Oe===null||ne.scrollTop>=Oe-1){ye.current=ne.scrollTop,ce<=4&&(ie.current=null,ye.current=null);return}ie.current=null,ye.current=null}Ae.current=ce<=48,vr()},onPointerDown:()=>{Tt(),ie.current=null,ye.current=null},onTouchStart:()=>{Tt(),ie.current=null,ye.current=null},onWheel:()=>{Tt(),ie.current=null,ye.current=null},onKeyDown:K=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," ","Escape"].includes(K.key)&&Tt()},onDragOver:K=>{e.onSendFile&&K.preventDefault()},onDrop:K=>{if(!e.onSendFile)return;K.preventDefault();const ne=K.dataTransfer.files?.[0];ne&&Aa(ne)},children:v.jsxs("div",{className:"messages-inner",children:[v.jsxs("div",{className:"e2e-note",children:[v.jsx(Ce,{name:"lock"}),"End-to-end encrypted · the broker only sees ciphertext"]}),(e.hiddenEarlier??0)>0&&e.onLoadEarlier&&v.jsxs("button",{className:"btn sm chat-load-earlier",onClick:()=>{Ae.current=!1;const K=bt.current;Nt.current=K?{height:K.scrollHeight,top:K.scrollTop}:null,e.onLoadEarlier?.()},children:["Load earlier messages (",e.hiddenEarlier," remaining)"]}),v.jsx(yz,{messages:Lt,optimisticSend:c,sentKeys:H.current,hiddenEarlier:e.hiddenEarlier??0,unreadWireId:e.unreadOpen?.wireId,roomLines:xr,contactCid:t.id,contactName:t.name,onStartReply:k,onRevealMessage:Ta,onPreview:B,onFetchFile:e.onFetchFile}),v.jsx("div",{className:"thread-end","aria-hidden":!0})]})},t.id),He&&v.jsxs("button",{type:"button",className:"jump-latest btn sm","aria-label":Y?`Jump to latest, ${Y} new messages`:"Jump to latest",onClick:K=>{const ne=K.currentTarget===document.activeElement;Tt(),ee(0),Dr(!0),ne&&requestAnimationFrame(()=>bt.current?.focus({preventScroll:!0}))},children:[v.jsx("span",{children:"Jump to latest"}),!!Y&&v.jsx("span",{className:"jump-latest-count","aria-live":"polite",children:Y})]}),ht&&v.jsx("div",{className:"banner",role:"status",children:ht}),f&&v.jsxs("div",{className:"banner error",role:"alert",children:[f,f.startsWith("Send failed:")&&v.jsx("span",{className:"banner-actions",children:v.jsx("button",{className:"linkbtn",onClick:()=>void Ji(),children:"retry"})})]}),v.jsxs("div",{className:"composer-wrap",ref:zt,children:[U&&ke&&e.onSendCommand&&v.jsx(iz,{catalog:ke,recipientName:t.name,busy:he,onRefresh:()=>void mi(!0,!0),onClose:jr,onSend:async(K,ne,ce,Oe)=>{if(!t||t.id!==ke.recipient_cid)throw new Error("Recipient changed; refresh commands");return e.onSendCommand(t.id,K.name,ne,ce,Oe)}},`${ke.recipient_cid}:${ke.fingerprint}`),Fe.length>0&&v.jsx("div",{ref:me,id:"composer-command-suggestions",className:"command-suggestions",role:"listbox","aria-label":"Suggested contact commands",onScroll:xn,children:Fe.map((K,ne)=>v.jsxs("div",{id:`composer-command-option-${ne}`,role:"option","aria-selected":ne===st,className:"command-suggestion","data-pressed":M?.key===qe&&M.name===K.name||void 0,onMouseDown:ce=>{ce.button===0&&ce.preventDefault()},onPointerDown:ce=>{!ce.isPrimary||ce.button!==0||(ue.current={key:qe,name:K.name},oe({key:qe,name:K.name,pointer:ce.pointerId,x:ce.clientX,y:ce.clientY}))},onPointerMove:ce=>{M?.pointer===ce.pointerId&&Math.hypot(ce.clientX-M.x,ce.clientY-M.y)>10&&xn()},onPointerUp:()=>oe(null),onPointerCancel:xn,onPointerLeave:ce=>{ce.buttons!==0&&xn()},onClick:ce=>{const Oe=ue.current;xn(),(ce.detail===0||Oe?.key===qe&&Oe.name===K.name)&&Ra(K.name)},children:[v.jsxs("strong",{children:["/",K.name]}),K.description&&v.jsx("span",{children:K.description})]},`${qe}:${K.name}`))}),w&&v.jsxs("div",{className:"reply-bar",children:[v.jsx("div",{className:"reply-bar-line"}),v.jsxs("div",{className:"reply-bar-body",children:[v.jsxs("div",{className:"reply-bar-author",children:["Replying to ",w.author]}),v.jsx("div",{className:"reply-bar-text",children:w.text})]}),v.jsx("button",{className:"icon-btn",title:"Cancel reply",onClick:()=>k(null),children:v.jsx(Ce,{name:"close",size:16})})]}),b&&v.jsx(JS,{att:b,sending:_,onSend:ac,onDiscard:()=>E(null)}),A&&v.jsx("div",{className:"attachment-processing",role:"status",children:"Optimizing photo for secure delivery…"}),v.jsxs("div",{className:"composer"+(P?" recording":""),children:[e.onLoadCommands&&ke&&ke.commands.length>0&&v.jsx("button",{ref:Vt,type:"button",className:"icon-btn composer-tool command-trigger",title:"Recipient commands","aria-label":"Recipient commands","aria-expanded":U,disabled:he,onClick:()=>{U?jr():z(!0)},children:v.jsx(Ce,{name:"menu",size:19})}),e.onSendFile&&v.jsxs(v.Fragment,{children:[v.jsx("input",{ref:en,type:"file",style:{display:"none"},onChange:K=>{const ne=K.target.files?.[0];ne&&Aa(ne),K.target.value=""}}),v.jsx("button",{className:"icon-btn composer-tool",title:"Attach a file or photo",disabled:_||A||P,onClick:()=>en.current?.click(),children:v.jsx(Ce,{name:"paperclip",size:18})})]}),v.jsx("textarea",{ref:et,className:"field",rows:1,placeholder:(w?"Reply to "+w.author:"Message "+t.name)+"…",value:r,"aria-busy":a,"aria-autocomplete":Fe.length?"list":void 0,"aria-controls":Fe.length?"composer-command-suggestions":void 0,"aria-activedescendant":st>=0?`composer-command-option-${st}`:void 0,onFocus:()=>ve(!0),onBlur:()=>{ve(!1),X(null)},onCompositionStart:()=>{Q(!0),X(null)},onCompositionEnd:()=>Q(!1),onChange:K=>{s(K.target.value),X(null),T(!1)},onKeyDown:K=>{if(!(Se||K.nativeEvent.isComposing||K.keyCode===229)){if(Fe.length&&!K.shiftKey&&!K.altKey&&!K.ctrlKey&&!K.metaKey){if(K.key==="ArrowDown"||K.key==="ArrowUp"){K.preventDefault();const ne=st<0?K.key==="ArrowDown"?0:Fe.length-1:(st+(K.key==="ArrowDown"?1:-1)+Fe.length)%Fe.length;X({key:qe,name:Fe[ne].name});return}if((K.key==="Enter"||K.key==="Tab")&&st>=0){K.preventDefault(),Ra(Fe[st].name);return}if(K.key==="Escape"){K.preventDefault(),T(!0),X(null);return}}K.key==="Enter"?!(window.matchMedia("(pointer: coarse)").matches||window.innerWidth<=860)&&!K.shiftKey&&(K.preventDefault(),Ji()):K.key==="Escape"&&k(null)}}}),e.onSendFile&&!r.trim()&&!b&&!A&&!_?v.jsx(ZS,{disabled:_||A||!!b,onReady:K=>{R(!1),E(K)},onError:K=>{R(!1),m(K)},onActiveChange:R},t.id):v.jsxs("button",{className:"btn primary","aria-label":"Send",onPointerDown:K=>{K.button===0&&document.activeElement===et.current&&K.preventDefault()},onClick:()=>void Ji(),disabled:a||Zs||!r.trim(),title:Zs?"Delivery status unknown — edit before sending again":void 0,children:[v.jsx(Ce,{name:"send",size:16}),v.jsx("span",{className:"btn-label",children:"Send"})]})]})]}),q&&(Ca(q.filename,q.mime)?v.jsx(SC,{rec:q,onClose:()=>B(null)}):v.jsx(wC,{rec:q,onClose:()=>B(null),onSendText:e.onSend,onSendFile:e.onSendFile}))]})}const QC=3;function xz(e,t,n=QC){return[t,...e.filter(r=>r.cid!==t.cid)].slice(0,n)}function wz(e,t){return e.filter(n=>n.id!==t)}const Sz=6e3,kz=xz,Cz=wz;function bz(){const[e,t]=S.useState([]),n=S.useRef(0),r=S.useCallback((l,c,d)=>{const f=Date.now(),m={id:`${l}:${f}:${n.current++}`,cid:l,name:c,preview:"",at:f};t(p=>kz(p,m,QC))},[]),s=S.useCallback(l=>t(c=>Cz(c,l)),[]),a=S.useCallback(l=>t(c=>c.filter(d=>d.cid!==l)),[]);return{toasts:e,push:r,dismiss:s,clear:a}}function Ez(e){const{item:t,onOpen:n,onDismiss:r}=e,[s,a]=S.useState(!1),[l,c]=S.useState(!1),d=s||l;return S.useEffect(()=>{if(d)return;const f=setTimeout(()=>r(t.id),Sz);return()=>clearTimeout(f)},[t.id,d,r]),v.jsxs("div",{className:"banner msg",role:"status",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>c(!0),onBlur:f=>{f.currentTarget.contains(f.relatedTarget)||c(!1)},children:[v.jsxs("button",{className:"msg-open",title:`Open the conversation with ${t.name}`,onClick:()=>n(t.cid),children:[v.jsx("span",{className:"avatar sm accent","aria-hidden":"true",children:xh(t.name)}),v.jsxs("span",{className:"msg-text",children:[v.jsx("strong",{className:"msg-name",children:t.name}),v.jsx("span",{className:"msg-preview",children:t.preview||"New message"})]})]}),v.jsx("button",{className:"icon-btn msg-close",title:"Dismiss","aria-label":`Dismiss the notification from ${t.name}`,onClick:()=>r(t.id),children:v.jsx(Ce,{name:"close",size:15})})]})}function _z(e){return v.jsx(v.Fragment,{children:e.items.map(t=>v.jsx(Ez,{item:t,onOpen:e.onOpen,onDismiss:e.onDismiss},t.id))})}function Pz(e){const t=S.useRef(null),{text:n,size:r=240}=e;return S.useEffect(()=>{if(!t.current||!n)return;const s=t.current;cm(()=>import("./browser-mCqw9EMW.js").then(a=>a.b),[]).then(a=>{a.toCanvas(s,n,{width:r,margin:2,errorCorrectionLevel:"M",color:{dark:"#000000",light:"#ffffff"}})})},[n,r]),v.jsx("div",{style:{display:"flex",justifyContent:"center",margin:"8px 0"},children:v.jsx("canvas",{ref:t,"data-testid":"qr-canvas","data-invite":n,width:r,height:r,style:{borderRadius:8,border:"1px solid var(--line)",imageRendering:"pixelated"}})})}function Tz(e){const t=S.useRef(null),n=S.useRef(null),r=S.useRef(null),s=S.useRef(0),a=S.useRef(!0),[l,c]=S.useState("requesting"),[d,f]=S.useState(""),m=S.useCallback(()=>{s.current&&cancelAnimationFrame(s.current),r.current&&(r.current.getTracks().forEach(w=>w.stop()),r.current=null),t.current&&(t.current.srcObject=null)},[]),p=S.useCallback(w=>{r.current=w;const k=t.current;k.srcObject=w,k.setAttribute("playsinline","true"),k.play();const b=n.current,E=b.getContext("2d"),P=()=>{if(a.current)if(k.readyState>=k.HAVE_ENOUGH_DATA){const R=k.videoWidth||320,_=k.videoHeight||240;b.width=R,b.height=_,E.drawImage(k,0,0,R,_);const j=E.getImageData(0,0,R,_);cm(()=>import("./jsQR-C-e-dPgH.js").then(A=>A.j),[]).then(A=>{const N=A.default,q=N(j.data,j.width,j.height,{inversionAttempts:"dontInvert"});if(q&&q.data&&a.current){m(),e.onDecode(q.data);return}a.current&&(s.current=requestAnimationFrame(P))})}else s.current=requestAnimationFrame(P)};s.current=requestAnimationFrame(P)},[m,e]);S.useEffect(()=>{if(a.current=!0,!navigator.mediaDevices?.getUserMedia){c("nocamera");return}return navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then(w=>{if(!a.current){w.getTracks().forEach(k=>k.stop());return}c("scanning"),p(w)}).catch(w=>{if(!a.current)return;const k=w.name??"";k==="NotAllowedError"||k==="PermissionDeniedError"?c("denied"):k==="NotFoundError"||k==="DevicesNotFoundError"?c("nocamera"):(c("error"),f(w.message??String(w)))}),()=>{a.current=!1,m()}},[]);const y=()=>{m(),e.onClose()};return v.jsxs("div",{"data-testid":"qr-scanner",style:{display:"flex",flexDirection:"column",gap:12,padding:"12px 0"},children:[(l==="requesting"||l==="scanning")&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:l==="requesting"?"Requesting camera…":"Point your camera at the QR code."}),v.jsxs("div",{style:{position:"relative",borderRadius:8,overflow:"hidden",background:"#000",minHeight:200},children:[v.jsx("canvas",{ref:n,"data-testid":"scanner-canvas",style:{display:"none"}}),v.jsx("video",{ref:t,"data-testid":"scanner-video",muted:!0,playsInline:!0,style:{width:"100%",display:"block",borderRadius:8}}),l==="scanning"&&v.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx("div",{style:{width:160,height:160,borderRadius:12,border:"2px solid var(--accent)",boxShadow:"0 0 0 9999px rgba(0,0,0,0.4)"}})})]})]}),l==="denied"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[v.jsx(Ce,{name:"shield",size:16}),v.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"Camera access denied"})]}),v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:"Camera permission was denied. To scan QR codes, allow camera access in your browser settings, then try again. Or paste the invite text below instead."})]}),l==="nocamera"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[v.jsx(Ce,{name:"close",size:16}),v.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"No camera available"})]}),v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:"No camera was found on this device. Paste the invite text below instead."})]}),l==="error"&&v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:v.jsxs("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--danger, #e53)"},children:["Camera error: ",d||"unknown error",". Paste the invite text below instead."]})}),v.jsx("button",{className:"btn",style:{justifyContent:"center"},onClick:y,children:l==="scanning"?v.jsxs(v.Fragment,{children:[v.jsx(Ce,{name:"close",size:14}),"Cancel scan"]}):v.jsxs(v.Fragment,{children:[v.jsx(Ce,{name:"close",size:14}),"Close scanner"]})})]})}function Rz(e){const[t,n]=S.useState("generate"),[r,s]=S.useState("one_time"),[a,l]=S.useState(""),[c,d]=S.useState(null),[f,m]=S.useState("one_time"),[p,y]=S.useState(""),[w,k]=S.useState(""),[b,E]=S.useState(!1),[P,R]=S.useState(null),[_,j]=S.useState(null),[A,N]=S.useState(!1),[q,B]=S.useState(null),D=S.useRef(!1),I=async()=>{if(!D.current){D.current=!0,E(!0),j(null),R(null);try{m(r),d(await e.onCreate(r,r==="one_time"&&a.trim()||void 0))}catch(z){j(z instanceof Error?z.message:String(z))}finally{D.current=!1,E(!1)}}},U=v.jsx(kC,{className:"modal-tabs",label:"Invite mode",options:[{id:"generate",label:"Generate invite"},{id:"accept",label:"Accept invite"}],value:t,onChange:n,idPrefix:"invite-tab",panelId:"invite-panel"});return v.jsx(Pa,{title:t==="generate"?"Invite a contact":"Accept an invite",onClose:()=>{D.current||e.onClose()},tabs:U,children:v.jsxs("div",{id:"invite-panel",role:"tabpanel","aria-labelledby":`invite-tab-${t}`,children:[t==="generate"&&!c&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:13},children:[v.jsxs("p",{className:"muted","data-testid":"invite-identity",style:{margin:0,fontSize:"0.85rem"},children:["Creating as ",v.jsx("strong",{children:e.identity.name})," · ",v.jsxs("span",{className:"mono",children:["@",Z1(e.identity.cid)]})]}),v.jsxs("div",{role:"radiogroup","aria-label":"Invite kind",style:{display:"flex",flexDirection:"column",gap:7},children:[v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"invite-kind",checked:r==="one_time",onChange:()=>s("one_time")})," One person (one time)"]}),v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"invite-kind",checked:r==="public",onChange:()=>s("public")})," Reusable public invite"]})]}),r==="one_time"?v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.9rem"},children:"Optionally name the person or agent this invite is for."}),v.jsx("input",{className:"field",value:a,onChange:z=>l(z.target.value),placeholder:"Their name (optional), e.g. Bob",maxLength:64})]}):v.jsx("p",{className:"onb-warning","data-testid":"public-invite-warning",style:{margin:0,fontSize:"0.9rem"},children:"Anyone with this invite can connect until you revoke it. It has no expiry and stays valid across server restarts."}),v.jsx("button",{className:"btn primary",style:{justifyContent:"center"},disabled:b,onClick:()=>void I(),children:b?"Generating…":r==="public"?"Create public invite":"Generate invite"}),r==="public"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsx("h4",{style:{margin:0,fontSize:"0.9rem"},children:"Active reusable invites"}),e.invites.filter(z=>z.mode==="public").length===0&&v.jsx("p",{className:"muted",style:{margin:0},children:"None right now."}),e.invites.filter(z=>z.mode==="public").map(z=>v.jsxs("div",{"data-testid":"public-invite-row",style:{padding:"8px 10px",background:"var(--inset)",borderRadius:7},children:[v.jsx("span",{className:"mono",children:z.invite_id}),v.jsxs("p",{className:"muted",children:["Created ",z.created?kI(z.created):"unknown"," · Active until revoked · No expiry"]}),q===z.invite_id?v.jsxs("span",{children:[v.jsx("button",{className:"btn sm danger",onClick:()=>void e.onRevoke(z.invite_id).then(()=>(B(null),e.onRefresh())).catch(he=>j(String(he))),children:"Confirm revoke"})," ",v.jsx("button",{className:"btn sm",onClick:()=>B(null),children:"Keep it"})]}):v.jsx("button",{className:"btn sm",onClick:()=>B(z.invite_id),children:"Revoke"})]},z.invite_id))]}),P&&v.jsx("p",{className:"muted",children:P}),_&&v.jsx("p",{className:"onb-error",children:_})]}),t==="generate"&&c&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted","data-testid":f==="public"?"public-result-note":void 0,children:f==="public"?"Shown only on this screen. Copy it now; the text cannot be recovered later. The invite stays active until revoked.":`Send this invite to ${a.trim()||"your contact"}. It can be redeemed once.`}),v.jsx("textarea",{className:"field mono","data-testid":"invite-result-text",readOnly:!0,rows:5,value:c,onFocus:z=>z.currentTarget.select()}),f==="one_time"&&v.jsx(Pz,{text:c}),v.jsxs("button",{className:"btn primary",onClick:()=>void navigator.clipboard.writeText(c).then(()=>R("Copied to clipboard.")),children:[v.jsx(Ce,{name:"copy",size:15}),"Copy invite"]}),f==="public"&&v.jsx("button",{className:"btn","data-testid":"done-hide-invite",onClick:()=>{d(null),l(""),e.onRefresh()},children:"Done — hide invite"}),P&&v.jsx("p",{className:"muted",children:P})]}),t==="accept"&&v.jsxs("form",{style:{display:"flex",flexDirection:"column",gap:13},onSubmit:z=>{z.preventDefault(),!(!p.trim()||b)&&(E(!0),j(null),e.onAccept(p.trim(),w.trim()||void 0).then(()=>{R("Invite accepted — the contact will appear once the sender verifies your identity."),y(""),k("")}).catch(he=>j(String(he))).finally(()=>E(!1)))},children:[v.jsx("p",{className:"muted",children:"Paste the invite you received, or scan a QR code."}),A?v.jsx(Tz,{onDecode:z=>{y(z),N(!1)},onClose:()=>N(!1)}):v.jsxs("button",{type:"button",className:"btn",onClick:()=>N(!0),children:[v.jsx(Ce,{name:"monitor",size:15}),"Scan QR code"]}),v.jsx("textarea",{className:"field mono","aria-label":"Invite",rows:5,value:p,onChange:z=>y(z.target.value),placeholder:"Paste invite text…"}),v.jsx("input",{className:"field",value:w,onChange:z=>k(z.target.value),placeholder:"Rename them (optional)",maxLength:64}),v.jsx("button",{className:"btn primary",type:"submit",disabled:b||!p.trim(),children:b?"Connecting…":"Add contact"}),P&&v.jsx("p",{className:"muted",children:P}),_&&v.jsx("p",{className:"onb-error",children:_})]})]})})}function Az(e){const[t,n]=S.useState(e.identity.bio??""),[r,s]=S.useState(!1),[a,l]=S.useState(null),[c,d]=S.useState(e.push.preview),f=fA(),m=!e.workerSupported||e.push.status==="unsupported"?f??"Unavailable — requires a secure browser with service-worker support.":e.push.status==="needs-permission"?f??"Needs permission — allow notifications, then choose Enable or Repair.":e.push.status==="on"?"On — this browser and the server agree on the current Web Push configuration.":e.push.status==="repairing"?"Repairing — checking the browser subscription and server acknowledgement…":e.push.status==="error"?"Repair needed — the browser and server could not confirm the same subscription.":"Off — enable notifications for this browser.";return v.jsxs(Pa,{title:"Settings",onClose:e.onClose,wide:!0,children:[v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Display name"}),v.jsx("input",{className:"field",readOnly:!0,value:e.identity.name})]}),v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Your address"}),v.jsx("input",{className:"field mono",readOnly:!0,value:e.identity.cid,onFocus:p=>p.currentTarget.select()}),v.jsx("p",{className:"muted",children:"Your public address on ours. Share an invite to connect more easily."})]}),v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Public bio"}),v.jsx("textarea",{className:"field",rows:3,value:t,onChange:p=>{n(p.target.value),s(!1),l(null)}}),v.jsx("button",{className:"btn sm",onClick:()=>{l(null),e.onSaveBio(t).then(()=>s(!0)).catch(p=>l(String(p)))},children:r?"Saved":"Save bio"}),a&&v.jsx("p",{className:"onb-error",children:a})]}),v.jsxs("label",{style:{display:"flex",gap:9},children:[v.jsx("input",{type:"checkbox",checked:e.dark,onChange:e.onToggleDark})," Dark mode"]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"Notifications"}),v.jsx("p",{className:e.push.status==="needs-permission"||e.push.status==="error"?"onb-error":"muted",children:m}),f&&f!==m&&v.jsx("p",{className:"muted","data-testid":"push-platform-guidance",children:f}),v.jsxs("fieldset",{style:{border:0,padding:0,margin:"12px 0"},children:[v.jsx("legend",{className:"lbl",children:"Lock-screen preview"}),v.jsxs("label",{style:{display:"block",marginTop:7},children:[v.jsx("input",{type:"radio",name:"push-preview",checked:c==="full",onChange:()=>d("full")})," Full — sender and message text or filename"]}),v.jsxs("label",{style:{display:"block",marginTop:7},children:[v.jsx("input",{type:"radio",name:"push-preview",checked:c==="private",onChange:()=>d("private")})," Private — generic content only"]})]}),v.jsx("p",{className:"muted",children:"Full previews can expose sender names, message text, and filenames on the lock screen. The push provider still sees delivery endpoint, timing, and payload size metadata in either mode."}),v.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.push.status==="on"?v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("disable",c),children:"Disable notifications"}),v.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("repair",c),children:"Repair"}),c!==e.push.preview&&v.jsx("button",{className:"btn primary",disabled:e.busy,onClick:()=>void e.onPushAction("enable",c),children:"Save preview"})]}):v.jsx("button",{className:"btn primary",disabled:e.busy||!e.workerSupported||e.push.status==="unsupported",onClick:()=>void e.onPushAction(e.push.status==="error"||e.push.blocked?"repair":"enable",c),children:e.busy?"Repairing…":e.push.status==="error"||e.push.blocked?"Repair":"Enable notifications"})})]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"App status"}),v.jsx("p",{className:"muted",children:e.offline?"Offline — reconnecting. Message and identity data are never cached.":"Online."}),e.onInstall&&v.jsx("button",{className:"btn",onClick:e.onInstall,children:"Install app"}),e.updateAvailable&&v.jsx("button",{className:"btn primary",onClick:e.onReloadUpdate,children:"Reload to update"})]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"Build"}),v.jsx("input",{className:"field mono",readOnly:!0,value:e.build?`${e.build.version} · ${e.build.sha}`:"Loading…"})]})]})}function Iz(e,t,n,r,s=6e4){return!t||!t.sha?"current":t.sha===e?(n.remoteSha=null,n.firstMismatchAt=null,"current"):(n.remoteSha=t.sha,(n.firstMismatchAt===null||n.firstMismatchAt===void 0)&&(n.firstMismatchAt=r),n.controllerChanged?"newer-available":r-n.firstMismatchAt>=s?"stuck":"newer-available")}const Mz="85ef389e9da7ddd984a456db550ce39978fd8a18",Nz=15*6e4,Lz=6e4,jz=Iz;async function Dz(){try{const e=await fetch("/version.json",{cache:"no-store"});return e.ok?await e.json():null}catch{return null}}function Oz(e){const t={remoteSha:null,firstMismatchAt:null,controllerChanged:!1},n=()=>{t.controllerChanged=!0};navigator.serviceWorker?.addEventListener("controllerchange",n);let r=!1;const s=async()=>{const d=await Dz(),f=jz(Mz,d,t,Date.now(),Lz);f==="newer-available"?(e.onUpdateAvailable(),navigator.serviceWorker?.getRegistration().then(m=>m?.update())):f==="stuck"&&!r&&(r=!0,e.onStuck(d.sha))},a=setTimeout(()=>void s(),5e3),l=setInterval(()=>void s(),Nz),c=()=>{document.visibilityState==="visible"&&s()};return document.addEventListener("visibilitychange",c),()=>{clearTimeout(a),clearInterval(l),document.removeEventListener("visibilitychange",c),navigator.serviceWorker?.removeEventListener("controllerchange",n)}}async function Fz(e){try{const t=await navigator.serviceWorker.getRegistrations();await Promise.all(t.map(r=>r.unregister()));const n=await caches.keys();await Promise.all(n.map(r=>caches.delete(r)))}catch{}return location.replace(location.pathname+"?v="+encodeURIComponent(e)),new Promise(()=>{})}function Vz(){const e=new URL(location.href);e.searchParams.has("v")&&(e.searchParams.delete("v"),history.replaceState(null,"",e.pathname+e.search+e.hash))}const tw=[0,100,400,1e3,3e3,6e3],nw=e=>new Promise(t=>setTimeout(t,e)),rw={delivered:1,read:2},iw="ours-dark-v3",sw="#chat-message-",ow=Tu,zz=e=>e instanceof Error&&e.message?e.message:"The request could not be completed.";function JC(e,t){const n=new Map,r=[];for(const s of e?.messages??[]){const a={dir:s.dir,text:s.text,date:s.date,read:s.read,wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:null,peerCid:s.peer_cid,receipt:s.receipt??void 0,receiptless:s.dir==="out"&&!s.wire_id,messageKind:s.message_kind,typed:s.typed};s.wire_id?n.set(s.wire_id,a):r.push(a)}for(const s of t){const a=n.get(s.wire_id);n.set(s.wire_id,{dir:s.dir,text:"",date:s.date,read:a?.read??s.dir==="out",wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:a?.replyTo??null,kind:"file",filename:s.filename,mime:s.mime,receipt:a?.receipt})}return[...r,...n.values()].sort((s,a)=>{const l=ow(s.date)-ow(a.date);return l===0?s.wireId.localeCompare(a.wireId):l})}function Bz(e){const t={};for(const n of Object.values(e.roots??{}))t[n.root_cid]={label:n.root_name,note:"Verified identity"};return t}function Uz(e,t){return[...e.contacts.contacts.map(r=>{const s=e.contacts.roots?.[r.container_id],a=ur(e,r.container_id),c=JC(a,t[r.container_id]??[]).at(-1),d=Au(r);return{id:r.container_id,name:d,announcedName:r.name,initials:xh(d),when:c?SI(c.date):"",activityAt:c?.date??"",last:c?.kind==="file"?AI(c.filename,c.mime):a?.preview??c?.text??"",unread:a?.unread??0,status:"active",root:s?.root_cid??null,sub:s?`role “${s.role_id}” of ${s.root_name}`:"",roleId:s?.role_id??null,rootName:s?.root_name??null,mine:!1,kind:s?"agent":"person"}}),...e.contacts.pending.map(r=>{const s=Au(r);return{id:`pending:${r.container_id}`,name:s,announcedName:r.name,initials:xh(s),when:"",activityAt:"",last:`${r.queued} queued · approval required`,unread:0,status:"pending",root:null,sub:"",roleId:null,rootName:null,mine:!1,kind:"person"}})]}function $z(){return v.jsx(Hz,{})}function Hz(){const e=S.useRef(oA(uf(window.location.pathname))).current,[t,n]=S.useReducer(g0,e),[r,s]=S.useState(null),a=S.useRef(0),l=S.useRef(null),c=S.useRef(t),d=S.useRef(new nA),f=S.useRef(null),m=S.useRef(new Map),p=S.useRef(new Map),[y,w]=S.useState({}),k=S.useRef(y),[b,E]=S.useState(null),P=S.useRef(new Set),[R,_]=S.useState(null),j=S.useRef(R),A=S.useRef(!1),[N,q]=S.useState([]),[B,D]=S.useState(null),[I,U]=S.useState(()=>localStorage.getItem(iw)!=="0"),[z,he]=S.useState(null),[J,Z]=S.useState({supported:!1,offline:!navigator.onLine,updateAvailable:!1,registration:null}),[ve,Se]=S.useState({status:"unsupported",preview:"full"}),[Q,pe]=S.useState(!1),T=S.useRef(!1),[F,X]=S.useState(()=>window.location.hash.startsWith(sw)),{toasts:M,push:oe,dismiss:ue,clear:ae}=bz(),me=S.useCallback(H=>{c.current=g0(c.current,H),n(H)},[]),ke=S.useCallback(H=>{A.current=H},[]);S.useEffect(()=>{c.current=t},[t]),j.current=R,k.current=y,S.useMemo(()=>(P0(Object.values(y).flat()),null),[y]),S.useEffect(()=>(document.documentElement.classList.toggle("theme-dark",I),()=>document.documentElement.classList.remove("theme-dark")),[I]);const xe=S.useCallback(H=>me({type:"error",message:zz(H)}),[me]),$e=S.useCallback(()=>{const H=c.current;return{visibility:document.visibilityState,appRoute:H.route.name==="chats"?"chats":"other",selectedContactCid:lr(H),desktopLayout:f.current?.matches??window.innerWidth>=861,mobileDetailOpen:H.mobileDetailOpen,conversationCoveringDialogOpen:j.current!==null}},[]),Fe=S.useCallback(async(H,ge=!0)=>{try{const ie=await Xe.conversation(H);return me({type:"page",contactCid:H,page:ie}),ie}catch(ie){return ge&&xe(ie),null}},[me,xe]),qe=S.useCallback(async(H,ge=!0)=>{try{const ie=await Xe.files(H);return P0(ie.files),w(ye=>({...ye,[H]:ie.files})),ie.files}catch(ie){return ge&&xe(ie),null}},[xe]);S.useEffect(()=>Oz({onUpdateAvailable:()=>Z(H=>({...H,updateAvailable:!0})),onStuck:H=>{Fz(H)}}),[]);const st=S.useCallback(async()=>{const H=await Xe.contacts();return me({type:"contacts",contacts:{...H,pending:H.pending??[]}}),H},[me]),ot=S.useCallback(async()=>{try{const[H,ge,ie]=await Promise.all([Xe.identity(),Xe.contacts(),Xe.buildInfo()]),ye={...ge,pending:ge.pending??[]};return c.current.identity&&c.current.identity.cid!==H.cid&&(PI(),k.current={},w({})),me({type:"snapshot",identity:H,contacts:ye}),D(ie),await Promise.all(ye.contacts.flatMap(Le=>[Fe(Le.container_id,!1),qe(Le.container_id,!1)])),lr(c.current)}catch(H){return xe(H),null}},[me,qe,Fe,xe]),Vt=S.useCallback(async H=>{await d.current.request(H,async()=>{tA(H,$e())&&(await Xe.markRead(H),await Promise.all([Fe(H),st()]))}).catch(xe)},[$e,st,Fe,xe]),en=S.useCallback(async H=>{const ge=++a.current;l.current?.abort();const ie=new AbortController;l.current=ie,s(null),ae(H),qe(H,!1);let ye;try{ye=await Xe.conversation(H,void 0,ie.signal)}catch(ht){ie.signal.aborted||xe(ht);return}if(ie.signal.aborted||ge!==a.current)return;me({type:"page",contactCid:H,page:ye});const Le=ye.unread;let fe=[...ye.messages],Ge=ye.nextBefore;const wt=new Set,dt=new Set(fe.map(ht=>ht.wire_id).filter(Boolean)),Je=()=>fe.filter(ht=>ht.dir==="in"&&!ht.read);for(;Je().length<Le&&Ge&&!wt.has(Ge);){wt.add(Ge);let ht;try{ht=await Xe.conversation(H,Ge,ie.signal)}catch{break}if(ie.signal.aborted||ge!==a.current)return;const qt=ht.messages.filter(Tt=>!Tt.wire_id||!dt.has(Tt.wire_id));if(!qt.length&&ht.nextBefore===Ge)break;for(const Tt of qt)Tt.wire_id&&dt.add(Tt.wire_id);fe=[...qt,...fe],me({type:"older_page",contactCid:H,page:ht,newer:ye.messages}),Ge=ht.nextBefore}const yt=Je()[0];yt?.wire_id&&ge===a.current&&!ie.signal.aborted&&s({contactCid:H,wireId:yt.wire_id,count:Le}),await Vt(H)},[ae,me,Vt,qe,xe]),et=S.useCallback(async(H,ge,ie="page")=>{const ye=`page:${H}:${ie}`,Le=(m.current.get(ye)??0)+1;m.current.set(ye,Le);for(const fe of tw){if(fe&&await nw(fe),m.current.get(ye)!==Le)return;const Ge=await Fe(H,!1);if(Ge&&ge(Ge))return}},[Fe]),Wt=S.useCallback(async(H,ge)=>{const ie=`file:${H}`,ye=(m.current.get(ie)??0)+1;m.current.set(ie,ye);for(const Le of tw)if(Le&&await nw(Le),m.current.get(ie)!==ye||(await qe(H,!1))?.some(Ge=>Ge.wire_id===ge))return},[qe]),Tn=S.useRef(!1);S.useEffect(()=>{if(!F||!t.loaded)return;const H=decodeURIComponent(window.location.hash.slice(sw.length)),ge=lr(c.current);if(!H||!ge){X(!1);return}if(ur(c.current,ge)?.messages.some(ie=>ie.wire_id===H)){X(!1);return}Tn.current||(Tn.current=!0,et(ge,ie=>ie.messages.some(ye=>ye.wire_id===H),`anchor:${H}`).catch(()=>{}).finally(()=>X(!1)))},[F,et,t.loaded,t.pages]),S.useMemo(()=>(_I({url:H=>Object.values(k.current).flat().find(ie=>ie.wire_id===H)?.available?Xe.mediaUrl(H):null,bytes:async H=>{if(!Object.values(k.current).flat().find(ye=>ye.wire_id===H)?.available)return null;const ie=await fetch(Xe.mediaUrl(H),{cache:"no-store",credentials:"same-origin"});if(!ie.ok)throw new Error(`Media request failed (HTTP ${ie.status})`);return new Uint8Array(await ie.arrayBuffer())},fetch:async H=>{const ge=Object.values(k.current).flat().find(ie=>ie.wire_id===H);if(!ge)throw new Error("Media record is unavailable");await Xe.fetchFiles([H]),await qe(ge.contact_id)}}),null),[qe]),S.useEffect(()=>{let H;uA(ie=>{Z(ie),x0(ie.registration).then(Se).catch(()=>Se(ye=>({...ye,status:"error"})))},{shouldDeferReload:()=>A.current||j.current!==null}).then(ie=>{H=ie}).catch(xe);const ge=ie=>{ie.preventDefault(),he(ie)};return window.addEventListener("beforeinstallprompt",ge),()=>{H?.(),window.removeEventListener("beforeinstallprompt",ge)}},[xe]),S.useEffect(()=>yA(),[]),S.useEffect(()=>{if(!(!J.registration||ve.status!=="on"))return eA({registration:J.registration,identity:Xe.identity,onEvent:W1})},[ve.status,ve.bindingId,J.registration]),S.useEffect(()=>{const H=()=>Se(ge=>({...ge,status:"error"}));return window.addEventListener("ours-push-repair-required",H),()=>window.removeEventListener("ours-push-repair-required",H)},[]),S.useEffect(()=>{window.location.pathname==="/"&&window.history.replaceState(null,"",ni()),f.current=window.matchMedia("(min-width: 861px)");const H=()=>{const fe=uf(window.location.pathname);l.current?.abort(),a.current+=1,s(null),me({type:"route",route:fe}),T.current&&fe.name==="chats"&&fe.contactCid&&(T.current=!1,requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0}))),fe.name==="chats"&&fe.contactCid&&en(fe.contactCid)},ge=()=>{if(document.visibilityState!=="visible")return;const fe=lr(c.current);fe&&Vt(fe),X1(),J.registration&&x0(J.registration).then(Se).catch(()=>Se(Ge=>({...Ge,status:"error"})))};window.addEventListener("popstate",H),document.addEventListener("visibilitychange",ge);const ie=fe=>{const Ge=fe.type==="sync_required"?`${fe.type}:${fe.reason}`:fe.type==="receipt_received"?`${fe.type}:${fe.contact_id}:${fe.kind}:${fe.wire_ids.join(",")}`:`${fe.type}:${fe.contact_id}:${fe.wire_id}`,wt=Date.now(),dt=p.current.get(Ge)??0;p.current.set(Ge,wt);for(const[Je,yt]of p.current)wt-yt>6e4&&p.current.delete(Je);wt-dt<6e4||(async()=>{if(fe.type==="sync_required"){await ot();return}if(st().catch(xe),fe.type==="file_received"){await Wt(fe.contact_id,fe.wire_id);const Je=c.current.contacts.contacts.find(yt=>yt.container_id===fe.contact_id);lr(c.current)!==fe.contact_id&&Je&&oe(fe.contact_id,Au(Je),"New file");return}if(fe.type==="message_received"){const Je=c.current.contacts.contacts.find(yt=>yt.container_id===fe.contact_id);await et(fe.contact_id,yt=>yt.messages.some(ht=>ht.wire_id===fe.wire_id),`message:${fe.wire_id}`),lr(c.current)===fe.contact_id?await Vt(fe.contact_id):Je&&oe(fe.contact_id,Au(Je),"New message");return}me({type:"receipt",contactCid:fe.contact_id,kind:fe.kind,wireIds:fe.wire_ids}),await et(fe.contact_id,Je=>fe.wire_ids.every(yt=>{const ht=Je.messages.find(qt=>qt.wire_id===yt);return!!ht?.receipt&&rw[ht.receipt]>=rw[fe.kind]}),`receipt:${fe.wire_ids.join(",")}`)})().catch(xe)},ye=YR(ie),Le=QR(ie,fe=>me({type:"connection",connection:fe}));return ot().then(fe=>{fe&&en(fe)}),()=>{Le(),ye(),window.removeEventListener("popstate",H),document.removeEventListener("visibilitychange",ge)}},[et,Wt,me,Vt,en,oe,st,ot,xe,J.registration]);const zt=(H,ge,ie)=>{window.history.pushState({oursMessenger:!0},"",ge),me({type:"route",route:H,mobileDetailOpen:ie})},tn=async H=>{zt({name:"chats",contactCid:H},ni(H),!0),await en(H)},bt=async H=>{const ge=ur(c.current,H);if(!(!ge?.nextBefore||P.current.has(H))){P.current.add(H),E(H);try{const ie=await Xe.conversation(H,ge.nextBefore);me({type:"older_page",contactCid:H,page:ie,newer:ge.messages})}catch(ie){xe(ie)}finally{P.current.delete(H),E(null)}}},tr=S.useCallback(async(H,ge)=>{const ie=c.current,ye=lr(ie);if(!ye)return"unavailable";const Le=ur(ie,ye);if(!Le)return"unavailable";if(Le.messages.some(dt=>dt.wire_id===H))return"found";let fe=Le.nextBefore;const Ge=new Set;let wt=[...Le.messages];for(let dt=0;fe&&!Ge.has(fe)&&dt<10;dt++){Ge.add(fe);const Je=await Xe.conversation(ye,fe,ge);if(ge.aborted||c.current.identity?.cid!==ie.identity?.cid||lr(c.current)!==ye)return"unavailable";if(wt=[...Je.messages,...wt],Je.messages.some(yt=>yt.wire_id===H))return me({type:"older_page",contactCid:ye,page:Je,newer:wt}),"found";fe=Je.nextBefore}return fe?"limit":"unavailable"},[me]),He=lr(t),Lr=t.contacts.contacts.find(H=>H.container_id===He),Y=S.useMemo(()=>Uz(t,y),[t,y]),ee=Y.find(H=>H.id===He)??null,Te=He?JC(ur(t,He),y[He]??[]):[],Ae=t.identity;S.useEffect(()=>{if(!t.loaded)return;const H=uf(window.location.pathname),ge=H.name==="chats"||H.name==="contact"?H.contactCid:null;!ge||t.contacts.contacts.some(ie=>ie.container_id===ge)||(window.history.replaceState({oursMessenger:!0},"",ni()),r?.contactCid===ge&&(l.current?.abort(),a.current+=1,s(null)))},[t.loaded,t.contacts.contacts,r]);const Ve=t.loaded?He&&!ur(t,He)||F?"updating":t.connection!=="live"?"connecting":null:"connecting",at=async(H,ge=ve.preview)=>{if(J.registration){pe(!0),Se(ie=>({...ie,status:"repairing",preview:ge}));try{Se(await(H==="enable"?K1(J.registration,{preview:ge}):H==="repair"?mA(J.registration,ge):gA(J.registration,ve)))}catch(ie){Se(ye=>({...ye,status:"error"})),xe(ie)}finally{pe(!1)}}},Nt=()=>{q([]),_("invite"),Xe.invites().then(q).catch(xe)};return t.route.name==="not_found"?v.jsxs("div",{className:"centered-screen",children:[v.jsx("h1",{children:"Page not found"}),v.jsx("button",{className:"btn primary",onClick:()=>zt({name:"chats",contactCid:null},ni()),children:"Open chats"})]}):Ae?v.jsx("div",{className:I?"theme-dark":"",style:{height:"100%"},children:v.jsxs("div",{className:"app signal-app",children:[v.jsxs("main",{className:"section signal-stage"+(t.mobileDetailOpen?" show-detail":""),children:[v.jsx(mz,{contacts:Y,roots:Bz(t.contacts),selected:He,onSelect:H=>{H.startsWith("pending:")||tn(H)},onInvite:Nt,onSettings:()=>_("settings"),onApprovePending:async H=>{try{return await Xe.respondToIntroduction(H,"approve"),await ot(),!0}catch(ge){return xe(ge),!1}},onRejectPending:async H=>{try{return await Xe.respondToIntroduction(H,"reject"),await ot(),!0}catch(ge){return xe(ge),!1}}}),t.route.name==="contact"&&ee?v.jsx(gz,{contact:ee,messages:Te,onBack:()=>{T.current=!0,iA(window.history.state)==="back"?window.history.back():(window.history.replaceState({oursMessenger:!0},"",ni(ee.id)),me({type:"route",route:{name:"chats",contactCid:ee.id},mobileDetailOpen:!0}),requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0})),T.current=!1)},onRename:H=>void Xe.renameContact(ee.id,H).then(ot).catch(xe),onRemove:()=>{confirm(`Remove “${Lr?.name??"contact"}”?`)&&Xe.removeContact(ee.id).then(()=>(window.history.replaceState({oursMessenger:!0},"",ni()),me({type:"route",route:{name:"chats",contactCid:null},mobileDetailOpen:!1}),ot())).catch(xe)},onOpenMessage:H=>{zt({name:"chats",contactCid:ee.id},ni(ee.id),!0);let ge=12;const ie=()=>{const ye=document.getElementById(`chat-message-${encodeURIComponent(H)}`),Le=ye?.closest(".messages");if((!ye||!Le||Le.clientHeight<=0)&&ge-- >0){requestAnimationFrame(ie);return}if(!ye||!Le)return;const fe=ye.getBoundingClientRect(),Ge=Le.getBoundingClientRect(),wt=Le.scrollTop+fe.top-Ge.top-Math.max(0,(Le.clientHeight-fe.height)/2),dt=Math.max(0,Math.min(wt,Le.scrollHeight-Le.clientHeight));Le.scrollTo({top:dt,behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})};requestAnimationFrame(ie)},indexOffset:ur(t,ee.id)?.hasMore?Math.max(1,(ur(t,ee.id)?.total??Te.length)-Te.length):0,onSendText:async(H,ge)=>{const ie=await Xe.send(ee.id,H,ge);return await Fe(ee.id,!1),ie.wire_id??void 0},onSendFile:async(H,ge)=>{await Xe.sendFile(ee.id,new Blob([H.bytes],{type:H.mime}),H.filename,H.mime,ge),await Promise.all([qe(ee.id),Fe(ee.id,!1)])}}):v.jsx(vz,{contact:ee,messages:Te,syncing:Ve,unreadOpen:r?.contactCid===He?r:null,hiddenEarlier:ur(t,He??"")?.hasMore?Math.max(1,(ur(t,He??"")?.total??Te.length)-Te.length):0,onRevealMessage:tr,onLoadEarlier:He&&b!==He?()=>void bt(He):void 0,onBack:()=>{l.current?.abort(),a.current+=1,s(null),zt({name:"chats",contactCid:null},ni(),!1)},onOpenContact:()=>{He&&zt({name:"contact",contactCid:He},rA(He),!0)},onDraftChange:ke,onSend:async(H,ge,ie)=>{if(!He)return;const ye=He,Le=await Xe.send(ye,H,ge,ie);return me({type:"sent_message",contactCid:ye,message:{dir:"out",text:H,date:new Date().toISOString(),read:!0,wire_id:Le.wire_id??"",receipt:null,reply_to:ge?{wire_id:ge}:null}}),Le.wire_id?et(ye,fe=>fe.messages.some(Ge=>Ge.wire_id===Le.wire_id),`send:${Le.wire_id}`):st().catch(xe),Le.wire_id??void 0},onLoadCommands:async(H,ge)=>Xe.commands(H,ge),onSendCommand:async(H,ge,ie,ye,Le,fe)=>{const Ge=await Xe.sendCommand(H,ge,ie,ye,Le,fe);return Fe(H,!1),Ge},onSendFile:async(H,ge)=>{He&&(await Xe.sendFile(He,new Blob([H.bytes],{type:H.mime}),H.filename,H.mime,ge),await Promise.all([qe(He),Fe(He,!1)]))},onFetchFile:async H=>{await Xe.fetchFiles([H]),He&&await qe(He)}},He??"no-conversation")]}),v.jsxs("div",{className:"app-banners",children:[J.offline&&v.jsx("div",{className:"banner warn",role:"status","aria-live":"polite",children:"Offline — reconnecting to the network…"}),t.connection!=="live"&&v.jsx("div",{className:"banner warn",role:"status","aria-live":"polite",children:t.connection==="retrying"?"Live updates interrupted — reconnecting…":"Connecting to live updates…"}),J.updateAvailable&&v.jsxs("div",{className:"banner info",children:[v.jsx("span",{role:"status","aria-live":"polite",children:"A new version is available."}),v.jsx("span",{className:"banner-actions",children:v.jsx("button",{className:"linkbtn",onClick:()=>{J.registration&&y0(J.registration)},children:"Restart now"})})]}),v.jsx(_z,{items:M,onDismiss:ue,onOpen:H=>void tn(H)})]}),R==="invite"&&v.jsx(Rz,{identity:Ae,invites:N,onRefresh:async()=>q(await Xe.invites()),onCreate:async(H,ge)=>(await Xe.createInvite(H,ge)).blob,onAccept:async(H,ge)=>{await Xe.addContact(H,ge),await ot()},onRevoke:async H=>{await Xe.revokeInvite(H)},onClose:()=>{_(null),ot()}}),R==="settings"&&v.jsx(Az,{identity:Ae,push:ve,workerSupported:J.supported,busy:Q,offline:J.offline,updateAvailable:J.updateAvailable,build:B,dark:I,onToggleDark:()=>U(H=>(localStorage.setItem(iw,H?"0":"1"),!H)),onSaveBio:async H=>{await Xe.setBio(H),await ot()},onPushAction:at,onInstall:z?()=>void z.prompt().then(()=>he(null)):void 0,onReloadUpdate:()=>{J.registration&&y0(J.registration)},onClose:()=>{j.current=null,_(null),He&&Vt(He)}}),t.error&&v.jsxs("div",{className:"banner error",role:"alert","aria-live":"assertive",children:[t.error,v.jsx("button",{className:"linkbtn",onClick:()=>me({type:"error",message:null}),children:"dismiss"})]})]})}):v.jsx("div",{className:I?"theme-dark":"",style:{height:"100%"},children:v.jsx("div",{className:"centered-screen",children:v.jsx("p",{className:"muted",children:"Loading…"})})})}Vz();const ZC=document.getElementById("root");if(!ZC)throw new Error("missing #root");KE.createRoot(ZC).render(v.jsx(WT,{reducedMotion:"user",children:v.jsx($z,{})}));export{cm as _,Jh as g};
|
|
332
|
+
//# sourceMappingURL=index-C65oKF4f.js.map
|