@pi-chamber/web 1.0.6-rc.4 → 1.0.6-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{DiagramView-BZ--w7Lh.js → DiagramView-BxBfOrN5.js} +1 -1
- package/dist/assets/{DiffView-Dtn6otnT.js → DiffView-CSC9GMrb.js} +3 -3
- package/dist/assets/{FileSaveConflictDialog-p1ik30al.js → FileSaveConflictDialog-C_MNWp6w.js} +1 -1
- package/dist/assets/{FilesView-D0Z0VmQm.js → FilesView-DeN6KmNt.js} +4 -4
- package/dist/assets/{GitHubDetailScaffold-a27RksFo.js → GitHubDetailScaffold-CrtJwlqV.js} +2 -2
- package/dist/assets/{GitHubLinkPicker-B0CfzNfk.js → GitHubLinkPicker-g6w8K95J.js} +1 -1
- package/dist/assets/GitHubListPrimitives-lAi2ywE3.js +1 -0
- package/dist/assets/{GitView-BNkoaVYl.js → GitView-D9_em8Vx.js} +5 -5
- package/dist/assets/IssuesSurface-DCiHe6TE.js +7 -0
- package/dist/assets/{JsonTreeView-CEiJsFnP.js → JsonTreeView-D64mTfTx.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-418ChlsN.js → MarkdownRendererImpl-DwE90rTA.js} +3 -3
- package/dist/assets/PatchDiff-CcIwURzW.js +1 -0
- package/dist/assets/{PierreDiffViewer-CkuyY9ne.js → PierreDiffViewer-tN7awL0-.js} +2 -2
- package/dist/assets/PullRequestsSurface-iX4r3QlS.js +2 -0
- package/dist/assets/{SessionSwitcherContent-DkfjRgwv.js → SessionSwitcherContent-DrrM0ObM.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-CEw8BEs6.js → SessionSwitcherDropdown-B9_0JwY7.js} +2 -2
- package/dist/assets/SessionUnreadDot-Bpgp2gLO.js +1 -0
- package/dist/assets/SettingsView-C4hec1iy.js +6 -0
- package/dist/assets/{SettingsWindow-D03Z9QyW.js → SettingsWindow-Bepcpy0R.js} +1 -1
- package/dist/assets/{StickyHorizontalScrollbar-CONTbZgX.js → StickyHorizontalScrollbar-DNsbTLS7.js} +1 -1
- package/dist/assets/{ToolOutputDialog-DibddNlz.js → ToolOutputDialog-Dl9-vpvL.js} +5 -5
- package/dist/assets/{ToolPartDiffPreview-Bx7T1M2f.js → ToolPartDiffPreview-CLlHEPYD.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-BY-mDMT8.js → VirtualizedFileDiff-D9OpUpR3.js} +4 -4
- package/dist/assets/{Virtualizer-cIf8dSOQ.js → Virtualizer-okhy9Aq3.js} +1 -1
- package/dist/assets/{collapsible-BhQdnj8G.js → collapsible-ZT74WYMA.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-CzkFqhaU.js → computeVirtualFileMetrics-CDv_UBXL.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-CjCOK8EB.js → contextFileOpenGuard-BJ2sAhZG.js} +1 -1
- package/dist/assets/{fileTreeStatus-CPTpyKOV.js → fileTreeStatus-B2PDFobt.js} +2 -2
- package/dist/assets/{gitStatusPredicates-_GNbGCCb.js → gitStatusPredicates-BDdOjxH_.js} +1 -1
- package/dist/assets/{githubLink-CwIFogWd.js → githubLink-wwC2_C_9.js} +2 -2
- package/dist/assets/index-BaLCg7tL.css +1 -0
- package/dist/assets/{index-DjOKW10B.js → index-MXKT8Ir9.js} +1 -1
- package/dist/assets/index-fmzQmSSv.js +11 -0
- package/dist/assets/{main-C51a3z3b.js → main-CnW7qm2b.js} +2 -2
- package/dist/assets/{main-1wmEZ4Is.js → main-DmHVgAh0.js} +4 -4
- package/dist/assets/{markdownCore-Dsr6dY5C.js → markdownCore-DOFhfL5i.js} +2 -2
- package/dist/assets/{miniChat-DCxCx1fF.js → miniChat-D_Wl2jlx.js} +2 -2
- package/dist/assets/{mobile-D6Ac2Mu3.js → mobile-Cl-KcfGW.js} +2 -2
- package/dist/assets/{nativeFileSave-P_Eg5Dgb.js → nativeFileSave-B4Rg6n8u.js} +1 -1
- package/dist/assets/{pi-session-focus-preference-DjDyjZ1C.js → pi-session-focus-preference-BqEU9Iq6.js} +3 -3
- package/dist/assets/{renderDiffWithHighlighter-CK_inhQE.js → renderDiffWithHighlighter-U7WjeGm9.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-wBNgFl0U.js → renderElectronMiniChatApp-BJxNc9OP.js} +2 -2
- package/dist/assets/{renderFileWithHighlighter-B_PFeRW5.js → renderFileWithHighlighter-DiwpFgMp.js} +1 -1
- package/dist/assets/{renderMobileApp-B3mhxGnb.js → renderMobileApp-d5KpyvBc.js} +3 -3
- package/dist/assets/runtimeEndpointReset-Cd4yJDsk.js +62 -0
- package/dist/assets/{runtimeSurface-C3YPOBlg.js → runtimeSurface-X62LLBLv.js} +1 -1
- package/dist/assets/{useAppFontEffects-CoFst31H.js → useAppFontEffects-FKnY7Fe2.js} +92 -92
- package/dist/assets/useGitHubRemoteSearch-4QMXIODG.js +1 -0
- package/dist/assets/{useSwitcherItems-DHCCg4GF.js → useSwitcherItems-DtCNsq8u.js} +1 -1
- package/dist/assets/{vendor-aparajita-capacitor-secure-storage-B9_YeZyx.js → vendor-aparajita-capacitor-secure-storage-DVZvgYu4.js} +1 -1
- package/dist/assets/{vendor-base-ui-CKSCJw-4.js → vendor-base-ui-BCqPBzDj.js} +1 -1
- package/dist/assets/{vendor-boot-Ciu-Edvy.js → vendor-boot-3SaHYVb1.js} +1 -1
- package/dist/assets/{vendor-capacitor-app-Bpy_aPMq.js → vendor-capacitor-app-NbQ-WiPS.js} +1 -1
- package/dist/assets/{vendor-capacitor-keyboard-DO8AIjrZ.js → vendor-capacitor-keyboard-CgrHt8iN.js} +1 -1
- package/dist/assets/{vendor-capacitor-status-bar-SQkytwUW.js → vendor-capacitor-status-bar-CWt0OF5t.js} +1 -1
- package/dist/assets/{vendor-codemirror-autocomplete-CInQsE8a.js → vendor-codemirror-autocomplete-WThuuUAz.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-angular-QbsN3LGE.js → vendor-codemirror-lang-angular-BbLGCxF6.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-cpp-BT5U7lxV.js → vendor-codemirror-lang-cpp-Cceks-9O.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-css-dF-Dxbty.js → vendor-codemirror-lang-css-D1wpUg3Z.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-go-e4dp1bar.js → vendor-codemirror-lang-go-Cv0zXHHM.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-html-DKcbBVQ4.js → vendor-codemirror-lang-html-DbL8oT9H.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-java-CB2-FWv6.js → vendor-codemirror-lang-java-CNugenuC.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-javascript-B1zJk7xE.js → vendor-codemirror-lang-javascript-Bx_FIyZF.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-jinja-BsERjdSd.js → vendor-codemirror-lang-jinja-DDGjB3Zq.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-json-C0pZ0NhY.js → vendor-codemirror-lang-json-DIvqf9Pb.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-less-_N9HmR4h.js → vendor-codemirror-lang-less-D8r9dGG1.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-liquid-D02xJRCD.js → vendor-codemirror-lang-liquid-B24mguYi.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-markdown-_6ojeUuZ.js → vendor-codemirror-lang-markdown-v3yG2sbf.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-php-DguCnbJA.js → vendor-codemirror-lang-php-BcZGalqy.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-python-Byr5gw5f.js → vendor-codemirror-lang-python-b-JqEwQy.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-rust-DN6Wh0eK.js → vendor-codemirror-lang-rust-B1uZxDW-.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-sass-DOlEW7q1.js → vendor-codemirror-lang-sass-DqPrngKp.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-sql-BJzE9Dby.js → vendor-codemirror-lang-sql-UyCnpt-k.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-vue-DR8E-2nr.js → vendor-codemirror-lang-vue-xDwYkovV.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-wast-n6lcDH5S.js → vendor-codemirror-lang-wast-CF3169p_.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-xml-Cf2lmlmY.js → vendor-codemirror-lang-xml-FCtVhuOb.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-yaml-DSR_E0yh.js → vendor-codemirror-lang-yaml-g0sPmAnv.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-CSid5JuX.js → vendor-codemirror-language-data-B03xgzP2.js} +2 -2
- package/dist/assets/{vendor-codemirror-search-8lY3lt6q.js → vendor-codemirror-search-Dw3Wpu15.js} +1 -1
- package/dist/assets/{vendor-lezer-cpp-DZYTDKiD.js → vendor-lezer-cpp-Cu3E-KUI.js} +1 -1
- package/dist/assets/{vendor-lezer-css-6qV4fYNQ.js → vendor-lezer-css-Cb8vp67u.js} +1 -1
- package/dist/assets/{vendor-lezer-go-BDi_Iblq.js → vendor-lezer-go-BTsIaOm7.js} +1 -1
- package/dist/assets/{vendor-lezer-html-BjqcY-oJ.js → vendor-lezer-html-UQMsUwj-.js} +1 -1
- package/dist/assets/{vendor-lezer-java-J2BXqz1h.js → vendor-lezer-java-BIWrFrAx.js} +1 -1
- package/dist/assets/{vendor-lezer-javascript-CiQ9F8yX.js → vendor-lezer-javascript-BH2Etgoy.js} +1 -1
- package/dist/assets/{vendor-lezer-json-BxN83KKR.js → vendor-lezer-json-CE-QUCwM.js} +1 -1
- package/dist/assets/{vendor-lezer-lr-BVsDua_K.js → vendor-lezer-lr-HY6Yc0Vr.js} +1 -1
- package/dist/assets/{vendor-lezer-markdown-BkMtRQ3X.js → vendor-lezer-markdown-xFL3Evwf.js} +1 -1
- package/dist/assets/{vendor-lezer-php-B3XqnXdP.js → vendor-lezer-php-Cr_mQGrG.js} +1 -1
- package/dist/assets/{vendor-lezer-python-D342CidI.js → vendor-lezer-python-BNRFWCb0.js} +1 -1
- package/dist/assets/{vendor-lezer-rust-Dbfg_4LA.js → vendor-lezer-rust-BvfOK5cU.js} +1 -1
- package/dist/assets/{vendor-lezer-sass-ClxPaFt1.js → vendor-lezer-sass-qoxiLisk.js} +1 -1
- package/dist/assets/{vendor-lezer-xml-I_S6FQ1u.js → vendor-lezer-xml--x8SSpqU.js} +1 -1
- package/dist/assets/{vendor-lezer-yaml-COA6HWLP.js → vendor-lezer-yaml-BDo1JaEr.js} +1 -1
- package/dist/assets/{vendor-replit-codemirror-vim-7IE2zVmx.js → vendor-replit-codemirror-vim-D1Fe7FiY.js} +1 -1
- package/dist/assets/{web-components-CzkvK_V5.js → web-components-D5QImbWv.js} +4 -4
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +1 -1
- package/server/lib/pi/archive-store.js +38 -10
- package/server/lib/pi/archive-store.test.js +10 -0
- package/server/lib/pi/routes.js +65 -18
- package/server/lib/pi/routes.test.js +189 -8
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +5 -1
- package/server/lib/pi/session-daemon/session-daemon-engines.test.js +18 -0
- package/server/lib/pi/session-daemon/session-daemon.js +24 -1
- package/server/lib/pi/session-shelf-store.js +155 -84
- package/server/lib/pi/session-shelf-store.test.js +134 -33
- package/server/lib/pi/ui-settings-store.js +59 -0
- package/server/lib/pi/ui-settings-store.test.js +105 -6
- package/dist/assets/GitHubListPrimitives-LFdR70l6.js +0 -1
- package/dist/assets/IssuesSurface-D4kD7_VW.js +0 -7
- package/dist/assets/PatchDiff-BtOv_oLB.js +0 -1
- package/dist/assets/PullRequestsSurface-PML07zr-.js +0 -2
- package/dist/assets/SessionUnreadDot-DXUn8-ss.js +0 -1
- package/dist/assets/SettingsView-BvUeFUqw.js +0 -6
- package/dist/assets/index-Cfrwo5uQ.js +0 -11
- package/dist/assets/index-D7k62S9M.css +0 -1
- package/dist/assets/runtimeEndpointReset-D8lAOCUB.js +0 -62
- package/dist/assets/useGitHubRemoteSearch-C0-6hhMJ.js +0 -1
|
@@ -62,4 +62,4 @@ Error generating stack: `+d.message+`
|
|
|
62
62
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
63
63
|
`)},OW=0,Qa=[];function MW(t){var e=S.useRef([]),n=S.useRef([0,0]),i=S.useRef(),r=S.useState(OW++)[0],o=S.useState(tV)[0],a=S.useRef(t);S.useEffect(function(){a.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var w=$G([t.lockRef.current],(t.shards||[]).map(oD),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var c=S.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var E=Op(w),O=n.current,T="deltaX"in w?w.deltaX:O[0]-E[0],A="deltaY"in w?w.deltaY:O[1]-E[1],D,k=w.target,M=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in w&&M==="h"&&k.type==="range")return!1;var I=window.getSelection(),L=I&&I.anchorNode,B=L?L===k||L.contains(k):!1;if(B)return!1;var H=rD(M,k);if(!H)return!0;if(H?D=M:(D=M==="v"?"h":"v",H=rD(M,k)),!H)return!1;if(!i.current&&"changedTouches"in w&&(T||A)&&(i.current=D),!D)return!0;var U=i.current||D;return TW(U,C,w,U==="h"?T:A)},[]),f=S.useCallback(function(w){var C=w;if(!(!Qa.length||Qa[Qa.length-1]!==o)){var E="deltaY"in C?sD(C):Op(C),O=e.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&RW(D.delta,E)})[0];if(O&&O.should){C.cancelable&&C.preventDefault();return}if(!O){var T=(a.current.shards||[]).map(oD).filter(Boolean).filter(function(D){return D.contains(C.target)}),A=T.length>0?c(C,T[0]):!a.current.noIsolation;A&&C.cancelable&&C.preventDefault()}}},[]),h=S.useCallback(function(w,C,E,O){var T={name:w,delta:C,target:E,should:O,shadowParent:DW(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(A){return A!==T})},1)},[]),m=S.useCallback(function(w){n.current=Op(w),i.current=void 0},[]),p=S.useCallback(function(w){h(w.type,sD(w),w.target,c(w,t.lockRef.current))},[]),y=S.useCallback(function(w){h(w.type,Op(w),w.target,c(w,t.lockRef.current))},[]);S.useEffect(function(){return Qa.push(o),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",f,$a),document.addEventListener("touchmove",f,$a),document.addEventListener("touchstart",m,$a),function(){Qa=Qa.filter(function(w){return w!==o}),document.removeEventListener("wheel",f,$a),document.removeEventListener("touchmove",f,$a),document.removeEventListener("touchstart",m,$a)}},[]);var b=t.removeScrollBar,x=t.inert;return S.createElement(S.Fragment,null,x?S.createElement(o,{styles:AW(r)}):null,b?S.createElement(vW,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function DW(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const kW=sW(eV,MW);var sV=S.forwardRef(function(t,e){return S.createElement(Zg,os({},t,{ref:e,sideCar:kW}))});sV.classNames=Zg.classNames;var PW=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Za=new WeakMap,Mp=new WeakMap,Dp={},Pb=0,oV=function(t){return t&&(t.host||oV(t.parentNode))},IW=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=oV(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},NW=function(t,e,n,i){var r=IW(e,Array.isArray(t)?t:[t]);Dp[n]||(Dp[n]=new WeakMap);var o=Dp[n],a=[],c=new Set,f=new Set(r),h=function(p){!p||c.has(p)||(c.add(p),h(p.parentNode))};r.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(y){if(c.has(y))m(y);else try{var b=y.getAttribute(i),x=b!==null&&b!=="false",w=(Za.get(y)||0)+1,C=(o.get(y)||0)+1;Za.set(y,w),o.set(y,C),a.push(y),w===1&&x&&Mp.set(y,!0),C===1&&y.setAttribute(n,"true"),x||y.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",y,E)}})};return m(e),c.clear(),Pb++,function(){a.forEach(function(p){var y=Za.get(p)-1,b=o.get(p)-1;Za.set(p,y),o.set(p,b),y||(Mp.has(p)||p.removeAttribute(i),Mp.delete(p)),b||p.removeAttribute(n)}),Pb--,Pb||(Za=new WeakMap,Za=new WeakMap,Mp=new WeakMap,Dp={})}},LW=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=PW(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),NW(i,r,n,"aria-hidden")):function(){return null}},BW=Object.defineProperty,Ss=(t,e)=>BW(t,"name",{value:e,configurable:!0}),m1="Dialog",[lV,hie]=xB(m1),[VW,ia]=lV(m1),zW=Ss(t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:r,onOpenChange:o,modal:a=!0}=t,c=S.useRef(null),f=S.useRef(null),{nodes:h,registry:m}=FB(),[p,y]=EB({prop:i,defaultProp:r??!1,onChange:o,caller:m1}),[b,x]=S.useState(0),[w,C]=S.useState(0);return fe.jsx(VW,{scope:e,triggerRef:c,contentRef:f,contentId:ps(),titleId:ps(),descriptionId:ps(),titlePresent:b>0,descriptionPresent:w>0,setTitleCount:x,setDescriptionCount:C,open:p,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(E=>!E),[y]),modal:a,branchNodes:h,branchRegistry:m,children:n})},"Dialog"),aV="DialogPortal",[_W,uV]=lV(aV,{forceMount:void 0}),HW=Ss(t=>{const{__scopeDialog:e,forceMount:n,children:i,container:r}=t,o=ia(aV,e);return fe.jsx(_W,{scope:e,forceMount:n,children:S.Children.map(i,a=>fe.jsx(d1,{present:n||o.open,children:fe.jsx(qG,{asChild:!0,container:r,children:a})}))})},"DialogPortal"),mx="DialogOverlay",FW=S.forwardRef(Ss(function(e,n){const i=uV(mx,e.__scopeDialog),{forceMount:r=i.forceMount,...o}=e,a=ia(mx,e.__scopeDialog);return a.modal?fe.jsx(d1,{present:r||a.open,children:fe.jsx(jW,{...o,ref:n})}):null},"DialogOverlay")),UW=a1("DialogOverlay.RemoveScroll"),jW=S.forwardRef(Ss(function(e,n){const{__scopeDialog:i,...r}=e,o=ia(mx,i),a=BB(),c=Wu(n,a);return fe.jsx(sV,{as:UW,allowPinchZoom:!0,shards:S.useMemo(()=>[o.contentRef,...o.branchNodes.map(f=>({current:f}))],[o.contentRef,o.branchNodes]),children:fe.jsx(pr.div,{"data-state":g1(o.open),...r,ref:c,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),Ff="DialogContent",KW=S.forwardRef(Ss(function(e,n){const i=uV(Ff,e.__scopeDialog),{forceMount:r=i.forceMount,...o}=e,a=ia(Ff,e.__scopeDialog);return fe.jsx(d1,{present:r||a.open,children:a.modal?fe.jsx(YW,{...o,ref:n}):fe.jsx(qW,{...o,ref:n})})},"DialogContent")),YW=S.forwardRef(Ss(function(e,n){const i=ia(Ff,e.__scopeDialog),r=S.useRef(null),o=Wu(n,i.contentRef,r);return S.useEffect(()=>{const a=r.current;if(a)return LW(a)},[]),fe.jsx(cV,{...e,ref:o,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Bl(e.onCloseAutoFocus,a=>{a.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:Bl(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&a.preventDefault()}),onFocusOutside:Bl(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),qW=S.forwardRef(Ss(function(e,n){const i=ia(Ff,e.__scopeDialog),r=S.useRef(!1),o=S.useRef(!1);return fe.jsx(cV,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||i.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;i.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})},"DialogContentNonModal")),cV=S.forwardRef(Ss(function(e,n){const{__scopeDialog:i,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,"aria-describedby":c,children:f,...h}=e,m=ia(Ff,i);return p1(),fe.jsx(HB,{registry:m.branchRegistry,children:fe.jsx(UG,{asChild:!0,loop:!0,trapped:r,branches:m.branchNodes,onMountAutoFocus:o,onUnmountAutoFocus:a,children:fe.jsx(_G,{role:"dialog",id:m.contentId,"aria-labelledby":m.titlePresent?m.titleId:void 0,"aria-describedby":m.descriptionPresent?fV(c,m.descriptionId):c,"data-state":g1(m.open),...h,ref:n,deferPointerDownOutside:!0,onDismiss:()=>m.onOpenChange(!1),children:f})})})},"DialogContentImpl"));function fV(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const i of String(n).trim().split(/\s+/))i&&e.add(i);return e.size>0?Array.from(e).join(" "):void 0}Ss(fV,"concatAriaDescribedby");function g1(t){return t?"open":"closed"}Ss(g1,"getState");var Qc='[cmdk-group=""]',Ib='[cmdk-group-items=""]',GW='[cmdk-group-heading=""]',dV='[cmdk-item=""]',lD=`${dV}:not([aria-disabled="true"])`,gx="cmdk-item-select",ru="data-value",WW=(t,e,n)=>cG(t,e,n),hV=S.createContext(void 0),xd=()=>S.useContext(hV),pV=S.createContext(void 0),y1=()=>S.useContext(pV),mV=S.createContext(void 0),gV=S.forwardRef((t,e)=>{let n=su(()=>{var N,ne;return{search:"",value:(ne=(N=t.value)!=null?N:t.defaultValue)!=null?ne:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=su(()=>new Set),r=su(()=>new Map),o=su(()=>new Map),a=su(()=>new Set),c=yV(t),{label:f,children:h,value:m,onValueChange:p,filter:y,shouldFilter:b,loop:x,disablePointerSelection:w=!1,vimBindings:C=!0,...E}=t,O=ps(),T=ps(),A=ps(),D=S.useRef(null),k=sX();Jl(()=>{if(m!==void 0){let N=m.trim();n.current.value=N,M.emit()}},[m]),Jl(()=>{k(6,F)},[]);let M=S.useMemo(()=>({subscribe:N=>(a.current.add(N),()=>a.current.delete(N)),snapshot:()=>n.current,setState:(N,ne,q)=>{var G,Z,ae,Se;if(!Object.is(n.current[N],ne)){if(n.current[N]=ne,N==="search")U(),B(),k(1,H);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let le=document.getElementById(A);le?le.focus():(G=document.getElementById(O))==null||G.focus()}if(k(7,()=>{var le;n.current.selectedItemId=(le=K())==null?void 0:le.id,M.emit()}),q||k(5,F),((Z=c.current)==null?void 0:Z.value)!==void 0){let le=ne??"";(Se=(ae=c.current).onValueChange)==null||Se.call(ae,le);return}}M.emit()}},emit:()=>{a.current.forEach(N=>N())}}),[]),I=S.useMemo(()=>({value:(N,ne,q)=>{var G;ne!==((G=o.current.get(N))==null?void 0:G.value)&&(o.current.set(N,{value:ne,keywords:q}),n.current.filtered.items.set(N,L(ne,q)),k(2,()=>{B(),M.emit()}))},item:(N,ne)=>(i.current.add(N),ne&&(r.current.has(ne)?r.current.get(ne).add(N):r.current.set(ne,new Set([N]))),k(3,()=>{U(),B(),n.current.value||H(),M.emit()}),()=>{o.current.delete(N),i.current.delete(N),n.current.filtered.items.delete(N);let q=K();k(4,()=>{U(),q?.getAttribute("id")===N&&H(),M.emit()})}),group:N=>(r.current.has(N)||r.current.set(N,new Set),()=>{o.current.delete(N),r.current.delete(N)}),filter:()=>c.current.shouldFilter,label:f||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:O,inputId:A,labelId:T,listInnerRef:D}),[]);function L(N,ne){var q,G;let Z=(G=(q=c.current)==null?void 0:q.filter)!=null?G:WW;return N?Z(N,n.current.search,ne):0}function B(){if(!n.current.search||c.current.shouldFilter===!1)return;let N=n.current.filtered.items,ne=[];n.current.filtered.groups.forEach(G=>{let Z=r.current.get(G),ae=0;Z.forEach(Se=>{let le=N.get(Se);ae=Math.max(le,ae)}),ne.push([G,ae])});let q=D.current;z().sort((G,Z)=>{var ae,Se;let le=G.getAttribute("id"),ge=Z.getAttribute("id");return((ae=N.get(ge))!=null?ae:0)-((Se=N.get(le))!=null?Se:0)}).forEach(G=>{let Z=G.closest(Ib);Z?Z.appendChild(G.parentElement===Z?G:G.closest(`${Ib} > *`)):q.appendChild(G.parentElement===q?G:G.closest(`${Ib} > *`))}),ne.sort((G,Z)=>Z[1]-G[1]).forEach(G=>{var Z;let ae=(Z=D.current)==null?void 0:Z.querySelector(`${Qc}[${ru}="${encodeURIComponent(G[0])}"]`);ae?.parentElement.appendChild(ae)})}function H(){let N=z().find(q=>q.getAttribute("aria-disabled")!=="true"),ne=N?.getAttribute(ru);M.setState("value",ne||void 0)}function U(){var N,ne,q,G;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let Z=0;for(let ae of i.current){let Se=(ne=(N=o.current.get(ae))==null?void 0:N.value)!=null?ne:"",le=(G=(q=o.current.get(ae))==null?void 0:q.keywords)!=null?G:[],ge=L(Se,le);n.current.filtered.items.set(ae,ge),ge>0&&Z++}for(let[ae,Se]of r.current)for(let le of Se)if(n.current.filtered.items.get(le)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=Z}function F(){var N,ne,q;let G=K();G&&(((N=G.parentElement)==null?void 0:N.firstChild)===G&&((q=(ne=G.closest(Qc))==null?void 0:ne.querySelector(GW))==null||q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function K(){var N;return(N=D.current)==null?void 0:N.querySelector(`${dV}[aria-selected="true"]`)}function z(){var N;return Array.from(((N=D.current)==null?void 0:N.querySelectorAll(lD))||[])}function V(N){let ne=z()[N];ne&&M.setState("value",ne.getAttribute(ru))}function X(N){var ne;let q=K(),G=z(),Z=G.findIndex(Se=>Se===q),ae=G[Z+N];(ne=c.current)!=null&&ne.loop&&(ae=Z+N<0?G[G.length-1]:Z+N===G.length?G[0]:G[Z+N]),ae&&M.setState("value",ae.getAttribute(ru))}function j(N){let ne=K(),q=ne?.closest(Qc),G;for(;q&&!G;)q=N>0?iX(q,Qc):rX(q,Qc),G=q?.querySelector(lD);G?M.setState("value",G.getAttribute(ru)):X(N)}let Y=()=>V(z().length-1),$=N=>{N.preventDefault(),N.metaKey?Y():N.altKey?j(1):X(1)},te=N=>{N.preventDefault(),N.metaKey?V(0):N.altKey?j(-1):X(-1)};return S.createElement(pr.div,{ref:e,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:N=>{var ne;(ne=E.onKeyDown)==null||ne.call(E,N);let q=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||q))switch(N.key){case"n":case"j":{C&&N.ctrlKey&&$(N);break}case"ArrowDown":{$(N);break}case"p":case"k":{C&&N.ctrlKey&&te(N);break}case"ArrowUp":{te(N);break}case"Home":{N.preventDefault(),V(0);break}case"End":{N.preventDefault(),Y();break}case"Enter":{N.preventDefault();let G=K();if(G){let Z=new Event(gx);G.dispatchEvent(Z)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:lX},f),Jg(t,N=>S.createElement(pV.Provider,{value:M},S.createElement(hV.Provider,{value:I},N))))}),XW=S.forwardRef((t,e)=>{var n,i;let r=ps(),o=S.useRef(null),a=S.useContext(mV),c=xd(),f=yV(t),h=(i=(n=f.current)==null?void 0:n.forceMount)!=null?i:a?.forceMount;Jl(()=>{if(!h)return c.item(r,a?.id)},[h]);let m=vV(r,o,[t.value,t.children,o],t.keywords),p=y1(),y=jo(k=>k.value&&k.value===m.current),b=jo(k=>h||c.filter()===!1?!0:k.search?k.filtered.items.get(r)>0:!0);S.useEffect(()=>{let k=o.current;if(!(!k||t.disabled))return k.addEventListener(gx,x),()=>k.removeEventListener(gx,x)},[b,t.onSelect,t.disabled]);function x(){var k,M;w(),(M=(k=f.current).onSelect)==null||M.call(k,m.current)}function w(){p.setState("value",m.current,!0)}if(!b)return null;let{disabled:C,value:E,onSelect:O,forceMount:T,keywords:A,...D}=t;return S.createElement(pr.div,{ref:Ql(o,e),...D,id:r,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!y,"data-disabled":!!C,"data-selected":!!y,onPointerMove:C||c.getDisablePointerSelection()?void 0:w,onClick:C?void 0:x},t.children)}),$W=S.forwardRef((t,e)=>{let{heading:n,children:i,forceMount:r,...o}=t,a=ps(),c=S.useRef(null),f=S.useRef(null),h=ps(),m=xd(),p=jo(b=>r||m.filter()===!1?!0:b.search?b.filtered.groups.has(a):!0);Jl(()=>m.group(a),[]),vV(a,c,[t.value,t.heading,f]);let y=S.useMemo(()=>({id:a,forceMount:r}),[r]);return S.createElement(pr.div,{ref:Ql(c,e),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&S.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Jg(t,b=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},S.createElement(mV.Provider,{value:y},b))))}),QW=S.forwardRef((t,e)=>{let{alwaysRender:n,...i}=t,r=S.useRef(null),o=jo(a=>!a.search);return!n&&!o?null:S.createElement(pr.div,{ref:Ql(r,e),...i,"cmdk-separator":"",role:"separator"})}),ZW=S.forwardRef((t,e)=>{let{onValueChange:n,...i}=t,r=t.value!=null,o=y1(),a=jo(h=>h.search),c=jo(h=>h.selectedItemId),f=xd();return S.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),S.createElement(pr.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:r?t.value:a,onChange:h=>{r||o.setState("search",h.target.value),n?.(h.target.value)}})}),JW=S.forwardRef((t,e)=>{let{children:n,label:i="Suggestions",...r}=t,o=S.useRef(null),a=S.useRef(null),c=jo(h=>h.selectedItemId),f=xd();return S.useEffect(()=>{if(a.current&&o.current){let h=a.current,m=o.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=h.offsetHeight;m.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return y.observe(h),()=>{cancelAnimationFrame(p),y.unobserve(h)}}},[]),S.createElement(pr.div,{ref:Ql(o,e),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:f.listId},Jg(t,h=>S.createElement("div",{ref:Ql(a,f.listInnerRef),"cmdk-list-sizer":""},h)))}),eX=S.forwardRef((t,e)=>{let{open:n,onOpenChange:i,overlayClassName:r,contentClassName:o,container:a,...c}=t;return S.createElement(zW,{open:n,onOpenChange:i},S.createElement(HW,{container:a},S.createElement(FW,{"cmdk-overlay":"",className:r}),S.createElement(KW,{"aria-label":t.label,"cmdk-dialog":"",className:o},S.createElement(gV,{ref:e,...c}))))}),tX=S.forwardRef((t,e)=>jo(n=>n.filtered.count===0)?S.createElement(pr.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),nX=S.forwardRef((t,e)=>{let{progress:n,children:i,label:r="Loading...",...o}=t;return S.createElement(pr.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},Jg(t,a=>S.createElement("div",{"aria-hidden":!0},a)))}),pie=Object.assign(gV,{List:JW,Item:XW,Input:ZW,Group:$W,Separator:QW,Dialog:eX,Empty:tX,Loading:nX});function iX(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function rX(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function yV(t){let e=S.useRef(t);return Jl(()=>{e.current=t}),e}var Jl=typeof window>"u"?S.useEffect:S.useLayoutEffect;function su(t){let e=S.useRef();return e.current===void 0&&(e.current=t()),e}function jo(t){let e=y1(),n=()=>t(e.snapshot());return S.useSyncExternalStore(e.subscribe,n,n)}function vV(t,e,n,i=[]){let r=S.useRef(),o=xd();return Jl(()=>{var a;let c=(()=>{var h;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():r.current}})(),f=i.map(h=>h.trim());o.value(t,c,f),(a=e.current)==null||a.setAttribute(ru,c),r.current=c}),r}var sX=()=>{let[t,e]=S.useState(),n=su(()=>new Map);return Jl(()=>{n.current.forEach(i=>i()),n.current=new Map},[t]),(i,r)=>{n.current.set(i,r),e({})}};function oX(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Jg({asChild:t,children:e},n){return t&&S.isValidElement(e)?S.cloneElement(oX(e),{ref:e.ref},n(e.props.children)):n(e)}var lX={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const aX=1024;let uX=0;class ar{constructor(e,n){this.from=e,this.to=n}}class mt{constructor(e={}){this.id=uX++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Si.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}}mt.closedBy=new mt({deserialize:t=>t.split(" ")});mt.openedBy=new mt({deserialize:t=>t.split(" ")});mt.group=new mt({deserialize:t=>t.split(" ")});mt.isolate=new mt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});mt.contextHash=new mt({perNode:!0});mt.lookAhead=new mt({perNode:!0});mt.mounted=new mt({perNode:!0});class Eu{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[mt.mounted.id]}}const cX=Object.create(null);class Si{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):cX,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Si(e.name||"",n,e.id,i);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(r)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(mt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(mt.group),o=-1;o<(r?r.length:0);o++){let a=n[o<0?i.name:r[o]];if(a)return a}}}}Si.none=new Si("",Object.create(null),0,8);class v1{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let r=null;for(let o of e){let a=o(i);if(a){r||(r=Object.assign({},i.props));let c=a[1],f=a[0];f.combine&&f.id in r&&(c=f.combine(r[f.id],c)),r[f.id]=c}}n.push(r?new Si(i.name,r,i.id,i.flags):i)}return new v1(n)}}const kp=new WeakMap,aD=new WeakMap;var Vt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Vt||(Vt={}));class Qt{constructor(e,n,i,r,o){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,o&&o.length){this.props=Object.create(null);for(let[a,c]of o)this.props[typeof a=="number"?a:a.id]=c}}toString(){let e=Eu.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Hm(this.topNode,e)}cursorAt(e,n=0,i=0){let r=kp.get(this)||this.topNode,o=new Hm(r);return o.moveTo(e,n),kp.set(this,o._tree),o}get topNode(){return new ai(this,0,0,null)}resolve(e,n=0){let i=Uf(kp.get(this)||this.topNode,e,n,!1);return kp.set(this,i),i}resolveInner(e,n=0){let i=Uf(aD.get(this)||this.topNode,e,n,!0);return aD.set(this,i),i}resolveStack(e,n=0){return hX(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:o=this.length}=e,a=e.mode||0,c=(a&Vt.IncludeAnonymous)>0;for(let f=this.cursor(a|Vt.IncludeAnonymous);;){let h=!1;if(f.from<=o&&f.to>=r&&(!c&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;h=!0}for(;h&&i&&(c||!f.type.isAnonymous)&&i(f),!f.nextSibling();){if(!f.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:x1(Si.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Qt(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new Qt(Si.none,n,i,r)))}static build(e){return pX(e)}}Qt.empty=new Qt(Si.none,[],[],0);class b1{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new b1(this.buffer,this.index)}}class Ko{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return Si.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],r=this.set.types[n],o=r.name;if(/\W/.test(o)&&!r.isError&&(o=JSON.stringify(o)),e+=4,i==e)return o;let a=[];for(;e<i;)a.push(this.childString(e)),e=this.buffer[e+3];return o+"("+a.join(",")+")"}findChild(e,n,i,r,o){let{buffer:a}=this,c=-1;for(let f=e;f!=n&&!(bV(o,r,a[f+1],a[f+2])&&(c=f,i>0));f=a[f+3]);return c}slice(e,n,i){let r=this.buffer,o=new Uint16Array(n-e),a=0;for(let c=e,f=0;c<n;){o[f++]=r[c++],o[f++]=r[c++]-i;let h=o[f++]=r[c++]-i;o[f++]=r[c++]-e,a=Math.max(a,h)}return new Ko(o,a,this.set)}}function bV(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function Uf(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!i&&t instanceof ai&&t.index<0?null:t.parent;if(!a)return t;t=a}let o=i?0:Vt.IgnoreOverlays;if(i)for(let a=t,c=a.parent;c;a=c,c=a.parent)a instanceof ai&&a.index<0&&((r=c.enter(e,n,o))===null||r===void 0?void 0:r.from)!=a.from&&(t=c);for(;;){let a=t.enter(e,n,o);if(!a)return t;t=a}}class SV{cursor(e=0){return new Hm(this,e)}getChild(e,n=null,i=null){let r=uD(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return uD(this,e,n,i)}resolve(e,n=0){return Uf(this,e,n,!1)}resolveInner(e,n=0){return Uf(this,e,n,!0)}matchContext(e){return yx(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}}class ai extends SV{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,o=0){for(let a=this;;){for(let{children:c,positions:f}=a._tree,h=n>0?c.length:-1;e!=h;e+=n){let m=c[e],p=f[e]+a.from,y;if(!(!(o&Vt.EnterBracketed&&m instanceof Qt&&(y=Eu.get(m))&&!y.overlay&&y.bracketed&&i>=p&&i<=p+m.length)&&!bV(r,i,p,p+m.length))){if(m instanceof Ko){if(o&Vt.ExcludeBuffers)continue;let b=m.findChild(0,m.buffer.length,n,i-p,r);if(b>-1)return new us(new fX(a,m,e,p),null,b)}else if(o&Vt.IncludeAnonymous||!m.type.isAnonymous||S1(m)){let b;if(!(o&Vt.IgnoreMounts)&&(b=Eu.get(m))&&!b.overlay)return new ai(b.tree,p,e,a);let x=new ai(m,p,e,a);return o&Vt.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?m.children.length-1:0,n,i,r,o)}}}if(o&Vt.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&Vt.IgnoreOverlays)&&(r=Eu.get(this._tree))&&r.overlay){let o=e-this.from,a=i&Vt.EnterBracketed&&r.bracketed;for(let{from:c,to:f}of r.overlay)if((n>0||a?c<=o:c<o)&&(n<0||a?f>=o:f>o))return new ai(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function uD(t,e,n,i){let r=t.cursor(),o=[];if(!r.firstChild())return o;if(n!=null){for(let a=!1;!a;)if(a=r.type.is(n),!r.nextSibling())return o}for(;;){if(i!=null&&r.type.is(i))return o;if(r.type.is(e)&&o.push(r.node),!r.nextSibling())return i==null?o:[]}}function yx(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class fX{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}}class us extends SV{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return o<0?null:new us(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&Vt.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new us(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new us(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new us(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,o=i.buffer[this.index+3];if(o>r){let a=i.buffer[this.index+1];e.push(i.slice(r,o,a)),n.push(0)}return new Qt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function xV(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let a=t[o];(a.from>n.from||a.to<n.to)&&(n=a,e=o)}let i=n instanceof ai&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new dX(r,n)}class dX{constructor(e,n){this.heads=e,this.node=n}get next(){return xV(this.heads)}}function hX(t,e,n){let i=t.resolveInner(e,n),r=null;for(let o=i instanceof ai?i:i.context.parent;o;o=o.parent)if(o.index<0){let a=o.parent;(r||(r=[i])).push(a.resolve(e,n)),o=a}else{let a=Eu.get(o.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let c=new ai(a.tree,a.overlay[0].from+o.from,-1,o);(r||(r=[i])).push(Uf(c,e,n,!1))}}return r?xV(r):i}class Hm{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Vt.EnterBracketed,e instanceof ai)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof ai?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,o=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&Vt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Vt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Vt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(r.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let o=n+e,a=e<0?-1:i._tree.children.length;o!=a;o+=e){let c=i._tree.children[o];if(this.mode&Vt.IncludeAnonymous||c instanceof Ko||!c.type.isAnonymous||S1(c))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,o=this.stack.length;o>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;n=a,i=o+1;break e}r=this.stack[--o]}for(let r=i;r<this.stack.length;r++)n=new us(this.buffer,n,this.stack[r]);return this.bufferNode=new us(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return yx(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,o=this.stack.length-1;r>=0;o--){if(o<0)return yx(this._tree,e,r);let a=i[n.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}}function S1(t){return t.children.some(e=>e instanceof Ko||!e.type.isAnonymous||S1(e))}function pX(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=aX,reused:o=[],minRepeatType:a=i.types.length}=t,c=Array.isArray(n)?new b1(n,n.length):n,f=i.types,h=0,m=0;function p(D,k,M,I,L,B){let{id:H,start:U,end:F,size:K}=c,z=m,V=h;if(K<0)if(c.next(),K==-1){let te=o[H];M.push(te),I.push(U-D);return}else if(K==-3){h=H;return}else if(K==-4){m=H;return}else throw new RangeError(`Unrecognized record size: ${K}`);let X=f[H],j,Y,$=U-D;if(F-U<=r&&(Y=C(c.pos-k,L))){let te=new Uint16Array(Y.size-Y.skip),N=c.pos-Y.size,ne=te.length;for(;c.pos>N;)ne=E(Y.start,te,ne);j=new Ko(te,F-Y.start,i),$=Y.start-D}else{let te=c.pos-K;c.next();let N=[],ne=[],q=H>=a?H:-1,G=0,Z=F,ae=z;for(;c.pos>te;)q>=0&&c.id==q&&c.size>=0?(c.end<=Z-r&&(x(N,ne,U,G,c.end,Z,q,ae,V),G=N.length,Z=c.end,ae=m),c.next()):B>2500?y(U,te,N,ne):(q>=0&&c.size==-1&&o[c.id].type==i.types[q]&&(G<N.length&&x(N,ne,U,G,c.end,Z,q,ae,V),G=N.length+1,Z=c.start,ae=m),p(U,te,N,ne,q,B+1));if(q>=0&&G>0&&G<N.length&&x(N,ne,U,G,U,Z,q,ae,V),N.reverse(),ne.reverse(),q>-1&&G>0){let Se=b(X,V);j=x1(X,N,ne,0,N.length,0,F-U,Se,Se)}else j=w(X,N,ne,F-U,z-F,V)}M.push(j),I.push($)}function y(D,k,M,I){let L=[],B=0,H=-1;for(;c.pos>k;){let{id:U,start:F,end:K,size:z}=c;if(z>4)c.next();else{if(H>-1&&F<H)break;H<0&&(H=K-r),L.push(U,F,K),B++,c.next()}}if(B){let U=new Uint16Array(B*4),F=L[L.length-2];for(let K=L.length-3,z=0;K>=0;K-=3)U[z++]=L[K],U[z++]=L[K+1]-F,U[z++]=L[K+2]-F,U[z++]=z;M.push(new Ko(U,L[2]-F,i)),I.push(F-D)}}function b(D,k){return(M,I,L)=>{let B=0,H=M.length-1,U,F;if(H>=0&&(U=M[H])instanceof Qt){if(!H&&U.type==D&&U.length==L)return U;(F=U.prop(mt.lookAhead))&&(B=I[H]+U.length+F-L)}return w(D,M,I,L,B,k)}}function x(D,k,M,I,L,B,H,U,F){let K=[],z=[];for(;D.length>I;)K.push(D.pop()),z.push(k.pop()+M-L);D.push(w(i.types[H],K,z,B-L,U-B,F)),k.push(L-M)}function w(D,k,M,I,L,B,H){if(B){let U=[mt.contextHash,B];H=H?[U].concat(H):[U]}if(L>25){let U=[mt.lookAhead,L];H=H?[U].concat(H):[U]}return new Qt(D,k,M,I,H)}function C(D,k){let M=c.fork(),I=0,L=0,B=0,H=M.end-r,U={size:0,start:0,skip:0};e:for(let F=M.pos-D;M.pos>F;){let K=M.size;if(M.id==k&&K>=0){U.size=I,U.start=L,U.skip=B,B+=4,I+=4,M.next();continue}let z=M.pos-K;if(K<0||z<F||M.start<H)break;let V=M.id>=a?4:0,X=M.start;for(M.next();M.pos>z;){if(M.size<0)if(M.size==-3||M.size==-4)V+=4;else break e;else M.id>=a&&(V+=4);M.next()}L=X,I+=K,B+=V}return(k<0||I==D)&&(U.size=I,U.start=L,U.skip=B),U.size>4?U:void 0}function E(D,k,M){let{id:I,start:L,end:B,size:H}=c;if(c.next(),H>=0&&I<a){let U=M;if(H>4){let F=c.pos-(H-4);for(;c.pos>F;)M=E(D,k,M)}k[--M]=U,k[--M]=B-D,k[--M]=L-D,k[--M]=I}else H==-3?h=I:H==-4&&(m=I);return M}let O=[],T=[];for(;c.pos>0;)p(t.start||0,t.bufferStart||0,O,T,-1,0);let A=(e=t.length)!==null&&e!==void 0?e:O.length?T[0]+O[0].length:0;return new Qt(f[t.topID],O.reverse(),T.reverse(),A)}const cD=new WeakMap;function Jp(t,e){if(!t.isAnonymous||e instanceof Ko||e.type!=t)return 1;let n=cD.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof Qt)){n=1;break}n+=Jp(t,i)}cD.set(e,n)}return n}function x1(t,e,n,i,r,o,a,c,f){let h=0;for(let x=i;x<r;x++)h+=Jp(t,e[x]);let m=Math.ceil(h*1.5/8),p=[],y=[];function b(x,w,C,E,O){for(let T=C;T<E;){let A=T,D=w[T],k=Jp(t,x[T]);for(T++;T<E;T++){let M=Jp(t,x[T]);if(k+M>=m)break;k+=M}if(T==A+1){if(k>m){let M=x[A];b(M.children,M.positions,0,M.children.length,w[A]+O);continue}p.push(x[A])}else{let M=w[T-1]+x[T-1].length-D;p.push(x1(t,x,w,A,T,D,M,null,f))}y.push(D+O-o)}}return b(e,n,i,r,0),(c||f)(p,y,a)}class mie{constructor(){this.map=new WeakMap}setBuffer(e,n,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(n,i)}getBuffer(e,n){let i=this.map.get(e);return i&&i.get(n)}set(e,n){e instanceof us?this.setBuffer(e.context.buffer,e.index,n):e instanceof ai&&this.map.set(e.tree,n)}get(e){return e instanceof us?this.getBuffer(e.context.buffer,e.index):e instanceof ai?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Gs{constructor(e,n,i,r,o=!1,a=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new Gs(0,e.length,e,0,!1,i)];for(let o of n)o.to>e.length&&r.push(o);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],o=1,a=e.length?e[0]:null;for(let c=0,f=0,h=0;;c++){let m=c<n.length?n[c]:null,p=m?m.fromA:1e9;if(p-f>=i)for(;a&&a.from<p;){let y=a;if(f>=y.from||p<=y.to||h){let b=Math.max(y.from,f)-h,x=Math.min(y.to,p)-h;y=b>=x?null:new Gs(b,x,y.tree,y.offset+h,c>0,!!m)}if(y&&r.push(y),a.to>p)break;a=o<e.length?e[o++]:null}if(!m)break;f=m.toA,h=m.toA-m.toB}return r}}class wV{startParse(e,n,i){return typeof e=="string"&&(e=new mX(e)),i=i?i.length?i.map(r=>new ar(r.from,r.to)):[new ar(0,0)]:[new ar(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let o=r.advance();if(o)return o}}}class mX{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function gie(t){return(e,n,i,r)=>new yX(e,t,n,i,r)}class fD{constructor(e,n,i,r,o,a){this.parser=e,this.parse=n,this.overlay=i,this.bracketed=r,this.target=o,this.from=a}}function dD(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class gX{constructor(e,n,i,r,o,a,c,f){this.parser=e,this.predicate=n,this.mounts=i,this.index=r,this.start=o,this.bracketed=a,this.target=c,this.prev=f,this.depth=0,this.ranges=[]}}const CV=new mt({perNode:!0});class yX{constructor(e,n,i,r,o){this.nest=n,this.input=i,this.fragments=r,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Qt(i.type,i.children,i.positions,i.length,i.propValues.concat([[CV,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[mt.mounted.id]=new Eu(n,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new SX(this.fragments),n=null,i=null,r=new Hm(new ai(this.baseTree,this.ranges[0].from,0,null),Vt.IncludeAnonymous|Vt.IgnoreMounts);e:for(let o,a;;){let c=!0,f;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)c=!1;else if(e.hasNode(r)){if(n){let h=n.mounts.find(m=>m.frag.from<=r.from&&m.frag.to>=r.to&&m.mount.overlay);if(h)for(let m of h.mount.overlay){let p=m.from+h.pos,y=m.to+h.pos;p>=r.from&&y<=r.to&&!n.ranges.some(b=>b.from<y&&b.to>p)&&n.ranges.push({from:p,to:y})}}c=!1}else if(i&&(a=vX(i.ranges,r.from,r.to)))c=a!=2;else if(!r.type.isAnonymous&&(o=this.nest(r,this.input))&&(r.from<r.to||!o.overlay)){r.tree||(bX(r),n&&n.depth++,i&&i.depth++);let h=e.findMounts(r.from,o.parser);if(typeof o.overlay=="function")n=new gX(o.parser,o.overlay,h,this.inner.length,r.from,!!o.bracketed,r.tree,n);else{let m=gD(this.ranges,o.overlay||(r.from<r.to?[new ar(r.from,r.to)]:[]));m.length&&dD(m),(m.length||!o.overlay)&&this.inner.push(new fD(o.parser,m.length?o.parser.startParse(this.input,yD(h,m),m):o.parser.startParse(""),o.overlay?o.overlay.map(p=>new ar(p.from-r.from,p.to-r.from)):null,!!o.bracketed,r.tree,m.length?m[0].from:r.from)),o.overlay?m.length&&(i={ranges:m,depth:0,prev:i}):c=!1}}else if(n&&(f=n.predicate(r))&&(f===!0&&(f=new ar(r.from,r.to)),f.from<f.to)){let h=n.ranges.length-1;h>=0&&n.ranges[h].to==f.from?n.ranges[h]={from:n.ranges[h].from,to:f.to}:n.ranges.push(f)}if(c&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let h=gD(this.ranges,n.ranges);h.length&&(dD(h),this.inner.splice(n.index,0,new fD(n.parser,n.parser.startParse(this.input,yD(n.mounts,h),h),n.ranges.map(m=>new ar(m.from-n.start,m.to-n.start)),n.bracketed,n.target,h[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function vX(t,e,n){for(let i of t){if(i.from>=n)break;if(i.to>e)return i.from<=e&&i.to>=n?2:1}return 0}function hD(t,e,n,i,r,o){if(e<n){let a=t.buffer[e+1];i.push(t.slice(e,n,a)),r.push(a-o)}}function bX(t){let{node:e}=t,n=[],i=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let r=t.tree,o=r.children.indexOf(i),a=r.children[o],c=a.buffer,f=[o];function h(m,p,y,b,x,w){let C=n[w],E=[],O=[];hD(a,m,C,E,O,b);let T=c[C+1],A=c[C+2];f.push(E.length);let D=w?h(C+4,c[C+3],a.set.types[c[C]],T,A-T,w-1):e.toTree();return E.push(D),O.push(T-b),hD(a,c[C+3],p,E,O,b),new Qt(y,E,O,x)}r.children[o]=h(0,c.length,Si.none,0,a.length,n.length-1);for(let m of f){let p=t.tree.children[m],y=t.tree.positions[m];t.yield(new ai(p,y+t.from,m,t._tree))}}class pD{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Vt.IncludeAnonymous|Vt.IgnoreMounts|Vt.ExcludeBuffers)}moveTo(e){let{cursor:n}=this,i=e-this.offset;for(;!this.done&&n.from<i;)if(!(n.to>=i&&n.enter(i,1,Vt.IncludeAnonymous|Vt.IgnoreMounts|Vt.IgnoreOverlays|Vt.ExcludeBuffers)))if(n.to<=i)n.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Qt)n=n.children[0];else break}return!1}}function mD(t){let e=t.tree.prop(CV);return e==null?t.to:Math.min(t.to,e-t.offset)}class SX{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=mD(n),this.inner=new pD(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=mD(e),this.inner=new pD(e.tree,-e.offset)}}findMounts(e,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let a=(i=o.tree)===null||i===void 0?void 0:i.prop(mt.mounted);if(a&&a.parser==n)for(let c=this.fragI;c<this.fragments.length;c++){let f=this.fragments[c];if(f.from>=o.to)break;f.tree==this.curFrag.tree&&r.push({frag:f,pos:o.from-f.offset,mount:a})}}}return r}}function gD(t,e){let n=null,i=e;for(let r=1,o=0;r<t.length;r++){let a=t[r-1].to,c=t[r].from;for(;o<i.length;o++){let f=i[o];if(f.from>=c)break;f.to<=a||(n||(i=n=e.slice()),f.from<a?(n[o]=new ar(f.from,a),f.to>c&&n.splice(o+1,0,new ar(c,f.to))):f.to>c?n[o--]=new ar(c,f.to):n.splice(o--,1))}}return i}function xX(t,e,n,i){let r=0,o=0,a=!1,c=!1,f=-1e9,h=[];for(;;){let m=r==t.length?1e9:a?t[r].to:t[r].from,p=o==e.length?1e9:c?e[o].to:e[o].from;if(a!=c){let y=Math.max(f,n),b=Math.min(m,p,i);y<b&&h.push(new ar(y,b))}if(f=Math.min(m,p),f==1e9)break;m==f&&(a?(a=!1,r++):a=!0),p==f&&(c?(c=!1,o++):c=!0)}return h}function yD(t,e){let n=[];for(let{pos:i,mount:r,frag:o}of t){let a=i+(r.overlay?r.overlay[0].from:0),c=a+r.tree.length,f=Math.max(o.from,a),h=Math.min(o.to,c);if(r.overlay){let m=r.overlay.map(y=>new ar(y.from+i,y.to+i)),p=xX(e,m,f,h);for(let y=0,b=f;;y++){let x=y==p.length,w=x?h:p[y].from;if(w>b&&n.push(new Gs(b,w,r.tree,-a,o.from>=b||o.openStart,o.to<=w||o.openEnd)),x)break;b=p[y].to}}else n.push(new Gs(f,h,r.tree,-a,o.from>=a||o.openStart,o.to<=c||o.openEnd))}return n}let wX=0;class rr{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=wX++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof rr&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new rr(i,[],null,[]);if(r.set.push(r),n)for(let o of n.set)r.set.push(o);return r}static defineModifier(e){let n=new Fm(e);return i=>i.modified.indexOf(n)>-1?i:Fm.get(i.base||i,i.modified.concat(n).sort((r,o)=>r.id-o.id))}}let CX=0;class Fm{constructor(e){this.name=e,this.instances=[],this.id=CX++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(c=>c.base==e&&EX(n,c.modified));if(i)return i;let r=[],o=new rr(e.name,r,e,n);for(let c of n)c.instances.push(o);let a=TX(n);for(let c of e.set)if(!c.modified.length)for(let f of a)r.push(Fm.get(c,f));return o}}function EX(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function TX(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function RX(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let o=[],a=2,c=r;for(let p=0;;){if(c=="..."&&p>0&&p+3==r.length){a=1;break}let y=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!y)throw new RangeError("Invalid path: "+r);if(o.push(y[0]=="*"?"":y[0][0]=='"'?JSON.parse(y[0]):y[0]),p+=y[0].length,p==r.length)break;let b=r[p++];if(p==r.length&&b=="!"){a=0;break}if(b!="/")throw new RangeError("Invalid path: "+r);c=r.slice(p)}let f=o.length-1,h=o[f];if(!h)throw new RangeError("Invalid path: "+r);let m=new jf(i,a,f>0?o.slice(0,f):null);e[h]=m.sort(e[h])}}return EV.add(e)}const EV=new mt({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth<=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let o=new jf(r.tags,r.mode,r.context);n?n.next=o:i=o,n=o}return i}});class jf{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}jf.empty=new jf([],2,null);function TV(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let a of o.tag)n[a.id]=o.class;let{scope:i,all:r=null}=e||{};return{style:o=>{let a=r;for(let c of o)for(let f of c.set){let h=n[f.id];if(h){a=a?a+" "+h:h;break}}return a},scope:i}}function AX(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function OX(t,e,n,i=0,r=t.length){let o=new MX(i,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),i,r,"",o.highlighters),o.flush(r)}class MX{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,r,o){let{type:a,from:c,to:f}=e;if(c>=i||f<=n)return;a.isTop&&(o=this.highlighters.filter(b=>!b.scope||b.scope(a)));let h=r,m=DX(e)||jf.empty,p=AX(o,m.tags);if(p&&(h&&(h+=" "),h+=p,m.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(n,c),h),m.opaque)return;let y=e.tree&&e.tree.prop(mt.mounted);if(y&&y.overlay){let b=e.node.enter(y.overlay[0].from+c,1),x=this.highlighters.filter(C=>!C.scope||C.scope(y.tree.type)),w=e.firstChild();for(let C=0,E=c;;C++){let O=C<y.overlay.length?y.overlay[C]:null,T=O?O.from+c:f,A=Math.max(n,E),D=Math.min(i,T);if(A<D&&w)for(;e.from<D&&(this.highlightRange(e,A,D,r,o),this.startSpan(Math.min(D,e.to),h),!(e.to>=T||!e.nextSibling())););if(!O||T>i)break;E=O.to+c,E>n&&(this.highlightRange(b.cursor(),Math.max(n,O.from+c),Math.min(i,E),"",x),this.startSpan(Math.min(i,E),h))}w&&e.parent()}else if(e.firstChild()){y&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,o),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function DX(t){let e=t.type.prop(EV);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Le=rr.define,Pp=Le(),Mo=Le(),vD=Le(Mo),bD=Le(Mo),Do=Le(),Ip=Le(Do),Nb=Le(Do),Jr=Le(),Tl=Le(Jr),Qr=Le(),Zr=Le(),vx=Le(),Zc=Le(vx),Np=Le(),ze={comment:Pp,lineComment:Le(Pp),blockComment:Le(Pp),docComment:Le(Pp),name:Mo,variableName:Le(Mo),typeName:vD,tagName:Le(vD),propertyName:bD,attributeName:Le(bD),className:Le(Mo),labelName:Le(Mo),namespace:Le(Mo),macroName:Le(Mo),literal:Do,string:Ip,docString:Le(Ip),character:Le(Ip),attributeValue:Le(Ip),number:Nb,integer:Le(Nb),float:Le(Nb),bool:Le(Do),regexp:Le(Do),escape:Le(Do),color:Le(Do),url:Le(Do),keyword:Qr,self:Le(Qr),null:Le(Qr),atom:Le(Qr),unit:Le(Qr),modifier:Le(Qr),operatorKeyword:Le(Qr),controlKeyword:Le(Qr),definitionKeyword:Le(Qr),moduleKeyword:Le(Qr),operator:Zr,derefOperator:Le(Zr),arithmeticOperator:Le(Zr),logicOperator:Le(Zr),bitwiseOperator:Le(Zr),compareOperator:Le(Zr),updateOperator:Le(Zr),definitionOperator:Le(Zr),typeOperator:Le(Zr),controlOperator:Le(Zr),punctuation:vx,separator:Le(vx),bracket:Zc,angleBracket:Le(Zc),squareBracket:Le(Zc),paren:Le(Zc),brace:Le(Zc),content:Jr,heading:Tl,heading1:Le(Tl),heading2:Le(Tl),heading3:Le(Tl),heading4:Le(Tl),heading5:Le(Tl),heading6:Le(Tl),contentSeparator:Le(Jr),list:Le(Jr),quote:Le(Jr),emphasis:Le(Jr),strong:Le(Jr),link:Le(Jr),monospace:Le(Jr),strikethrough:Le(Jr),inserted:Le(),deleted:Le(),changed:Le(),invalid:Le(),meta:Np,documentMeta:Le(Np),annotation:Le(Np),processingInstruction:Le(Np),definition:rr.defineModifier("definition"),constant:rr.defineModifier("constant"),function:rr.defineModifier("function"),standard:rr.defineModifier("standard"),local:rr.defineModifier("local"),special:rr.defineModifier("special")};for(let t in ze){let e=ze[t];e instanceof rr&&(e.name=t)}const yie=TV([{tag:ze.link,class:"tok-link"},{tag:ze.heading,class:"tok-heading"},{tag:ze.emphasis,class:"tok-emphasis"},{tag:ze.strong,class:"tok-strong"},{tag:ze.keyword,class:"tok-keyword"},{tag:ze.atom,class:"tok-atom"},{tag:ze.bool,class:"tok-bool"},{tag:ze.url,class:"tok-url"},{tag:ze.labelName,class:"tok-labelName"},{tag:ze.inserted,class:"tok-inserted"},{tag:ze.deleted,class:"tok-deleted"},{tag:ze.literal,class:"tok-literal"},{tag:ze.string,class:"tok-string"},{tag:ze.number,class:"tok-number"},{tag:[ze.regexp,ze.escape,ze.special(ze.string)],class:"tok-string2"},{tag:ze.variableName,class:"tok-variableName"},{tag:ze.local(ze.variableName),class:"tok-variableName tok-local"},{tag:ze.definition(ze.variableName),class:"tok-variableName tok-definition"},{tag:ze.special(ze.variableName),class:"tok-variableName2"},{tag:ze.definition(ze.propertyName),class:"tok-propertyName tok-definition"},{tag:ze.typeName,class:"tok-typeName"},{tag:ze.namespace,class:"tok-namespace"},{tag:ze.className,class:"tok-className"},{tag:ze.macroName,class:"tok-macroName"},{tag:ze.propertyName,class:"tok-propertyName"},{tag:ze.operator,class:"tok-operator"},{tag:ze.comment,class:"tok-comment"},{tag:ze.meta,class:"tok-meta"},{tag:ze.invalid,class:"tok-invalid"},{tag:ze.punctuation,class:"tok-punctuation"}]);function SD(t,e,n,i=0,r=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let o=r;for(let a=i;a<e;a++)t.charCodeAt(a)==9?o+=n-o%n:o++;return o}class RV{constructor(e,n,i,r){this.string=e,this.tabSize=n,this.indentUnit=i,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),i;if(typeof e=="string"?i=n==e:i=n&&(e instanceof RegExp?e.test(n):e(n)),i)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=SD(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:SD(this.string,null,this.tabSize)}match(e,n,i){if(typeof e=="string"){let r=a=>i?a.toLowerCase():a,o=this.string.substr(this.pos,e.length);return r(o)==r(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}var Lb;const kl=new mt;function AV(t){return We.define({combine:t?e=>e.concat(t):void 0})}const kX=new mt;class Yi{constructor(e,n,i=[],r=""){this.data=e,this.name=r,Ut.prototype.hasOwnProperty("tree")||Object.defineProperty(Ut.prototype,"tree",{get(){return hr(this)}}),this.parser=n,this.extension=[Vu.of(this),Ut.languageData.of((o,a,c)=>{let f=xD(o,a,c),h=f.type.prop(kl);if(!h)return[];let m=o.facet(h),p=f.type.prop(kX);if(p){let y=f.resolve(a-f.from,c);for(let b of p)if(b.test(y,o)){let x=o.facet(b.facet);return b.type=="replace"?x:x.concat(m)}}return m})].concat(i)}isActiveAt(e,n,i=-1){return xD(e,n,i).type.prop(kl)==this.data}findRegions(e){let n=e.facet(Vu);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(o,a)=>{if(o.prop(kl)==this.data){i.push({from:a,to:a+o.length});return}let c=o.prop(mt.mounted);if(c){if(c.tree.prop(kl)==this.data){if(c.overlay)for(let f of c.overlay)i.push({from:f.from+a,to:f.to+a});else i.push({from:a,to:a+o.length});return}else if(c.overlay){let f=i.length;if(r(c.tree,c.overlay[0].from+a),i.length>f)return}}for(let f=0;f<o.children.length;f++){let h=o.children[f];h instanceof Qt&&r(h,o.positions[f]+a)}};return r(hr(e),0),i}get allowsNesting(){return!0}}Yi.setState=$t.define();function xD(t,e,n){let i=t.facet(Vu),r=hr(t).topNode;if(!i||i.allowsNesting)for(let o=r;o;o=o.enter(e,n,Vt.ExcludeBuffers|Vt.EnterBracketed))o.type.isTop&&(r=o);return r}class bx extends Yi{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=AV(e.languageData);return new bx(n,e.parser.configure({props:[kl.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new bx(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function hr(t){let e=t.field(Yi.state,!1);return e?e.tree:Qt.empty}function PX(t,e,n=50){var i;let r=(i=t.field(Yi.state,!1))===null||i===void 0?void 0:i.context;if(!r)return null;let o=r.viewport;r.updateViewport({from:0,to:e});let a=r.isDone(e)||r.work(n,e)?r.tree:null;return r.updateViewport(o),a}function vie(t,e=t.viewport.to,n=100){let i=PX(t.state,e,n);return i!=hr(t.state)&&t.dispatch({}),!!i}class IX{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}}let Jc=null;class Lu{constructor(e,n,i=[],r,o,a,c,f){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=o,this.viewport=a,this.skipped=c,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new Lu(e,n,[],Qt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new IX(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Qt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Gs.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Gs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Jc;Jc=this;try{return e()}finally{Jc=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=wD(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:o,viewport:a,skipped:c}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((h,m,p,y)=>f.push({fromA:h,toA:m,fromB:p,toB:y})),i=Gs.applyChanges(i,f),r=Qt.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){c=[];for(let h of this.skipped){let m=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);m<p&&c.push({from:m,to:p})}}}return new Lu(this.parser,n,i,r,o,a,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:o}=this.skipped[i];r<e.to&&o>e.from&&(this.fragments=wD(this.fragments,r,o),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends wV{createParse(n,i,r){let o=r[0].from,a=r[r.length-1].to;return{parsedPos:o,advance(){let f=Jc;if(f){for(let h of r)f.tempSkipped.push(h);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=a,new Qt(Si.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Jc}}function wD(t,e,n){return Gs.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Bu{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new Bu(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=Lu.create(e.facet(Vu).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new Bu(i)}}Yi.state=bs.define({create:Bu.init,update(t,e){for(let n of e.effects)if(n.is(Yi.setState))return n.value;return e.startState.facet(Vu)!=e.state.facet(Vu)?Bu.init(e.state):t.apply(e)}});let OV=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(OV=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Bb=typeof navigator<"u"&&(!((Lb=navigator.scheduling)===null||Lb===void 0)&&Lb.isInputPending)?()=>navigator.scheduling.isInputPending():null,NX=kr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Yi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Yi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=OV(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,o=i.field(Yi.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Bb?Math.max(25,e.timeRemaining()-5):1e9),c=o.context.treeLen<r&&i.doc.length>r+1e3,f=o.context.work(()=>Bb&&Bb()||Date.now()>a,r+(c?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Yi.setState.of(new Bu(o.context))})),this.chunkBudget>0&&!(f&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>as(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Vu=We.define({combine(t){return t.length?t[0]:null},enables:t=>[Yi.state,NX,nt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Sie{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class MV{constructor(e,n,i,r,o,a=void 0){this.name=e,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=o,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:i}=e;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new MV(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,n,i)}static matchFilename(e,n){for(let r of e)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,n,i=!0){n=n.toLowerCase();for(let r of e)if(r.alias.some(o=>o==n))return r;if(i)for(let r of e)for(let o of r.alias){let a=n.indexOf(o);if(a>-1&&(o.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+o.length])))return r}return null}}const LX=We.define(),w1=We.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function ea(t){let e=t.facet(w1);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Um(t,e){let n="",i=t.tabSize,r=t.facet(w1)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let o=0;o<e;o++)n+=r;return n}function DV(t,e){t instanceof Ut&&(t=new ey(t));for(let i of t.state.facet(LX)){let r=i(t,e);if(r!==void 0)return r}let n=hr(t.state);return n.length>=e?BX(t,n,e):null}class ey{constructor(e,n={}){this.state=e,this.options=n,this.unit=ea(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:o}=this.options;return r!=null&&r>=i.from&&r<=i.to?o&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),o=this.countColumn(i,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(o+=a-this.countColumn(i,i.search(/\S|$/))),o}countColumn(e,n=e.length){return Fg(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let a=o(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const kV=new mt;function BX(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let o=[];for(let a=r;a&&!(a.from<i.node.from||a.to>i.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)i={node:o[a],next:i}}return PV(i,t,n)}function PV(t,e,n){for(let i=t;i;i=i.next){let r=zX(i.node);if(r)return r(C1.create(e,n,i))}return 0}function VX(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function zX(t){let e=t.type.prop(kV);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(mt.closedBy))){let r=t.lastChild,o=r&&i.indexOf(r.name)>-1;return a=>IV(a,!0,1,void 0,o&&!VX(a)?r.from:void 0)}return t.parent==null?_X:null}function _X(){return 0}class C1 extends ey{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new C1(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(HX(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return PV(this.context.next,this.base,this.pos)}}function HX(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function FX(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),a=r==null||r<=o.from?o.to:Math.min(o.to,r);for(let c=n.to;;){let f=e.childAfter(c);if(!f||f==i)return null;if(!f.type.isSkipped){if(f.from>=a)return null;let h=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+h}}c=f.to}}function xie({closing:t,align:e=!0,units:n=1}){return i=>IV(i,e,n,t)}function IV(t,e,n,i,r){let o=t.textAfter,a=o.match(/^\s*/)[0].length,c=i&&o.slice(a,a+i.length)==i||r==t.pos+a,f=e?FX(t):null;return f?c?t.column(f.from):t.column(f.to):t.baseIndent+(c?0:t.unit*n)}const wie=t=>t.baseIndent;function Cie({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}const UX=We.define(),jX=new mt;function Eie(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function KX(t,e,n){let i=hr(t);if(i.length<n)return null;let r=i.resolveStack(n,1),o=null;for(let a=r;a;a=a.next){let c=a.node;if(c.to<=n||c.from>n)continue;if(o&&c.from<e)break;let f=c.type.prop(jX);if(f&&(c.to<i.length-50||i.length==t.doc.length||!YX(c))){let h=f(c,t);h&&h.from<=n&&h.from>=e&&h.to>n&&(o=h)}}return o}function YX(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function qX(t,e,n){for(let i of t.facet(UX)){let r=i(t,e,n);if(r)return r}return KX(t,e,n)}function NV(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}const LV=$t.define({map:NV}),BV=$t.define({map:NV});function GX(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(i=>i.from<=n&&i.to>=n)||e.push(t.lineBlockAt(n));return e}const E1=bs.define({create(){return on.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,r)=>t=CD(t,i,r)),t=t.map(e.changes);let n=[];for(let i of e.effects)i.is(LV)&&!XX(t,i.value.from,i.value.to)?n.push(i.value):i.is(BV)&&(t=t.update({filter:(r,o)=>i.value.from!=r||i.value.to!=o,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=e.state.facet(VV),r=n.map(o=>(i?on.replace({widget:new e2(i(e.state,o))}):ED).range(o.from,o.to));t=t.update({add:r})}return e.selection&&(t=CD(t,e.selection.main.head)),t},provide:t=>nt.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let i=t[n++],r=t[n++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(ED.range(i,r))}return on.set(e,!0)}});function CD(t,e,n=e){let i=!1;return t.between(e,n,(r,o)=>{r<n&&o>e&&(i=!0)}),i?t.update({filterFrom:e,filterTo:n,filter:(r,o)=>r>=n||o<=e}):t}function WX(t,e,n){var i;let r=null;return(i=t.field(E1,!1))===null||i===void 0||i.between(e,n,(o,a)=>{(!r||r.from>o)&&(r={from:o,to:a})}),r}function XX(t,e,n){let i=!1;return t.between(e,e,(r,o)=>{r==e&&o==n&&(i=!0)}),i}function $X(t,e){return t.field(E1,!1)?e:e.concat($t.appendConfig.of(JX()))}const Tie=t=>{for(let e of GX(t)){let n=qX(t.state,e.from,e.to);if(n)return t.dispatch({effects:$X(t.state,[LV.of(n),QX(t,n)])}),!0}return!1};function QX(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return nt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${r}.`)}const ZX={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},VV=We.define({combine(t){return Hg(t,ZX)}});function JX(t){return[E1,t2]}function zV(t,e){let{state:n}=t,i=n.facet(VV),r=a=>{let c=t.lineBlockAt(t.posAtDOM(a.target)),f=WX(t.state,c.from,c.to);f&&t.dispatch({effects:BV.of(f)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,r,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}const ED=on.replace({widget:new class extends na{toDOM(t){return zV(t,null)}}});class e2 extends na{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return zV(e,this.value)}}const t2=nt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ty{constructor(e,n){this.specs=e;let i;function r(c){let f=Ho.newName();return(i||(i=Object.create(null)))["."+f]=c,f}const o=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,a=n.scope;this.scope=a instanceof Yi?c=>c.prop(kl)==a.data:a?c=>c==a:void 0,this.style=TV(e.map(c=>({tag:c.tag,class:c.class||r(Object.assign({},c,{tag:null}))})),{all:o}).style,this.module=i?new Ho(i):null,this.themeType=n.themeType}static define(e,n){return new ty(e,n||{})}}const Sx=We.define(),_V=We.define({combine(t){return t.length?[t[0]]:null}});function Vb(t){let e=t.facet(Sx);return e.length?e:t.facet(_V)}function Rie(t,e){let n=[i2],i;return t instanceof ty&&(t.module&&n.push(nt.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(_V.of(t)):i?n.push(Sx.computeN([nt.darkTheme],r=>r.facet(nt.darkTheme)==(i=="dark")?[t]:[])):n.push(Sx.of(t)),n}class n2{constructor(e){this.markCache=Object.create(null),this.tree=hr(e.state),this.decorations=this.buildDeco(e,Vb(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=hr(e.state),i=Vb(e.state),r=i!=Vb(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!r&&n.type==this.tree.type&&a>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return on.none;let i=new vu;for(let{from:r,to:o}of e.visibleRanges)OX(this.tree,n,(a,c,f)=>{i.add(a,c,this.markCache[f]||(this.markCache[f]=on.mark({class:f})))},r,o);return i.finish()}}const i2=zg.high(kr.fromClass(n2,{decorations:t=>t.decorations})),Aie=ty.define([{tag:ze.meta,color:"#404740"},{tag:ze.link,textDecoration:"underline"},{tag:ze.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ze.emphasis,fontStyle:"italic"},{tag:ze.strong,fontWeight:"bold"},{tag:ze.strikethrough,textDecoration:"line-through"},{tag:ze.keyword,color:"#708"},{tag:[ze.atom,ze.bool,ze.url,ze.contentSeparator,ze.labelName],color:"#219"},{tag:[ze.literal,ze.inserted],color:"#164"},{tag:[ze.string,ze.deleted],color:"#a11"},{tag:[ze.regexp,ze.escape,ze.special(ze.string)],color:"#e40"},{tag:ze.definition(ze.variableName),color:"#00f"},{tag:ze.local(ze.variableName),color:"#30a"},{tag:[ze.typeName,ze.namespace],color:"#085"},{tag:ze.className,color:"#167"},{tag:[ze.special(ze.variableName),ze.macroName],color:"#256"},{tag:ze.definition(ze.propertyName),color:"#00c"},{tag:ze.comment,color:"#940"},{tag:ze.invalid,color:"#f00"}]),r2=1e4,s2="()[]{}",o2=new mt;function xx(t,e,n){let i=t.prop(e<0?mt.openedBy:mt.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function wx(t){let e=t.type.prop(o2);return e?e(t.node):t}function uu(t,e,n,i={}){let r=i.maxScanDistance||r2,o=i.brackets||s2,a=hr(t),c=a.resolveInner(e,n);for(let f=c;f;f=f.parent){let h=xx(f.type,n,o);if(h&&f.from<f.to){let m=wx(f);if(m&&(n>0?e>=m.from&&e<m.to:e>m.from&&e<=m.to))return l2(t,e,n,f,m,h,o)}}return a2(t,e,n,a,c.type,r,o)}function l2(t,e,n,i,r,o,a){let c=i.parent,f={from:r.from,to:r.to},h=0,m=c?.cursor();if(m&&(n<0?m.childBefore(i.from):m.childAfter(i.to)))do if(n<0?m.to<=i.from:m.from>=i.to){if(h==0&&o.indexOf(m.type.name)>-1&&m.from<m.to){let p=wx(m);return{start:f,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(xx(m.type,n,a))h++;else if(xx(m.type,-n,a)){if(h==0){let p=wx(m);return{start:f,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(n<0?m.prevSibling():m.nextSibling());return{start:f,matched:!1}}function a2(t,e,n,i,r,o,a){if(n<0?!e:e==t.doc.length)return null;let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=a.indexOf(c);if(f<0||f%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},m=t.doc.iterRange(e,n>0?t.doc.length:0),p=0;for(let y=0;!m.next().done&&y<=o;){let b=m.value;n<0&&(y+=b.length);let x=e+y*n;for(let w=n>0?0:b.length-1,C=n>0?b.length:-1;w!=C;w+=n){let E=a.indexOf(b[w]);if(!(E<0||i.resolveInner(x+w,1).type!=r))if(E%2==0==n>0)p++;else{if(p==1)return{start:h,end:{from:x+w,to:x+w+1},matched:E>>1==f>>1};p--}}n>0&&(y+=b.length)}return m.done?{start:h,matched:!1}:null}function u2(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||c2,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||R1,mergeTokens:t.mergeTokens!==!1}}function c2(t){if(typeof t!="object")return t;let e={};for(let n in t){let i=t[n];e[n]=i instanceof Array?i.slice():i}return e}const TD=new WeakMap;class HV extends Yi{constructor(e){let n=AV(e.languageData),i=u2(e),r,o=new class extends wV{createParse(a,c,f){return new d2(r,a,c,f)}};super(n,o,[],e.name),this.topNode=m2(n,this),r=this,this.streamParser=i,this.stateAfter=new mt({perNode:!0}),this.tokenTable=e.tokenTable?new KV(i.tokenTable):p2}static define(e){return new HV(e)}getIndent(e){let n,{overrideIndentation:i}=e.options;i&&(n=TD.get(e.state),n!=null&&n<e.pos-1e4&&(n=void 0));let r=T1(this,e.node.tree,e.node.from,e.node.from,n??e.pos),o,a;if(r?(a=r.state,o=r.pos+1):(a=this.streamParser.startState(e.unit),o=e.node.from),e.pos-o>1e4)return null;for(;o<e.pos;){let f=e.state.doc.lineAt(o),h=Math.min(e.pos,f.to);if(f.length){let m=i?i(f.from):-1,p=new RV(f.text,e.state.tabSize,e.unit,m<0?void 0:m);for(;p.pos<h-f.from;)UV(this.streamParser.token,p,a)}else this.streamParser.blankLine(a,e.unit);if(h==e.pos)break;o=f.to+1}let c=e.lineAt(e.pos);return i&&n==null&&TD.set(e.state,c.from),this.streamParser.indent(a,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function T1(t,e,n,i,r){let o=n>=i&&n+e.length<=r&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let c=e.children[a],f=n+e.positions[a],h=c instanceof Qt&&f<r&&T1(t,c,f,i,r);if(h)return h}return null}function FV(t,e,n,i,r){if(r&&n<=0&&i>=e.length)return e;!r&&n==0&&e.type==t.topNode&&(r=!0);for(let o=e.children.length-1;o>=0;o--){let a=e.positions[o],c=e.children[o],f;if(a<i&&c instanceof Qt){if(!(f=FV(t,c,n-a,i-a,r)))break;return r?new Qt(e.type,e.children.slice(0,o).concat(f),e.positions.slice(0,o+1),a+f.length):f}}return null}function f2(t,e,n,i,r){for(let o of e){let a=o.from+(o.openStart?25:0),c=o.to-(o.openEnd?25:0),f=a<=n&&c>n&&T1(t,o.tree,0-o.offset,n,c),h;if(f&&f.pos<=i&&(h=FV(t,o.tree,n+o.offset,f.pos+o.offset,!1)))return{state:f.state,tree:h}}return{state:t.streamParser.startState(r?ea(r):4),tree:Qt.empty}}class d2{constructor(e,n,i,r){this.lang=e,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let o=Lu.get(),a=r[0].from,{state:c,tree:f}=f2(e,i,a,this.to,o?.state);this.state=c,this.parsedPos=this.chunkStart=a+f.length;for(let h=0;h<f.children.length;h++)this.chunks.push(f.children[h]),this.chunkPos.push(f.positions[h]);o&&this.parsedPos<o.viewport.from-1e5&&r.some(h=>h.from<=o.viewport.from&&h.to>=o.viewport.from)&&(this.state=this.lang.streamParser.startState(ea(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let e=Lu.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
|
|
64
64
|
`&&(n="");else{let i=n.indexOf(`
|
|
65
|
-
`);i>-1&&(n=n.slice(0,i))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),i=e+n.length;for(let r=this.rangeIndex;;){let o=this.ranges[r].to;if(o>=i||(n=n.slice(0,o-(i-n.length)),r++,r==this.ranges.length))break;let a=this.ranges[r].from,c=this.lineAfter(a);n+=c,i=a+c.length}return{line:n,end:i}}skipGapsTo(e,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,o=e+n;if(i>0?r>o:r>=o)break;let a=this.ranges[++this.rangeIndex].from;n+=a-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,i,r){let o=4;if(this.ranges.length>1){r=this.skipGapsTo(n,r,1),n+=r;let c=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,o+=this.chunk.length-c}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&o==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(e,n,i,o),r}parseLine(e){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:o}=this.lang,a=new RV(n,e?e.state.tabSize:4,e?ea(e.state):2);if(a.eol())o.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let c=UV(o.token,a,this.state);if(c&&(r=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Qt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:h2,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Qt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Qt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function UV(t,e,n){e.start=e.pos;for(let i=0;i<10;i++){let r=t(e,n);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const R1=Object.create(null),Kf=[Si.none],h2=new v1(Kf),RD=[],AD=Object.create(null),jV=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])jV[t]=YV(R1,e);class KV{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),jV)}resolve(e){return e?this.table[e]||(this.table[e]=YV(this.extra,e)):0}}const p2=new KV(R1);function zb(t,e){RD.indexOf(t)>-1||(RD.push(t),console.warn(e))}function YV(t,e){let n=[];for(let c of e.split(" ")){let f=[];for(let h of c.split(".")){let m=t[h]||ze[h];m?typeof m=="function"?f.length?f=f.map(m):zb(h,`Modifier ${h} used at start of tag`):f.length?zb(h,`Tag ${h} used as modifier`):f=Array.isArray(m)?m:[m]:zb(h,`Unknown highlighting tag ${h}`)}for(let h of f)n.push(h)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(c=>c.id),o=AD[r];if(o)return o.id;let a=AD[r]=Si.define({id:Kf.length,name:i,props:[RX({[i]:n})]});return Kf.push(a),a.id}function m2(t,e){let n=Si.define({id:Kf.length,name:"Document",props:[kl.add(()=>t),kV.add(()=>i=>e.getIndent(i))],top:!0});return Kf.push(n),n}an.RTL,an.LTR;const g2=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=O1(t.state,n.from);return i.line?y2(t):i.block?b2(t):!1};function A1(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}const y2=A1(w2,0),v2=A1(qV,0),b2=A1((t,e)=>qV(t,e,x2(e)),0);function O1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const ef=50;function S2(t,{open:e,close:n},i,r){let o=t.sliceDoc(i-ef,i),a=t.sliceDoc(r,r+ef),c=/\s*$/.exec(o)[0].length,f=/^\s*/.exec(a)[0].length,h=o.length-c;if(o.slice(h-e.length,h)==e&&a.slice(f,f+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:r+f,margin:f&&1}};let m,p;r-i<=2*ef?m=p=t.sliceDoc(i,r):(m=t.sliceDoc(i,i+ef),p=t.sliceDoc(r-ef,r));let y=/^\s*/.exec(m)[0].length,b=/\s*$/.exec(p)[0].length,x=p.length-b-n.length;return m.slice(y,y+e.length)==e&&p.slice(x,x+n.length)==n?{open:{pos:i+y+e.length,margin:/\s/.test(m.charAt(y+e.length))?1:0},close:{pos:r-b-n.length,margin:/\s/.test(p.charAt(x-1))?1:0}}:null}function x2(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function qV(t,e,n=e.selection.ranges){let i=n.map(o=>O1(e,o.from).block);if(!i.every(o=>o))return null;let r=n.map((o,a)=>S2(e,i[a],o.from,o.to));if(t!=2&&!r.every(o=>o))return{changes:e.changes(n.map((o,a)=>r[a]?[]:[{from:o.from,insert:i[a].open+" "},{from:o.to,insert:" "+i[a].close}]))};if(t!=1&&r.some(o=>o)){let o=[];for(let a=0,c;a<r.length;a++)if(c=r[a]){let f=i[a],{open:h,close:m}=c;o.push({from:h.pos-f.open.length,to:h.pos+h.margin},{from:m.pos-m.margin,to:m.pos+f.close.length})}return{changes:o}}return null}function w2(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:o,to:a}of n){let c=i.length,f=1e9,h;for(let m=o;m<=a;){let p=e.doc.lineAt(m);if(h==null&&(h=O1(e,p.from).line,!h))continue e;if(p.from>r&&(o==a||a>p.from)){r=p.from;let y=/^\s*/.exec(p.text)[0].length,b=y==p.length,x=p.text.slice(y,y+h.length)==h?y:-1;y<p.text.length&&y<f&&(f=y),i.push({line:p,comment:x,token:h,indent:y,empty:b,single:!1})}m=p.to+1}if(f<1e9)for(let m=c;m<i.length;m++)i[m].indent<i[m].line.text.length&&(i[m].indent=f);i.length==c+1&&(i[c].single=!0)}if(t!=2&&i.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:c,token:f,indent:h,empty:m,single:p}of i)(p||!m)&&o.push({from:c.from+h,insert:f+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&i.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:c,token:f}of i)if(c>=0){let h=a.from+c,m=h+f.length;a.text[m-a.from]==" "&&m++,o.push({from:h,to:m})}return{changes:o}}return null}const Cx=Zo.define(),C2=Zo.define(),E2=We.define(),GV=We.define({combine(t){return Hg(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),WV=bs.define({create(){return cs.empty},update(t,e){let n=e.state.facet(GV),i=e.annotation(Cx);if(i){let f=ki.fromTransaction(e,i.selection),h=i.side,m=h==0?t.undone:t.done;return f?m=jm(m,m.length,n.minDepth,f):m=QV(m,e.startState.selection),new cs(h==0?i.rest:m,h==0?m:i.rest)}let r=e.annotation(C2);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Bn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=ki.fromTransaction(e),a=e.annotation(Bn.time),c=e.annotation(Bn.userEvent);return o?t=t.addChanges(o,a,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,c,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new cs(t.done.map(ki.fromJSON),t.undone.map(ki.fromJSON))}});function Oie(t={}){return[WV,GV.of(t),nt.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?XV:e.inputType=="historyRedo"?Ex:null;return i?(e.preventDefault(),i(n)):!1}})]}function ny(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(WV,!1);if(!r)return!1;let o=r.pop(t,n,e);return o?(i(o),!0):!1}}const XV=ny(0,!1),Ex=ny(1,!1),T2=ny(0,!0),R2=ny(1,!0);class ki{constructor(e,n,i,r,o){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new ki(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new ki(e.changes&&In.fromJSON(e.changes),[],e.mapped&&hs.fromJSON(e.mapped),e.startSelection&&xe.fromJSON(e.startSelection),e.selectionsAfter.map(xe.fromJSON))}static fromTransaction(e,n){let i=ur;for(let r of e.startState.facet(E2)){let o=r(e);o.length&&(i=i.concat(o))}return!i.length&&e.changes.empty?null:new ki(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,ur)}static selection(e){return new ki(void 0,ur,void 0,void 0,e)}}function jm(t,e,n,i){let r=e+1>n+20?e-n-1:0,o=t.slice(r,e);return o.push(i),o}function A2(t,e){let n=[],i=!1;return t.iterChangedRanges((r,o)=>n.push(r,o)),e.iterChangedRanges((r,o,a,c)=>{for(let f=0;f<n.length;){let h=n[f++],m=n[f++];c>=h&&a<=m&&(i=!0)}}),i}function O2(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function $V(t,e){return t.length?e.length?t.concat(e):t:e}const ur=[],M2=200;function QV(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-M2));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),jm(t,t.length-1,1e9,n.setSelAfter(i)))}else return[ki.selection([e])]}function D2(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function _b(t,e){if(!t.length)return t;let n=t.length,i=ur;for(;n;){let r=k2(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let o=t.slice(0,n);return o[n-1]=r,o}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[ki.selection(i)]:ur}function k2(t,e,n){let i=$V(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):ur,n);if(!t.changes)return ki.selection(i);let r=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new ki(r,$t.mapEffects(t.effects,e),a,t.startSelection.map(o),i)}const P2=/^(input\.type|delete)($|\.)/;class cs{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new cs(this.done,this.undone):this}addChanges(e,n,i,r,o){let a=this.done,c=a[a.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!i||P2.test(i))&&(!c.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,A2(c.changes,e.changes))||i=="input.type.compose")?a=jm(a,a.length-1,r.minDepth,new ki(e.changes.compose(c.changes),$V($t.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,ur)):a=jm(a,a.length,r.minDepth,e),new cs(a,ur,n,i)}addSelection(e,n,i,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:ur;return o.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&O2(o[o.length-1],e)?this:new cs(QV(this.done,e),this.undone,n,i)}addMapping(e){return new cs(_b(this.done,e),_b(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let o=r[r.length-1],a=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(i&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Cx.of({side:e,rest:D2(r),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let c=r.length==1?ur:r.slice(0,r.length-1);return o.mapped&&(c=_b(c,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Cx.of({side:e,rest:c,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}cs.empty=new cs(ur,ur);const Mie=[{key:"Mod-z",run:XV,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Ex,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Ex,preventDefault:!0},{key:"Mod-u",run:T2,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:R2,preventDefault:!0}];function Xu(t,e){return xe.create(t.ranges.map(e),t.mainIndex)}function Br(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Vr({state:t,dispatch:e},n){let i=Xu(t.selection,n);return i.eq(t.selection,!0)?!1:(e(Br(t,i)),!0)}function iy(t,e){return xe.cursor(e?t.to:t.from)}function M1(t,e){return Vr(t,n=>n.empty?t.moveByChar(n,e):iy(n,e))}function ui(t){return t.textDirectionAt(t.state.selection.main.head)==an.LTR}const ZV=t=>M1(t,!ui(t)),JV=t=>M1(t,ui(t)),Die=t=>M1(t,!1);function e3(t,e){return Vr(t,n=>n.empty?t.moveByGroup(n,e):iy(n,e))}const I2=t=>e3(t,!ui(t)),N2=t=>e3(t,ui(t));function L2(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function ry(t,e,n){let i=hr(t).resolveInner(e.head),r=n?mt.closedBy:mt.openedBy;for(let f=e.head;;){let h=n?i.childAfter(f):i.childBefore(f);if(!h)break;L2(t,h,r)?i=h:f=n?h.to:h.from}let o=i.type.prop(r),a,c;return o&&(a=n?uu(t,i.from,1):uu(t,i.to,-1))&&a.matched?c=n?a.end.to:a.end.from:c=n?i.to:i.from,xe.cursor(c,n?-1:1)}const B2=t=>Vr(t,e=>ry(t.state,e,!ui(t))),V2=t=>Vr(t,e=>ry(t.state,e,ui(t)));function t3(t,e){return Vr(t,n=>{if(!n.empty)return iy(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const n3=t=>t3(t,!1),i3=t=>t3(t,!0);function r3(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let o of t.state.facet(nt.scrollMargins)){let a=o(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(i=Math.max(a?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function s3(t,e){let n=r3(t),{state:i}=t,r=Xu(i.selection,a=>a.empty?t.moveVertically(a,e,n.height):iy(a,e));if(r.eq(i.selection))return!1;let o;if(n.selfScroll){let a=t.coordsAtPos(i.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),f=c.top+n.marginTop,h=c.bottom-n.marginBottom;a&&a.top>f&&a.bottom<h&&(o=nt.scrollIntoView(r.main.head,{y:"start",yMargin:a.top-f}))}return t.dispatch(Br(i,r),{effects:o}),!0}const OD=t=>s3(t,!1),Tx=t=>s3(t,!0);function el(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let o=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;o&&e.head!=i.from+o&&(r=xe.cursor(i.from+o))}return r}const z2=t=>Vr(t,e=>el(t,e,!0)),_2=t=>Vr(t,e=>el(t,e,!1)),H2=t=>Vr(t,e=>el(t,e,!ui(t))),F2=t=>Vr(t,e=>el(t,e,ui(t))),U2=t=>Vr(t,e=>t.moveToLineBoundary(e,!1,!1)),j2=t=>Vr(t,e=>t.moveToLineBoundary(e,!0,!1));function K2(t,e,n){let i=!1,r=Xu(t.selection,o=>{let a=uu(t,o.head,-1)||uu(t,o.head,1)||o.head>0&&uu(t,o.head-1,1)||o.head<t.doc.length&&uu(t,o.head+1,-1);if(!a||!a.end)return o;i=!0;let c=a.start.from==o.head?a.end.to:a.end.from;return xe.cursor(c)});return i?(e(Br(t,r)),!0):!1}const Y2=({state:t,dispatch:e})=>K2(t,e);function mr(t,e,n){let i=Xu(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=xe.range(r.head,r.anchor));let o=n(r);return xe.range(r.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(Br(t.state,i)),!0)}function o3(t,e){return mr(t,e,n=>t.moveByChar(n,e))}const l3=t=>o3(t,!ui(t)),a3=t=>o3(t,ui(t));function u3(t,e){return mr(t,e,n=>t.moveByGroup(n,e))}const q2=t=>u3(t,!ui(t)),G2=t=>u3(t,ui(t)),W2=t=>{let e=!ui(t);return mr(t,e,n=>ry(t.state,n,e))},X2=t=>{let e=ui(t);return mr(t,e,n=>ry(t.state,n,e))};function c3(t,e){return mr(t,e,n=>t.moveVertically(n,e))}const f3=t=>c3(t,!1),d3=t=>c3(t,!0);function h3(t,e){return mr(t,e,n=>t.moveVertically(n,e,r3(t).height))}const MD=t=>h3(t,!1),DD=t=>h3(t,!0),$2=t=>mr(t,!0,e=>el(t,e,!0)),Q2=t=>mr(t,!1,e=>el(t,e,!1)),Z2=t=>{let e=!ui(t);return mr(t,e,n=>el(t,n,e))},J2=t=>{let e=ui(t);return mr(t,e,n=>el(t,n,e))},e$=t=>mr(t,!1,e=>xe.cursor(t.lineBlockAt(e.head).from)),t$=t=>mr(t,!0,e=>xe.cursor(t.lineBlockAt(e.head).to)),kD=({state:t,dispatch:e})=>(e(Br(t,{anchor:0})),!0),PD=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.doc.length})),!0),ID=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.selection.main.anchor,head:0})),!0),ND=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),n$=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),i$=({state:t,dispatch:e})=>{let n=sy(t).map(({from:i,to:r})=>xe.undirectionalRange(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:xe.create(n),userEvent:"select"})),!0},r$=({state:t,dispatch:e})=>{let n=Xu(t.selection,i=>{let r=hr(t),o=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=o.node.from&&a.node.to<=o.node.to&&(o=a)}for(let a=o;a;a=a.next){let{node:c}=a;if((c.from<i.from&&c.to>=i.to||c.to>i.to&&c.from<=i.from)&&a.next)return xe.undirectionalRange(c.from,c.to)}return i});return n.eq(t.selection)?!1:(e(Br(t,n)),!0)};function p3(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let o of n.selection.ranges){let a=n.doc.lineAt(o.head);if(e?a.to<t.state.doc.length:a.from>0)for(let c=o;;){let f=t.moveVertically(c,e);if(f.head<a.from||f.head>a.to){r.some(h=>h.head==f.head)||r.push(f);break}else{if(f.head==c.head)break;c=f}}}return r.length==i.ranges.length?!1:(t.dispatch(Br(n,xe.create(r,r.length-1))),!0)}const s$=t=>p3(t,!1),o$=t=>p3(t,!0),l$=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=xe.create([n.main]):n.main.empty||(i=xe.create([xe.cursor(n.main.head)])),i?(e(Br(t,i)),!0):!1};function wd(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(o=>{let{from:a,to:c}=o;if(a==c){let f=e(o);f<a?(n="delete.backward",f=Lp(t,f,!1)):f>a&&(n="delete.forward",f=Lp(t,f,!0)),a=Math.min(a,f),c=Math.max(c,f)}else a=Lp(t,a,!1),c=Lp(t,c,!0);return a==c?{range:o}:{changes:{from:a,to:c},range:xe.cursor(a,a<o.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?nt.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Lp(t,e,n){if(t instanceof nt)for(let i of t.state.facet(nt.atomicRanges).map(r=>r(t)))i.between(e,e,(r,o)=>{r<e&&o>e&&(e=n?o:r)});return e}const m3=(t,e,n)=>wd(t,i=>{let r=i.from,{state:o}=t,a=o.doc.lineAt(r),c,f;if(n&&!e&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(c=a.text.slice(0,r-a.from))){if(c[c.length-1]==" ")return r-1;let h=Fg(c,o.tabSize),m=h%ea(o)||ea(o);for(let p=0;p<m&&c[c.length-1-p]==" ";p++)r--;f=r}else f=li(a.text,r-a.from,e,e)+a.from,f==r&&a.number!=(e?o.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(f-a.from,r-a.from))&&(f=li(a.text,f-a.from,!1,!1)+a.from);return f}),Rx=t=>m3(t,!1,!0),g3=t=>m3(t,!0,!1),y3=(t,e)=>wd(t,n=>{let i=n.head,{state:r}=t,o=r.doc.lineAt(i),a=r.charCategorizer(i);for(let c=null;;){if(i==(e?o.to:o.from)){i==n.head&&o.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let f=li(o.text,i-o.from,e)+o.from,h=o.text.slice(Math.min(i,f)-o.from,Math.max(i,f)-o.from),m=a(h);if(c!=null&&m!=c)break;(h!=" "||i!=n.head)&&(c=m),i=f}return i}),v3=t=>y3(t,!1),a$=t=>y3(t,!0),u$=t=>wd(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),c$=t=>wd(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),f$=t=>wd(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),d$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:kt.of(["",""])},range:xe.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},h$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,o=t.doc.lineAt(r),a=r==o.from?r-1:li(o.text,r-o.from,!1)+o.from,c=r==o.to?r+1:li(o.text,r-o.from,!0)+o.from;return{changes:{from:a,to:c,insert:t.doc.slice(r,c).append(t.doc.slice(a,r))},range:xe.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function sy(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(!i.empty&&i.to==o.from&&(o=t.doc.lineAt(i.to-1)),n>=r.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(i)}else e.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return e}function b3(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let o of sy(t)){if(n?o.to==t.doc.length:o.from==0)continue;let a=t.doc.lineAt(n?o.to+1:o.from-1),c=a.length+1;if(n){i.push({from:o.to,to:a.to},{from:o.from,insert:a.text+t.lineBreak});for(let f of o.ranges)r.push(xe.range(Math.min(t.doc.length,f.anchor+c),Math.min(t.doc.length,f.head+c)))}else{i.push({from:a.from,to:o.from},{from:o.to,insert:t.lineBreak+a.text});for(let f of o.ranges)r.push(xe.range(f.anchor-c,f.head-c))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:xe.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const p$=({state:t,dispatch:e})=>b3(t,e,!1),m$=({state:t,dispatch:e})=>b3(t,e,!0);function S3(t,e,n){if(t.readOnly)return!1;let i=[];for(let o of sy(t))n?i.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):i.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const g$=({state:t,dispatch:e})=>S3(t,e,!1),y$=({state:t,dispatch:e})=>S3(t,e,!0),v$=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(sy(e).map(({from:r,to:o})=>(r>0?r--:o<e.doc.length&&o++,{from:r,to:o}))),i=Xu(e.selection,r=>{let o;if(t.lineWrapping){let a=t.lineBlockAt(r.head),c=t.coordsAtPos(r.head,r.assoc||1);c&&(o=a.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,o)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function b$(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=hr(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),o;return i&&r&&i.to<=e&&r.from>=e&&(o=i.type.prop(mt.closedBy))&&o.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const LD=x3(!1),S$=x3(!0);function x3(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:o,to:a}=r,c=e.doc.lineAt(o),f=!t&&o==a&&b$(e,o);t&&(o=a=(a<=c.to?c:e.doc.lineAt(a)).to);let h=new ey(e,{simulateBreak:o,simulateDoubleBreak:!!f}),m=DV(h,o);for(m==null&&(m=Fg(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));a<c.to&&/\s/.test(c.text[a-c.from]);)a++;f?{from:o,to:a}=f:o>c.from&&o<c.from+100&&!/\S/.test(c.text.slice(0,o))&&(o=c.from);let p=["",Um(e,m)];return f&&p.push(Um(e,h.lineIndent(c.from,-1))),{changes:{from:o,to:a,insert:kt.of(p)},range:xe.cursor(o+1+p[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function D1(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let a=i.from;a<=i.to;){let c=t.doc.lineAt(a);c.number>n&&(i.empty||i.to>c.from)&&(e(c,r,i),n=c.number),a=c.to+1}let o=t.changes(r);return{changes:r,range:xe.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const x$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new ey(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),r=D1(t,(o,a,c)=>{let f=DV(i,o.from);if(f==null)return;/\S/.test(o.text)||(f=0);let h=/^\s*/.exec(o.text)[0],m=Um(t,f);(h!=m||c.from<o.from+h.length)&&(n[o.from]=f,a.push({from:o.from,to:o.from+h.length,insert:m}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},w3=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(D1(t,(n,i)=>{i.push({from:n.from,insert:t.facet(w1)})}),{userEvent:"input.indent"})),!0),C3=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(D1(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let o=Fg(r,t.tabSize),a=0,c=Um(t,Math.max(0,o-ea(t)));for(;a<r.length&&a<c.length&&r.charCodeAt(a)==c.charCodeAt(a);)a++;i.push({from:n.from+a,to:n.from+r.length,insert:c.slice(a)})}),{userEvent:"delete.dedent"})),!0),w$=t=>(t.setTabFocusMode(),!0),C$=[{key:"Ctrl-b",run:ZV,shift:l3,preventDefault:!0},{key:"Ctrl-f",run:JV,shift:a3},{key:"Ctrl-p",run:n3,shift:f3},{key:"Ctrl-n",run:i3,shift:d3},{key:"Ctrl-a",run:U2,shift:e$},{key:"Ctrl-e",run:j2,shift:t$},{key:"Ctrl-d",run:g3},{key:"Ctrl-h",run:Rx},{key:"Ctrl-k",run:u$},{key:"Ctrl-Alt-h",run:v3},{key:"Ctrl-o",run:d$},{key:"Ctrl-t",run:h$},{key:"Ctrl-v",run:Tx}],E$=[{key:"ArrowLeft",run:ZV,shift:l3,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:I2,shift:q2,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:H2,shift:Z2,preventDefault:!0},{key:"ArrowRight",run:JV,shift:a3,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:N2,shift:G2,preventDefault:!0},{mac:"Cmd-ArrowRight",run:F2,shift:J2,preventDefault:!0},{key:"ArrowUp",run:n3,shift:f3,preventDefault:!0},{mac:"Cmd-ArrowUp",run:kD,shift:ID},{mac:"Ctrl-ArrowUp",run:OD,shift:MD},{key:"ArrowDown",run:i3,shift:d3,preventDefault:!0},{mac:"Cmd-ArrowDown",run:PD,shift:ND},{mac:"Ctrl-ArrowDown",run:Tx,shift:DD},{key:"PageUp",run:OD,shift:MD},{key:"PageDown",run:Tx,shift:DD},{key:"Home",run:_2,shift:Q2,preventDefault:!0},{key:"Mod-Home",run:kD,shift:ID},{key:"End",run:z2,shift:$2,preventDefault:!0},{key:"Mod-End",run:PD,shift:ND},{key:"Enter",run:LD,shift:LD},{key:"Mod-a",run:n$},{key:"Backspace",run:Rx,shift:Rx,preventDefault:!0},{key:"Delete",run:g3,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:v3,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:a$,preventDefault:!0},{mac:"Mod-Backspace",run:c$,preventDefault:!0},{mac:"Mod-Delete",run:f$,preventDefault:!0}].concat(C$.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),kie=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:B2,shift:W2},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:V2,shift:X2},{key:"Alt-ArrowUp",run:p$},{key:"Shift-Alt-ArrowUp",run:g$},{key:"Alt-ArrowDown",run:m$},{key:"Shift-Alt-ArrowDown",run:y$},{key:"Mod-Alt-ArrowUp",run:s$},{key:"Mod-Alt-ArrowDown",run:o$},{key:"Escape",run:l$},{key:"Mod-Enter",run:S$},{key:"Alt-l",mac:"Ctrl-l",run:i$},{key:"Mod-i",run:r$,preventDefault:!0},{key:"Mod-[",run:C3},{key:"Mod-]",run:w3},{key:"Mod-Alt-\\",run:x$},{key:"Shift-Mod-k",run:v$},{key:"Shift-Mod-\\",run:Y2},{key:"Mod-/",run:g2},{key:"Alt-A",mac:"Ctrl-A",run:v2},{key:"Ctrl-m",mac:"Shift-Alt-m",run:w$}].concat(E$),Pie={key:"Tab",run:w3,shift:C3};function T$(t,e,n){const i=new Array(t);return new Proxy(i,{get(r,o,a){if(typeof o=="string"){const c=o.charCodeAt(0);if(c>=48&&c<=57){const f=+o;if(Number.isInteger(f)&&f>=0&&f<t){let h=r[f];if(!h){const m=e[f*2];h=r[f]={index:f,key:n(f),start:m,size:e[f*2+1],end:m+e[f*2+1],lane:0}}return h}}if(o==="length")return t}return Reflect.get(r,o,a)}})}function Ja(t,e,n){let i=n.initialDeps??[],r,o=!0;function a(){const c=t();return(c.length!==i.length||c.some((h,m)=>i[m]!==h))&&(i=c,r=e(...c),n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(r),o=!1),r}return a.updateDeps=c=>{i=c},a}function BD(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const R$=(t,e)=>Math.abs(t-e)<1.01,A$=(t,e,n)=>{let i;return function(...r){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,r),n)}};let tf;const Hb=()=>{if(tf!==void 0)return tf;if(typeof navigator>"u")return tf=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return tf=!0;const t=navigator.maxTouchPoints;return tf=navigator.platform==="MacIntel"&&t!==void 0&&t>0},VD=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},O$=t=>t,M$=t=>{const e=Math.max(t.startIndex-t.overscan,0),i=Math.min(t.endIndex+t.overscan,t.count-1)-e+1,r=new Array(i);for(let o=0;o<i;o++)r[o]=e+o;return r},D$=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;const r=a=>{const{width:c,height:f}=a;e({width:Math.round(c),height:Math.round(f)})};if(r(VD(n)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(a=>{const c=()=>{const f=a[0];if(f?.borderBoxSize){const h=f.borderBoxSize[0];if(h){r({width:h.inlineSize,height:h.blockSize});return}}r(VD(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Km={passive:!0},k$=typeof window>"u"?!0:"onscrollend"in window,P$=(t,e,n)=>{const i=t.scrollElement;if(!i)return;const r=t.targetWindow;if(!r)return;const o=t.options.useScrollendEvent&&k$;let a=0;const c=o?null:A$(r,()=>e(a,!1),t.options.isScrollingResetDelay),f=p=>()=>{a=n(i),c?.(),e(a,p)},h=f(!0),m=f(!1);return i.addEventListener("scroll",h,Km),o&&i.addEventListener("scrollend",m,Km),()=>{i.removeEventListener("scroll",h),o&&i.removeEventListener("scrollend",m)}},I$=(t,e)=>P$(t,e,n=>{const{horizontal:i,isRtl:r}=t.options;return i?n.scrollLeft*(r&&-1||1):n.scrollTop}),N$=(t,e,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(t),r=n.options.getItemKey(i);return n.itemSizeCache.get(r)??n.options.estimateSize(i)}if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!e){const i=n.indexFromElement(t),r=n.options.getItemKey(i),o=n.itemSizeCache.get(r);if(o!==void 0)return o}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},L$=(t,{adjustments:e=0,behavior:n},i)=>{var r,o;(o=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[i.options.horizontal?"left":"top"]:t+e,behavior:n})},B$=L$;class V${constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,i,r;return((r=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:r.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{const a=()=>{const c=o.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[h,m]of this.elementsCache)if(m===c){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),n=null},observe:r=>{var o;return(o=i())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=i())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{var i,r;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:O$,rangeExtractor:M$,onChange:()=>{},measureElement:N$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in n){const b=n[y];b!==void 0&&(o[y]=b)}const a=this.options;let c=null,f=null,h=!1;if(a!==void 0&&a.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const y=a.count,b=o.count,x=this.getMeasurements(),w=y>0?((i=x[0])==null?void 0:i.key)??a.getItemKey(0):null,C=y>0?((r=x[y-1])==null?void 0:r.key)??a.getItemKey(y-1):null;if(b!==y||y>0&&b>0&&(o.getItemKey(0)!==w||o.getItemKey(b-1)!==C)){h=!0;const T=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;T&&(c=[T.key,this.getScrollOffset()-T.start]);const A=o.followOnAppend===!0?"auto":o.followOnAppend||null;A&&b>y&&this.isAtEnd(a.scrollEndThreshold)&&(y===0||o.getItemKey(b-1)!==C)&&(f=A)}}this.options=o,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let m=!1,p=0;if(c&&this.scrollOffset!==null){const[y,b]=c,x=this.getMeasurements(),{count:w,getItemKey:C}=this.options;let E=0;for(;E<w&&C(E)!==y;)E++;if(E<w){const O=x[E];if(O){const T=O.start+b;T!==this.scrollOffset&&(p=T-this.scrollOffset,this.scrollOffset=T,m=!0)}}}(m||f)&&(this.pendingScrollAnchor=[m?c[0]:null,m?c[1]:0,f,p])},this.notify=n=>{var i,r;(r=(i=this.options).onChange)==null||r.call(i,this,n)},this.maybeNotify=Ja(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,a)=>{if(a&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=a?c===o?this.scrollDirection:c<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Hb()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",a,Km),o.addEventListener("touchend",c,Km),this.unsubs.push(()=>{o.removeEventListener("touchstart",a),o.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const r=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,r&&this.scrollElement&&this.options.enabled){const[o,a,c,f]=r;o!==null&&!c&&(Hb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;const r=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=r,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,i)=>{const r=new Map,o=new Map;for(let a=i-1;a>=0;a--){const c=n[a];if(r.has(c.lane))continue;const f=o.get(c.lane);if(f==null||c.end>f.end?o.set(c.lane,c):c.end<f.end&&r.set(c.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=Ja(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,i,r,o,a,c,f)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f}),{key:!1}),this.getMeasurements=Ja(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f},h)=>{const m=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const x=this.options.gap,w=n*2;let C=this._flatMeasurements;if(!C||C.length<w){const T=new Float64Array(w);C&&p>0&&T.set(C.subarray(0,p*2)),C=T,this._flatMeasurements=C}let E;if(p===0)E=i+r;else{const T=p-1;E=C[T*2]+C[T*2+1]+x}for(let T=p;T<n;T++){const A=o(T),D=m.get(A),k=typeof D=="number"?D:this.options.estimateSize(T);C[T*2]=E,C[T*2+1]=k,E+=k+x}const O=T$(n,C,o);return this.measurementsCache=O,O}const y=this.measurementsCache.slice(0,p),b=new Array(c).fill(void 0);for(let x=0;x<p;x++){const w=y[x];w&&(b[w.lane]=x)}for(let x=p;x<n;x++){const w=o(x),C=this.laneAssignments.get(x);let E,O;const T=f==="estimate"||m.has(w);if(C!==void 0&&this.options.lanes>1){E=C;const M=b[E],I=M!==void 0?y[M]:void 0;O=I?I.end+this.options.gap:i+r}else{const M=this.options.lanes===1?y[x-1]:this.getFurthestMeasurement(y,x);O=M?M.end+this.options.gap:i+r,E=M?M.lane:x%this.options.lanes,this.options.lanes>1&&T&&this.laneAssignments.set(x,E)}const A=m.get(w),D=typeof A=="number"?A:this.options.estimateSize(x),k=O+D;y[x]={index:x,start:O,size:D,end:k,key:w,lane:E},b[E]=x}return this.measurementsCache=y,y},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ja(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,r,o)=>{if(n.length===0||i===0)return this.range=null,null;const a=Math.max(this.getTotalSize()-i,0),c=Math.min(Math.max(r,0),a);return this.range=_$(n,i,c,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ja(()=>{let n=null,i=null;const r=this.calculateRange();return r&&(n=r.startIndex,i=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,r,o,a)=>o===null||a===null?[]:n({startIndex:o,endIndex:a,overscan:i,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,r=n.getAttribute(i);return r?parseInt(r,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const r=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(r!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,r-o),c=Math.min(this.options.count-1,r+o);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const i=this.indexFromElement(n),r=this.options.getItemKey(i),o=this.elementsCache.get(r);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(r,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var r,o;if(n<0||n>=this.options.count)return;let a,c,f;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)f=this.options.getItemKey(n),c=h[n*2],a=h[n*2+1];else{const y=this.measurementsCache[n];if(!y)return;f=y.key,c=y.start,a=y.size}const m=this.itemSizeCache.get(f)??a,p=i-m;if(p!==0){const y=this.options.anchorTo==="end"&&((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=y?this.getTotalSize():0,x=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:c,size:a,end:c+a,lane:0},p,this):c<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(f)||this.scrollDirection!=="backward"));(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++,y?this.applyScrollAdjustment(this.getTotalSize()-b):x&&this.applyScrollAdjustment(p),this.notify(!1)}},this.getVirtualItems=Ja(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const r=[];for(let o=0,a=n.length;o<a;o++){const c=n[o],f=i[c];r.push(f)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const r=this._flatMeasurements,o=this.options.lanes===1&&r!=null,a=E3(0,i.length-1,o?c=>r[c*2]:c=>BD(i[c]).start,n);return BD(i[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,r=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),a=this.getScrollOffset();i==="auto"&&(i=n>=a+o?"end":"start"),i==="center"?n+=(r-o)/2:i==="end"&&(n-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.getSize(),o=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(i==="auto")if(a.end>=o+r-this.options.scrollPaddingEnd)i="end";else if(a.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,a.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:r="auto"}={})=>{const o=this.getOffsetForAlignment(n,i),a=this.now();this.scrollState={index:null,align:i,behavior:r,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:r="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,i);if(!o)return;const[a,c]=o,f=this.now();this.scrollState={index:n,align:c,behavior:r,startedAt:f,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const r=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let r;if(i.length===0)r=this.options.paddingStart;else if(this.options.lanes===1){const o=i.length-1,a=this._flatMeasurements;a!=null?r=a[o*2]+a[o*2+1]:r=((n=i[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let a=i.length-1;for(;a>=0&&o.some(c=>c===null);){const c=i[a];o[c.lane]===null&&(o[c.lane]=c.end),a--}r=Math.max(...o.filter(c=>c!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const r of i)r&&this.itemSizeCache.has(r.key)&&n.push({index:r.index,key:r.key,start:r.start,size:r.size,end:r.end,lane:r.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:r})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:r,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,n){e!==0&&(Hb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,r=i?i[0]:this.scrollState.lastTargetOffset,o=1,a=r!==this.scrollState.lastTargetOffset;if(!a&&R$(r,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==r&&this._scrollToOffset(r,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const c=this.getSize()||600,f=Math.abs(r-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&f>c;this.scrollState.lastTargetOffset=r,h||(this.scrollState.behavior="auto"),this._scrollToOffset(r,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const E3=(t,e,n,i)=>{for(;t<=e;){const r=(t+e)/2|0,o=n(r);if(o<i)t=r+1;else if(o>i)e=r-1;else return r}return t>0?t-1:0};function z$(t,e,n){let i=0;for(;i<=e;){const r=(i+e)/2|0,o=t[r*2];if(o<n)i=r+1;else if(o>n)e=r-1;else return r}return i>0?i-1:0}function _$(t,e,n,i,r){const o=t.length-1;if(t.length<=i)return{startIndex:0,endIndex:o};if(i===1&&r!==null){const h=z$(r,o,n);let m=h;const p=n+e;for(;m<o&&r[m*2]+r[m*2+1]<p;)m++;return{startIndex:h,endIndex:m}}let c=E3(0,o,h=>t[h].start,n),f=c;if(i===1)for(;f<o&&t[f].end<n+e;)f++;else if(i>1){const h=Array(i).fill(0);for(;f<o&&h.some(p=>p<n+e);){const p=t[f];h[p.lane]=p.end,f++}const m=Array(i).fill(n+e);for(;c>=0&&m.some(p=>p>=n);){const p=t[c];m[p.lane]=p.start,c--}c=Math.max(0,c-c%i),f=Math.min(o,f+(i-1-f%i))}return{startIndex:c,endIndex:f}}const Fb=typeof document<"u"?S.useLayoutEffect:S.useEffect;function H$({useFlushSync:t=!0,directDomUpdates:e=!1,directDomUpdatesMode:n="transform",...i}){const r=S.useReducer(h=>h+1,0)[1],o=S.useRef({enabled:e,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=e,o.current.mode=n;const a=h=>{const m=o.current;if(!m.enabled||!m.container)return;const p=h.getTotalSize();if(p!==m.lastSize){m.lastSize=p;const E=h.options.horizontal?"width":"height";m.container.style[E]=`${p}px`}const y=!!h.options.horizontal,b=m.mode==="transform",x=y?"left":"top",w=h.options.scrollMargin,C=h.getVirtualItems();for(const E of C){const O=E.start-w,T=h.elementsCache.get(E.key);T&&m.lastPositions.get(T)!==O&&(m.lastPositions.set(T,O),b?T.style.transform=y?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:T.style[x]=`${O}px`)}},c={...i,onChange:(h,m)=>{var p;const y=o.current;let b=!0;if(y.enabled){a(h);const x=h.range,w=y.prevRange;b=!w||w.isScrolling!==h.isScrolling||w.startIndex!==x?.startIndex||w.endIndex!==x?.endIndex,b&&(y.prevRange=x?{startIndex:x.startIndex,endIndex:x.endIndex,isScrolling:h.isScrolling}:null)}b&&(t&&m?Ln.flushSync(r):r()),(p=i.onChange)==null||p.call(i,h,m)}},[f]=S.useState(()=>{const h=new V$(c);return Object.assign(h,{containerRef:m=>{const p=o.current;if(p.container=m,p.lastSize=null,m&&p.enabled){const y=h.getTotalSize();p.lastSize=y;const b=h.options.horizontal?"width":"height";m.style[b]=`${y}px`}}})});return f.setOptions(c),Fb(()=>f._didMount(),[]),Fb(()=>f._willUpdate()),Fb(()=>{a(f)}),f}function Iie(t){return H$({observeElementRect:D$,observeElementOffset:I$,scrollToFn:B$,...t})}function k1(t,e){t.indexOf(e)===-1&&t.push(e)}function zu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ys=(t,e,n)=>n>e?e:n<t?t:n;let oy=()=>{};const Yo={},T3=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),R3=t=>typeof t=="object"&&t!==null,A3=t=>/^0[^.\s]+$/u.test(t);function O3(t){let e;return()=>(e===void 0&&(e=t()),e)}const fr=t=>t,Cd=(...t)=>t.reduce((e,n)=>i=>n(e(i))),_u=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class P1{constructor(){this.subscriptions=[]}add(e){return k1(this.subscriptions,e),()=>zu(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let o=0;o<r;o++){const a=this.subscriptions[o];a&&a(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ii=t=>t*1e3,cr=t=>t/1e3,M3=(t,e)=>e?t*(1e3/e):0,F$=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},D3=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,U$=1e-7,j$=12;function K$(t,e,n,i,r){let o,a,c=0;do a=e+(n-e)/2,o=D3(a,i,r)-t,o>0?n=a:e=a;while(Math.abs(o)>U$&&++c<j$);return a}function Ed(t,e,n,i){if(t===e&&n===i)return fr;const r=o=>K$(o,0,1,t,n);return o=>o===0||o===1?o:D3(r(o),e,i)}const k3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,I1=t=>e=>1-t(1-e),P3=Ed(.33,1.53,.69,.99),N1=I1(P3),I3=k3(N1),N3=t=>t>=1?1:(t*=2)<1?.5*N1(t):.5*(2-Math.pow(2,-10*(t-1))),L1=t=>1-Math.sin(Math.acos(t)),L3=I1(L1),B3=k3(L1),Y$=Ed(.42,0,1,1),q$=Ed(0,0,.58,1),V3=Ed(.42,0,.58,1),z3=t=>Array.isArray(t)&&typeof t[0]!="number";function _3(t,e){return z3(t)?t[F$(0,t.length,e)]:t}const H3=t=>Array.isArray(t)&&typeof t[0]=="number",G$={linear:fr,easeIn:Y$,easeInOut:V3,easeOut:q$,circIn:L1,circInOut:B3,circOut:L3,backIn:N1,backInOut:I3,backOut:P3,anticipate:N3},W$=t=>typeof t=="string",zD=t=>{if(H3(t)){oy(t.length===4);const[e,n,i,r]=t;return Ed(e,n,i,r)}else if(W$(t))return G$[t];return t},Bp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function X$(t){let e=new Set,n=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(h){o.has(h)&&(f.schedule(h),t()),h(a)}const f={schedule:(h,m=!1,p=!1)=>{const b=p&&i?e:n;return m&&o.add(h),b.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(a=h,i){r=!0;return}i=!0;const m=e;e=n,n=m,e.forEach(c),e.clear(),i=!1,r&&(r=!1,f.process(h))}};return f}const $$=40;function F3(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=Bp.reduce((T,A)=>(T[A]=X$(o),T),{}),{setup:c,read:f,resolveKeyframes:h,preUpdate:m,update:p,preRender:y,render:b,postRender:x}=a,w=()=>{const T=Yo.useManualTiming,A=T?r.timestamp:performance.now();n=!1,T||(r.delta=i?1e3/60:Math.max(Math.min(A-r.timestamp,$$),1)),r.timestamp=A,r.isProcessing=!0,c.process(r),f.process(r),h.process(r),m.process(r),p.process(r),y.process(r),b.process(r),x.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(w))},C=()=>{n=!0,i=!0,r.isProcessing||t(w)};return{schedule:Bp.reduce((T,A)=>{const D=a[A];return T[A]=(k,M=!1,I=!1)=>(n||C(),D.schedule(k,M,I)),T},{}),cancel:T=>{for(let A=0;A<Bp.length;A++)a[Bp[A]].cancel(T)},state:r,steps:a}}const{schedule:Zt,cancel:qo,state:ei,steps:Ub}=F3(typeof requestAnimationFrame<"u"?requestAnimationFrame:fr,!0);let em;function Q$(){em=void 0}const mi={now:()=>(em===void 0&&mi.set(ei.isProcessing||Yo.useManualTiming?ei.timestamp:performance.now()),em),set:t=>{em=t,queueMicrotask(Q$)}},U3=t=>e=>typeof e=="string"&&e.startsWith(t),j3=U3("--"),Z$=U3("var(--"),B1=t=>Z$(t)?J$.test(t.split("/*")[0].trim()):!1,J$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _D(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const $u={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Yf={...$u,transform:t=>ys(0,1,t)},Vp={...$u,default:1},wf=t=>Math.round(t*1e5)/1e5,V1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function eQ(t){return t==null}const tQ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,z1=(t,e)=>n=>!!(typeof n=="string"&&tQ.test(n)&&n.startsWith(t)||e&&!eQ(n)&&Object.prototype.hasOwnProperty.call(n,e)),K3=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,o,a,c]=i.match(V1);return{[t]:parseFloat(r),[e]:parseFloat(o),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},nQ=t=>ys(0,255,t),jb={...$u,transform:t=>Math.round(nQ(t))},Pl={test:z1("rgb","red"),parse:K3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+jb.transform(t)+", "+jb.transform(e)+", "+jb.transform(n)+", "+wf(Yf.transform(i))+")"};function iQ(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Ax={test:z1("#"),parse:iQ,transform:Pl.transform},Td=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Vs=Td("deg"),ms=Td("%"),je=Td("px"),rQ=Td("vh"),sQ=Td("vw"),HD={...ms,parse:t=>ms.parse(t)/100,transform:t=>ms.transform(t*100)},cu={test:z1("hsl","hue"),parse:K3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ms.transform(wf(e))+", "+ms.transform(wf(n))+", "+wf(Yf.transform(i))+")"},Mn={test:t=>Pl.test(t)||Ax.test(t)||cu.test(t),parse:t=>Pl.test(t)?Pl.parse(t):cu.test(t)?cu.parse(t):Ax.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Pl.transform(t):cu.transform(t),getAnimatableNone:t=>{const e=Mn.parse(t);return e.alpha=0,Mn.transform(e)}},oQ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function lQ(t){return isNaN(t)&&typeof t=="string"&&(t.match(V1)?.length||0)+(t.match(oQ)?.length||0)>0}const Y3="number",q3="color",aQ="var",uQ="var(",FD="${}",cQ=/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 Hu(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const c=e.replace(cQ,f=>(Mn.test(f)?(i.color.push(o),r.push(q3),n.push(Mn.parse(f))):f.startsWith(uQ)?(i.var.push(o),r.push(aQ),n.push(f)):(i.number.push(o),r.push(Y3),n.push(parseFloat(f))),++o,FD)).split(FD);return{values:n,split:c,indexes:i,types:r}}function fQ(t){return Hu(t).values}function G3({split:t,types:e}){const n=t.length;return i=>{let r="";for(let o=0;o<n;o++)if(r+=t[o],i[o]!==void 0){const a=e[o];a===Y3?r+=wf(i[o]):a===q3?r+=Mn.transform(i[o]):r+=i[o]}return r}}function dQ(t){return G3(Hu(t))}const hQ=t=>typeof t=="number"?0:Mn.test(t)?Mn.getAnimatableNone(t):t,pQ=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:hQ(t);function mQ(t){const e=Hu(t);return G3(e)(e.values.map((i,r)=>pQ(i,e.split[r])))}const Mr={test:lQ,parse:fQ,createTransformer:dQ,getAnimatableNone:mQ};function Kb(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function gQ({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,o=0,a=0;if(!e)r=o=a=n;else{const c=n<.5?n*(1+e):n+e-n*e,f=2*n-c;r=Kb(f,c,t+1/3),o=Kb(f,c,t),a=Kb(f,c,t-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:i}}function Ym(t,e){return n=>n>0?e:t}const Yt=(t,e,n)=>t+(e-t)*n,Yb=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},yQ=[Ax,Pl,cu],vQ=t=>yQ.find(e=>e.test(t));function UD(t){const e=vQ(t);if(!e)return!1;let n=e.parse(t);return e===cu&&(n=gQ(n)),n}const jD=(t,e)=>{const n=UD(t),i=UD(e);if(!n||!i)return Ym(t,e);const r={...n};return o=>(r.red=Yb(n.red,i.red,o),r.green=Yb(n.green,i.green,o),r.blue=Yb(n.blue,i.blue,o),r.alpha=Yt(n.alpha,i.alpha,o),Pl.transform(r))},Ox=new Set(["none","hidden"]);function bQ(t,e){return Ox.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function SQ(t,e){return n=>Yt(t,e,n)}function _1(t){return typeof t=="number"?SQ:typeof t=="string"?B1(t)?Ym:Mn.test(t)?jD:CQ:Array.isArray(t)?W3:typeof t=="object"?Mn.test(t)?jD:xQ:Ym}function W3(t,e){const n=[...t],i=n.length,r=t.map((o,a)=>_1(o)(o,e[a]));return o=>{for(let a=0;a<i;a++)n[a]=r[a](o);return n}}function xQ(t,e){const n={...t,...e},i={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(i[r]=_1(t[r])(t[r],e[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function wQ(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],c=t.values[a]??0;n[r]=c,i[o]++}return n}const CQ=(t,e)=>{const n=Mr.createTransformer(e),i=Hu(t),r=Hu(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Ox.has(t)&&!r.values.length||Ox.has(e)&&!i.values.length?bQ(t,e):Cd(W3(wQ(i,r),r.values),n):Ym(t,e)};function X3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Yt(t,e,n):_1(t)(t,e)}const EQ=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Zt.update(e,n),stop:()=>qo(e),now:()=>ei.isProcessing?ei.timestamp:mi.now()}},$3=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let o=0;o<r;o++)i+=Math.round(t(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},qm=2e4;function H1(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<qm;)e+=n,i=t.next(e);return e>=qm?1/0:e}function Q3(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(H1(i),qm);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:cr(r)}}const yn={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 Mx(t,e){return t*Math.sqrt(1-e*e)}const TQ=12;function RQ(t,e,n){let i=n;for(let r=1;r<TQ;r++)i=i-t(i)/e(i);return i}const qb=.001;function AQ({duration:t=yn.duration,bounce:e=yn.bounce,velocity:n=yn.velocity,mass:i=yn.mass}){let r,o,a=1-e;a=ys(yn.minDamping,yn.maxDamping,a),t=ys(yn.minDuration,yn.maxDuration,cr(t)),a<1?(r=h=>{const m=h*a,p=m*t,y=m-n,b=Mx(h,a),x=Math.exp(-p);return qb-y/b*x},o=h=>{const p=h*a*t,y=p*n+n,b=Math.pow(a,2)*Math.pow(h,2)*t,x=Math.exp(-p),w=Mx(Math.pow(h,2),a);return(-r(h)+qb>0?-1:1)*((y-b)*x)/w}):(r=h=>{const m=Math.exp(-h*t),p=(h-n)*t+1;return-qb+m*p},o=h=>{const m=Math.exp(-h*t),p=(n-h)*(t*t);return m*p});const c=5/t,f=RQ(r,o,c);if(t=Ii(t),isNaN(f))return{stiffness:yn.stiffness,damping:yn.damping,duration:t};{const h=Math.pow(f,2)*i;return{stiffness:h,damping:a*2*Math.sqrt(i*h),duration:t}}}const OQ=["duration","bounce"],MQ=["stiffness","damping","mass"];function KD(t,e){return e.some(n=>t[n]!==void 0)}function DQ(t){let e={velocity:yn.velocity,stiffness:yn.stiffness,damping:yn.damping,mass:yn.mass,isResolvedFromDuration:!1,...t};if(!KD(t,MQ)&&KD(t,OQ))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*ys(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:yn.mass,stiffness:r,damping:o}}else{const n=AQ({...t,velocity:0});e={...e,...n,mass:yn.mass},e.isResolvedFromDuration=!0}return e}function qf(t=yn.visualDuration,e=yn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:f,damping:h,mass:m,duration:p,velocity:y,isResolvedFromDuration:b}=DQ({...n,velocity:-cr(n.velocity||0)}),x=y||0,w=h/(2*Math.sqrt(f*m)),C=a-o,E=cr(Math.sqrt(f/m)),O=Math.abs(C)<5;i||(i=O?yn.restSpeed.granular:yn.restSpeed.default),r||(r=O?yn.restDelta.granular:yn.restDelta.default);let T,A,D,k,M,I;if(w<1)D=Mx(E,w),k=(x+w*E*C)/D,T=B=>{const H=Math.exp(-w*E*B);return a-H*(k*Math.sin(D*B)+C*Math.cos(D*B))},M=w*E*k+C*D,I=w*E*C-k*D,A=B=>Math.exp(-w*E*B)*(M*Math.sin(D*B)+I*Math.cos(D*B));else if(w===1){T=H=>a-Math.exp(-E*H)*(C+(x+E*C)*H);const B=x+E*C;A=H=>Math.exp(-E*H)*(E*B*H-x)}else{const B=E*Math.sqrt(w*w-1);T=K=>{const z=Math.exp(-w*E*K),V=Math.min(B*K,300);return a-z*((x+w*E*C)*Math.sinh(V)+B*C*Math.cosh(V))/B};const H=(x+w*E*C)/B,U=w*E*H-C*B,F=w*E*C-H*B;A=K=>{const z=Math.exp(-w*E*K),V=Math.min(B*K,300);return z*(U*Math.sinh(V)+F*Math.cosh(V))}}const L={calculatedDuration:b&&p||null,velocity:B=>Ii(A(B)),next:B=>{if(!b&&w<1){const U=Math.exp(-w*E*B),F=Math.sin(D*B),K=Math.cos(D*B),z=a-U*(k*F+C*K),V=Ii(U*(M*F+I*K));return c.done=Math.abs(V)<=i&&Math.abs(a-z)<=r,c.value=c.done?a:z,c}const H=T(B);if(b)c.done=B>=p;else{const U=Ii(A(B));c.done=Math.abs(U)<=i&&Math.abs(a-H)<=r}return c.value=c.done?a:H,c},toString:()=>{const B=Math.min(H1(L),qm),H=$3(U=>L.next(B*U).value,B,30);return B+"ms "+H},toTransition:()=>{}};return L}qf.applyToOptions=t=>{const e=Q3(t,100,qf);return t.ease=e.ease,t.duration=Ii(e.duration),t.type="keyframes",t};const kQ=5;function Z3(t,e,n){const i=Math.max(e-kQ,0);return M3(n-t(i),e-i)}function Dx({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:a,min:c,max:f,restDelta:h=.5,restSpeed:m}){const p=t[0],y={done:!1,value:p},b=I=>c!==void 0&&I<c||f!==void 0&&I>f,x=I=>c===void 0?f:f===void 0||Math.abs(c-I)<Math.abs(f-I)?c:f;let w=n*e;const C=p+w,E=a===void 0?C:a(C);E!==C&&(w=E-p);const O=I=>-w*Math.exp(-I/i),T=I=>E+O(I),A=I=>{const L=O(I),B=T(I);y.done=Math.abs(L)<=h,y.value=y.done?E:B};let D,k;const M=I=>{b(y.value)&&(D=I,k=qf({keyframes:[y.value,x(y.value)],velocity:Z3(T,I,y.value),damping:r,stiffness:o,restDelta:h,restSpeed:m}))};return M(0),{calculatedDuration:null,next:I=>{let L=!1;return!k&&D===void 0&&(L=!0,A(I),M(I)),D!==void 0&&I>=D?k.next(I-D):(!L&&A(I),y)}}}function PQ(t,e,n){const i=[],r=n||Yo.mix||X3,o=t.length-1;for(let a=0;a<o;a++){let c=r(t[a],t[a+1]);if(e){const f=Array.isArray(e)?e[a]||fr:e;c=Cd(f,c)}i.push(c)}return i}function IQ(t,e,{clamp:n=!0,ease:i,mixer:r}={}){const o=t.length;if(oy(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=PQ(e,i,r),f=c.length,h=m=>{if(a&&m<t[0])return e[0];let p=0;if(f>1)for(;p<t.length-2&&!(m<t[p+1]);p++);const y=_u(t[p],t[p+1],m);return c[p](y)};return n?m=>h(ys(t[0],t[o-1],m)):h}function J3(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=_u(0,e,i);t.push(Yt(n,1,r))}}function ez(t){const e=[0];return J3(e,t.length-1),e}function NQ(t,e){return t.map(n=>n*e)}function LQ(t,e){return t.map(()=>e||V3).splice(0,t.length-1)}function Cf({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=z3(i)?i.map(zD):zD(i),o={done:!1,value:e[0]},a=NQ(n&&n.length===e.length?n:ez(e),t),c=IQ(a,e,{ease:Array.isArray(r)?r:LQ(e,r)});return{calculatedDuration:t,next:f=>(o.value=c(f),o.done=f>=t,o)}}const BQ=t=>t!==null;function ly(t,{repeat:e,repeatType:n="loop"},i,r=1){const o=t.filter(BQ),c=r<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!c||i===void 0?o[c]:i}const VQ={decay:Dx,inertia:Dx,tween:Cf,keyframes:Cf,spring:qf};function tz(t){typeof t.type=="string"&&(t.type=VQ[t.type])}class F1{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const zQ=t=>t/100;class Gm extends F1{constructor(e){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!==mi.now()&&this.tick(mi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;tz(e);const{type:n=Cf,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=e;let{keyframes:c}=e;const f=n||Cf;f!==Cf&&typeof c[0]!="number"&&(this.mixKeyframes=Cd(zQ,X3(c[0],c[1])),c=[0,100]);const h=f({...e,keyframes:c});o==="mirror"&&(this.mirroredGenerator=f({...e,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=H1(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=h}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:h=0,keyframes:m,repeat:p,repeatType:y,repeatDelay:b,type:x,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-h*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?E<0:E>r;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let T=this.currentTime,A=i;if(p){const I=Math.min(this.currentTime,r)/c;let L=Math.floor(I),B=I%1;!B&&I>=1&&(B=1),B===1&&L--,L=Math.min(L,p+1),L%2&&(y==="reverse"?(B=1-B,b&&(B-=b/c)):y==="mirror"&&(A=a)),T=ys(0,1,B)*c}let D;O?(this.delayState.value=m[0],D=this.delayState):D=A.next(T),o&&!O&&(D.value=o(D.value));let{done:k}=D;!O&&f!==null&&(k=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return M&&x!==Dx&&(D.value=ly(m,this.options,C,this.speed)),w&&w(D.value),M&&this.finish(),D}then(e,n){return this.finished.then(e,n)}get duration(){return cr(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+cr(e)}get time(){return cr(this.currentTime)}set time(e){e=Ii(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Z3(i=>this.generator.next(i).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(mi.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=cr(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=EQ,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),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(mi.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(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function _Q(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Il=t=>t*180/Math.PI,kx=t=>{const e=Il(Math.atan2(t[1],t[0]));return Px(e)},HQ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:kx,rotateZ:kx,skewX:t=>Il(Math.atan(t[1])),skewY:t=>Il(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Px=t=>(t=t%360,t<0&&(t+=360),t),YD=kx,qD=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),GD=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),FQ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qD,scaleY:GD,scale:t=>(qD(t)+GD(t))/2,rotateX:t=>Px(Il(Math.atan2(t[6],t[5]))),rotateY:t=>Px(Il(Math.atan2(-t[2],t[0]))),rotateZ:YD,rotate:YD,skewX:t=>Il(Math.atan(t[4])),skewY:t=>Il(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ix(t){return t.includes("scale")?1:0}function Nx(t,e){if(!t||t==="none")return Ix(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=FQ,r=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=HQ,r=c}if(!r)return Ix(e);const o=i[e],a=r[1].split(",").map(jQ);return typeof o=="function"?o(a):a[o]}const UQ=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Nx(n,e)};function jQ(t){return parseFloat(t.trim())}const Qu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zu=new Set([...Qu,"pathRotation"]),WD=t=>t===$u||t===je,KQ=new Set(["x","y","z"]),YQ=Qu.filter(t=>!KQ.has(t));function qQ(t){const e=[];return YQ.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const Lo={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const r=t.max-t.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const r=t.max-t.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Nx(e,"x"),y:(t,{transform:e})=>Nx(e,"y")};Lo.translateX=Lo.x;Lo.translateY=Lo.y;const Vl=new Set;let Lx=!1,Bx=!1,Vx=!1;function nz(){if(Bx){const t=Array.from(Vl).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=qQ(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,a])=>{i.getValue(o)?.set(a)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Bx=!1,Lx=!1,Vl.forEach(t=>t.complete(Vx)),Vl.clear()}function iz(){Vl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Bx=!0)})}function GQ(){Vx=!0,iz(),nz(),Vx=!1}class U1{constructor(e,n,i,r,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Vl.add(this),Lx||(Lx=!0,Zt.read(iz),Zt.resolveKeyframes(nz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const o=r?.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const c=i.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),r&&o===void 0&&r.set(e[0])}_Q(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vl.delete(this)}cancel(){this.state==="scheduled"&&(Vl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const WQ=t=>t.startsWith("--");function rz(t,e,n){WQ(e)?t.style.setProperty(e,n):t.style[e]=n}const XQ={};function sz(t,e){const n=O3(t);return()=>XQ[e]??n()}const $Q=sz(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),oz=sz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cf=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,XD={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cf([0,.65,.55,1]),circOut:cf([.55,0,1,.45]),backIn:cf([.31,.01,.66,-.59]),backOut:cf([.33,1.53,.69,.99])};function lz(t,e){if(t)return typeof t=="function"?oz()?$3(t,e):"ease-out":H3(t)?cf(t):Array.isArray(t)?t.map(n=>lz(n,e)||XD.easeOut):XD[t]}function QQ(t,e,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:a="loop",ease:c="easeOut",times:f}={},h=void 0){const m={[e]:n};f&&(m.offset=f);const p=lz(c,r);Array.isArray(p)&&(m.easing=p);const y={delay:i,duration:r,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return h&&(y.pseudoElement=h),t.animate(m,y)}function j1(t){return typeof t=="function"&&"applyToOptions"in t}function ZQ({type:t,...e}){return j1(t)&&oz()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class az extends F1{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:c,onComplete:f}=e;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=e,oy(typeof e.type!="string");const h=ZQ(e);this.animation=QQ(n,i,r,h,o),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=ly(r,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),rz(n,i,m),this.animation.cancel()}f?.(),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:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return cr(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+cr(e)}get time(){return cr(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ii(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:i,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&$Q()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),fr):r(this)}}const uz={anticipate:N3,backInOut:I3,circInOut:B3};function JQ(t){return t in uz}function eZ(t){typeof t.ease=="string"&&JQ(t.ease)&&(t.ease=uz[t.ease])}const Gb=10;class tZ extends az{constructor(e){eZ(e),tz(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new Gm({...a,autoplay:!1}),f=Math.max(Gb,mi.now()-this.startTime),h=ys(0,Gb,f-Gb),m=c.sample(f).value,{name:p}=this.options;o&&p&&rz(o,p,m),n.setWithVelocity(c.sample(Math.max(0,f-h)).value,m,h),c.stop()}}const $D=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Mr.test(t)||t==="0")&&!t.startsWith("url("));function nZ(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function iZ(t,e,n,i){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],a=$D(r,e),c=$D(o,e);return!a||!c?!1:nZ(t)||(n==="spring"||j1(n))&&i}function zx(t){t.duration=0,t.type="keyframes"}const cz=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),rZ=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function sZ(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&rZ.test(t[e]))return!0;return!1}const oZ=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),lZ=O3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function aZ(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:o,type:a,keyframes:c}=t,f=e?.owner?.current;if(!(f instanceof HTMLElement)&&!(f instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:m}=e.owner.getProps();return lZ()&&n&&(cz.has(n)||oZ.has(n)&&sZ(c))&&(n!=="transform"||!m)&&!h&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}const uZ=40;class cZ extends F1{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",keyframes:c,name:f,motionValue:h,element:m,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=mi.now();const y={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:a,name:f,motionValue:h,element:m,...p},b=m?.KeyframeResolver||U1;this.keyframeResolver=new b(c,(x,w,C)=>this.onKeyframesResolved(x,w,y,!C),f,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:o,type:a,velocity:c,delay:f,isHandoff:h,onUpdate:m}=i;this.resolvedAt=mi.now();let p=!0;iZ(e,o,a,c)||(p=!1,(Yo.instantAnimations||!f)&&m?.(ly(e,i,n)),e[0]=e[e.length-1],zx(i),i.repeat=0);const b={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>uZ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},x=p&&!h&&aZ(b),w=b.motionValue?.owner?.current;let C;if(x)try{C=new tZ({...b,element:w})}catch{C=new Gm(b)}else C=new Gm(b);C.finished.then(()=>{this.notifyFinished()}).catch(fr),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),GQ()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class fZ{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=n}attachTimeline(e){const n=this.animations.map(i=>i.attachTimeline(e));return()=>{n.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return QD(this.animations,"duration")}get iterationDuration(){return QD(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function QD(t,e){let n=0;for(let i=0;i<t.length;i++){const r=t[i][e];r!==null&&r>n&&(n=r)}return n}class dZ extends fZ{then(e,n){return this.finished.finally(e).then(()=>{})}}function fz(t,e,n,i=0,r=1){const o=Array.from(t).sort((h,m)=>h.sortNodePosition(m)).indexOf(e),a=t.size,c=(a-1)*i;return typeof n=="function"?n(o,a):r===1?o*i:c-o*i}const ZD=30,hZ=t=>!isNaN(parseFloat(t));class pZ{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=mi.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=mi.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=hZ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new P1);const i=this.events[e].add(n);return e==="change"?()=>{i(),Zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=mi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ZD)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ZD);return M3(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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 Go(t,e){return new pZ(t,e)}function dz(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function K1(t,e){const n=t?.[e]??t?.default??t;return n!==t?dz(n,t):n}const mZ={type:"spring",stiffness:500,damping:25,restSpeed:10},gZ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),yZ={type:"keyframes",duration:.8},vZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bZ=(t,{keyframes:e})=>e.length>2?yZ:Zu.has(t)?t.startsWith("scale")?gZ(e[1]):mZ:vZ,SZ=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function xZ(t){for(const e in t)if(!SZ.has(e))return!0;return!1}const Y1=(t,e,n,i={},r,o)=>a=>{const c=K1(i,t)||{},f=c.delay||i.delay||0;let{elapsed:h=0}=i;h=h-Ii(f);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-h,onUpdate:y=>{e.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:r};xZ(c)||Object.assign(m,bZ(t,m)),m.duration&&(m.duration=Ii(m.duration)),m.repeatDelay&&(m.repeatDelay=Ii(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(zx(m),m.delay===0&&(p=!0)),(Yo.instantAnimations||Yo.skipAnimations||r?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,zx(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,p&&!o&&e.get()!==void 0){const y=ly(m.keyframes,c);if(y!==void 0){Zt.update(()=>{m.onUpdate(y),m.onComplete()});return}}return c.isSync?new Gm(m):new cZ(m)},wZ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function CZ(t){const e=wZ.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}function hz(t,e,n=1){const[i,r]=CZ(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const a=o.trim();return T3(a)?parseFloat(a):a}return B1(r)?hz(r,e,n+1):r}function JD(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function q1(t,e,n,i){if(typeof e=="function"){const[r,o]=JD(i);e=e(n!==void 0?n:t.custom,r,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,o]=JD(i);e=e(n!==void 0?n:t.custom,r,o)}return e}function zl(t,e,n){const i=t.getProps();return q1(i,e,n!==void 0?n:i.custom,t)}const pz=new Set(["width","height","top","left","right","bottom",...Qu]),_x=t=>Array.isArray(t);function EZ(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Go(n))}function TZ(t){return _x(t)?t[t.length-1]||0:t}function RZ(t,e){const n=zl(t,e);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const a in o){const c=TZ(o[a]);EZ(t,a,c)}}const Vn=t=>!!(t&&t.getVelocity);function AZ(t){return!!(Vn(t)&&t.add)}function Hx(t,e){const n=t.getValue("willChange");if(AZ(n))return n.add(e);if(!n&&Yo.WillChange){const i=new Yo.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function G1(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const OZ="framerAppearId",mz="data-"+G1(OZ);function gz(t){return t.props[mz]}function MZ({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function W1(t,e,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:a,...c}=e;const f=t.getDefaultTransition();o=o?dz(o,f):f;const h=o?.reduceMotion,m=o?.skipAnimations;i&&(o=i);const p=[],y=r&&t.animationState&&t.animationState.getState()[r],b=o?.path;b&&b.animateVisualElement(t,c,o,n,p);for(const x in c){const w=t.getValue(x,t.latestValues[x]??null),C=c[x];if(C===void 0||y&&MZ(y,x))continue;const E={delay:n,...K1(o||{},x)};m&&(E.skipAnimations=!0);const O=w.get();if(O!==void 0&&!w.isAnimating()&&!Array.isArray(C)&&C===O&&!E.velocity){Zt.update(()=>w.set(C));continue}let T=!1;if(window.MotionHandoffAnimation){const k=gz(t);if(k){const M=window.MotionHandoffAnimation(k,x,Zt);M!==null&&(E.startTime=M,T=!0)}}Hx(t,x);const A=h??t.shouldReduceMotion;w.start(Y1(x,w,C,A&&pz.has(x)?{type:!1}:E,t,T));const D=w.animation;D&&p.push(D)}if(a){const x=()=>Zt.update(()=>{a&&RZ(t,a)});p.length?Promise.all(p).then(x):x()}return p}function Fx(t,e,n={}){const i=zl(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(W1(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=r;return DZ(t,e,f,h,m,p,n)}:()=>Promise.resolve(),{when:c}=r;if(c){const[f,h]=c==="beforeChildren"?[o,a]:[a,o];return f().then(()=>h())}else return Promise.all([o(),a(n.delay)])}function DZ(t,e,n=0,i=0,r=0,o=1,a){const c=[];for(const f of t.variantChildren)f.notify("AnimationStart",e),c.push(Fx(f,e,{...a,delay:n+(typeof i=="function"?0:i)+fz(t.variantChildren,f,i,r,o)}).then(()=>f.notify("AnimationComplete",e)));return Promise.all(c)}function kZ(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(o=>Fx(t,o,n));i=Promise.all(r)}else if(typeof e=="string")i=Fx(t,e,n);else{const r=typeof e=="function"?zl(t,e,n.custom):e;i=Promise.all(W1(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const PZ={test:t=>t==="auto",parse:t=>t},yz=t=>e=>e.test(t),vz=[$u,je,ms,Vs,sQ,rQ,PZ],ek=t=>vz.find(yz(t));function IZ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||A3(t):!0}const NZ=new Set(["brightness","contrast","saturate","opacity"]);function LZ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(V1)||[];if(!i)return t;const r=n.replace(i,"");let o=NZ.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+r+")"}const BZ=/\b([a-z-]*)\(.*?\)/gu,Ux={...Mr,getAnimatableNone:t=>{const e=t.match(BZ);return e?e.map(LZ).join(" "):t}},jx={...Mr,getAnimatableNone:t=>{const e=Mr.parse(t);return Mr.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},tk={...$u,transform:Math.round},VZ={rotate:Vs,pathRotation:Vs,rotateX:Vs,rotateY:Vs,rotateZ:Vs,scale:Vp,scaleX:Vp,scaleY:Vp,scaleZ:Vp,skew:Vs,skewX:Vs,skewY:Vs,distance:je,translateX:je,translateY:je,translateZ:je,x:je,y:je,z:je,perspective:je,transformPerspective:je,opacity:Yf,originX:HD,originY:HD,originZ:je},Wm={borderWidth:je,borderTopWidth:je,borderRightWidth:je,borderBottomWidth:je,borderLeftWidth:je,borderRadius:je,borderTopLeftRadius:je,borderTopRightRadius:je,borderBottomRightRadius:je,borderBottomLeftRadius:je,width:je,maxWidth:je,height:je,maxHeight:je,top:je,right:je,bottom:je,left:je,inset:je,insetBlock:je,insetBlockStart:je,insetBlockEnd:je,insetInline:je,insetInlineStart:je,insetInlineEnd:je,padding:je,paddingTop:je,paddingRight:je,paddingBottom:je,paddingLeft:je,paddingBlock:je,paddingBlockStart:je,paddingBlockEnd:je,paddingInline:je,paddingInlineStart:je,paddingInlineEnd:je,margin:je,marginTop:je,marginRight:je,marginBottom:je,marginLeft:je,marginBlock:je,marginBlockStart:je,marginBlockEnd:je,marginInline:je,marginInlineStart:je,marginInlineEnd:je,fontSize:je,backgroundPositionX:je,backgroundPositionY:je,...VZ,zIndex:tk,fillOpacity:Yf,strokeOpacity:Yf,numOctaves:tk},zZ={...Wm,color:Mn,backgroundColor:Mn,outlineColor:Mn,fill:Mn,stroke:Mn,borderColor:Mn,borderTopColor:Mn,borderRightColor:Mn,borderBottomColor:Mn,borderLeftColor:Mn,filter:Ux,WebkitFilter:Ux,mask:jx,WebkitMask:jx},bz=t=>zZ[t],_Z=new Set([Ux,jx]);function Sz(t,e){let n=bz(t);return _Z.has(n)||(n=Mr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const HZ=new Set(["auto","none","0"]);function FZ(t,e,n){let i=0,r;for(;i<t.length&&!r;){const o=t[i];typeof o=="string"&&!HZ.has(o)&&Hu(o).values.length&&(r=t[i]),i++}if(r&&n)for(const o of e)t[o]=Sz(n,r)}class UZ extends U1{constructor(e,n,i,r,o){super(e,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<e.length;m++){let p=e[m];if(typeof p=="string"&&(p=p.trim(),B1(p))){const y=hz(p,n.current);y!==void 0&&(e[m]=y),m===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!pz.has(i)||e.length!==2)return;const[r,o]=e,a=ek(r),c=ek(o),f=_D(r),h=_D(o);if(f!==h&&Lo[i]){this.needsMeasurement=!0;return}if(a!==c)if(WD(a)&&WD(c))for(let m=0;m<e.length;m++){const p=e[m];typeof p=="string"&&(e[m]=parseFloat(p))}else Lo[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||IZ(e[r]))&&i.push(r);i.length&&FZ(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Lo[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=Lo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const X1=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function $1(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;e&&(i=e.current);const r=n?.[t]??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(i=>i!=null)}const Kx=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function jZ(t){return R3(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Q1}=F3(queueMicrotask,!1),Tr={x:!1,y:!1};function xz(){return Tr.x||Tr.y}function KZ(t){return t==="x"||t==="y"?Tr[t]?null:(Tr[t]=!0,()=>{Tr[t]=!1}):Tr.x||Tr.y?null:(Tr.x=Tr.y=!0,()=>{Tr.x=Tr.y=!1})}function wz(t,e){const n=$1(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function YZ(t){return!(t.pointerType==="touch"||xz())}function qZ(t,e,n={}){const[i,r,o]=wz(t,n);return i.forEach(a=>{let c=!1,f=!1,h;const m=()=>{a.removeEventListener("pointerleave",x)},p=C=>{h&&(h(C),h=void 0),m()},y=C=>{c=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),f&&(f=!1,p(C))},b=()=>{c=!0,window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",y,r)},x=C=>{if(C.pointerType!=="touch"){if(c){f=!0;return}p(C)}},w=C=>{if(!YZ(C))return;f=!1;const E=e(a,C);typeof E=="function"&&(h=E,a.addEventListener("pointerleave",x,r))};a.addEventListener("pointerenter",w,r),a.addEventListener("pointerdown",b,r)}),o}const Cz=(t,e)=>e?t===e?!0:Cz(t,e.parentElement):!1,Z1=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,GZ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WZ(t){return GZ.has(t.tagName)||t.isContentEditable===!0}const XZ=new Set(["INPUT","SELECT","TEXTAREA"]);function $Z(t){return XZ.has(t.tagName)||t.isContentEditable===!0}const tm=new WeakSet;function nk(t){return e=>{e.key==="Enter"&&t(e)}}function Wb(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const QZ=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=nk(()=>{if(tm.has(n))return;Wb(n,"down");const r=nk(()=>{Wb(n,"up")}),o=()=>Wb(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function ik(t){return Z1(t)&&!xz()}const rk=new WeakSet;function ZZ(t,e,n={}){const[i,r,o]=wz(t,n),a=c=>{const f=c.currentTarget;if(!ik(c)||rk.has(c))return;tm.add(f),n.stopPropagation&&rk.add(c);const h=e(f,c),m={...r,capture:!0},p=(x,w)=>{window.removeEventListener("pointerup",y,m),window.removeEventListener("pointercancel",b,m),tm.has(f)&&tm.delete(f),ik(x)&&typeof h=="function"&&h(x,{success:w})},y=x=>{p(x,f===window||f===document||n.useGlobalTarget||Cz(f,x.target))},b=x=>{p(x,!1)};window.addEventListener("pointerup",y,m),window.addEventListener("pointercancel",b,m)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,r),jZ(c)&&(c.addEventListener("focus",h=>QZ(h,r)),!WZ(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function ay(t){return R3(t)&&"ownerSVGElement"in t}const nm=new WeakMap;let im;const Ez=(t,e,n)=>(i,r)=>r&&r[0]?r[0][t+"Size"]:ay(i)&&"getBBox"in i?i.getBBox()[e]:i[n],JZ=Ez("inline","width","offsetWidth"),eJ=Ez("block","height","offsetHeight");function tJ({target:t,borderBoxSize:e}){nm.get(t)?.forEach(n=>{n(t,{get width(){return JZ(t,e)},get height(){return eJ(t,e)}})})}function nJ(t){t.forEach(tJ)}function iJ(){typeof ResizeObserver>"u"||(im=new ResizeObserver(nJ))}function rJ(t,e){im||iJ();const n=$1(t);return n.forEach(i=>{let r=nm.get(i);r||(r=new Set,nm.set(i,r)),r.add(e),im?.observe(i)}),()=>{n.forEach(i=>{const r=nm.get(i);r?.delete(e),r?.size||im?.unobserve(i)})}}const rm=new Set;let fu;function sJ(){fu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};rm.forEach(e=>e(t))},window.addEventListener("resize",fu)}function oJ(t){return rm.add(t),fu||sJ(),()=>{rm.delete(t),!rm.size&&typeof fu=="function"&&(window.removeEventListener("resize",fu),fu=void 0)}}function sk(t,e){return typeof t=="function"?oJ(t):rJ(t,e)}function Tz(t){return ay(t)&&t.tagName==="svg"}const lJ=[...vz,Mn,Mr],aJ=t=>lJ.find(yz(t)),ok=()=>({translate:0,scale:1,origin:0,originPoint:0}),du=()=>({x:ok(),y:ok()}),lk=()=>({min:0,max:0}),On=()=>({x:lk(),y:lk()}),Gf=new WeakMap;function uy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Wf(t){return typeof t=="string"||Array.isArray(t)}const J1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],eC=["initial",...J1];function cy(t){return uy(t.animate)||eC.some(e=>Wf(t[e]))}function Rz(t){return!!(cy(t)||t.variants)}function uJ(t,e,n){for(const i in e){const r=e[i],o=n[i];if(Vn(r))t.addValue(i,r);else if(Vn(o))t.addValue(i,Go(r,{owner:t}));else if(o!==r)if(t.hasValue(i)){const a=t.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=t.getStaticValue(i);t.addValue(i,Go(a!==void 0?a:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const Yx={current:null},Az={current:!1},cJ=typeof window<"u";function fJ(){if(Az.current=!0,!!cJ)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Yx.current=t.matches;t.addEventListener("change",e),e()}else Yx.current=!1}const ak=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xm={};function Oz(t){Xm=t}function dJ(){return Xm}class Mz{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:a,visualState:c},f={}){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=U1,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 b=mi.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,Zt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=f,this.blockInitialAnimation=!!a,this.isControllingVariants=cy(n),this.isVariantNode=Rz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in y){const x=y[b];h[b]!==void 0&&Vn(x)&&x.set(h[b])}}mount(e){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=e,Gf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Az.current||fJ(),this.shouldReduceMotion=Yx.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(),qo(this.notifyUpdate),qo(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&cz.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:f,ease:h,duration:m}=n.accelerate,p=new az({element:this.current,name:e,keyframes:c,times:f,ease:h,duration:Ii(m)}),y=a(p);this.valueSubscriptions.set(e,()=>{y(),p.cancel()});return}const i=Zu.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Zt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),o&&o()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Xm){const n=Xm[e];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):On()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<ak.length;i++){const r=ak[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,a=e[o];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=uJ(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Go(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(T3(i)||A3(i))?i=parseFloat(i):!aJ(i)&&Mr.test(n)&&(i=Sz(e,n)),this.setBaseTarget(e,Vn(i)?i.get():i)),Vn(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=q1(this.props,n,this.presenceContext?.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Vn(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new P1),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Q1.render(this.render)}}class Dz extends Mz{constructor(){super(...arguments),this.KeyframeResolver=UZ}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Vn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class tl{constructor(e){this.isMounted=!1,this.node=e}update(){}}function kz({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function hJ({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function pJ(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Xb(t){return t===void 0||t===1}function qx({scale:t,scaleX:e,scaleY:n}){return!Xb(t)||!Xb(e)||!Xb(n)}function Ol(t){return qx(t)||Pz(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Pz(t){return uk(t.x)||uk(t.y)}function uk(t){return t&&t!=="0%"}function $m(t,e,n){const i=t-n,r=e*i;return n+r}function ck(t,e,n,i,r){return r!==void 0&&(t=$m(t,r,i)),$m(t,n,i)+e}function Gx(t,e=0,n=1,i,r){t.min=ck(t.min,e,n,i,r),t.max=ck(t.max,e,n,i,r)}function Iz(t,{x:e,y:n}){Gx(t.x,e.translate,e.scale,e.originPoint),Gx(t.y,n.translate,n.scale,n.originPoint)}const fk=.999999999999,dk=1.0000000000001;function mJ(t,e,n,i=!1){const r=n.length;if(!r)return;e.x=e.y=1;let o,a;for(let c=0;c<r;c++){o=n[c],a=o.projectionDelta;const{visualElement:f}=o.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(ns(t.x,-o.scroll.offset.x),ns(t.y,-o.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,Iz(t,a)),i&&Ol(o.latestValues)&&sm(t,o.latestValues,o.layout?.layoutBox))}e.x<dk&&e.x>fk&&(e.x=1),e.y<dk&&e.y>fk&&(e.y=1)}function ns(t,e){t.min+=e,t.max+=e}function hk(t,e,n,i,r=.5){const o=Yt(t.min,t.max,r);Gx(t,e,n,o,i)}function pk(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function sm(t,e,n){const i=n??t;hk(t.x,pk(e.x,i.x),e.scaleX,e.scale,e.originX),hk(t.y,pk(e.y,i.y),e.scaleY,e.scale,e.originY)}function Nz(t,e){return kz(pJ(t.getBoundingClientRect(),e))}function gJ(t,e,n){const i=Nz(t,n),{scroll:r}=e;return r&&(ns(i.x,r.offset.x),ns(i.y,r.offset.y)),i}const yJ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vJ=Qu.length;function bJ(t,e,n){let i="",r=!0;for(let a=0;a<vJ;a++){const c=Qu[a],f=t[c];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(c.startsWith("scale")?1:0);else{const m=parseFloat(f);h=c.startsWith("scale")?m===1:m===0}if(!h||n){const m=Kx(f,Wm[c]);if(!h){r=!1;const p=yJ[c]||c;i+=`${p}(${m}) `}n&&(e[c]=m)}}const o=t.pathRotation;return o&&(r=!1,i+=`rotate(${Kx(o,Wm.pathRotation)}) `),i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}function tC(t,e,n){const{style:i,vars:r,transformOrigin:o}=t;let a=!1,c=!1;for(const f in e){const h=e[f];if(Zu.has(f)){a=!0;continue}else if(j3(f)){r[f]=h;continue}else{const m=Kx(h,Wm[f]);f.startsWith("origin")?(c=!0,o[f]=m):i[f]=m}}if(e.transform||(a||n?i.transform=bJ(e,t.transform,n):i.transform&&(i.transform="none")),c){const{originX:f="50%",originY:h="50%",originZ:m=0}=o;i.transformOrigin=`${f} ${h} ${m}`}}function Lz(t,{style:e,vars:n},i,r){const o=t.style;let a;for(a in e)o[a]=e[a];r?.applyProjectionStyles(o,i);for(a in n)o.setProperty(a,n[a])}function mk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const nf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(je.test(t))t=parseFloat(t);else return t;const n=mk(t,e.target.x),i=mk(t,e.target.y);return`${n}% ${i}%`}},SJ={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,r=Mr.parse(t);if(r.length>5)return i;const o=Mr.createTransformer(t),a=typeof r[0]!="number"?1:0,c=n.x.scale*e.x,f=n.y.scale*e.y;r[0+a]/=c,r[1+a]/=f;const h=Yt(c,f,.5);return typeof r[2+a]=="number"&&(r[2+a]/=h),typeof r[3+a]=="number"&&(r[3+a]/=h),o(r)}},Wx={borderRadius:{...nf,applyTo:[...X1]},borderTopLeftRadius:nf,borderTopRightRadius:nf,borderBottomLeftRadius:nf,borderBottomRightRadius:nf,boxShadow:SJ};function Bz(t,{layout:e,layoutId:n}){return Zu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wx[t]||t==="opacity")}function nC(t,e,n){const i=t.style,r=e?.style,o={};if(!i)return o;for(const a in i)(Vn(i[a])||r&&Vn(r[a])||Bz(a,t)||n?.getValue(a)?.liveStyle!==void 0)&&(o[a]=i[a]);return o}function xJ(t){return window.getComputedStyle(t)}class Vz extends Dz{constructor(){super(...arguments),this.type="html",this.renderInstance=Lz}mount(e){oy(!!e.style),super.mount(e)}readValueFromInstance(e,n){if(Zu.has(n))return this.projection?.isProjecting?Ix(n):UQ(e,n);{const i=xJ(e),r=(j3(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Nz(e,n)}build(e,n,i){tC(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return nC(e,n,i)}}function wJ(t,e){return t in e}class CJ extends Mz{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(wJ(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return On()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const EJ={offset:"stroke-dashoffset",array:"stroke-dasharray"},TJ={offset:"strokeDashoffset",array:"strokeDasharray"};function RJ(t,e,n=1,i=0,r=!0){t.pathLength=1;const o=r?EJ:TJ;t[o.offset]=`${-i}`,t[o.array]=`${e} ${n}`}const AJ=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zz(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:a=0,...c},f,h,m){if(tC(t,c,h),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:y}=t;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 b of AJ)p[b]!==void 0&&(y[b]=p[b],delete p[b]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),i!==void 0&&(p.scale=i),r!==void 0&&RJ(p,r,o,a,!1)}const _z=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"]),Hz=t=>typeof t=="string"&&t.toLowerCase()==="svg";function OJ(t,e,n,i){Lz(t,e,void 0,i);for(const r in e.attrs)t.setAttribute(_z.has(r)?r:G1(r),e.attrs[r])}function Fz(t,e,n){const i=nC(t,e,n);for(const r in t)if(Vn(t[r])||Vn(e[r])){const o=Qu.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=t[r]}return i}class Uz extends Dz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=On}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Zu.has(n)){const i=bz(n);return i&&i.default||0}return n=_z.has(n)?n:G1(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return Fz(e,n,i)}build(e,n,i){zz(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,r){OJ(e,n,i,r)}mount(e){this.isSVGTag=Hz(e.tagName),super.mount(e)}}const MJ=eC.length;function jz(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?jz(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<MJ;n++){const i=eC[n],r=t.props[i];(Wf(r)||r===!1)&&(e[i]=r)}return e}function Kz(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const DJ=[...J1].reverse(),kJ=J1.length;function PJ(t){return e=>Promise.all(e.map(({animation:n,options:i})=>kZ(t,n,i)))}function IJ(t){let e=PJ(t),n=gk(),i=!0,r=!1;const o=h=>(m,p)=>{const y=zl(t,p,h==="exit"?t.presenceContext?.custom:void 0);if(y){const{transition:b,transitionEnd:x,...w}=y;m={...m,...w,...x}}return m};function a(h){e=h(t)}function c(h){const{props:m}=t,p=jz(t.parent)||{},y=[],b=new Set;let x={},w=1/0;for(let E=0;E<kJ;E++){const O=DJ[E],T=n[O],A=m[O]!==void 0?m[O]:p[O],D=Wf(A),k=O===h?T.isActive:null;k===!1&&(w=E);let M=A===p[O]&&A!==m[O]&&D;if(M&&(i||r)&&t.manuallyAnimateOnMount&&(M=!1),T.protectedKeys={...x},!T.isActive&&k===null||!A&&!T.prevProp||uy(A)||typeof A=="boolean")continue;if(O==="exit"&&T.isActive&&k!==!0){T.prevResolvedValues&&(x={...x,...T.prevResolvedValues});continue}const I=NJ(T.prevProp,A);let L=I||O===h&&T.isActive&&!M&&D||E>w&&D,B=!1;const H=Array.isArray(A)?A:[A];let U=H.reduce(o(O),{});k===!1&&(U={});const{prevResolvedValues:F={}}=T,K={...F,...U},z=j=>{L=!0,b.has(j)&&(B=!0,b.delete(j)),T.needsAnimating[j]=!0;const Y=t.getValue(j);Y&&(Y.liveStyle=!1)};for(const j in K){const Y=U[j],$=F[j];if(x.hasOwnProperty(j))continue;let te=!1;_x(Y)&&_x($)?te=!Kz(Y,$)||I:te=Y!==$,te?Y!=null?z(j):b.add(j):Y!==void 0&&b.has(j)?z(j):T.protectedKeys[j]=!0}T.prevProp=A,T.prevResolvedValues=U,T.isActive&&(x={...x,...U}),(i||r)&&t.blockInitialAnimation&&(L=!1);const V=M&&I;L&&(!V||B)&&y.push(...H.map(j=>{const Y={type:O};if(typeof j=="string"&&(i||r)&&!V&&t.manuallyAnimateOnMount&&t.parent){const{parent:$}=t,te=zl($,j);if($.enteringChildren&&te){const{delayChildren:N}=te.transition||{};Y.delay=fz($.enteringChildren,t,N)}}return{animation:j,options:Y}}))}if(b.size){const E={};if(typeof m.initial!="boolean"){const O=zl(t,Array.isArray(m.initial)?m.initial[0]:m.initial);O&&O.transition&&(E.transition=O.transition)}b.forEach(O=>{const T=t.getBaseTarget(O),A=t.getValue(O);A&&(A.liveStyle=!0),E[O]=T??null}),y.push({animation:E})}let C=!!y.length;return i&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(C=!1),i=!1,r=!1,C?e(y):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();t.variantChildren?.forEach(y=>y.animationState?.setActive(h,m)),n[h].isActive=m;const p=c(h);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:c,setActive:f,setAnimateFunction:a,getState:()=>n,reset:()=>{n=gk(),r=!0}}}function NJ(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Kz(e,t):!1}function Rl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gk(){return{animate:Rl(!0),whileInView:Rl(),whileHover:Rl(),whileTap:Rl(),whileDrag:Rl(),whileFocus:Rl(),exit:Rl()}}function Xx(t,e){t.min=e.min,t.max=e.max}function Er(t,e){Xx(t.x,e.x),Xx(t.y,e.y)}function yk(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Yz=1e-4,LJ=1-Yz,BJ=1+Yz,qz=.01,VJ=0-qz,zJ=0+qz;function gi(t){return t.max-t.min}function _J(t,e,n){return Math.abs(t-e)<=n}function vk(t,e,n,i=.5){t.origin=i,t.originPoint=Yt(e.min,e.max,t.origin),t.scale=gi(n)/gi(e),t.translate=Yt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=LJ&&t.scale<=BJ||isNaN(t.scale))&&(t.scale=1),(t.translate>=VJ&&t.translate<=zJ||isNaN(t.translate))&&(t.translate=0)}function Ef(t,e,n,i){vk(t.x,e.x,n.x,i?i.originX:void 0),vk(t.y,e.y,n.y,i?i.originY:void 0)}function bk(t,e,n,i=0){const r=i?Yt(n.min,n.max,i):n.min;t.min=r+e.min,t.max=t.min+gi(e)}function HJ(t,e,n,i){bk(t.x,e.x,n.x,i?.x),bk(t.y,e.y,n.y,i?.y)}function Sk(t,e,n,i=0){const r=i?Yt(n.min,n.max,i):n.min;t.min=e.min-r,t.max=t.min+gi(e)}function Qm(t,e,n,i){Sk(t.x,e.x,n.x,i?.x),Sk(t.y,e.y,n.y,i?.y)}function xk(t,e,n,i,r){return t-=e,t=$m(t,1/n,i),r!==void 0&&(t=$m(t,1/r,i)),t}function FJ(t,e=0,n=1,i=.5,r,o=t,a=t){if(ms.test(e)&&(e=parseFloat(e),e=Yt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let c=Yt(o.min,o.max,i);t===o&&(c-=e),t.min=xk(t.min,e,n,c,r),t.max=xk(t.max,e,n,c,r)}function wk(t,e,[n,i,r],o,a){FJ(t,e[n],e[i],e[r],e.scale,o,a)}const UJ=["x","scaleX","originX"],jJ=["y","scaleY","originY"];function Ck(t,e,n,i){wk(t.x,e,UJ,n?n.x:void 0,i?i.x:void 0),wk(t.y,e,jJ,n?n.y:void 0,i?i.y:void 0)}function Ek(t){return t.translate===0&&t.scale===1}function Gz(t){return Ek(t.x)&&Ek(t.y)}function Tk(t,e){return t.min===e.min&&t.max===e.max}function KJ(t,e){return Tk(t.x,e.x)&&Tk(t.y,e.y)}function Rk(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Wz(t,e){return Rk(t.x,e.x)&&Rk(t.y,e.y)}function Ak(t){return gi(t.x)/gi(t.y)}function Ok(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function es(t){return[t("x"),t("y")]}function YJ(t,e,n){let i="";const r=t.x.translate/e.x,o=t.y.translate/e.y,a=n?.z||0;if((r||o||a)&&(i=`translate3d(${r}px, ${o}px, ${a}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:h,rotate:m,pathRotation:p,rotateX:y,rotateY:b,skewX:x,skewY:w}=n;h&&(i=`perspective(${h}px) ${i}`),m&&(i+=`rotate(${m}deg) `),p&&(i+=`rotate(${p}deg) `),y&&(i+=`rotateX(${y}deg) `),b&&(i+=`rotateY(${b}deg) `),x&&(i+=`skewX(${x}deg) `),w&&(i+=`skewY(${w}deg) `)}const c=t.x.scale*e.x,f=t.y.scale*e.y;return(c!==1||f!==1)&&(i+=`scale(${c}, ${f})`),i||"none"}const qJ=X1.length,Mk=t=>typeof t=="string"?parseFloat(t):t,Dk=t=>typeof t=="number"||je.test(t);function GJ(t,e,n,i,r,o){r?(t.opacity=Yt(0,n.opacity??1,WJ(i)),t.opacityExit=Yt(e.opacity??1,0,XJ(i))):o&&(t.opacity=Yt(e.opacity??1,n.opacity??1,i));for(let a=0;a<qJ;a++){const c=X1[a];let f=kk(e,c),h=kk(n,c);if(f===void 0&&h===void 0)continue;f||(f=0),h||(h=0),f===0||h===0||Dk(f)===Dk(h)?(t[c]=Math.max(Yt(Mk(f),Mk(h),i),0),(ms.test(h)||ms.test(f))&&(t[c]+="%")):t[c]=h}(e.rotate||n.rotate)&&(t.rotate=Yt(e.rotate||0,n.rotate||0,i))}function kk(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const WJ=Xz(0,.5,L3),XJ=Xz(.5,.95,fr);function Xz(t,e,n){return i=>i<t?0:i>e?1:n(_u(t,e,i))}function $z(t,e,n){const i=Vn(t)?t:Go(t);return i.start(Y1("",i,e,n)),i.animation}function Xf(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const $J=(t,e)=>t.depth-e.depth;class QJ{constructor(){this.children=[],this.isDirty=!1}add(e){k1(this.children,e),this.isDirty=!0}remove(e){zu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort($J),this.isDirty=!1,this.children.forEach(e)}}function ZJ(t,e){const n=mi.now(),i=({timestamp:r})=>{const o=r-n;o>=e&&(qo(i),t(o-e))};return Zt.setup(i,!0),()=>qo(i)}function om(t){return Vn(t)?t.get():t}class JJ{constructor(){this.members=[]}add(e){k1(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const r=i.instance;(!r||r.isConnected===!1)&&!i.snapshot&&(zu(this.members,i),i.unmount())}e.scheduleRender()}remove(e){if(zu(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const lm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$b=["","X","Y","Z"],eee=1e3;let tee=0;function Qb(t,e,n,i){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Qz(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=gz(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Zt,!(r||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Qz(i)}function Zz({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},c=e?.()){this.id=tee++,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(ree),this.nodes.forEach(cee),this.nodes.forEach(fee),this.nodes.forEach(see)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,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 f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new QJ)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new P1),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const f=this.eventHandlers.get(a);f&&f.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=ay(a)&&!Tz(a),this.instance=a;const{layoutId:c,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),t){let m,p=0;const y=()=>this.root.updateBlockedByResize=!1;Zt.read(()=>{p=window.innerWidth}),t(a,()=>{const b=window.innerWidth;b!==p&&(p=b,this.root.updateBlockedByResize=!0,m&&m(),m=ZJ(y,250),lm.hasAnimatedSinceResize&&(lm.hasAnimatedSinceResize=!1,this.nodes.forEach(Nk)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||f)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||h.getDefaultTransition()||gee,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=h.getProps(),E=!this.targetLayout||!Wz(this.targetLayout,b),O=!p&&y;if(this.options.layoutRoot||this.resumeFrom||O||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...K1(x,"layout"),onPlay:w,onComplete:C};(h.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(m,O,T.path)}else p||Nk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qo(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(dee),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Qz(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:f}=this.options;if(c===void 0&&!f)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const f=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),f&&this.nodes.forEach(lee),this.nodes.forEach(Pk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ik);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(aee),this.nodes.forEach(uee),this.nodes.forEach(nee),this.nodes.forEach(iee)):this.nodes.forEach(Ik),this.clearAllSnapshots();const c=mi.now();ei.delta=ys(0,1e3/60,c-ei.timestamp),ei.timestamp=c,ei.isProcessing=!0,Ub.update.process(ei),Ub.preRender.process(ei),Ub.render.process(ei),ei.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Q1.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(oee),this.sharedNodes.forEach(hee)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!gi(this.snapshot.measuredBox.x)&&!gi(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 f=0;f<this.path.length;f++)this.path[f].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=On()),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,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!Gz(this.projectionDelta),f=this.getTransformTemplate(),h=f?f(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;a&&this.instance&&(c||Ol(this.latestValues)||m)&&(r(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return a&&(f=this.removeTransform(f)),yee(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return On();const c=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vee))){const{scroll:h}=this.root;h&&(ns(c.x,h.offset.x),ns(c.y,h.offset.y))}return c}removeElementScroll(a){const c=On();if(Er(c,a),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:m,options:p}=h;h!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&Er(c,a),ns(c.x,m.offset.x),ns(c.y,m.offset.y))}return c}applyTransform(a,c=!1,f){const h=f||On();Er(h,a);for(let m=0;m<this.path.length;m++){const p=this.path[m];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(ns(h.x,-p.scroll.offset.x),ns(h.y,-p.scroll.offset.y)),Ol(p.latestValues)&&sm(h,p.latestValues,p.layout?.layoutBox)}return Ol(this.latestValues)&&sm(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(a){const c=On();Er(c,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!Ol(h.latestValues))continue;let m;h.instance&&(qx(h.latestValues)&&h.updateSnapshot(),m=On(),Er(m,h.measurePageBox())),Ck(c,h.latestValues,h.snapshot?.layoutBox,m)}return Ol(this.latestValues)&&Ck(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==ei.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(a||f&&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=ei.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=On(),this.targetWithTransforms=On()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),HJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Er(this.target,this.layout.layoutBox),Iz(this.target,this.targetDelta)):Er(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||qx(this.parent.latestValues)||Pz(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,f){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=On(),this.relativeTargetOrigin=On(),Qm(this.relativeTargetOrigin,c,f,this.options.layoutAnchor||void 0),Er(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),c=!!this.resumingFrom||this!==a;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===ei.timestamp&&(f=!1),f)return;const{layout:h,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||!(h||m))return;Er(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;mJ(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=On());const{target:b}=a;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yk(this.prevProjectionDelta.x,this.projectionDelta.x),yk(this.prevProjectionDelta.y,this.projectionDelta.y)),Ef(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!Ok(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ok(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=du(),this.projectionDelta=du(),this.projectionDeltaWithTransform=du()}setAnimationOrigin(a,c=!1,f){const h=this.snapshot,m=h?h.latestValues:{},p={...this.latestValues},y=du();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const b=On(),x=h?h.source:void 0,w=this.layout?this.layout.source:void 0,C=x!==w,E=this.getStack(),O=!E||E.members.length<=1,T=!!(C&&!O&&this.options.crossfade===!0&&!this.path.some(mee));this.animationProgress=0;let A;const D=f?.interpolateProjection(a);this.mixTargetDelta=k=>{const M=k/1e3,I=D?.(M);I?(y.x.translate=I.x,y.x.scale=Yt(a.x.scale,1,M),y.x.origin=a.x.origin,y.x.originPoint=a.x.originPoint,y.y.translate=I.y,y.y.scale=Yt(a.y.scale,1,M),y.y.origin=a.y.origin,y.y.originPoint=a.y.originPoint):(Lk(y.x,a.x,M),Lk(y.y,a.y,M)),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qm(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),pee(this.relativeTarget,this.relativeTargetOrigin,b,M),A&&KJ(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=On()),Er(A,this.relativeTarget)),C&&(this.animationValues=p,GJ(p,m,this.latestValues,M,T,O)),I&&I.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=I.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(qo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Zt.update(()=>{lm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Go(0)),this.motionValue.jump(0,!1),this.currentAnimation=$z(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(eee),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:f,layout:h,latestValues:m}=a;if(!(!c||!f||!h)){if(this!==a&&this.layout&&h&&Jz(this.options.animationType,this.layout.layoutBox,h.layoutBox)){f=this.target||On();const p=gi(this.layout.layoutBox.x);f.x.min=a.target.x.min,f.x.max=f.x.min+p;const y=gi(this.layout.layoutBox.y);f.y.min=a.target.y.min,f.y.max=f.y.min+y}Er(c,f),sm(c,m),Ef(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new JJ),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:f}={}){const h=this.getStack();h&&h.promote(this,f),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:f}=a;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const h={};f.z&&Qb("z",a,h,this.animationValues);for(let m=0;m<$b.length;m++)Qb(`rotate${$b[m]}`,a,h,this.animationValues),Qb(`skew${$b[m]}`,a,h,this.animationValues);a.render();for(const m in h)a.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=om(c?.pointerEvents)||"",a.transform=f?f(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=om(c?.pointerEvents)||""),this.hasProjected&&!Ol(this.latestValues)&&(a.transform=f?f({},""):"none",this.hasProjected=!1);return}a.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=YJ(this.projectionDeltaWithTransform,this.treeScale,m);f&&(p=f(m,p)),a.transform=p;const{x:y,y:b}=this.projectionDelta;a.transformOrigin=`${y.origin*100}% ${b.origin*100}% 0`,h.animationValues?a.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:a.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const x in Wx){if(m[x]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:E}=Wx[x],O=p==="none"?m[x]:w(m[x],h);if(C){const T=C.length;for(let A=0;A<T;A++)a[C[A]]=O}else E?this.options.visualElement.renderState.vars[x]=O:a[x]=O}this.options.layoutId&&(a.pointerEvents=h===this?om(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Pk),this.root.sharedNodes.clear()}}}function nee(t){t.updateLayout()}function iee(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")es(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],y=gi(p);p.min=n[m].min,p.max=p.min+y});else if(r==="x"||r==="y"){const m=r==="x"?"y":"x";Xx(o?e.measuredBox[m]:e.layoutBox[m],n[m])}else Jz(r,e.layoutBox,n)&&es(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],y=gi(n[m]);p.max=p.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[m].max=t.relativeTarget[m].min+y)});const a=du();Ef(a,n,e.layoutBox);const c=du();o?Ef(c,t.applyTransform(i,!0),e.measuredBox):Ef(c,n,e.layoutBox);const f=!Gz(a);let h=!1;if(!t.resumeFrom){const m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:y}=m;if(p&&y){const b=t.options.layoutAnchor||void 0,x=On();Qm(x,e.layoutBox,p.layoutBox,b);const w=On();Qm(w,n,y.layoutBox,b),Wz(x,w)||(h=!0),m.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=x,t.relativeParent=m)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function ree(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function see(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function oee(t){t.clearSnapshot()}function Pk(t){t.clearMeasurements()}function lee(t){t.isLayoutDirty=!0,t.updateLayout()}function Ik(t){t.isLayoutDirty=!1}function aee(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function uee(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Nk(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function cee(t){t.resolveTargetDelta()}function fee(t){t.calcProjection()}function dee(t){t.resetSkewAndRotation()}function hee(t){t.removeLeadSnapshot()}function Lk(t,e,n){t.translate=Yt(e.translate,0,n),t.scale=Yt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Bk(t,e,n,i){t.min=Yt(e.min,n.min,i),t.max=Yt(e.max,n.max,i)}function pee(t,e,n,i){Bk(t.x,e.x,n.x,i),Bk(t.y,e.y,n.y,i)}function mee(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gee={duration:.45,ease:[.4,0,.1,1]},Vk=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),zk=Vk("applewebkit/")&&!Vk("chrome/")?Math.round:fr;function _k(t){t.min=zk(t.min),t.max=zk(t.max)}function yee(t){_k(t.x),_k(t.y)}function Jz(t,e,n){return t==="position"||t==="preserve-aspect"&&!_J(Ak(e),Ak(n),.2)}function vee(t){return t!==t.root&&t.scroll?.wasRoot}const bee=Zz({attachResizeListener:(t,e)=>Xf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Zb={current:void 0},e_=Zz({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Zb.current){const t=new bee({});t.mount(window),t.setOptions({layoutScroll:!0}),Zb.current=t}return Zb.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function iC(t){return typeof t=="object"&&!Array.isArray(t)}function t_(t,e,n,i){return t==null?[]:typeof t=="string"&&iC(e)?$1(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(r=>r!=null):[t]}function See(t,e,n){return t*(e+1)+n*e}function Hk(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function xee(t,e,n){for(let i=0;i<t.length;i++){const r=t[i];r.at>e&&r.at<n&&(zu(t,r),i--)}}function wee(t,e,n,i,r,o){xee(t,r,o);for(let a=0;a<e.length;a++)t.push({value:e[a],at:Yt(r,o,i[a]),easing:_3(n,a)})}function Cee(t,e,n=0){const i=e+1+e*n;for(let r=0;r<t.length;r++)t[r]=t[r]/i}function Eee(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const Tee="easeInOut",Ree=20;function Aee(t,{defaultTransition:e={},...n}={},i,r){const o=e.duration||.3,a=new Map,c=new Map,f={},h=new Map;let m=0,p=0,y=0;for(let b=0;b<t.length;b++){const x=t[b];if(typeof x=="string"){h.set(x,p);continue}else if(!Array.isArray(x)){h.set(x.name,Hk(p,x.at,m,h));continue}let[w,C,E={}]=x;E.at!==void 0&&(p=Hk(p,E.at,m,h));let O=0;const T=(A,D,k,M=0,I=0)=>{const L=Oee(A),{delay:B=0,times:H=ez(L),type:U=e.type||"keyframes",repeat:F,repeatType:K,repeatDelay:z=0,...V}=D;let{ease:X=e.ease||"easeOut",duration:j}=D;const Y=typeof B=="function"?B(M,I):B,$=L.length,te=j1(U)?U:r?.[U||"keyframes"];if($<=2&&te){let G=100;if($===2&&kee(L)){const Se=L[1]-L[0];G=Math.abs(Se)}const Z={...e,...V};j!==void 0&&(Z.duration=Ii(j));const ae=Q3(Z,G,te);X=ae.ease,j=ae.duration}j??(j=o);const N=p+Y;H.length===1&&H[0]===0&&(H[1]=1);const ne=H.length-L.length;if(ne>0&&J3(H,ne),L.length===1&&L.unshift(null),F&&F<Ree){const G=j>0?z/j:0;j=See(j,F,z);const Z=[...L],ae=[...H];X=Array.isArray(X)?[...X]:[X];const Se=[...X],le=K==="reverse"||K==="mirror";let ge=Z,ce=Se;le&&(ge=[...Z].reverse(),K==="reverse"&&(ce=[...Se].reverse().map(ue=>typeof ue=="function"?I1(ue):ue)));for(let ue=0;ue<F;ue++){const Te=le&&ue%2===0,ye=Te?ge:Z,Pe=Te?ce:Se,Ee=(ue+1)*(1+G);G>0&&(L.push(L[L.length-1]),H.push(Ee),X.push("linear")),L.push(...ye);for(let Me=0;Me<ye.length;Me++)H.push(ae[Me]+Ee),X.push(Me===0?"linear":_3(Pe,Me-1))}Cee(H,F,G)}const q=N+j;wee(k,L,X,H,N,q),O=Math.max(Y+j,O),y=Math.max(q,y)};if(Vn(w)){const A=Fk(w,c);T(C,E,Uk("default",A))}else{const A=t_(w,C,i,f),D=A.length;for(let k=0;k<D;k++){C=C,E=E;const M=A[k],I=Fk(M,c);for(const L in C)T(C[L],Mee(E,L),Uk(L,I),k,D)}}m=p,p+=O}return c.forEach((b,x)=>{for(const w in b){const C=b[w];C.sort(Eee);const E=[],O=[],T=[];for(let M=0;M<C.length;M++){const{at:I,value:L,easing:B}=C[M];E.push(L),O.push(_u(0,y,I)),T.push(B||"easeOut")}O[0]!==0&&(O.unshift(0),E.unshift(E[0]),T.unshift(Tee)),O[O.length-1]!==1&&(O.push(1),E.push(null)),a.has(x)||a.set(x,{keyframes:{},transition:{}});const A=a.get(x);A.keyframes[w]=E;const{type:D,...k}=e;A.transition[w]={...k,duration:y,ease:T,times:O,...n}}}),a}function Fk(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Uk(t,e){return e[t]||(e[t]=[]),e[t]}function Oee(t){return Array.isArray(t)?t:[t]}function Mee(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Dee=t=>typeof t=="number",kee=t=>t.every(Dee);function Pee(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ay(t)&&!Tz(t)?new Uz(e):new Vz(e);n.mount(t),Gf.set(t,n)}function Iee(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new CJ(e);n.mount(t),Gf.set(t,n)}function Nee(t,e){return Vn(t)||typeof t=="number"||typeof t=="string"&&!iC(e)}function n_(t,e,n,i){const r=[];if(Nee(t,e))r.push($z(t,iC(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return r;const o=t_(t,e,i),a=o.length;for(let c=0;c<a;c++){const f=o[c],h=f instanceof Element?Pee:Iee;Gf.has(f)||h(f);const m=Gf.get(f),p={...n};"delay"in p&&typeof p.delay=="function"&&(p.delay=p.delay(c,a)),r.push(...W1(m,{...e,transition:p},{}))}}return r}function Lee(t,e,n){const i=[],r=t.map(a=>{if(Array.isArray(a)&&typeof a[0]=="function"){const c=a[0],f=Go(0);return f.on("change",c),a.length===1?[f,[0,1]]:a.length===2?[f,[0,1],a[1]]:[f,a[1],a[2]]}return a});return Aee(r,e,n,{spring:qf}).forEach(({keyframes:a,transition:c},f)=>{i.push(...n_(f,a,c))}),i}function Bee(t){return Array.isArray(t)&&t.some(Array.isArray)}function Vee(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;function r(o,a,c){let f=[],h;const m={};if(n!==void 0&&(m.reduceMotion=n),i!==void 0&&(m.skipAnimations=i),Bee(o)){const{onComplete:y,...b}=a||{};typeof y=="function"&&(h=y),f=Lee(o,{...m,...b},e)}else{const{onComplete:y,...b}=c||{};typeof y=="function"&&(h=y),f=n_(o,a,{...m,...b},e)}const p=new dZ(f);return h&&p.finished.then(h),e&&(e.animations.push(p),p.finished.then(()=>{zu(e.animations,p)})),p}return r}const Lie=Vee(),jk=(t,e)=>Math.abs(t-e);function zee(t,e){const n=jk(t.x,e.x),i=jk(t.y,e.y);return Math.sqrt(n**2+i**2)}const i_=S.createContext({});function r_(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const _ee=typeof window<"u",Hee=_ee?S.useLayoutEffect:S.useEffect,rC=S.createContext(null),sC=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fee(t=!0){const e=S.useContext(rC);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,o=S.useId();S.useEffect(()=>{if(t)return r(o)},[t]);const a=S.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,a]:[!0]}const s_=S.createContext({strict:!1}),Kk={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 Yk=!1;function Uee(){if(Yk)return;const t={};for(const e in Kk)t[e]={isEnabled:n=>Kk[e].some(i=>!!n[i])};Oz(t),Yk=!0}function o_(){return Uee(),dJ()}function jee(t){const e=o_();for(const n in t)e[n]={...e[n],...t[n]};Oz(e)}const Kee=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 Zm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Kee.has(t)}let l_=t=>!Zm(t);function Yee(t){typeof t=="function"&&(l_=e=>e.startsWith("on")?!Zm(e):t(e))}try{Yee(require("@emotion/is-prop-valid").default)}catch{}function qee(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||Vn(t[r])||(l_(r)||n===!0&&Zm(r)||!e&&!Zm(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const fy=S.createContext({});function Gee(t,e){if(cy(t)){const{initial:n,animate:i}=t;return{initial:n===!1||Wf(n)?n:void 0,animate:Wf(i)?i:void 0}}return t.inherit!==!1?e:{}}function Wee(t){const{initial:e,animate:n}=Gee(t,S.useContext(fy));return S.useMemo(()=>({initial:e,animate:n}),[qk(e),qk(n)])}function qk(t){return Array.isArray(t)?t.join(" "):t}const oC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function a_(t,e,n){for(const i in e)!Vn(e[i])&&!Bz(i,n)&&(t[i]=e[i])}function Xee({transformTemplate:t},e){return S.useMemo(()=>{const n=oC();return tC(n,e,t),Object.assign({},n.vars,n.style)},[e])}function $ee(t,e){const n=t.style||{},i={};return a_(i,n,t),Object.assign(i,Xee(t,e)),i}function Qee(t,e){const n={},i=$ee(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const u_=()=>({...oC(),attrs:{}});function Zee(t,e,n,i){const r=S.useMemo(()=>{const o=u_();return zz(o,e,Hz(i),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};a_(o,t.style,t),r.style={...o,...r.style}}return r}const Jee=["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 lC(t){return typeof t!="string"||t.includes("-")?!1:!!(Jee.indexOf(t)>-1||/[A-Z]/u.test(t))}function ete(t,e,n,{latestValues:i},r,o=!1,a){const f=(a??lC(t)?Zee:Qee)(e,i,r,t),h=qee(e,typeof t=="string",o),m=t!==S.Fragment?{...h,...f,ref:n}:{},{children:p}=e,y=S.useMemo(()=>Vn(p)?p.get():p,[p]);return S.createElement(t,{...m,children:y})}function tte({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:nte(n,i,r,t),renderState:e()}}function nte(t,e,n,i){const r={},o=i(t,{});for(const y in o)r[y]=om(o[y]);let{initial:a,animate:c}=t;const f=cy(t),h=Rz(t);e&&h&&!f&&t.inherit!==!1&&(a===void 0&&(a=e.initial),c===void 0&&(c=e.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const p=m?c:a;if(p&&typeof p!="boolean"&&!uy(p)){const y=Array.isArray(p)?p:[p];for(let b=0;b<y.length;b++){const x=q1(t,y[b]);if(x){const{transitionEnd:w,transition:C,...E}=x;for(const O in E){let T=E[O];if(Array.isArray(T)){const A=m?T.length-1:0;T=T[A]}T!==null&&(r[O]=T)}for(const O in w)r[O]=w[O]}}}return r}const c_=t=>(e,n)=>{const i=S.useContext(fy),r=S.useContext(rC),o=()=>tte(t,e,i,r);return n?o():r_(o)},ite=c_({scrapeMotionValuesFromProps:nC,createRenderState:oC}),rte=c_({scrapeMotionValuesFromProps:Fz,createRenderState:u_}),ste=Symbol.for("motionComponentSymbol");function ote(t,e,n){const i=S.useRef(n);S.useInsertionEffect(()=>{i.current=n});const r=S.useRef(null);return S.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const a=i.current;if(typeof a=="function")if(o){const c=a(o);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o)},[e])}const f_=S.createContext({});function ou(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function lte(t,e,n,i,r,o){const{visualElement:a}=S.useContext(fy),c=S.useContext(s_),f=S.useContext(rC),h=S.useContext(sC),m=h.reducedMotion,p=h.skipAnimations,y=S.useRef(null),b=S.useRef(!1);i=i||c.renderer,!y.current&&i&&(y.current=i(t,{visualState:e,parent:a,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:o}),b.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const x=y.current,w=S.useContext(f_);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&ate(y.current,n,r,w);const C=S.useRef(!1);S.useInsertionEffect(()=>{x&&C.current&&x.update(n,f)});const E=n[mz],O=S.useRef(!!E&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return Hee(()=>{b.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),O.current&&x.animationState&&x.animationState.animateChanges())}),S.useEffect(()=>{x&&(!O.current&&x.animationState&&x.animationState.animateChanges(),O.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),O.current=!1),x.enteringChildren=void 0)}),x}function ate(t,e,n,i){const{layoutId:r,layout:o,drag:a,dragConstraints:c,layoutScroll:f,layoutRoot:h,layoutAnchor:m,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:d_(t.parent)),t.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!a||c&&ou(c),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:f,layoutRoot:h,layoutAnchor:m})}function d_(t){if(t)return t.options.allowProjection!==!1?t.projection:d_(t.parent)}function Jb(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&jee(i);const o=n?n==="svg":lC(t),a=o?rte:ite;function c(h,m){let p;const y={...S.useContext(sC),...h,layoutId:ute(h)},{isStatic:b}=y,x=Wee(h),w=a(h,b);if(!b&&typeof window<"u"){cte();const C=fte(y);p=C.MeasureLayout,x.visualElement=lte(t,w,y,r,C.ProjectionNode,o)}return fe.jsxs(fy.Provider,{value:x,children:[p&&x.visualElement?fe.jsx(p,{visualElement:x.visualElement,...y}):null,ete(t,h,ote(w,x.visualElement,m),w,b,e,o)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const f=S.forwardRef(c);return f[ste]=t,f}function ute({layoutId:t}){const e=S.useContext(i_).id;return e&&t!==void 0?e+"-"+t:t}function cte(t,e){S.useContext(s_).strict}function fte(t){const e=o_(),{drag:n,layout:i}=e;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function dte(t,e){if(typeof Proxy>"u")return Jb;const n=new Map,i=(o,a)=>Jb(o,a,t,e),r=(o,a)=>i(o,a);return new Proxy(r,{get:(o,a)=>a==="create"?i:(n.has(a)||n.set(a,Jb(a,void 0,t,e)),n.get(a))})}const hte=(t,e)=>e.isSVG??lC(t)?new Uz(e):new Vz(e,{allowProjection:t!==S.Fragment});class pte extends tl{constructor(e){super(e),e.animationState||(e.animationState=IJ(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();uy(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let mte=0;class gte extends tl{constructor(){super(...arguments),this.id=mte++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=zl(this.node,o,a);if(c){const{transition:f,transitionEnd:h,...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 r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const yte={animation:{Feature:pte},exit:{Feature:gte}};function Rd(t){return{point:{x:t.pageX,y:t.pageY}}}const vte=t=>e=>Z1(e)&&t(e,Rd(e));function Tf(t,e,n,i){return Xf(t,e,vte(n),i)}const h_=({current:t})=>t?t.ownerDocument.defaultView:null,Gk=new Set(["auto","scroll"]);class p_{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:a=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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=eS(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,C=zee(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!C)return;const{point:E}=x,{timestamp:O}=ei;this.history.push({...E,timestamp:O});const{onStart:T,onMove:A}=this.handlers;w||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,x)},this.handlePointerMove=(x,w)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=zp(w,this.transformPagePoint),Zt.update(this.updatePoint,!0)},this.handlePointerUp=(x,w)=>{this.end();const{onEnd:C,onSessionEnd:E,resumeAnimation:O}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&O&&O(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=eS(x.type==="pointercancel"?this.lastMoveEventInfo:zp(w,this.transformPagePoint),this.history);this.startEvent&&C&&C(x,T),E&&E(x,T)},!Z1(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=a,this.contextWindow=r||window;const f=Rd(e),h=zp(f,this.transformPagePoint),{point:m}=h,{timestamp:p}=ei;this.history=[{...m,timestamp:p}];const{onSessionStart:y}=n;y&&y(e,eS(h,this.history));const b={passive:!0,capture:!0};this.removeListeners=Cd(Tf(this.contextWindow,"pointermove",this.handlePointerMove,b),Tf(this.contextWindow,"pointerup",this.handlePointerUp,b),Tf(this.contextWindow,"pointercancel",this.handlePointerUp,b)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(Gk.has(i.overflowX)||Gk.has(i.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(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:r.x-n.x,y:r.y-n.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,r),Zt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qo(this.updatePoint)}}function zp(t,e){return e?{point:e(t.point)}:t}function Wk(t,e){return{x:t.x-e.x,y:t.y-e.y}}function eS({point:t},e){return{point:t,delta:Wk(t,m_(e)),offset:Wk(t,bte(e)),velocity:Ste(e,.1)}}function bte(t){return t[0]}function m_(t){return t[t.length-1]}function Ste(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=m_(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Ii(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&r.timestamp-i.timestamp>Ii(e)*2&&(i=t[1]);const o=cr(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const a={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function xte(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Yt(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Yt(n,t,i.max):Math.min(t,n)),t}function Xk(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function wte(t,{top:e,left:n,bottom:i,right:r}){return{x:Xk(t.x,n,r),y:Xk(t.y,e,i)}}function $k(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function Cte(t,e){return{x:$k(t.x,e.x),y:$k(t.y,e.y)}}function Ete(t,e){let n=.5;const i=gi(t),r=gi(e);return r>i?n=_u(e.min,e.max-i,t.min):i>r&&(n=_u(t.min,t.max-r,e.min)),ys(0,1,n)}function Tte(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const $x=.35;function Rte(t=$x){return t===!1?t=0:t===!0&&(t=$x),{x:Qk(t,"left","right"),y:Qk(t,"top","bottom")}}function Qk(t,e,n){return{min:Zk(t,e),max:Zk(t,n)}}function Zk(t,e){return typeof t=="number"?t:t[e]||0}const Ate=new WeakMap;class Ote{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=On(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=p=>{n&&this.snapToCursor(Rd(p).point),this.stopAnimation()},a=(p,y)=>{const{drag:b,dragPropagation:x,onDragStart:w}=this.getProps();if(b&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=KZ(b),!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),es(E=>{let O=this.getAxisMotionValue(E).get()||0;if(ms.test(O)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[E];A&&(O=gi(A)*(parseFloat(O)/100))}}this.originPoint[E]=O}),w&&Zt.update(()=>w(p,y),!1,!0),Hx(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},c=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:b,dragDirectionLock:x,onDirectionLock:w,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=y;if(x&&this.currentDirection===null){this.currentDirection=Dte(E),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",y.point,E),this.updateAxis("y",y.point,E),this.visualElement.render(),C&&Zt.update(()=>C(p,y),!1,!0)},f=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new p_(e,{onSessionStart:o,onStart:a,onMove:c,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:h_(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!i)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&Zt.postRender(()=>c(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!_p(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(a=xte(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ou(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=wte(i.layoutBox,e):this.constraints=!1,this.elastic=Rte(n),r!==this.constraints&&!ou(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Tte(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ou(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const o=gJ(i,r.root,this.visualElement.getTransformPagePoint());let a=Cte(r.layout.layoutBox,o);if(n){const c=n(hJ(a));this.hasMutatedConstraints=!!c,c&&(a=kz(c))}return a}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},h=es(m=>{if(!_p(m,n,this.currentDirection))return;let p=f&&f[m]||{};(a===!0||a===m)&&(p={min:0,max:0});const y=r?200:1e6,b=r?40:1e7,x={type:"inertia",velocity:i?e[m]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(m,x)});return Promise.all(h).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return Hx(this.visualElement,e),i.start(Y1(e,i,0,n,this.visualElement,!1))}stopAnimation(){es(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps()[n];return r||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){es(n=>{const{drag:i}=this.getProps();if(!_p(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:c}=r.layout.layoutBox[n],f=o.get()||0;o.set(e[n]-Yt(a,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!ou(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};es(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const f=c.get();r[a]=Ete({min:f,max:f},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),es(a=>{if(!_p(a,e,null))return;const c=this.getAxisMotionValue(a),{min:f,max:h}=this.constraints[a];c.set(Yt(f,h,r[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ate.set(this.visualElement,this);const e=this.visualElement.current,n=Tf(e,"pointerdown",h=>{const{drag:m,dragListener:p=!0}=this.getProps(),y=h.target,b=y!==e&&$Z(y);m&&p&&!b&&this.start(h)});let i;const r=()=>{const{dragConstraints:h}=this.getProps();ou(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Mte(e,h.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Zt.read(r);const c=Xf(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(es(p=>{const y=this.getAxisMotionValue(p);y&&(this.originPoint[p]+=h[p].translate,y.set(y.get()+h[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),a(),f&&f(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:a=$x,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:a,dragMomentum:c}}}function Jk(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Mte(t,e,n){const i=sk(t,Jk(n)),r=sk(e,Jk(n));return()=>{i(),r()}}function _p(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Dte(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class kte extends tl{constructor(e){super(e),this.removeGroupControls=fr,this.removeListeners=fr,this.controls=new Ote(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const tS=t=>(e,n)=>{t&&Zt.update(()=>t(e,n),!1,!0)};class Pte extends tl{constructor(){super(...arguments),this.removePointerDownListener=fr}onPointerDown(e){this.session=new p_(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:h_(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:tS(e),onStart:tS(n),onMove:tS(i),onEnd:(o,a)=>{delete this.session,r&&Zt.postRender(()=>r(o,a))}}}mount(){this.removePointerDownListener=Tf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let nS=!1;class Ite extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),i&&i.register&&r&&i.register(o),nS&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:o}=this.props,{projection:a}=i;return a&&(a.isPresent=o,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),nS=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==o?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||Zt.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Q1.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;nS=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function g_(t){const[e,n]=Fee(),i=S.useContext(i_);return fe.jsx(Ite,{...t,layoutGroup:i,switchLayoutGroup:S.useContext(f_),isPresent:e,safeToRemove:n})}const Nte={pan:{Feature:Pte},drag:{Feature:kte,ProjectionNode:e_,MeasureLayout:g_}};function eP(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&Zt.postRender(()=>o(e,Rd(e)))}class Lte extends tl{mount(){const{current:e}=this.node;e&&(this.unmount=qZ(e,(n,i)=>(eP(this.node,i,"Start"),r=>eP(this.node,r,"End"))))}unmount(){}}class Bte extends tl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=Cd(Xf(this.node.current,"focus",()=>this.onFocus()),Xf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tP(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&Zt.postRender(()=>o(e,Rd(e)))}class Vte extends tl{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=ZZ(e,(r,o)=>(tP(this.node,o,"Start"),(a,{success:c})=>tP(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const Qx=new WeakMap,iS=new WeakMap,zte=t=>{const e=Qx.get(t.target);e&&e(t)},_te=t=>{t.forEach(zte)};function Hte({root:t,...e}){const n=t||document;iS.has(n)||iS.set(n,{});const i=iS.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(_te,{root:t,...e})),i[r]}function Fte(t,e,n){const i=Hte(e);return Qx.set(t,n),i.observe(t),()=>{Qx.delete(t),i.unobserve(t)}}const Ute={some:0,all:1};class jte extends tl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=e,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Ute[r]},c=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),y=h?m:p;y&&y(f)};this.stopObserver=Fte(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Kte(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Kte({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Yte={inView:{Feature:jte},tap:{Feature:Vte},focus:{Feature:Bte},hover:{Feature:Lte}},qte={layout:{ProjectionNode:e_,MeasureLayout:g_}},Gte={...yte,...Yte,...Nte,...qte},Wte=dte(Gte,hte);function Bie(t){const e=r_(()=>Go(t)),{isStatic:n}=S.useContext(sC);if(n){const[,i]=S.useState(t);S.useEffect(()=>e.on("change",i),[])}return e}const Vie=Wte;function zie(t){const[e,n]=S.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=S.useRef(null),r=S.useRef(null),o=S.useRef(null),a=S.useRef(null),c=S.useRef(!0),f=S.useRef(null),h=Uu(),m=S.useMemo(()=>({anchor:e,setAnchor:n,actionsRef:o,backdropRef:i,internalBackdropRef:r,positionerRef:a,allowMouseUpTriggerRef:c,initialCursorPointRef:f,rootId:h}),[e,h]);return fe.jsx(CI.Provider,{value:m,children:fe.jsx(Ng.Provider,{value:void 0,children:fe.jsx(Oj,{...t})})})}const nP=500,_ie=S.forwardRef(function(e,n){const{render:i,className:r,style:o,...a}=e,{setAnchor:c,actionsRef:f,internalBackdropRef:h,backdropRef:m,positionerRef:p,allowMouseUpTriggerRef:y,initialCursorPointRef:b,rootId:x}=Lg(!1),{store:w}=Lr(!1),C=w.useState("open"),E=w.useState("disabled"),O=S.useRef(null),T=S.useRef(null),A=wn(),D=wn(),k=S.useRef(!1),M=S.useRef(null);function I(z,V,X){const j=X.type.startsWith("touch");b.current={x:z,y:V},c({getBoundingClientRect(){return DOMRect.fromRect({width:j?10:0,height:j?10:0,x:z,y:V})}}),k.current=!1,f.current?.setOpen(!0,Ze(gs,X)),D.start(nP,()=>{k.current=!0})}function L(z){if(E)return;y.current=!0,Rr(z),I(z.clientX,z.clientY,z.nativeEvent);const V=xt(O.current);M.current?.abort();const X=new AbortController;M.current=X,V.addEventListener("mouseup",j=>{if(y.current=!1,!k.current)return;D.clear(),k.current=!1;const Y=zn(j);Ye(p.current,Y)||x&&Y&&zw(Y)===x||f.current?.setOpen(!1,Ze(sw,j))},{once:!0,signal:X.signal})}function B(){A.clear(),T.current=null}function H(z){if(E){B();return}if(y.current=!1,z.touches.length!==1){B();return}z.stopPropagation();const V=z.touches[0],X={x:V.clientX,y:V.clientY};T.current=X,A.start(nP,()=>{I(X.x,X.y,z.nativeEvent)})}function U(z){if(z.touches.length!==1){B();return}if(A.isStarted()&&T.current){const V=z.touches[0],X=10,j=Math.abs(V.clientX-T.current.x),Y=Math.abs(V.clientY-T.current.y);(j>X||Y>X)&&B()}}return S.useEffect(()=>()=>{M.current?.abort()},[]),S.useEffect(()=>{function z(X){if(E)return;const Y=zn(X);(Ye(O.current,Y)||Ye(h.current,Y)||Ye(m.current,Y))&&X.preventDefault()}const V=xt(O.current);return ft(V,"contextmenu",z)},[m,E,h]),Ot("div",e,{state:{open:C},ref:[O,n],props:[{onContextMenu:L,onTouchStart:H,onTouchMove:U,onTouchEnd:B,onTouchCancel:B,style:{WebkitTouchCallout:"none"}},a],stateAttributesMapping:Rf})}),Hie=gj;export{kX as $,ts as A,RX as B,am as C,aX as D,ze as E,hr as F,Bn as G,kt as H,Vt as I,w1 as J,Zo as K,xe as L,on as M,v1 as N,bs as O,wV as P,nt as Q,zg as R,$t as S,Dr as T,fK as U,ji as V,eg as W,na as X,We as Y,Kl as Z,Sie as _,Hp as a,nB as a$,bx as a0,kV as a1,wie as a2,Cie as a3,xie as a4,jX as a5,Eie as a6,AV as a7,mie as a8,gie as a9,w3 as aA,C3 as aB,_2 as aC,z2 as aD,Die as aE,PX as aF,Nne as aG,an as aH,RV as aI,x$ as aJ,LD as aK,ZV as aL,y2 as aM,XV as aN,Ex as aO,Ln as aP,Vie as aQ,Zte as aR,rne as aS,ine as aT,Jte as aU,nne as aV,sne as aW,tne as aX,ene as aY,Jne as aZ,Zne as a_,o2 as aa,rr as ab,UX as ac,Fg as ad,Yi as ae,Ut as af,kl as ag,MV as ah,Lu as ai,HV as aj,ZS as ak,Hg as al,wK as am,Vne as an,Bne as ao,kr as ap,vu as aq,u9 as ar,c9 as as,Dne as at,Us as au,li as av,Wa as aw,Pne as ax,Tie as ay,uu as az,mg as b,die as b$,nie as b0,eie as b1,iie as b2,yq as b3,Sq as b4,Iie as b5,zie as b6,_ie as b7,cne as b8,Hie as b9,Jn as bA,wne as bB,Fw as bC,Mne as bD,Cne as bE,Ene as bF,Tne as bG,Rne as bH,Ane as bI,One as bJ,b6 as bK,Hne as bL,Fne as bM,jne as bN,Une as bO,Kne as bP,Yne as bQ,qne as bR,Gne as bS,Wne as bT,Xne as bU,$ne as bV,Qne as bW,aie as bX,uie as bY,cie as bZ,fie as b_,une as ba,ane as bb,gne as bc,oie as bd,sie as be,KY as bf,jY as bg,lie as bh,$l as bi,tie as bj,pne as bk,yne as bl,_ne as bm,one as bn,lne as bo,Oj as bp,mne as bq,gj as br,fne as bs,dne as bt,hne as bu,a6 as bv,bne as bw,Sne as bx,JI as by,xne as bz,vi as c,pie as c0,uB as c1,Hf as c2,cB as c3,OX as c4,TV as c5,Oie as c6,Ine as c7,E$ as c8,Mie as c9,_g as ca,Lne as cb,Lie as cc,B$ as cd,rie as ce,Bie as cf,Rie as cg,ty as ch,Aie as ci,yie as cj,TK as ck,zne as cl,Pie as cm,kie as cn,vie as co,Qte as cp,vne as cq,He as d,Ze as e,en as f,Fu as g,Ot as h,Xo as i,fe as j,Ws as k,dn as l,Cw as m,De as n,eo as o,ft as p,Jt as q,$f as r,pP as s,gs as t,bm as u,dr as v,kH as w,Si as x,mt as y,Qt as z};
|
|
65
|
+
`);i>-1&&(n=n.slice(0,i))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),i=e+n.length;for(let r=this.rangeIndex;;){let o=this.ranges[r].to;if(o>=i||(n=n.slice(0,o-(i-n.length)),r++,r==this.ranges.length))break;let a=this.ranges[r].from,c=this.lineAfter(a);n+=c,i=a+c.length}return{line:n,end:i}}skipGapsTo(e,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,o=e+n;if(i>0?r>o:r>=o)break;let a=this.ranges[++this.rangeIndex].from;n+=a-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,i,r){let o=4;if(this.ranges.length>1){r=this.skipGapsTo(n,r,1),n+=r;let c=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,o+=this.chunk.length-c}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&o==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(e,n,i,o),r}parseLine(e){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:o}=this.lang,a=new RV(n,e?e.state.tabSize:4,e?ea(e.state):2);if(a.eol())o.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let c=UV(o.token,a,this.state);if(c&&(r=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Qt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:h2,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Qt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Qt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function UV(t,e,n){e.start=e.pos;for(let i=0;i<10;i++){let r=t(e,n);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const R1=Object.create(null),Kf=[Si.none],h2=new v1(Kf),RD=[],AD=Object.create(null),jV=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])jV[t]=YV(R1,e);class KV{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),jV)}resolve(e){return e?this.table[e]||(this.table[e]=YV(this.extra,e)):0}}const p2=new KV(R1);function zb(t,e){RD.indexOf(t)>-1||(RD.push(t),console.warn(e))}function YV(t,e){let n=[];for(let c of e.split(" ")){let f=[];for(let h of c.split(".")){let m=t[h]||ze[h];m?typeof m=="function"?f.length?f=f.map(m):zb(h,`Modifier ${h} used at start of tag`):f.length?zb(h,`Tag ${h} used as modifier`):f=Array.isArray(m)?m:[m]:zb(h,`Unknown highlighting tag ${h}`)}for(let h of f)n.push(h)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(c=>c.id),o=AD[r];if(o)return o.id;let a=AD[r]=Si.define({id:Kf.length,name:i,props:[RX({[i]:n})]});return Kf.push(a),a.id}function m2(t,e){let n=Si.define({id:Kf.length,name:"Document",props:[kl.add(()=>t),kV.add(()=>i=>e.getIndent(i))],top:!0});return Kf.push(n),n}an.RTL,an.LTR;const g2=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=O1(t.state,n.from);return i.line?y2(t):i.block?b2(t):!1};function A1(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}const y2=A1(w2,0),v2=A1(qV,0),b2=A1((t,e)=>qV(t,e,x2(e)),0);function O1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const ef=50;function S2(t,{open:e,close:n},i,r){let o=t.sliceDoc(i-ef,i),a=t.sliceDoc(r,r+ef),c=/\s*$/.exec(o)[0].length,f=/^\s*/.exec(a)[0].length,h=o.length-c;if(o.slice(h-e.length,h)==e&&a.slice(f,f+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:r+f,margin:f&&1}};let m,p;r-i<=2*ef?m=p=t.sliceDoc(i,r):(m=t.sliceDoc(i,i+ef),p=t.sliceDoc(r-ef,r));let y=/^\s*/.exec(m)[0].length,b=/\s*$/.exec(p)[0].length,x=p.length-b-n.length;return m.slice(y,y+e.length)==e&&p.slice(x,x+n.length)==n?{open:{pos:i+y+e.length,margin:/\s/.test(m.charAt(y+e.length))?1:0},close:{pos:r-b-n.length,margin:/\s/.test(p.charAt(x-1))?1:0}}:null}function x2(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function qV(t,e,n=e.selection.ranges){let i=n.map(o=>O1(e,o.from).block);if(!i.every(o=>o))return null;let r=n.map((o,a)=>S2(e,i[a],o.from,o.to));if(t!=2&&!r.every(o=>o))return{changes:e.changes(n.map((o,a)=>r[a]?[]:[{from:o.from,insert:i[a].open+" "},{from:o.to,insert:" "+i[a].close}]))};if(t!=1&&r.some(o=>o)){let o=[];for(let a=0,c;a<r.length;a++)if(c=r[a]){let f=i[a],{open:h,close:m}=c;o.push({from:h.pos-f.open.length,to:h.pos+h.margin},{from:m.pos-m.margin,to:m.pos+f.close.length})}return{changes:o}}return null}function w2(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:o,to:a}of n){let c=i.length,f=1e9,h;for(let m=o;m<=a;){let p=e.doc.lineAt(m);if(h==null&&(h=O1(e,p.from).line,!h))continue e;if(p.from>r&&(o==a||a>p.from)){r=p.from;let y=/^\s*/.exec(p.text)[0].length,b=y==p.length,x=p.text.slice(y,y+h.length)==h?y:-1;y<p.text.length&&y<f&&(f=y),i.push({line:p,comment:x,token:h,indent:y,empty:b,single:!1})}m=p.to+1}if(f<1e9)for(let m=c;m<i.length;m++)i[m].indent<i[m].line.text.length&&(i[m].indent=f);i.length==c+1&&(i[c].single=!0)}if(t!=2&&i.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:c,token:f,indent:h,empty:m,single:p}of i)(p||!m)&&o.push({from:c.from+h,insert:f+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&i.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:c,token:f}of i)if(c>=0){let h=a.from+c,m=h+f.length;a.text[m-a.from]==" "&&m++,o.push({from:h,to:m})}return{changes:o}}return null}const Cx=Zo.define(),C2=Zo.define(),E2=We.define(),GV=We.define({combine(t){return Hg(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),WV=bs.define({create(){return cs.empty},update(t,e){let n=e.state.facet(GV),i=e.annotation(Cx);if(i){let f=ki.fromTransaction(e,i.selection),h=i.side,m=h==0?t.undone:t.done;return f?m=jm(m,m.length,n.minDepth,f):m=QV(m,e.startState.selection),new cs(h==0?i.rest:m,h==0?m:i.rest)}let r=e.annotation(C2);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Bn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=ki.fromTransaction(e),a=e.annotation(Bn.time),c=e.annotation(Bn.userEvent);return o?t=t.addChanges(o,a,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,c,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new cs(t.done.map(ki.fromJSON),t.undone.map(ki.fromJSON))}});function Oie(t={}){return[WV,GV.of(t),nt.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?XV:e.inputType=="historyRedo"?Ex:null;return i?(e.preventDefault(),i(n)):!1}})]}function ny(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(WV,!1);if(!r)return!1;let o=r.pop(t,n,e);return o?(i(o),!0):!1}}const XV=ny(0,!1),Ex=ny(1,!1),T2=ny(0,!0),R2=ny(1,!0);class ki{constructor(e,n,i,r,o){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new ki(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new ki(e.changes&&In.fromJSON(e.changes),[],e.mapped&&hs.fromJSON(e.mapped),e.startSelection&&xe.fromJSON(e.startSelection),e.selectionsAfter.map(xe.fromJSON))}static fromTransaction(e,n){let i=ur;for(let r of e.startState.facet(E2)){let o=r(e);o.length&&(i=i.concat(o))}return!i.length&&e.changes.empty?null:new ki(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,ur)}static selection(e){return new ki(void 0,ur,void 0,void 0,e)}}function jm(t,e,n,i){let r=e+1>n+20?e-n-1:0,o=t.slice(r,e);return o.push(i),o}function A2(t,e){let n=[],i=!1;return t.iterChangedRanges((r,o)=>n.push(r,o)),e.iterChangedRanges((r,o,a,c)=>{for(let f=0;f<n.length;){let h=n[f++],m=n[f++];c>=h&&a<=m&&(i=!0)}}),i}function O2(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function $V(t,e){return t.length?e.length?t.concat(e):t:e}const ur=[],M2=200;function QV(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-M2));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),jm(t,t.length-1,1e9,n.setSelAfter(i)))}else return[ki.selection([e])]}function D2(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function _b(t,e){if(!t.length)return t;let n=t.length,i=ur;for(;n;){let r=k2(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let o=t.slice(0,n);return o[n-1]=r,o}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[ki.selection(i)]:ur}function k2(t,e,n){let i=$V(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):ur,n);if(!t.changes)return ki.selection(i);let r=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new ki(r,$t.mapEffects(t.effects,e),a,t.startSelection.map(o),i)}const P2=/^(input\.type|delete)($|\.)/;class cs{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new cs(this.done,this.undone):this}addChanges(e,n,i,r,o){let a=this.done,c=a[a.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!i||P2.test(i))&&(!c.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,A2(c.changes,e.changes))||i=="input.type.compose")?a=jm(a,a.length-1,r.minDepth,new ki(e.changes.compose(c.changes),$V($t.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,ur)):a=jm(a,a.length,r.minDepth,e),new cs(a,ur,n,i)}addSelection(e,n,i,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:ur;return o.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&O2(o[o.length-1],e)?this:new cs(QV(this.done,e),this.undone,n,i)}addMapping(e){return new cs(_b(this.done,e),_b(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let o=r[r.length-1],a=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(i&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Cx.of({side:e,rest:D2(r),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let c=r.length==1?ur:r.slice(0,r.length-1);return o.mapped&&(c=_b(c,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Cx.of({side:e,rest:c,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}cs.empty=new cs(ur,ur);const Mie=[{key:"Mod-z",run:XV,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Ex,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Ex,preventDefault:!0},{key:"Mod-u",run:T2,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:R2,preventDefault:!0}];function Xu(t,e){return xe.create(t.ranges.map(e),t.mainIndex)}function Br(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Vr({state:t,dispatch:e},n){let i=Xu(t.selection,n);return i.eq(t.selection,!0)?!1:(e(Br(t,i)),!0)}function iy(t,e){return xe.cursor(e?t.to:t.from)}function M1(t,e){return Vr(t,n=>n.empty?t.moveByChar(n,e):iy(n,e))}function ui(t){return t.textDirectionAt(t.state.selection.main.head)==an.LTR}const ZV=t=>M1(t,!ui(t)),JV=t=>M1(t,ui(t)),Die=t=>M1(t,!1);function e3(t,e){return Vr(t,n=>n.empty?t.moveByGroup(n,e):iy(n,e))}const I2=t=>e3(t,!ui(t)),N2=t=>e3(t,ui(t));function L2(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function ry(t,e,n){let i=hr(t).resolveInner(e.head),r=n?mt.closedBy:mt.openedBy;for(let f=e.head;;){let h=n?i.childAfter(f):i.childBefore(f);if(!h)break;L2(t,h,r)?i=h:f=n?h.to:h.from}let o=i.type.prop(r),a,c;return o&&(a=n?uu(t,i.from,1):uu(t,i.to,-1))&&a.matched?c=n?a.end.to:a.end.from:c=n?i.to:i.from,xe.cursor(c,n?-1:1)}const B2=t=>Vr(t,e=>ry(t.state,e,!ui(t))),V2=t=>Vr(t,e=>ry(t.state,e,ui(t)));function t3(t,e){return Vr(t,n=>{if(!n.empty)return iy(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const n3=t=>t3(t,!1),i3=t=>t3(t,!0);function r3(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let o of t.state.facet(nt.scrollMargins)){let a=o(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(i=Math.max(a?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function s3(t,e){let n=r3(t),{state:i}=t,r=Xu(i.selection,a=>a.empty?t.moveVertically(a,e,n.height):iy(a,e));if(r.eq(i.selection))return!1;let o;if(n.selfScroll){let a=t.coordsAtPos(i.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),f=c.top+n.marginTop,h=c.bottom-n.marginBottom;a&&a.top>f&&a.bottom<h&&(o=nt.scrollIntoView(r.main.head,{y:"start",yMargin:a.top-f}))}return t.dispatch(Br(i,r),{effects:o}),!0}const OD=t=>s3(t,!1),Tx=t=>s3(t,!0);function el(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let o=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;o&&e.head!=i.from+o&&(r=xe.cursor(i.from+o))}return r}const z2=t=>Vr(t,e=>el(t,e,!0)),_2=t=>Vr(t,e=>el(t,e,!1)),H2=t=>Vr(t,e=>el(t,e,!ui(t))),F2=t=>Vr(t,e=>el(t,e,ui(t))),U2=t=>Vr(t,e=>t.moveToLineBoundary(e,!1,!1)),j2=t=>Vr(t,e=>t.moveToLineBoundary(e,!0,!1));function K2(t,e,n){let i=!1,r=Xu(t.selection,o=>{let a=uu(t,o.head,-1)||uu(t,o.head,1)||o.head>0&&uu(t,o.head-1,1)||o.head<t.doc.length&&uu(t,o.head+1,-1);if(!a||!a.end)return o;i=!0;let c=a.start.from==o.head?a.end.to:a.end.from;return xe.cursor(c)});return i?(e(Br(t,r)),!0):!1}const Y2=({state:t,dispatch:e})=>K2(t,e);function mr(t,e,n){let i=Xu(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=xe.range(r.head,r.anchor));let o=n(r);return xe.range(r.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(Br(t.state,i)),!0)}function o3(t,e){return mr(t,e,n=>t.moveByChar(n,e))}const l3=t=>o3(t,!ui(t)),a3=t=>o3(t,ui(t));function u3(t,e){return mr(t,e,n=>t.moveByGroup(n,e))}const q2=t=>u3(t,!ui(t)),G2=t=>u3(t,ui(t)),W2=t=>{let e=!ui(t);return mr(t,e,n=>ry(t.state,n,e))},X2=t=>{let e=ui(t);return mr(t,e,n=>ry(t.state,n,e))};function c3(t,e){return mr(t,e,n=>t.moveVertically(n,e))}const f3=t=>c3(t,!1),d3=t=>c3(t,!0);function h3(t,e){return mr(t,e,n=>t.moveVertically(n,e,r3(t).height))}const MD=t=>h3(t,!1),DD=t=>h3(t,!0),$2=t=>mr(t,!0,e=>el(t,e,!0)),Q2=t=>mr(t,!1,e=>el(t,e,!1)),Z2=t=>{let e=!ui(t);return mr(t,e,n=>el(t,n,e))},J2=t=>{let e=ui(t);return mr(t,e,n=>el(t,n,e))},e$=t=>mr(t,!1,e=>xe.cursor(t.lineBlockAt(e.head).from)),t$=t=>mr(t,!0,e=>xe.cursor(t.lineBlockAt(e.head).to)),kD=({state:t,dispatch:e})=>(e(Br(t,{anchor:0})),!0),PD=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.doc.length})),!0),ID=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.selection.main.anchor,head:0})),!0),ND=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),n$=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),i$=({state:t,dispatch:e})=>{let n=sy(t).map(({from:i,to:r})=>xe.undirectionalRange(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:xe.create(n),userEvent:"select"})),!0},r$=({state:t,dispatch:e})=>{let n=Xu(t.selection,i=>{let r=hr(t),o=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=o.node.from&&a.node.to<=o.node.to&&(o=a)}for(let a=o;a;a=a.next){let{node:c}=a;if((c.from<i.from&&c.to>=i.to||c.to>i.to&&c.from<=i.from)&&a.next)return xe.undirectionalRange(c.from,c.to)}return i});return n.eq(t.selection)?!1:(e(Br(t,n)),!0)};function p3(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let o of n.selection.ranges){let a=n.doc.lineAt(o.head);if(e?a.to<t.state.doc.length:a.from>0)for(let c=o;;){let f=t.moveVertically(c,e);if(f.head<a.from||f.head>a.to){r.some(h=>h.head==f.head)||r.push(f);break}else{if(f.head==c.head)break;c=f}}}return r.length==i.ranges.length?!1:(t.dispatch(Br(n,xe.create(r,r.length-1))),!0)}const s$=t=>p3(t,!1),o$=t=>p3(t,!0),l$=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=xe.create([n.main]):n.main.empty||(i=xe.create([xe.cursor(n.main.head)])),i?(e(Br(t,i)),!0):!1};function wd(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(o=>{let{from:a,to:c}=o;if(a==c){let f=e(o);f<a?(n="delete.backward",f=Lp(t,f,!1)):f>a&&(n="delete.forward",f=Lp(t,f,!0)),a=Math.min(a,f),c=Math.max(c,f)}else a=Lp(t,a,!1),c=Lp(t,c,!0);return a==c?{range:o}:{changes:{from:a,to:c},range:xe.cursor(a,a<o.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?nt.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Lp(t,e,n){if(t instanceof nt)for(let i of t.state.facet(nt.atomicRanges).map(r=>r(t)))i.between(e,e,(r,o)=>{r<e&&o>e&&(e=n?o:r)});return e}const m3=(t,e,n)=>wd(t,i=>{let r=i.from,{state:o}=t,a=o.doc.lineAt(r),c,f;if(n&&!e&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(c=a.text.slice(0,r-a.from))){if(c[c.length-1]==" ")return r-1;let h=Fg(c,o.tabSize),m=h%ea(o)||ea(o);for(let p=0;p<m&&c[c.length-1-p]==" ";p++)r--;f=r}else f=li(a.text,r-a.from,e,e)+a.from,f==r&&a.number!=(e?o.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(f-a.from,r-a.from))&&(f=li(a.text,f-a.from,!1,!1)+a.from);return f}),Rx=t=>m3(t,!1,!0),g3=t=>m3(t,!0,!1),y3=(t,e)=>wd(t,n=>{let i=n.head,{state:r}=t,o=r.doc.lineAt(i),a=r.charCategorizer(i);for(let c=null;;){if(i==(e?o.to:o.from)){i==n.head&&o.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let f=li(o.text,i-o.from,e)+o.from,h=o.text.slice(Math.min(i,f)-o.from,Math.max(i,f)-o.from),m=a(h);if(c!=null&&m!=c)break;(h!=" "||i!=n.head)&&(c=m),i=f}return i}),v3=t=>y3(t,!1),a$=t=>y3(t,!0),u$=t=>wd(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),c$=t=>wd(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),f$=t=>wd(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),d$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:kt.of(["",""])},range:xe.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},h$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,o=t.doc.lineAt(r),a=r==o.from?r-1:li(o.text,r-o.from,!1)+o.from,c=r==o.to?r+1:li(o.text,r-o.from,!0)+o.from;return{changes:{from:a,to:c,insert:t.doc.slice(r,c).append(t.doc.slice(a,r))},range:xe.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function sy(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(!i.empty&&i.to==o.from&&(o=t.doc.lineAt(i.to-1)),n>=r.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(i)}else e.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return e}function b3(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let o of sy(t)){if(n?o.to==t.doc.length:o.from==0)continue;let a=t.doc.lineAt(n?o.to+1:o.from-1),c=a.length+1;if(n){i.push({from:o.to,to:a.to},{from:o.from,insert:a.text+t.lineBreak});for(let f of o.ranges)r.push(xe.range(Math.min(t.doc.length,f.anchor+c),Math.min(t.doc.length,f.head+c)))}else{i.push({from:a.from,to:o.from},{from:o.to,insert:t.lineBreak+a.text});for(let f of o.ranges)r.push(xe.range(f.anchor-c,f.head-c))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:xe.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const p$=({state:t,dispatch:e})=>b3(t,e,!1),m$=({state:t,dispatch:e})=>b3(t,e,!0);function S3(t,e,n){if(t.readOnly)return!1;let i=[];for(let o of sy(t))n?i.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):i.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const g$=({state:t,dispatch:e})=>S3(t,e,!1),y$=({state:t,dispatch:e})=>S3(t,e,!0),v$=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(sy(e).map(({from:r,to:o})=>(r>0?r--:o<e.doc.length&&o++,{from:r,to:o}))),i=Xu(e.selection,r=>{let o;if(t.lineWrapping){let a=t.lineBlockAt(r.head),c=t.coordsAtPos(r.head,r.assoc||1);c&&(o=a.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,o)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function b$(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=hr(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),o;return i&&r&&i.to<=e&&r.from>=e&&(o=i.type.prop(mt.closedBy))&&o.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const LD=x3(!1),S$=x3(!0);function x3(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:o,to:a}=r,c=e.doc.lineAt(o),f=!t&&o==a&&b$(e,o);t&&(o=a=(a<=c.to?c:e.doc.lineAt(a)).to);let h=new ey(e,{simulateBreak:o,simulateDoubleBreak:!!f}),m=DV(h,o);for(m==null&&(m=Fg(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));a<c.to&&/\s/.test(c.text[a-c.from]);)a++;f?{from:o,to:a}=f:o>c.from&&o<c.from+100&&!/\S/.test(c.text.slice(0,o))&&(o=c.from);let p=["",Um(e,m)];return f&&p.push(Um(e,h.lineIndent(c.from,-1))),{changes:{from:o,to:a,insert:kt.of(p)},range:xe.cursor(o+1+p[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function D1(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let a=i.from;a<=i.to;){let c=t.doc.lineAt(a);c.number>n&&(i.empty||i.to>c.from)&&(e(c,r,i),n=c.number),a=c.to+1}let o=t.changes(r);return{changes:r,range:xe.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const x$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new ey(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),r=D1(t,(o,a,c)=>{let f=DV(i,o.from);if(f==null)return;/\S/.test(o.text)||(f=0);let h=/^\s*/.exec(o.text)[0],m=Um(t,f);(h!=m||c.from<o.from+h.length)&&(n[o.from]=f,a.push({from:o.from,to:o.from+h.length,insert:m}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},w3=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(D1(t,(n,i)=>{i.push({from:n.from,insert:t.facet(w1)})}),{userEvent:"input.indent"})),!0),C3=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(D1(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let o=Fg(r,t.tabSize),a=0,c=Um(t,Math.max(0,o-ea(t)));for(;a<r.length&&a<c.length&&r.charCodeAt(a)==c.charCodeAt(a);)a++;i.push({from:n.from+a,to:n.from+r.length,insert:c.slice(a)})}),{userEvent:"delete.dedent"})),!0),w$=t=>(t.setTabFocusMode(),!0),C$=[{key:"Ctrl-b",run:ZV,shift:l3,preventDefault:!0},{key:"Ctrl-f",run:JV,shift:a3},{key:"Ctrl-p",run:n3,shift:f3},{key:"Ctrl-n",run:i3,shift:d3},{key:"Ctrl-a",run:U2,shift:e$},{key:"Ctrl-e",run:j2,shift:t$},{key:"Ctrl-d",run:g3},{key:"Ctrl-h",run:Rx},{key:"Ctrl-k",run:u$},{key:"Ctrl-Alt-h",run:v3},{key:"Ctrl-o",run:d$},{key:"Ctrl-t",run:h$},{key:"Ctrl-v",run:Tx}],E$=[{key:"ArrowLeft",run:ZV,shift:l3,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:I2,shift:q2,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:H2,shift:Z2,preventDefault:!0},{key:"ArrowRight",run:JV,shift:a3,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:N2,shift:G2,preventDefault:!0},{mac:"Cmd-ArrowRight",run:F2,shift:J2,preventDefault:!0},{key:"ArrowUp",run:n3,shift:f3,preventDefault:!0},{mac:"Cmd-ArrowUp",run:kD,shift:ID},{mac:"Ctrl-ArrowUp",run:OD,shift:MD},{key:"ArrowDown",run:i3,shift:d3,preventDefault:!0},{mac:"Cmd-ArrowDown",run:PD,shift:ND},{mac:"Ctrl-ArrowDown",run:Tx,shift:DD},{key:"PageUp",run:OD,shift:MD},{key:"PageDown",run:Tx,shift:DD},{key:"Home",run:_2,shift:Q2,preventDefault:!0},{key:"Mod-Home",run:kD,shift:ID},{key:"End",run:z2,shift:$2,preventDefault:!0},{key:"Mod-End",run:PD,shift:ND},{key:"Enter",run:LD,shift:LD},{key:"Mod-a",run:n$},{key:"Backspace",run:Rx,shift:Rx,preventDefault:!0},{key:"Delete",run:g3,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:v3,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:a$,preventDefault:!0},{mac:"Mod-Backspace",run:c$,preventDefault:!0},{mac:"Mod-Delete",run:f$,preventDefault:!0}].concat(C$.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),kie=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:B2,shift:W2},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:V2,shift:X2},{key:"Alt-ArrowUp",run:p$},{key:"Shift-Alt-ArrowUp",run:g$},{key:"Alt-ArrowDown",run:m$},{key:"Shift-Alt-ArrowDown",run:y$},{key:"Mod-Alt-ArrowUp",run:s$},{key:"Mod-Alt-ArrowDown",run:o$},{key:"Escape",run:l$},{key:"Mod-Enter",run:S$},{key:"Alt-l",mac:"Ctrl-l",run:i$},{key:"Mod-i",run:r$,preventDefault:!0},{key:"Mod-[",run:C3},{key:"Mod-]",run:w3},{key:"Mod-Alt-\\",run:x$},{key:"Shift-Mod-k",run:v$},{key:"Shift-Mod-\\",run:Y2},{key:"Mod-/",run:g2},{key:"Alt-A",mac:"Ctrl-A",run:v2},{key:"Ctrl-m",mac:"Shift-Alt-m",run:w$}].concat(E$),Pie={key:"Tab",run:w3,shift:C3};function T$(t,e,n){const i=new Array(t);return new Proxy(i,{get(r,o,a){if(typeof o=="string"){const c=o.charCodeAt(0);if(c>=48&&c<=57){const f=+o;if(Number.isInteger(f)&&f>=0&&f<t){let h=r[f];if(!h){const m=e[f*2];h=r[f]={index:f,key:n(f),start:m,size:e[f*2+1],end:m+e[f*2+1],lane:0}}return h}}if(o==="length")return t}return Reflect.get(r,o,a)}})}function Ja(t,e,n){let i=n.initialDeps??[],r,o=!0;function a(){const c=t();return(c.length!==i.length||c.some((h,m)=>i[m]!==h))&&(i=c,r=e(...c),n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(r),o=!1),r}return a.updateDeps=c=>{i=c},a}function BD(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const R$=(t,e)=>Math.abs(t-e)<1.01,A$=(t,e,n)=>{let i;return function(...r){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,r),n)}};let tf;const Hb=()=>{if(tf!==void 0)return tf;if(typeof navigator>"u")return tf=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return tf=!0;const t=navigator.maxTouchPoints;return tf=navigator.platform==="MacIntel"&&t!==void 0&&t>0},VD=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},O$=t=>t,M$=t=>{const e=Math.max(t.startIndex-t.overscan,0),i=Math.min(t.endIndex+t.overscan,t.count-1)-e+1,r=new Array(i);for(let o=0;o<i;o++)r[o]=e+o;return r},D$=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;const r=a=>{const{width:c,height:f}=a;e({width:Math.round(c),height:Math.round(f)})};if(r(VD(n)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(a=>{const c=()=>{const f=a[0];if(f?.borderBoxSize){const h=f.borderBoxSize[0];if(h){r({width:h.inlineSize,height:h.blockSize});return}}r(VD(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Km={passive:!0},k$=typeof window>"u"?!0:"onscrollend"in window,P$=(t,e,n)=>{const i=t.scrollElement;if(!i)return;const r=t.targetWindow;if(!r)return;const o=t.options.useScrollendEvent&&k$;let a=0;const c=o?null:A$(r,()=>e(a,!1),t.options.isScrollingResetDelay),f=p=>()=>{a=n(i),c?.(),e(a,p)},h=f(!0),m=f(!1);return i.addEventListener("scroll",h,Km),o&&i.addEventListener("scrollend",m,Km),()=>{i.removeEventListener("scroll",h),o&&i.removeEventListener("scrollend",m)}},I$=(t,e)=>P$(t,e,n=>{const{horizontal:i,isRtl:r}=t.options;return i?n.scrollLeft*(r&&-1||1):n.scrollTop}),N$=(t,e,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(t),r=n.options.getItemKey(i);return n.itemSizeCache.get(r)??n.options.estimateSize(i)}if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!e){const i=n.indexFromElement(t),r=n.options.getItemKey(i),o=n.itemSizeCache.get(r);if(o!==void 0)return o}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},L$=(t,{adjustments:e=0,behavior:n},i)=>{var r,o;(o=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[i.options.horizontal?"left":"top"]:t+e,behavior:n})},B$=L$;class V${constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,i,r;return((r=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:r.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{const a=()=>{const c=o.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[h,m]of this.elementsCache)if(m===c){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),n=null},observe:r=>{var o;return(o=i())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=i())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{var i,r;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:O$,rangeExtractor:M$,onChange:()=>{},measureElement:N$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in n){const b=n[y];b!==void 0&&(o[y]=b)}const a=this.options;let c=null,f=null,h=!1;if(a!==void 0&&a.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const y=a.count,b=o.count,x=this.getMeasurements(),w=y>0?((i=x[0])==null?void 0:i.key)??a.getItemKey(0):null,C=y>0?((r=x[y-1])==null?void 0:r.key)??a.getItemKey(y-1):null;if(b!==y||y>0&&b>0&&(o.getItemKey(0)!==w||o.getItemKey(b-1)!==C)){h=!0;const T=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;T&&(c=[T.key,this.getScrollOffset()-T.start]);const A=o.followOnAppend===!0?"auto":o.followOnAppend||null;A&&b>y&&this.isAtEnd(a.scrollEndThreshold)&&(y===0||o.getItemKey(b-1)!==C)&&(f=A)}}this.options=o,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let m=!1,p=0;if(c&&this.scrollOffset!==null){const[y,b]=c,x=this.getMeasurements(),{count:w,getItemKey:C}=this.options;let E=0;for(;E<w&&C(E)!==y;)E++;if(E<w){const O=x[E];if(O){const T=O.start+b;T!==this.scrollOffset&&(p=T-this.scrollOffset,this.scrollOffset=T,m=!0)}}}(m||f)&&(this.pendingScrollAnchor=[m?c[0]:null,m?c[1]:0,f,p])},this.notify=n=>{var i,r;(r=(i=this.options).onChange)==null||r.call(i,this,n)},this.maybeNotify=Ja(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,a)=>{if(a&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=a?c===o?this.scrollDirection:c<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Hb()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",a,Km),o.addEventListener("touchend",c,Km),this.unsubs.push(()=>{o.removeEventListener("touchstart",a),o.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const r=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,r&&this.scrollElement&&this.options.enabled){const[o,a,c,f]=r;o!==null&&!c&&(Hb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;const r=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=r,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,i)=>{const r=new Map,o=new Map;for(let a=i-1;a>=0;a--){const c=n[a];if(r.has(c.lane))continue;const f=o.get(c.lane);if(f==null||c.end>f.end?o.set(c.lane,c):c.end<f.end&&r.set(c.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=Ja(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,i,r,o,a,c,f)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f}),{key:!1}),this.getMeasurements=Ja(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f},h)=>{const m=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const x=this.options.gap,w=n*2;let C=this._flatMeasurements;if(!C||C.length<w){const T=new Float64Array(w);C&&p>0&&T.set(C.subarray(0,p*2)),C=T,this._flatMeasurements=C}let E;if(p===0)E=i+r;else{const T=p-1;E=C[T*2]+C[T*2+1]+x}for(let T=p;T<n;T++){const A=o(T),D=m.get(A),k=typeof D=="number"?D:this.options.estimateSize(T);C[T*2]=E,C[T*2+1]=k,E+=k+x}const O=T$(n,C,o);return this.measurementsCache=O,O}const y=this.measurementsCache.slice(0,p),b=new Array(c).fill(void 0);for(let x=0;x<p;x++){const w=y[x];w&&(b[w.lane]=x)}for(let x=p;x<n;x++){const w=o(x),C=this.laneAssignments.get(x);let E,O;const T=f==="estimate"||m.has(w);if(C!==void 0&&this.options.lanes>1){E=C;const M=b[E],I=M!==void 0?y[M]:void 0;O=I?I.end+this.options.gap:i+r}else{const M=this.options.lanes===1?y[x-1]:this.getFurthestMeasurement(y,x);O=M?M.end+this.options.gap:i+r,E=M?M.lane:x%this.options.lanes,this.options.lanes>1&&T&&this.laneAssignments.set(x,E)}const A=m.get(w),D=typeof A=="number"?A:this.options.estimateSize(x),k=O+D;y[x]={index:x,start:O,size:D,end:k,key:w,lane:E},b[E]=x}return this.measurementsCache=y,y},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ja(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,r,o)=>{if(n.length===0||i===0)return this.range=null,null;const a=Math.max(this.getTotalSize()-i,0),c=Math.min(Math.max(r,0),a);return this.range=_$(n,i,c,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ja(()=>{let n=null,i=null;const r=this.calculateRange();return r&&(n=r.startIndex,i=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,r,o,a)=>o===null||a===null?[]:n({startIndex:o,endIndex:a,overscan:i,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,r=n.getAttribute(i);return r?parseInt(r,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const r=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(r!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,r-o),c=Math.min(this.options.count-1,r+o);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const i=this.indexFromElement(n),r=this.options.getItemKey(i),o=this.elementsCache.get(r);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(r,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var r,o;if(n<0||n>=this.options.count)return;let a,c,f;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)f=this.options.getItemKey(n),c=h[n*2],a=h[n*2+1];else{const y=this.measurementsCache[n];if(!y)return;f=y.key,c=y.start,a=y.size}const m=this.itemSizeCache.get(f)??a,p=i-m;if(p!==0){const y=this.options.anchorTo==="end"&&((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=y?this.getTotalSize():0,x=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:c,size:a,end:c+a,lane:0},p,this):c<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(f)||this.scrollDirection!=="backward"));(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++,y?this.applyScrollAdjustment(this.getTotalSize()-b):x&&this.applyScrollAdjustment(p),this.notify(!1)}},this.getVirtualItems=Ja(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const r=[];for(let o=0,a=n.length;o<a;o++){const c=n[o],f=i[c];r.push(f)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const r=this._flatMeasurements,o=this.options.lanes===1&&r!=null,a=E3(0,i.length-1,o?c=>r[c*2]:c=>BD(i[c]).start,n);return BD(i[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,r=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),a=this.getScrollOffset();i==="auto"&&(i=n>=a+o?"end":"start"),i==="center"?n+=(r-o)/2:i==="end"&&(n-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.getSize(),o=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(i==="auto")if(a.end>=o+r-this.options.scrollPaddingEnd)i="end";else if(a.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,a.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:r="auto"}={})=>{const o=this.getOffsetForAlignment(n,i),a=this.now();this.scrollState={index:null,align:i,behavior:r,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:r="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,i);if(!o)return;const[a,c]=o,f=this.now();this.scrollState={index:n,align:c,behavior:r,startedAt:f,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const r=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let r;if(i.length===0)r=this.options.paddingStart;else if(this.options.lanes===1){const o=i.length-1,a=this._flatMeasurements;a!=null?r=a[o*2]+a[o*2+1]:r=((n=i[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let a=i.length-1;for(;a>=0&&o.some(c=>c===null);){const c=i[a];o[c.lane]===null&&(o[c.lane]=c.end),a--}r=Math.max(...o.filter(c=>c!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const r of i)r&&this.itemSizeCache.has(r.key)&&n.push({index:r.index,key:r.key,start:r.start,size:r.size,end:r.end,lane:r.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:r})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:r,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,n){e!==0&&(Hb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,r=i?i[0]:this.scrollState.lastTargetOffset,o=1,a=r!==this.scrollState.lastTargetOffset;if(!a&&R$(r,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==r&&this._scrollToOffset(r,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const c=this.getSize()||600,f=Math.abs(r-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&f>c;this.scrollState.lastTargetOffset=r,h||(this.scrollState.behavior="auto"),this._scrollToOffset(r,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const E3=(t,e,n,i)=>{for(;t<=e;){const r=(t+e)/2|0,o=n(r);if(o<i)t=r+1;else if(o>i)e=r-1;else return r}return t>0?t-1:0};function z$(t,e,n){let i=0;for(;i<=e;){const r=(i+e)/2|0,o=t[r*2];if(o<n)i=r+1;else if(o>n)e=r-1;else return r}return i>0?i-1:0}function _$(t,e,n,i,r){const o=t.length-1;if(t.length<=i)return{startIndex:0,endIndex:o};if(i===1&&r!==null){const h=z$(r,o,n);let m=h;const p=n+e;for(;m<o&&r[m*2]+r[m*2+1]<p;)m++;return{startIndex:h,endIndex:m}}let c=E3(0,o,h=>t[h].start,n),f=c;if(i===1)for(;f<o&&t[f].end<n+e;)f++;else if(i>1){const h=Array(i).fill(0);for(;f<o&&h.some(p=>p<n+e);){const p=t[f];h[p.lane]=p.end,f++}const m=Array(i).fill(n+e);for(;c>=0&&m.some(p=>p>=n);){const p=t[c];m[p.lane]=p.start,c--}c=Math.max(0,c-c%i),f=Math.min(o,f+(i-1-f%i))}return{startIndex:c,endIndex:f}}const Fb=typeof document<"u"?S.useLayoutEffect:S.useEffect;function H$({useFlushSync:t=!0,directDomUpdates:e=!1,directDomUpdatesMode:n="transform",...i}){const r=S.useReducer(h=>h+1,0)[1],o=S.useRef({enabled:e,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=e,o.current.mode=n;const a=h=>{const m=o.current;if(!m.enabled||!m.container)return;const p=h.getTotalSize();if(p!==m.lastSize){m.lastSize=p;const E=h.options.horizontal?"width":"height";m.container.style[E]=`${p}px`}const y=!!h.options.horizontal,b=m.mode==="transform",x=y?"left":"top",w=h.options.scrollMargin,C=h.getVirtualItems();for(const E of C){const O=E.start-w,T=h.elementsCache.get(E.key);T&&m.lastPositions.get(T)!==O&&(m.lastPositions.set(T,O),b?T.style.transform=y?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:T.style[x]=`${O}px`)}},c={...i,onChange:(h,m)=>{var p;const y=o.current;let b=!0;if(y.enabled){a(h);const x=h.range,w=y.prevRange;b=!w||w.isScrolling!==h.isScrolling||w.startIndex!==x?.startIndex||w.endIndex!==x?.endIndex,b&&(y.prevRange=x?{startIndex:x.startIndex,endIndex:x.endIndex,isScrolling:h.isScrolling}:null)}b&&(t&&m?Ln.flushSync(r):r()),(p=i.onChange)==null||p.call(i,h,m)}},[f]=S.useState(()=>{const h=new V$(c);return Object.assign(h,{containerRef:m=>{const p=o.current;if(p.container=m,p.lastSize=null,m&&p.enabled){const y=h.getTotalSize();p.lastSize=y;const b=h.options.horizontal?"width":"height";m.style[b]=`${y}px`}}})});return f.setOptions(c),Fb(()=>f._didMount(),[]),Fb(()=>f._willUpdate()),Fb(()=>{a(f)}),f}function Iie(t){return H$({observeElementRect:D$,observeElementOffset:I$,scrollToFn:B$,...t})}function k1(t,e){t.indexOf(e)===-1&&t.push(e)}function zu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ys=(t,e,n)=>n>e?e:n<t?t:n;let oy=()=>{};const Yo={},T3=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),R3=t=>typeof t=="object"&&t!==null,A3=t=>/^0[^.\s]+$/u.test(t);function O3(t){let e;return()=>(e===void 0&&(e=t()),e)}const fr=t=>t,Cd=(...t)=>t.reduce((e,n)=>i=>n(e(i))),_u=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class P1{constructor(){this.subscriptions=[]}add(e){return k1(this.subscriptions,e),()=>zu(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let o=0;o<r;o++){const a=this.subscriptions[o];a&&a(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ii=t=>t*1e3,cr=t=>t/1e3,M3=(t,e)=>e?t*(1e3/e):0,F$=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},D3=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,U$=1e-7,j$=12;function K$(t,e,n,i,r){let o,a,c=0;do a=e+(n-e)/2,o=D3(a,i,r)-t,o>0?n=a:e=a;while(Math.abs(o)>U$&&++c<j$);return a}function Ed(t,e,n,i){if(t===e&&n===i)return fr;const r=o=>K$(o,0,1,t,n);return o=>o===0||o===1?o:D3(r(o),e,i)}const k3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,I1=t=>e=>1-t(1-e),P3=Ed(.33,1.53,.69,.99),N1=I1(P3),I3=k3(N1),N3=t=>t>=1?1:(t*=2)<1?.5*N1(t):.5*(2-Math.pow(2,-10*(t-1))),L1=t=>1-Math.sin(Math.acos(t)),L3=I1(L1),B3=k3(L1),Y$=Ed(.42,0,1,1),q$=Ed(0,0,.58,1),V3=Ed(.42,0,.58,1),z3=t=>Array.isArray(t)&&typeof t[0]!="number";function _3(t,e){return z3(t)?t[F$(0,t.length,e)]:t}const H3=t=>Array.isArray(t)&&typeof t[0]=="number",G$={linear:fr,easeIn:Y$,easeInOut:V3,easeOut:q$,circIn:L1,circInOut:B3,circOut:L3,backIn:N1,backInOut:I3,backOut:P3,anticipate:N3},W$=t=>typeof t=="string",zD=t=>{if(H3(t)){oy(t.length===4);const[e,n,i,r]=t;return Ed(e,n,i,r)}else if(W$(t))return G$[t];return t},Bp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function X$(t){let e=new Set,n=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(h){o.has(h)&&(f.schedule(h),t()),h(a)}const f={schedule:(h,m=!1,p=!1)=>{const b=p&&i?e:n;return m&&o.add(h),b.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(a=h,i){r=!0;return}i=!0;const m=e;e=n,n=m,e.forEach(c),e.clear(),i=!1,r&&(r=!1,f.process(h))}};return f}const $$=40;function F3(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=Bp.reduce((T,A)=>(T[A]=X$(o),T),{}),{setup:c,read:f,resolveKeyframes:h,preUpdate:m,update:p,preRender:y,render:b,postRender:x}=a,w=()=>{const T=Yo.useManualTiming,A=T?r.timestamp:performance.now();n=!1,T||(r.delta=i?1e3/60:Math.max(Math.min(A-r.timestamp,$$),1)),r.timestamp=A,r.isProcessing=!0,c.process(r),f.process(r),h.process(r),m.process(r),p.process(r),y.process(r),b.process(r),x.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(w))},C=()=>{n=!0,i=!0,r.isProcessing||t(w)};return{schedule:Bp.reduce((T,A)=>{const D=a[A];return T[A]=(k,M=!1,I=!1)=>(n||C(),D.schedule(k,M,I)),T},{}),cancel:T=>{for(let A=0;A<Bp.length;A++)a[Bp[A]].cancel(T)},state:r,steps:a}}const{schedule:Zt,cancel:qo,state:ei,steps:Ub}=F3(typeof requestAnimationFrame<"u"?requestAnimationFrame:fr,!0);let em;function Q$(){em=void 0}const mi={now:()=>(em===void 0&&mi.set(ei.isProcessing||Yo.useManualTiming?ei.timestamp:performance.now()),em),set:t=>{em=t,queueMicrotask(Q$)}},U3=t=>e=>typeof e=="string"&&e.startsWith(t),j3=U3("--"),Z$=U3("var(--"),B1=t=>Z$(t)?J$.test(t.split("/*")[0].trim()):!1,J$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _D(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const $u={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Yf={...$u,transform:t=>ys(0,1,t)},Vp={...$u,default:1},wf=t=>Math.round(t*1e5)/1e5,V1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function eQ(t){return t==null}const tQ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,z1=(t,e)=>n=>!!(typeof n=="string"&&tQ.test(n)&&n.startsWith(t)||e&&!eQ(n)&&Object.prototype.hasOwnProperty.call(n,e)),K3=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,o,a,c]=i.match(V1);return{[t]:parseFloat(r),[e]:parseFloat(o),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},nQ=t=>ys(0,255,t),jb={...$u,transform:t=>Math.round(nQ(t))},Pl={test:z1("rgb","red"),parse:K3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+jb.transform(t)+", "+jb.transform(e)+", "+jb.transform(n)+", "+wf(Yf.transform(i))+")"};function iQ(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Ax={test:z1("#"),parse:iQ,transform:Pl.transform},Td=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Vs=Td("deg"),ms=Td("%"),je=Td("px"),rQ=Td("vh"),sQ=Td("vw"),HD={...ms,parse:t=>ms.parse(t)/100,transform:t=>ms.transform(t*100)},cu={test:z1("hsl","hue"),parse:K3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ms.transform(wf(e))+", "+ms.transform(wf(n))+", "+wf(Yf.transform(i))+")"},Mn={test:t=>Pl.test(t)||Ax.test(t)||cu.test(t),parse:t=>Pl.test(t)?Pl.parse(t):cu.test(t)?cu.parse(t):Ax.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Pl.transform(t):cu.transform(t),getAnimatableNone:t=>{const e=Mn.parse(t);return e.alpha=0,Mn.transform(e)}},oQ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function lQ(t){return isNaN(t)&&typeof t=="string"&&(t.match(V1)?.length||0)+(t.match(oQ)?.length||0)>0}const Y3="number",q3="color",aQ="var",uQ="var(",FD="${}",cQ=/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 Hu(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const c=e.replace(cQ,f=>(Mn.test(f)?(i.color.push(o),r.push(q3),n.push(Mn.parse(f))):f.startsWith(uQ)?(i.var.push(o),r.push(aQ),n.push(f)):(i.number.push(o),r.push(Y3),n.push(parseFloat(f))),++o,FD)).split(FD);return{values:n,split:c,indexes:i,types:r}}function fQ(t){return Hu(t).values}function G3({split:t,types:e}){const n=t.length;return i=>{let r="";for(let o=0;o<n;o++)if(r+=t[o],i[o]!==void 0){const a=e[o];a===Y3?r+=wf(i[o]):a===q3?r+=Mn.transform(i[o]):r+=i[o]}return r}}function dQ(t){return G3(Hu(t))}const hQ=t=>typeof t=="number"?0:Mn.test(t)?Mn.getAnimatableNone(t):t,pQ=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:hQ(t);function mQ(t){const e=Hu(t);return G3(e)(e.values.map((i,r)=>pQ(i,e.split[r])))}const Mr={test:lQ,parse:fQ,createTransformer:dQ,getAnimatableNone:mQ};function Kb(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function gQ({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,o=0,a=0;if(!e)r=o=a=n;else{const c=n<.5?n*(1+e):n+e-n*e,f=2*n-c;r=Kb(f,c,t+1/3),o=Kb(f,c,t),a=Kb(f,c,t-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:i}}function Ym(t,e){return n=>n>0?e:t}const Yt=(t,e,n)=>t+(e-t)*n,Yb=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},yQ=[Ax,Pl,cu],vQ=t=>yQ.find(e=>e.test(t));function UD(t){const e=vQ(t);if(!e)return!1;let n=e.parse(t);return e===cu&&(n=gQ(n)),n}const jD=(t,e)=>{const n=UD(t),i=UD(e);if(!n||!i)return Ym(t,e);const r={...n};return o=>(r.red=Yb(n.red,i.red,o),r.green=Yb(n.green,i.green,o),r.blue=Yb(n.blue,i.blue,o),r.alpha=Yt(n.alpha,i.alpha,o),Pl.transform(r))},Ox=new Set(["none","hidden"]);function bQ(t,e){return Ox.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function SQ(t,e){return n=>Yt(t,e,n)}function _1(t){return typeof t=="number"?SQ:typeof t=="string"?B1(t)?Ym:Mn.test(t)?jD:CQ:Array.isArray(t)?W3:typeof t=="object"?Mn.test(t)?jD:xQ:Ym}function W3(t,e){const n=[...t],i=n.length,r=t.map((o,a)=>_1(o)(o,e[a]));return o=>{for(let a=0;a<i;a++)n[a]=r[a](o);return n}}function xQ(t,e){const n={...t,...e},i={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(i[r]=_1(t[r])(t[r],e[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function wQ(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],c=t.values[a]??0;n[r]=c,i[o]++}return n}const CQ=(t,e)=>{const n=Mr.createTransformer(e),i=Hu(t),r=Hu(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Ox.has(t)&&!r.values.length||Ox.has(e)&&!i.values.length?bQ(t,e):Cd(W3(wQ(i,r),r.values),n):Ym(t,e)};function X3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Yt(t,e,n):_1(t)(t,e)}const EQ=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Zt.update(e,n),stop:()=>qo(e),now:()=>ei.isProcessing?ei.timestamp:mi.now()}},$3=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let o=0;o<r;o++)i+=Math.round(t(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},qm=2e4;function H1(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<qm;)e+=n,i=t.next(e);return e>=qm?1/0:e}function Q3(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(H1(i),qm);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:cr(r)}}const yn={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 Mx(t,e){return t*Math.sqrt(1-e*e)}const TQ=12;function RQ(t,e,n){let i=n;for(let r=1;r<TQ;r++)i=i-t(i)/e(i);return i}const qb=.001;function AQ({duration:t=yn.duration,bounce:e=yn.bounce,velocity:n=yn.velocity,mass:i=yn.mass}){let r,o,a=1-e;a=ys(yn.minDamping,yn.maxDamping,a),t=ys(yn.minDuration,yn.maxDuration,cr(t)),a<1?(r=h=>{const m=h*a,p=m*t,y=m-n,b=Mx(h,a),x=Math.exp(-p);return qb-y/b*x},o=h=>{const p=h*a*t,y=p*n+n,b=Math.pow(a,2)*Math.pow(h,2)*t,x=Math.exp(-p),w=Mx(Math.pow(h,2),a);return(-r(h)+qb>0?-1:1)*((y-b)*x)/w}):(r=h=>{const m=Math.exp(-h*t),p=(h-n)*t+1;return-qb+m*p},o=h=>{const m=Math.exp(-h*t),p=(n-h)*(t*t);return m*p});const c=5/t,f=RQ(r,o,c);if(t=Ii(t),isNaN(f))return{stiffness:yn.stiffness,damping:yn.damping,duration:t};{const h=Math.pow(f,2)*i;return{stiffness:h,damping:a*2*Math.sqrt(i*h),duration:t}}}const OQ=["duration","bounce"],MQ=["stiffness","damping","mass"];function KD(t,e){return e.some(n=>t[n]!==void 0)}function DQ(t){let e={velocity:yn.velocity,stiffness:yn.stiffness,damping:yn.damping,mass:yn.mass,isResolvedFromDuration:!1,...t};if(!KD(t,MQ)&&KD(t,OQ))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*ys(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:yn.mass,stiffness:r,damping:o}}else{const n=AQ({...t,velocity:0});e={...e,...n,mass:yn.mass},e.isResolvedFromDuration=!0}return e}function qf(t=yn.visualDuration,e=yn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:f,damping:h,mass:m,duration:p,velocity:y,isResolvedFromDuration:b}=DQ({...n,velocity:-cr(n.velocity||0)}),x=y||0,w=h/(2*Math.sqrt(f*m)),C=a-o,E=cr(Math.sqrt(f/m)),O=Math.abs(C)<5;i||(i=O?yn.restSpeed.granular:yn.restSpeed.default),r||(r=O?yn.restDelta.granular:yn.restDelta.default);let T,A,D,k,M,I;if(w<1)D=Mx(E,w),k=(x+w*E*C)/D,T=B=>{const H=Math.exp(-w*E*B);return a-H*(k*Math.sin(D*B)+C*Math.cos(D*B))},M=w*E*k+C*D,I=w*E*C-k*D,A=B=>Math.exp(-w*E*B)*(M*Math.sin(D*B)+I*Math.cos(D*B));else if(w===1){T=H=>a-Math.exp(-E*H)*(C+(x+E*C)*H);const B=x+E*C;A=H=>Math.exp(-E*H)*(E*B*H-x)}else{const B=E*Math.sqrt(w*w-1);T=K=>{const z=Math.exp(-w*E*K),V=Math.min(B*K,300);return a-z*((x+w*E*C)*Math.sinh(V)+B*C*Math.cosh(V))/B};const H=(x+w*E*C)/B,U=w*E*H-C*B,F=w*E*C-H*B;A=K=>{const z=Math.exp(-w*E*K),V=Math.min(B*K,300);return z*(U*Math.sinh(V)+F*Math.cosh(V))}}const L={calculatedDuration:b&&p||null,velocity:B=>Ii(A(B)),next:B=>{if(!b&&w<1){const U=Math.exp(-w*E*B),F=Math.sin(D*B),K=Math.cos(D*B),z=a-U*(k*F+C*K),V=Ii(U*(M*F+I*K));return c.done=Math.abs(V)<=i&&Math.abs(a-z)<=r,c.value=c.done?a:z,c}const H=T(B);if(b)c.done=B>=p;else{const U=Ii(A(B));c.done=Math.abs(U)<=i&&Math.abs(a-H)<=r}return c.value=c.done?a:H,c},toString:()=>{const B=Math.min(H1(L),qm),H=$3(U=>L.next(B*U).value,B,30);return B+"ms "+H},toTransition:()=>{}};return L}qf.applyToOptions=t=>{const e=Q3(t,100,qf);return t.ease=e.ease,t.duration=Ii(e.duration),t.type="keyframes",t};const kQ=5;function Z3(t,e,n){const i=Math.max(e-kQ,0);return M3(n-t(i),e-i)}function Dx({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:a,min:c,max:f,restDelta:h=.5,restSpeed:m}){const p=t[0],y={done:!1,value:p},b=I=>c!==void 0&&I<c||f!==void 0&&I>f,x=I=>c===void 0?f:f===void 0||Math.abs(c-I)<Math.abs(f-I)?c:f;let w=n*e;const C=p+w,E=a===void 0?C:a(C);E!==C&&(w=E-p);const O=I=>-w*Math.exp(-I/i),T=I=>E+O(I),A=I=>{const L=O(I),B=T(I);y.done=Math.abs(L)<=h,y.value=y.done?E:B};let D,k;const M=I=>{b(y.value)&&(D=I,k=qf({keyframes:[y.value,x(y.value)],velocity:Z3(T,I,y.value),damping:r,stiffness:o,restDelta:h,restSpeed:m}))};return M(0),{calculatedDuration:null,next:I=>{let L=!1;return!k&&D===void 0&&(L=!0,A(I),M(I)),D!==void 0&&I>=D?k.next(I-D):(!L&&A(I),y)}}}function PQ(t,e,n){const i=[],r=n||Yo.mix||X3,o=t.length-1;for(let a=0;a<o;a++){let c=r(t[a],t[a+1]);if(e){const f=Array.isArray(e)?e[a]||fr:e;c=Cd(f,c)}i.push(c)}return i}function IQ(t,e,{clamp:n=!0,ease:i,mixer:r}={}){const o=t.length;if(oy(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=PQ(e,i,r),f=c.length,h=m=>{if(a&&m<t[0])return e[0];let p=0;if(f>1)for(;p<t.length-2&&!(m<t[p+1]);p++);const y=_u(t[p],t[p+1],m);return c[p](y)};return n?m=>h(ys(t[0],t[o-1],m)):h}function J3(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=_u(0,e,i);t.push(Yt(n,1,r))}}function ez(t){const e=[0];return J3(e,t.length-1),e}function NQ(t,e){return t.map(n=>n*e)}function LQ(t,e){return t.map(()=>e||V3).splice(0,t.length-1)}function Cf({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=z3(i)?i.map(zD):zD(i),o={done:!1,value:e[0]},a=NQ(n&&n.length===e.length?n:ez(e),t),c=IQ(a,e,{ease:Array.isArray(r)?r:LQ(e,r)});return{calculatedDuration:t,next:f=>(o.value=c(f),o.done=f>=t,o)}}const BQ=t=>t!==null;function ly(t,{repeat:e,repeatType:n="loop"},i,r=1){const o=t.filter(BQ),c=r<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!c||i===void 0?o[c]:i}const VQ={decay:Dx,inertia:Dx,tween:Cf,keyframes:Cf,spring:qf};function tz(t){typeof t.type=="string"&&(t.type=VQ[t.type])}class F1{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const zQ=t=>t/100;class Gm extends F1{constructor(e){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!==mi.now()&&this.tick(mi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;tz(e);const{type:n=Cf,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=e;let{keyframes:c}=e;const f=n||Cf;f!==Cf&&typeof c[0]!="number"&&(this.mixKeyframes=Cd(zQ,X3(c[0],c[1])),c=[0,100]);const h=f({...e,keyframes:c});o==="mirror"&&(this.mirroredGenerator=f({...e,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=H1(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=h}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:h=0,keyframes:m,repeat:p,repeatType:y,repeatDelay:b,type:x,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-h*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?E<0:E>r;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let T=this.currentTime,A=i;if(p){const I=Math.min(this.currentTime,r)/c;let L=Math.floor(I),B=I%1;!B&&I>=1&&(B=1),B===1&&L--,L=Math.min(L,p+1),L%2&&(y==="reverse"?(B=1-B,b&&(B-=b/c)):y==="mirror"&&(A=a)),T=ys(0,1,B)*c}let D;O?(this.delayState.value=m[0],D=this.delayState):D=A.next(T),o&&!O&&(D.value=o(D.value));let{done:k}=D;!O&&f!==null&&(k=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return M&&x!==Dx&&(D.value=ly(m,this.options,C,this.speed)),w&&w(D.value),M&&this.finish(),D}then(e,n){return this.finished.then(e,n)}get duration(){return cr(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+cr(e)}get time(){return cr(this.currentTime)}set time(e){e=Ii(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Z3(i=>this.generator.next(i).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(mi.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=cr(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=EQ,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),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(mi.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(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function _Q(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Il=t=>t*180/Math.PI,kx=t=>{const e=Il(Math.atan2(t[1],t[0]));return Px(e)},HQ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:kx,rotateZ:kx,skewX:t=>Il(Math.atan(t[1])),skewY:t=>Il(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Px=t=>(t=t%360,t<0&&(t+=360),t),YD=kx,qD=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),GD=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),FQ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qD,scaleY:GD,scale:t=>(qD(t)+GD(t))/2,rotateX:t=>Px(Il(Math.atan2(t[6],t[5]))),rotateY:t=>Px(Il(Math.atan2(-t[2],t[0]))),rotateZ:YD,rotate:YD,skewX:t=>Il(Math.atan(t[4])),skewY:t=>Il(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ix(t){return t.includes("scale")?1:0}function Nx(t,e){if(!t||t==="none")return Ix(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=FQ,r=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=HQ,r=c}if(!r)return Ix(e);const o=i[e],a=r[1].split(",").map(jQ);return typeof o=="function"?o(a):a[o]}const UQ=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Nx(n,e)};function jQ(t){return parseFloat(t.trim())}const Qu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zu=new Set([...Qu,"pathRotation"]),WD=t=>t===$u||t===je,KQ=new Set(["x","y","z"]),YQ=Qu.filter(t=>!KQ.has(t));function qQ(t){const e=[];return YQ.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const Lo={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const r=t.max-t.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const r=t.max-t.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Nx(e,"x"),y:(t,{transform:e})=>Nx(e,"y")};Lo.translateX=Lo.x;Lo.translateY=Lo.y;const Vl=new Set;let Lx=!1,Bx=!1,Vx=!1;function nz(){if(Bx){const t=Array.from(Vl).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=qQ(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,a])=>{i.getValue(o)?.set(a)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Bx=!1,Lx=!1,Vl.forEach(t=>t.complete(Vx)),Vl.clear()}function iz(){Vl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Bx=!0)})}function GQ(){Vx=!0,iz(),nz(),Vx=!1}class U1{constructor(e,n,i,r,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Vl.add(this),Lx||(Lx=!0,Zt.read(iz),Zt.resolveKeyframes(nz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const o=r?.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const c=i.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),r&&o===void 0&&r.set(e[0])}_Q(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vl.delete(this)}cancel(){this.state==="scheduled"&&(Vl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const WQ=t=>t.startsWith("--");function rz(t,e,n){WQ(e)?t.style.setProperty(e,n):t.style[e]=n}const XQ={};function sz(t,e){const n=O3(t);return()=>XQ[e]??n()}const $Q=sz(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),oz=sz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cf=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,XD={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cf([0,.65,.55,1]),circOut:cf([.55,0,1,.45]),backIn:cf([.31,.01,.66,-.59]),backOut:cf([.33,1.53,.69,.99])};function lz(t,e){if(t)return typeof t=="function"?oz()?$3(t,e):"ease-out":H3(t)?cf(t):Array.isArray(t)?t.map(n=>lz(n,e)||XD.easeOut):XD[t]}function QQ(t,e,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:a="loop",ease:c="easeOut",times:f}={},h=void 0){const m={[e]:n};f&&(m.offset=f);const p=lz(c,r);Array.isArray(p)&&(m.easing=p);const y={delay:i,duration:r,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return h&&(y.pseudoElement=h),t.animate(m,y)}function j1(t){return typeof t=="function"&&"applyToOptions"in t}function ZQ({type:t,...e}){return j1(t)&&oz()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class az extends F1{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:c,onComplete:f}=e;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=e,oy(typeof e.type!="string");const h=ZQ(e);this.animation=QQ(n,i,r,h,o),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=ly(r,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),rz(n,i,m),this.animation.cancel()}f?.(),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:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return cr(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+cr(e)}get time(){return cr(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ii(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:i,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&$Q()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),fr):r(this)}}const uz={anticipate:N3,backInOut:I3,circInOut:B3};function JQ(t){return t in uz}function eZ(t){typeof t.ease=="string"&&JQ(t.ease)&&(t.ease=uz[t.ease])}const Gb=10;class tZ extends az{constructor(e){eZ(e),tz(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new Gm({...a,autoplay:!1}),f=Math.max(Gb,mi.now()-this.startTime),h=ys(0,Gb,f-Gb),m=c.sample(f).value,{name:p}=this.options;o&&p&&rz(o,p,m),n.setWithVelocity(c.sample(Math.max(0,f-h)).value,m,h),c.stop()}}const $D=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Mr.test(t)||t==="0")&&!t.startsWith("url("));function nZ(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function iZ(t,e,n,i){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],a=$D(r,e),c=$D(o,e);return!a||!c?!1:nZ(t)||(n==="spring"||j1(n))&&i}function zx(t){t.duration=0,t.type="keyframes"}const cz=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),rZ=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function sZ(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&rZ.test(t[e]))return!0;return!1}const oZ=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),lZ=O3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function aZ(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:o,type:a,keyframes:c}=t,f=e?.owner?.current;if(!(f instanceof HTMLElement)&&!(f instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:m}=e.owner.getProps();return lZ()&&n&&(cz.has(n)||oZ.has(n)&&sZ(c))&&(n!=="transform"||!m)&&!h&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}const uZ=40;class cZ extends F1{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",keyframes:c,name:f,motionValue:h,element:m,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=mi.now();const y={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:a,name:f,motionValue:h,element:m,...p},b=m?.KeyframeResolver||U1;this.keyframeResolver=new b(c,(x,w,C)=>this.onKeyframesResolved(x,w,y,!C),f,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:o,type:a,velocity:c,delay:f,isHandoff:h,onUpdate:m}=i;this.resolvedAt=mi.now();let p=!0;iZ(e,o,a,c)||(p=!1,(Yo.instantAnimations||!f)&&m?.(ly(e,i,n)),e[0]=e[e.length-1],zx(i),i.repeat=0);const b={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>uZ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},x=p&&!h&&aZ(b),w=b.motionValue?.owner?.current;let C;if(x)try{C=new tZ({...b,element:w})}catch{C=new Gm(b)}else C=new Gm(b);C.finished.then(()=>{this.notifyFinished()}).catch(fr),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),GQ()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class fZ{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=n}attachTimeline(e){const n=this.animations.map(i=>i.attachTimeline(e));return()=>{n.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return QD(this.animations,"duration")}get iterationDuration(){return QD(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function QD(t,e){let n=0;for(let i=0;i<t.length;i++){const r=t[i][e];r!==null&&r>n&&(n=r)}return n}class dZ extends fZ{then(e,n){return this.finished.finally(e).then(()=>{})}}function fz(t,e,n,i=0,r=1){const o=Array.from(t).sort((h,m)=>h.sortNodePosition(m)).indexOf(e),a=t.size,c=(a-1)*i;return typeof n=="function"?n(o,a):r===1?o*i:c-o*i}const ZD=30,hZ=t=>!isNaN(parseFloat(t));class pZ{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=mi.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=mi.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=hZ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new P1);const i=this.events[e].add(n);return e==="change"?()=>{i(),Zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=mi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ZD)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ZD);return M3(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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 Go(t,e){return new pZ(t,e)}function dz(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function K1(t,e){const n=t?.[e]??t?.default??t;return n!==t?dz(n,t):n}const mZ={type:"spring",stiffness:500,damping:25,restSpeed:10},gZ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),yZ={type:"keyframes",duration:.8},vZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bZ=(t,{keyframes:e})=>e.length>2?yZ:Zu.has(t)?t.startsWith("scale")?gZ(e[1]):mZ:vZ,SZ=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function xZ(t){for(const e in t)if(!SZ.has(e))return!0;return!1}const Y1=(t,e,n,i={},r,o)=>a=>{const c=K1(i,t)||{},f=c.delay||i.delay||0;let{elapsed:h=0}=i;h=h-Ii(f);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-h,onUpdate:y=>{e.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:r};xZ(c)||Object.assign(m,bZ(t,m)),m.duration&&(m.duration=Ii(m.duration)),m.repeatDelay&&(m.repeatDelay=Ii(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(zx(m),m.delay===0&&(p=!0)),(Yo.instantAnimations||Yo.skipAnimations||r?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,zx(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,p&&!o&&e.get()!==void 0){const y=ly(m.keyframes,c);if(y!==void 0){Zt.update(()=>{m.onUpdate(y),m.onComplete()});return}}return c.isSync?new Gm(m):new cZ(m)},wZ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function CZ(t){const e=wZ.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}function hz(t,e,n=1){const[i,r]=CZ(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const a=o.trim();return T3(a)?parseFloat(a):a}return B1(r)?hz(r,e,n+1):r}function JD(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function q1(t,e,n,i){if(typeof e=="function"){const[r,o]=JD(i);e=e(n!==void 0?n:t.custom,r,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,o]=JD(i);e=e(n!==void 0?n:t.custom,r,o)}return e}function zl(t,e,n){const i=t.getProps();return q1(i,e,n!==void 0?n:i.custom,t)}const pz=new Set(["width","height","top","left","right","bottom",...Qu]),_x=t=>Array.isArray(t);function EZ(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Go(n))}function TZ(t){return _x(t)?t[t.length-1]||0:t}function RZ(t,e){const n=zl(t,e);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const a in o){const c=TZ(o[a]);EZ(t,a,c)}}const Vn=t=>!!(t&&t.getVelocity);function AZ(t){return!!(Vn(t)&&t.add)}function Hx(t,e){const n=t.getValue("willChange");if(AZ(n))return n.add(e);if(!n&&Yo.WillChange){const i=new Yo.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function G1(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const OZ="framerAppearId",mz="data-"+G1(OZ);function gz(t){return t.props[mz]}function MZ({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function W1(t,e,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:a,...c}=e;const f=t.getDefaultTransition();o=o?dz(o,f):f;const h=o?.reduceMotion,m=o?.skipAnimations;i&&(o=i);const p=[],y=r&&t.animationState&&t.animationState.getState()[r],b=o?.path;b&&b.animateVisualElement(t,c,o,n,p);for(const x in c){const w=t.getValue(x,t.latestValues[x]??null),C=c[x];if(C===void 0||y&&MZ(y,x))continue;const E={delay:n,...K1(o||{},x)};m&&(E.skipAnimations=!0);const O=w.get();if(O!==void 0&&!w.isAnimating()&&!Array.isArray(C)&&C===O&&!E.velocity){Zt.update(()=>w.set(C));continue}let T=!1;if(window.MotionHandoffAnimation){const k=gz(t);if(k){const M=window.MotionHandoffAnimation(k,x,Zt);M!==null&&(E.startTime=M,T=!0)}}Hx(t,x);const A=h??t.shouldReduceMotion;w.start(Y1(x,w,C,A&&pz.has(x)?{type:!1}:E,t,T));const D=w.animation;D&&p.push(D)}if(a){const x=()=>Zt.update(()=>{a&&RZ(t,a)});p.length?Promise.all(p).then(x):x()}return p}function Fx(t,e,n={}){const i=zl(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(W1(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=r;return DZ(t,e,f,h,m,p,n)}:()=>Promise.resolve(),{when:c}=r;if(c){const[f,h]=c==="beforeChildren"?[o,a]:[a,o];return f().then(()=>h())}else return Promise.all([o(),a(n.delay)])}function DZ(t,e,n=0,i=0,r=0,o=1,a){const c=[];for(const f of t.variantChildren)f.notify("AnimationStart",e),c.push(Fx(f,e,{...a,delay:n+(typeof i=="function"?0:i)+fz(t.variantChildren,f,i,r,o)}).then(()=>f.notify("AnimationComplete",e)));return Promise.all(c)}function kZ(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(o=>Fx(t,o,n));i=Promise.all(r)}else if(typeof e=="string")i=Fx(t,e,n);else{const r=typeof e=="function"?zl(t,e,n.custom):e;i=Promise.all(W1(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const PZ={test:t=>t==="auto",parse:t=>t},yz=t=>e=>e.test(t),vz=[$u,je,ms,Vs,sQ,rQ,PZ],ek=t=>vz.find(yz(t));function IZ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||A3(t):!0}const NZ=new Set(["brightness","contrast","saturate","opacity"]);function LZ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(V1)||[];if(!i)return t;const r=n.replace(i,"");let o=NZ.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+r+")"}const BZ=/\b([a-z-]*)\(.*?\)/gu,Ux={...Mr,getAnimatableNone:t=>{const e=t.match(BZ);return e?e.map(LZ).join(" "):t}},jx={...Mr,getAnimatableNone:t=>{const e=Mr.parse(t);return Mr.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},tk={...$u,transform:Math.round},VZ={rotate:Vs,pathRotation:Vs,rotateX:Vs,rotateY:Vs,rotateZ:Vs,scale:Vp,scaleX:Vp,scaleY:Vp,scaleZ:Vp,skew:Vs,skewX:Vs,skewY:Vs,distance:je,translateX:je,translateY:je,translateZ:je,x:je,y:je,z:je,perspective:je,transformPerspective:je,opacity:Yf,originX:HD,originY:HD,originZ:je},Wm={borderWidth:je,borderTopWidth:je,borderRightWidth:je,borderBottomWidth:je,borderLeftWidth:je,borderRadius:je,borderTopLeftRadius:je,borderTopRightRadius:je,borderBottomRightRadius:je,borderBottomLeftRadius:je,width:je,maxWidth:je,height:je,maxHeight:je,top:je,right:je,bottom:je,left:je,inset:je,insetBlock:je,insetBlockStart:je,insetBlockEnd:je,insetInline:je,insetInlineStart:je,insetInlineEnd:je,padding:je,paddingTop:je,paddingRight:je,paddingBottom:je,paddingLeft:je,paddingBlock:je,paddingBlockStart:je,paddingBlockEnd:je,paddingInline:je,paddingInlineStart:je,paddingInlineEnd:je,margin:je,marginTop:je,marginRight:je,marginBottom:je,marginLeft:je,marginBlock:je,marginBlockStart:je,marginBlockEnd:je,marginInline:je,marginInlineStart:je,marginInlineEnd:je,fontSize:je,backgroundPositionX:je,backgroundPositionY:je,...VZ,zIndex:tk,fillOpacity:Yf,strokeOpacity:Yf,numOctaves:tk},zZ={...Wm,color:Mn,backgroundColor:Mn,outlineColor:Mn,fill:Mn,stroke:Mn,borderColor:Mn,borderTopColor:Mn,borderRightColor:Mn,borderBottomColor:Mn,borderLeftColor:Mn,filter:Ux,WebkitFilter:Ux,mask:jx,WebkitMask:jx},bz=t=>zZ[t],_Z=new Set([Ux,jx]);function Sz(t,e){let n=bz(t);return _Z.has(n)||(n=Mr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const HZ=new Set(["auto","none","0"]);function FZ(t,e,n){let i=0,r;for(;i<t.length&&!r;){const o=t[i];typeof o=="string"&&!HZ.has(o)&&Hu(o).values.length&&(r=t[i]),i++}if(r&&n)for(const o of e)t[o]=Sz(n,r)}class UZ extends U1{constructor(e,n,i,r,o){super(e,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<e.length;m++){let p=e[m];if(typeof p=="string"&&(p=p.trim(),B1(p))){const y=hz(p,n.current);y!==void 0&&(e[m]=y),m===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!pz.has(i)||e.length!==2)return;const[r,o]=e,a=ek(r),c=ek(o),f=_D(r),h=_D(o);if(f!==h&&Lo[i]){this.needsMeasurement=!0;return}if(a!==c)if(WD(a)&&WD(c))for(let m=0;m<e.length;m++){const p=e[m];typeof p=="string"&&(e[m]=parseFloat(p))}else Lo[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||IZ(e[r]))&&i.push(r);i.length&&FZ(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Lo[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=Lo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const X1=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function $1(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;e&&(i=e.current);const r=n?.[t]??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(i=>i!=null)}const Kx=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function jZ(t){return R3(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Q1}=F3(queueMicrotask,!1),Tr={x:!1,y:!1};function xz(){return Tr.x||Tr.y}function KZ(t){return t==="x"||t==="y"?Tr[t]?null:(Tr[t]=!0,()=>{Tr[t]=!1}):Tr.x||Tr.y?null:(Tr.x=Tr.y=!0,()=>{Tr.x=Tr.y=!1})}function wz(t,e){const n=$1(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function YZ(t){return!(t.pointerType==="touch"||xz())}function qZ(t,e,n={}){const[i,r,o]=wz(t,n);return i.forEach(a=>{let c=!1,f=!1,h;const m=()=>{a.removeEventListener("pointerleave",x)},p=C=>{h&&(h(C),h=void 0),m()},y=C=>{c=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),f&&(f=!1,p(C))},b=()=>{c=!0,window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",y,r)},x=C=>{if(C.pointerType!=="touch"){if(c){f=!0;return}p(C)}},w=C=>{if(!YZ(C))return;f=!1;const E=e(a,C);typeof E=="function"&&(h=E,a.addEventListener("pointerleave",x,r))};a.addEventListener("pointerenter",w,r),a.addEventListener("pointerdown",b,r)}),o}const Cz=(t,e)=>e?t===e?!0:Cz(t,e.parentElement):!1,Z1=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,GZ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WZ(t){return GZ.has(t.tagName)||t.isContentEditable===!0}const XZ=new Set(["INPUT","SELECT","TEXTAREA"]);function $Z(t){return XZ.has(t.tagName)||t.isContentEditable===!0}const tm=new WeakSet;function nk(t){return e=>{e.key==="Enter"&&t(e)}}function Wb(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const QZ=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=nk(()=>{if(tm.has(n))return;Wb(n,"down");const r=nk(()=>{Wb(n,"up")}),o=()=>Wb(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function ik(t){return Z1(t)&&!xz()}const rk=new WeakSet;function ZZ(t,e,n={}){const[i,r,o]=wz(t,n),a=c=>{const f=c.currentTarget;if(!ik(c)||rk.has(c))return;tm.add(f),n.stopPropagation&&rk.add(c);const h=e(f,c),m={...r,capture:!0},p=(x,w)=>{window.removeEventListener("pointerup",y,m),window.removeEventListener("pointercancel",b,m),tm.has(f)&&tm.delete(f),ik(x)&&typeof h=="function"&&h(x,{success:w})},y=x=>{p(x,f===window||f===document||n.useGlobalTarget||Cz(f,x.target))},b=x=>{p(x,!1)};window.addEventListener("pointerup",y,m),window.addEventListener("pointercancel",b,m)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,r),jZ(c)&&(c.addEventListener("focus",h=>QZ(h,r)),!WZ(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function ay(t){return R3(t)&&"ownerSVGElement"in t}const nm=new WeakMap;let im;const Ez=(t,e,n)=>(i,r)=>r&&r[0]?r[0][t+"Size"]:ay(i)&&"getBBox"in i?i.getBBox()[e]:i[n],JZ=Ez("inline","width","offsetWidth"),eJ=Ez("block","height","offsetHeight");function tJ({target:t,borderBoxSize:e}){nm.get(t)?.forEach(n=>{n(t,{get width(){return JZ(t,e)},get height(){return eJ(t,e)}})})}function nJ(t){t.forEach(tJ)}function iJ(){typeof ResizeObserver>"u"||(im=new ResizeObserver(nJ))}function rJ(t,e){im||iJ();const n=$1(t);return n.forEach(i=>{let r=nm.get(i);r||(r=new Set,nm.set(i,r)),r.add(e),im?.observe(i)}),()=>{n.forEach(i=>{const r=nm.get(i);r?.delete(e),r?.size||im?.unobserve(i)})}}const rm=new Set;let fu;function sJ(){fu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};rm.forEach(e=>e(t))},window.addEventListener("resize",fu)}function oJ(t){return rm.add(t),fu||sJ(),()=>{rm.delete(t),!rm.size&&typeof fu=="function"&&(window.removeEventListener("resize",fu),fu=void 0)}}function sk(t,e){return typeof t=="function"?oJ(t):rJ(t,e)}function Tz(t){return ay(t)&&t.tagName==="svg"}const lJ=[...vz,Mn,Mr],aJ=t=>lJ.find(yz(t)),ok=()=>({translate:0,scale:1,origin:0,originPoint:0}),du=()=>({x:ok(),y:ok()}),lk=()=>({min:0,max:0}),On=()=>({x:lk(),y:lk()}),Gf=new WeakMap;function uy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Wf(t){return typeof t=="string"||Array.isArray(t)}const J1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],eC=["initial",...J1];function cy(t){return uy(t.animate)||eC.some(e=>Wf(t[e]))}function Rz(t){return!!(cy(t)||t.variants)}function uJ(t,e,n){for(const i in e){const r=e[i],o=n[i];if(Vn(r))t.addValue(i,r);else if(Vn(o))t.addValue(i,Go(r,{owner:t}));else if(o!==r)if(t.hasValue(i)){const a=t.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=t.getStaticValue(i);t.addValue(i,Go(a!==void 0?a:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const Yx={current:null},Az={current:!1},cJ=typeof window<"u";function fJ(){if(Az.current=!0,!!cJ)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Yx.current=t.matches;t.addEventListener("change",e),e()}else Yx.current=!1}const ak=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xm={};function Oz(t){Xm=t}function dJ(){return Xm}class Mz{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:a,visualState:c},f={}){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=U1,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 b=mi.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,Zt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=f,this.blockInitialAnimation=!!a,this.isControllingVariants=cy(n),this.isVariantNode=Rz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in y){const x=y[b];h[b]!==void 0&&Vn(x)&&x.set(h[b])}}mount(e){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=e,Gf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Az.current||fJ(),this.shouldReduceMotion=Yx.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(),qo(this.notifyUpdate),qo(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&cz.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:f,ease:h,duration:m}=n.accelerate,p=new az({element:this.current,name:e,keyframes:c,times:f,ease:h,duration:Ii(m)}),y=a(p);this.valueSubscriptions.set(e,()=>{y(),p.cancel()});return}const i=Zu.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Zt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),o&&o()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Xm){const n=Xm[e];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):On()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<ak.length;i++){const r=ak[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,a=e[o];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=uJ(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Go(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(T3(i)||A3(i))?i=parseFloat(i):!aJ(i)&&Mr.test(n)&&(i=Sz(e,n)),this.setBaseTarget(e,Vn(i)?i.get():i)),Vn(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=q1(this.props,n,this.presenceContext?.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Vn(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new P1),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Q1.render(this.render)}}class Dz extends Mz{constructor(){super(...arguments),this.KeyframeResolver=UZ}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Vn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class tl{constructor(e){this.isMounted=!1,this.node=e}update(){}}function kz({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function hJ({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function pJ(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Xb(t){return t===void 0||t===1}function qx({scale:t,scaleX:e,scaleY:n}){return!Xb(t)||!Xb(e)||!Xb(n)}function Ol(t){return qx(t)||Pz(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Pz(t){return uk(t.x)||uk(t.y)}function uk(t){return t&&t!=="0%"}function $m(t,e,n){const i=t-n,r=e*i;return n+r}function ck(t,e,n,i,r){return r!==void 0&&(t=$m(t,r,i)),$m(t,n,i)+e}function Gx(t,e=0,n=1,i,r){t.min=ck(t.min,e,n,i,r),t.max=ck(t.max,e,n,i,r)}function Iz(t,{x:e,y:n}){Gx(t.x,e.translate,e.scale,e.originPoint),Gx(t.y,n.translate,n.scale,n.originPoint)}const fk=.999999999999,dk=1.0000000000001;function mJ(t,e,n,i=!1){const r=n.length;if(!r)return;e.x=e.y=1;let o,a;for(let c=0;c<r;c++){o=n[c],a=o.projectionDelta;const{visualElement:f}=o.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(ns(t.x,-o.scroll.offset.x),ns(t.y,-o.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,Iz(t,a)),i&&Ol(o.latestValues)&&sm(t,o.latestValues,o.layout?.layoutBox))}e.x<dk&&e.x>fk&&(e.x=1),e.y<dk&&e.y>fk&&(e.y=1)}function ns(t,e){t.min+=e,t.max+=e}function hk(t,e,n,i,r=.5){const o=Yt(t.min,t.max,r);Gx(t,e,n,o,i)}function pk(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function sm(t,e,n){const i=n??t;hk(t.x,pk(e.x,i.x),e.scaleX,e.scale,e.originX),hk(t.y,pk(e.y,i.y),e.scaleY,e.scale,e.originY)}function Nz(t,e){return kz(pJ(t.getBoundingClientRect(),e))}function gJ(t,e,n){const i=Nz(t,n),{scroll:r}=e;return r&&(ns(i.x,r.offset.x),ns(i.y,r.offset.y)),i}const yJ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vJ=Qu.length;function bJ(t,e,n){let i="",r=!0;for(let a=0;a<vJ;a++){const c=Qu[a],f=t[c];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(c.startsWith("scale")?1:0);else{const m=parseFloat(f);h=c.startsWith("scale")?m===1:m===0}if(!h||n){const m=Kx(f,Wm[c]);if(!h){r=!1;const p=yJ[c]||c;i+=`${p}(${m}) `}n&&(e[c]=m)}}const o=t.pathRotation;return o&&(r=!1,i+=`rotate(${Kx(o,Wm.pathRotation)}) `),i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}function tC(t,e,n){const{style:i,vars:r,transformOrigin:o}=t;let a=!1,c=!1;for(const f in e){const h=e[f];if(Zu.has(f)){a=!0;continue}else if(j3(f)){r[f]=h;continue}else{const m=Kx(h,Wm[f]);f.startsWith("origin")?(c=!0,o[f]=m):i[f]=m}}if(e.transform||(a||n?i.transform=bJ(e,t.transform,n):i.transform&&(i.transform="none")),c){const{originX:f="50%",originY:h="50%",originZ:m=0}=o;i.transformOrigin=`${f} ${h} ${m}`}}function Lz(t,{style:e,vars:n},i,r){const o=t.style;let a;for(a in e)o[a]=e[a];r?.applyProjectionStyles(o,i);for(a in n)o.setProperty(a,n[a])}function mk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const nf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(je.test(t))t=parseFloat(t);else return t;const n=mk(t,e.target.x),i=mk(t,e.target.y);return`${n}% ${i}%`}},SJ={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,r=Mr.parse(t);if(r.length>5)return i;const o=Mr.createTransformer(t),a=typeof r[0]!="number"?1:0,c=n.x.scale*e.x,f=n.y.scale*e.y;r[0+a]/=c,r[1+a]/=f;const h=Yt(c,f,.5);return typeof r[2+a]=="number"&&(r[2+a]/=h),typeof r[3+a]=="number"&&(r[3+a]/=h),o(r)}},Wx={borderRadius:{...nf,applyTo:[...X1]},borderTopLeftRadius:nf,borderTopRightRadius:nf,borderBottomLeftRadius:nf,borderBottomRightRadius:nf,boxShadow:SJ};function Bz(t,{layout:e,layoutId:n}){return Zu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wx[t]||t==="opacity")}function nC(t,e,n){const i=t.style,r=e?.style,o={};if(!i)return o;for(const a in i)(Vn(i[a])||r&&Vn(r[a])||Bz(a,t)||n?.getValue(a)?.liveStyle!==void 0)&&(o[a]=i[a]);return o}function xJ(t){return window.getComputedStyle(t)}class Vz extends Dz{constructor(){super(...arguments),this.type="html",this.renderInstance=Lz}mount(e){oy(!!e.style),super.mount(e)}readValueFromInstance(e,n){if(Zu.has(n))return this.projection?.isProjecting?Ix(n):UQ(e,n);{const i=xJ(e),r=(j3(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Nz(e,n)}build(e,n,i){tC(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return nC(e,n,i)}}function wJ(t,e){return t in e}class CJ extends Mz{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(wJ(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return On()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const EJ={offset:"stroke-dashoffset",array:"stroke-dasharray"},TJ={offset:"strokeDashoffset",array:"strokeDasharray"};function RJ(t,e,n=1,i=0,r=!0){t.pathLength=1;const o=r?EJ:TJ;t[o.offset]=`${-i}`,t[o.array]=`${e} ${n}`}const AJ=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zz(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:a=0,...c},f,h,m){if(tC(t,c,h),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:y}=t;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 b of AJ)p[b]!==void 0&&(y[b]=p[b],delete p[b]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),i!==void 0&&(p.scale=i),r!==void 0&&RJ(p,r,o,a,!1)}const _z=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"]),Hz=t=>typeof t=="string"&&t.toLowerCase()==="svg";function OJ(t,e,n,i){Lz(t,e,void 0,i);for(const r in e.attrs)t.setAttribute(_z.has(r)?r:G1(r),e.attrs[r])}function Fz(t,e,n){const i=nC(t,e,n);for(const r in t)if(Vn(t[r])||Vn(e[r])){const o=Qu.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=t[r]}return i}class Uz extends Dz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=On}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Zu.has(n)){const i=bz(n);return i&&i.default||0}return n=_z.has(n)?n:G1(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return Fz(e,n,i)}build(e,n,i){zz(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,r){OJ(e,n,i,r)}mount(e){this.isSVGTag=Hz(e.tagName),super.mount(e)}}const MJ=eC.length;function jz(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?jz(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<MJ;n++){const i=eC[n],r=t.props[i];(Wf(r)||r===!1)&&(e[i]=r)}return e}function Kz(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const DJ=[...J1].reverse(),kJ=J1.length;function PJ(t){return e=>Promise.all(e.map(({animation:n,options:i})=>kZ(t,n,i)))}function IJ(t){let e=PJ(t),n=gk(),i=!0,r=!1;const o=h=>(m,p)=>{const y=zl(t,p,h==="exit"?t.presenceContext?.custom:void 0);if(y){const{transition:b,transitionEnd:x,...w}=y;m={...m,...w,...x}}return m};function a(h){e=h(t)}function c(h){const{props:m}=t,p=jz(t.parent)||{},y=[],b=new Set;let x={},w=1/0;for(let E=0;E<kJ;E++){const O=DJ[E],T=n[O],A=m[O]!==void 0?m[O]:p[O],D=Wf(A),k=O===h?T.isActive:null;k===!1&&(w=E);let M=A===p[O]&&A!==m[O]&&D;if(M&&(i||r)&&t.manuallyAnimateOnMount&&(M=!1),T.protectedKeys={...x},!T.isActive&&k===null||!A&&!T.prevProp||uy(A)||typeof A=="boolean")continue;if(O==="exit"&&T.isActive&&k!==!0){T.prevResolvedValues&&(x={...x,...T.prevResolvedValues});continue}const I=NJ(T.prevProp,A);let L=I||O===h&&T.isActive&&!M&&D||E>w&&D,B=!1;const H=Array.isArray(A)?A:[A];let U=H.reduce(o(O),{});k===!1&&(U={});const{prevResolvedValues:F={}}=T,K={...F,...U},z=j=>{L=!0,b.has(j)&&(B=!0,b.delete(j)),T.needsAnimating[j]=!0;const Y=t.getValue(j);Y&&(Y.liveStyle=!1)};for(const j in K){const Y=U[j],$=F[j];if(x.hasOwnProperty(j))continue;let te=!1;_x(Y)&&_x($)?te=!Kz(Y,$)||I:te=Y!==$,te?Y!=null?z(j):b.add(j):Y!==void 0&&b.has(j)?z(j):T.protectedKeys[j]=!0}T.prevProp=A,T.prevResolvedValues=U,T.isActive&&(x={...x,...U}),(i||r)&&t.blockInitialAnimation&&(L=!1);const V=M&&I;L&&(!V||B)&&y.push(...H.map(j=>{const Y={type:O};if(typeof j=="string"&&(i||r)&&!V&&t.manuallyAnimateOnMount&&t.parent){const{parent:$}=t,te=zl($,j);if($.enteringChildren&&te){const{delayChildren:N}=te.transition||{};Y.delay=fz($.enteringChildren,t,N)}}return{animation:j,options:Y}}))}if(b.size){const E={};if(typeof m.initial!="boolean"){const O=zl(t,Array.isArray(m.initial)?m.initial[0]:m.initial);O&&O.transition&&(E.transition=O.transition)}b.forEach(O=>{const T=t.getBaseTarget(O),A=t.getValue(O);A&&(A.liveStyle=!0),E[O]=T??null}),y.push({animation:E})}let C=!!y.length;return i&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(C=!1),i=!1,r=!1,C?e(y):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();t.variantChildren?.forEach(y=>y.animationState?.setActive(h,m)),n[h].isActive=m;const p=c(h);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:c,setActive:f,setAnimateFunction:a,getState:()=>n,reset:()=>{n=gk(),r=!0}}}function NJ(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Kz(e,t):!1}function Rl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gk(){return{animate:Rl(!0),whileInView:Rl(),whileHover:Rl(),whileTap:Rl(),whileDrag:Rl(),whileFocus:Rl(),exit:Rl()}}function Xx(t,e){t.min=e.min,t.max=e.max}function Er(t,e){Xx(t.x,e.x),Xx(t.y,e.y)}function yk(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Yz=1e-4,LJ=1-Yz,BJ=1+Yz,qz=.01,VJ=0-qz,zJ=0+qz;function gi(t){return t.max-t.min}function _J(t,e,n){return Math.abs(t-e)<=n}function vk(t,e,n,i=.5){t.origin=i,t.originPoint=Yt(e.min,e.max,t.origin),t.scale=gi(n)/gi(e),t.translate=Yt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=LJ&&t.scale<=BJ||isNaN(t.scale))&&(t.scale=1),(t.translate>=VJ&&t.translate<=zJ||isNaN(t.translate))&&(t.translate=0)}function Ef(t,e,n,i){vk(t.x,e.x,n.x,i?i.originX:void 0),vk(t.y,e.y,n.y,i?i.originY:void 0)}function bk(t,e,n,i=0){const r=i?Yt(n.min,n.max,i):n.min;t.min=r+e.min,t.max=t.min+gi(e)}function HJ(t,e,n,i){bk(t.x,e.x,n.x,i?.x),bk(t.y,e.y,n.y,i?.y)}function Sk(t,e,n,i=0){const r=i?Yt(n.min,n.max,i):n.min;t.min=e.min-r,t.max=t.min+gi(e)}function Qm(t,e,n,i){Sk(t.x,e.x,n.x,i?.x),Sk(t.y,e.y,n.y,i?.y)}function xk(t,e,n,i,r){return t-=e,t=$m(t,1/n,i),r!==void 0&&(t=$m(t,1/r,i)),t}function FJ(t,e=0,n=1,i=.5,r,o=t,a=t){if(ms.test(e)&&(e=parseFloat(e),e=Yt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let c=Yt(o.min,o.max,i);t===o&&(c-=e),t.min=xk(t.min,e,n,c,r),t.max=xk(t.max,e,n,c,r)}function wk(t,e,[n,i,r],o,a){FJ(t,e[n],e[i],e[r],e.scale,o,a)}const UJ=["x","scaleX","originX"],jJ=["y","scaleY","originY"];function Ck(t,e,n,i){wk(t.x,e,UJ,n?n.x:void 0,i?i.x:void 0),wk(t.y,e,jJ,n?n.y:void 0,i?i.y:void 0)}function Ek(t){return t.translate===0&&t.scale===1}function Gz(t){return Ek(t.x)&&Ek(t.y)}function Tk(t,e){return t.min===e.min&&t.max===e.max}function KJ(t,e){return Tk(t.x,e.x)&&Tk(t.y,e.y)}function Rk(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Wz(t,e){return Rk(t.x,e.x)&&Rk(t.y,e.y)}function Ak(t){return gi(t.x)/gi(t.y)}function Ok(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function es(t){return[t("x"),t("y")]}function YJ(t,e,n){let i="";const r=t.x.translate/e.x,o=t.y.translate/e.y,a=n?.z||0;if((r||o||a)&&(i=`translate3d(${r}px, ${o}px, ${a}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:h,rotate:m,pathRotation:p,rotateX:y,rotateY:b,skewX:x,skewY:w}=n;h&&(i=`perspective(${h}px) ${i}`),m&&(i+=`rotate(${m}deg) `),p&&(i+=`rotate(${p}deg) `),y&&(i+=`rotateX(${y}deg) `),b&&(i+=`rotateY(${b}deg) `),x&&(i+=`skewX(${x}deg) `),w&&(i+=`skewY(${w}deg) `)}const c=t.x.scale*e.x,f=t.y.scale*e.y;return(c!==1||f!==1)&&(i+=`scale(${c}, ${f})`),i||"none"}const qJ=X1.length,Mk=t=>typeof t=="string"?parseFloat(t):t,Dk=t=>typeof t=="number"||je.test(t);function GJ(t,e,n,i,r,o){r?(t.opacity=Yt(0,n.opacity??1,WJ(i)),t.opacityExit=Yt(e.opacity??1,0,XJ(i))):o&&(t.opacity=Yt(e.opacity??1,n.opacity??1,i));for(let a=0;a<qJ;a++){const c=X1[a];let f=kk(e,c),h=kk(n,c);if(f===void 0&&h===void 0)continue;f||(f=0),h||(h=0),f===0||h===0||Dk(f)===Dk(h)?(t[c]=Math.max(Yt(Mk(f),Mk(h),i),0),(ms.test(h)||ms.test(f))&&(t[c]+="%")):t[c]=h}(e.rotate||n.rotate)&&(t.rotate=Yt(e.rotate||0,n.rotate||0,i))}function kk(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const WJ=Xz(0,.5,L3),XJ=Xz(.5,.95,fr);function Xz(t,e,n){return i=>i<t?0:i>e?1:n(_u(t,e,i))}function $z(t,e,n){const i=Vn(t)?t:Go(t);return i.start(Y1("",i,e,n)),i.animation}function Xf(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const $J=(t,e)=>t.depth-e.depth;class QJ{constructor(){this.children=[],this.isDirty=!1}add(e){k1(this.children,e),this.isDirty=!0}remove(e){zu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort($J),this.isDirty=!1,this.children.forEach(e)}}function ZJ(t,e){const n=mi.now(),i=({timestamp:r})=>{const o=r-n;o>=e&&(qo(i),t(o-e))};return Zt.setup(i,!0),()=>qo(i)}function om(t){return Vn(t)?t.get():t}class JJ{constructor(){this.members=[]}add(e){k1(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const r=i.instance;(!r||r.isConnected===!1)&&!i.snapshot&&(zu(this.members,i),i.unmount())}e.scheduleRender()}remove(e){if(zu(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const lm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$b=["","X","Y","Z"],eee=1e3;let tee=0;function Qb(t,e,n,i){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Qz(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=gz(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Zt,!(r||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Qz(i)}function Zz({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},c=e?.()){this.id=tee++,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(ree),this.nodes.forEach(cee),this.nodes.forEach(fee),this.nodes.forEach(see)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,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 f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new QJ)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new P1),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const f=this.eventHandlers.get(a);f&&f.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=ay(a)&&!Tz(a),this.instance=a;const{layoutId:c,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),t){let m,p=0;const y=()=>this.root.updateBlockedByResize=!1;Zt.read(()=>{p=window.innerWidth}),t(a,()=>{const b=window.innerWidth;b!==p&&(p=b,this.root.updateBlockedByResize=!0,m&&m(),m=ZJ(y,250),lm.hasAnimatedSinceResize&&(lm.hasAnimatedSinceResize=!1,this.nodes.forEach(Nk)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||f)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||h.getDefaultTransition()||gee,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=h.getProps(),E=!this.targetLayout||!Wz(this.targetLayout,b),O=!p&&y;if(this.options.layoutRoot||this.resumeFrom||O||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...K1(x,"layout"),onPlay:w,onComplete:C};(h.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(m,O,T.path)}else p||Nk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qo(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(dee),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Qz(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:f}=this.options;if(c===void 0&&!f)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const f=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),f&&this.nodes.forEach(lee),this.nodes.forEach(Pk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ik);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(aee),this.nodes.forEach(uee),this.nodes.forEach(nee),this.nodes.forEach(iee)):this.nodes.forEach(Ik),this.clearAllSnapshots();const c=mi.now();ei.delta=ys(0,1e3/60,c-ei.timestamp),ei.timestamp=c,ei.isProcessing=!0,Ub.update.process(ei),Ub.preRender.process(ei),Ub.render.process(ei),ei.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Q1.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(oee),this.sharedNodes.forEach(hee)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!gi(this.snapshot.measuredBox.x)&&!gi(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 f=0;f<this.path.length;f++)this.path[f].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=On()),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,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!Gz(this.projectionDelta),f=this.getTransformTemplate(),h=f?f(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;a&&this.instance&&(c||Ol(this.latestValues)||m)&&(r(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return a&&(f=this.removeTransform(f)),yee(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return On();const c=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vee))){const{scroll:h}=this.root;h&&(ns(c.x,h.offset.x),ns(c.y,h.offset.y))}return c}removeElementScroll(a){const c=On();if(Er(c,a),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:m,options:p}=h;h!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&Er(c,a),ns(c.x,m.offset.x),ns(c.y,m.offset.y))}return c}applyTransform(a,c=!1,f){const h=f||On();Er(h,a);for(let m=0;m<this.path.length;m++){const p=this.path[m];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(ns(h.x,-p.scroll.offset.x),ns(h.y,-p.scroll.offset.y)),Ol(p.latestValues)&&sm(h,p.latestValues,p.layout?.layoutBox)}return Ol(this.latestValues)&&sm(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(a){const c=On();Er(c,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!Ol(h.latestValues))continue;let m;h.instance&&(qx(h.latestValues)&&h.updateSnapshot(),m=On(),Er(m,h.measurePageBox())),Ck(c,h.latestValues,h.snapshot?.layoutBox,m)}return Ol(this.latestValues)&&Ck(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==ei.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(a||f&&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=ei.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=On(),this.targetWithTransforms=On()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),HJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Er(this.target,this.layout.layoutBox),Iz(this.target,this.targetDelta)):Er(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||qx(this.parent.latestValues)||Pz(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,f){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=On(),this.relativeTargetOrigin=On(),Qm(this.relativeTargetOrigin,c,f,this.options.layoutAnchor||void 0),Er(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),c=!!this.resumingFrom||this!==a;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===ei.timestamp&&(f=!1),f)return;const{layout:h,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||!(h||m))return;Er(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;mJ(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=On());const{target:b}=a;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yk(this.prevProjectionDelta.x,this.projectionDelta.x),yk(this.prevProjectionDelta.y,this.projectionDelta.y)),Ef(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!Ok(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ok(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=du(),this.projectionDelta=du(),this.projectionDeltaWithTransform=du()}setAnimationOrigin(a,c=!1,f){const h=this.snapshot,m=h?h.latestValues:{},p={...this.latestValues},y=du();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const b=On(),x=h?h.source:void 0,w=this.layout?this.layout.source:void 0,C=x!==w,E=this.getStack(),O=!E||E.members.length<=1,T=!!(C&&!O&&this.options.crossfade===!0&&!this.path.some(mee));this.animationProgress=0;let A;const D=f?.interpolateProjection(a);this.mixTargetDelta=k=>{const M=k/1e3,I=D?.(M);I?(y.x.translate=I.x,y.x.scale=Yt(a.x.scale,1,M),y.x.origin=a.x.origin,y.x.originPoint=a.x.originPoint,y.y.translate=I.y,y.y.scale=Yt(a.y.scale,1,M),y.y.origin=a.y.origin,y.y.originPoint=a.y.originPoint):(Lk(y.x,a.x,M),Lk(y.y,a.y,M)),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qm(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),pee(this.relativeTarget,this.relativeTargetOrigin,b,M),A&&KJ(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=On()),Er(A,this.relativeTarget)),C&&(this.animationValues=p,GJ(p,m,this.latestValues,M,T,O)),I&&I.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=I.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(qo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Zt.update(()=>{lm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Go(0)),this.motionValue.jump(0,!1),this.currentAnimation=$z(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(eee),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:f,layout:h,latestValues:m}=a;if(!(!c||!f||!h)){if(this!==a&&this.layout&&h&&Jz(this.options.animationType,this.layout.layoutBox,h.layoutBox)){f=this.target||On();const p=gi(this.layout.layoutBox.x);f.x.min=a.target.x.min,f.x.max=f.x.min+p;const y=gi(this.layout.layoutBox.y);f.y.min=a.target.y.min,f.y.max=f.y.min+y}Er(c,f),sm(c,m),Ef(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new JJ),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:f}={}){const h=this.getStack();h&&h.promote(this,f),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:f}=a;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const h={};f.z&&Qb("z",a,h,this.animationValues);for(let m=0;m<$b.length;m++)Qb(`rotate${$b[m]}`,a,h,this.animationValues),Qb(`skew${$b[m]}`,a,h,this.animationValues);a.render();for(const m in h)a.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=om(c?.pointerEvents)||"",a.transform=f?f(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=om(c?.pointerEvents)||""),this.hasProjected&&!Ol(this.latestValues)&&(a.transform=f?f({},""):"none",this.hasProjected=!1);return}a.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=YJ(this.projectionDeltaWithTransform,this.treeScale,m);f&&(p=f(m,p)),a.transform=p;const{x:y,y:b}=this.projectionDelta;a.transformOrigin=`${y.origin*100}% ${b.origin*100}% 0`,h.animationValues?a.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:a.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const x in Wx){if(m[x]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:E}=Wx[x],O=p==="none"?m[x]:w(m[x],h);if(C){const T=C.length;for(let A=0;A<T;A++)a[C[A]]=O}else E?this.options.visualElement.renderState.vars[x]=O:a[x]=O}this.options.layoutId&&(a.pointerEvents=h===this?om(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Pk),this.root.sharedNodes.clear()}}}function nee(t){t.updateLayout()}function iee(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")es(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],y=gi(p);p.min=n[m].min,p.max=p.min+y});else if(r==="x"||r==="y"){const m=r==="x"?"y":"x";Xx(o?e.measuredBox[m]:e.layoutBox[m],n[m])}else Jz(r,e.layoutBox,n)&&es(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],y=gi(n[m]);p.max=p.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[m].max=t.relativeTarget[m].min+y)});const a=du();Ef(a,n,e.layoutBox);const c=du();o?Ef(c,t.applyTransform(i,!0),e.measuredBox):Ef(c,n,e.layoutBox);const f=!Gz(a);let h=!1;if(!t.resumeFrom){const m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:y}=m;if(p&&y){const b=t.options.layoutAnchor||void 0,x=On();Qm(x,e.layoutBox,p.layoutBox,b);const w=On();Qm(w,n,y.layoutBox,b),Wz(x,w)||(h=!0),m.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=x,t.relativeParent=m)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function ree(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function see(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function oee(t){t.clearSnapshot()}function Pk(t){t.clearMeasurements()}function lee(t){t.isLayoutDirty=!0,t.updateLayout()}function Ik(t){t.isLayoutDirty=!1}function aee(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function uee(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Nk(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function cee(t){t.resolveTargetDelta()}function fee(t){t.calcProjection()}function dee(t){t.resetSkewAndRotation()}function hee(t){t.removeLeadSnapshot()}function Lk(t,e,n){t.translate=Yt(e.translate,0,n),t.scale=Yt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Bk(t,e,n,i){t.min=Yt(e.min,n.min,i),t.max=Yt(e.max,n.max,i)}function pee(t,e,n,i){Bk(t.x,e.x,n.x,i),Bk(t.y,e.y,n.y,i)}function mee(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gee={duration:.45,ease:[.4,0,.1,1]},Vk=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),zk=Vk("applewebkit/")&&!Vk("chrome/")?Math.round:fr;function _k(t){t.min=zk(t.min),t.max=zk(t.max)}function yee(t){_k(t.x),_k(t.y)}function Jz(t,e,n){return t==="position"||t==="preserve-aspect"&&!_J(Ak(e),Ak(n),.2)}function vee(t){return t!==t.root&&t.scroll?.wasRoot}const bee=Zz({attachResizeListener:(t,e)=>Xf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Zb={current:void 0},e_=Zz({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Zb.current){const t=new bee({});t.mount(window),t.setOptions({layoutScroll:!0}),Zb.current=t}return Zb.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function iC(t){return typeof t=="object"&&!Array.isArray(t)}function t_(t,e,n,i){return t==null?[]:typeof t=="string"&&iC(e)?$1(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(r=>r!=null):[t]}function See(t,e,n){return t*(e+1)+n*e}function Hk(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function xee(t,e,n){for(let i=0;i<t.length;i++){const r=t[i];r.at>e&&r.at<n&&(zu(t,r),i--)}}function wee(t,e,n,i,r,o){xee(t,r,o);for(let a=0;a<e.length;a++)t.push({value:e[a],at:Yt(r,o,i[a]),easing:_3(n,a)})}function Cee(t,e,n=0){const i=e+1+e*n;for(let r=0;r<t.length;r++)t[r]=t[r]/i}function Eee(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const Tee="easeInOut",Ree=20;function Aee(t,{defaultTransition:e={},...n}={},i,r){const o=e.duration||.3,a=new Map,c=new Map,f={},h=new Map;let m=0,p=0,y=0;for(let b=0;b<t.length;b++){const x=t[b];if(typeof x=="string"){h.set(x,p);continue}else if(!Array.isArray(x)){h.set(x.name,Hk(p,x.at,m,h));continue}let[w,C,E={}]=x;E.at!==void 0&&(p=Hk(p,E.at,m,h));let O=0;const T=(A,D,k,M=0,I=0)=>{const L=Oee(A),{delay:B=0,times:H=ez(L),type:U=e.type||"keyframes",repeat:F,repeatType:K,repeatDelay:z=0,...V}=D;let{ease:X=e.ease||"easeOut",duration:j}=D;const Y=typeof B=="function"?B(M,I):B,$=L.length,te=j1(U)?U:r?.[U||"keyframes"];if($<=2&&te){let G=100;if($===2&&kee(L)){const Se=L[1]-L[0];G=Math.abs(Se)}const Z={...e,...V};j!==void 0&&(Z.duration=Ii(j));const ae=Q3(Z,G,te);X=ae.ease,j=ae.duration}j??(j=o);const N=p+Y;H.length===1&&H[0]===0&&(H[1]=1);const ne=H.length-L.length;if(ne>0&&J3(H,ne),L.length===1&&L.unshift(null),F&&F<Ree){const G=j>0?z/j:0;j=See(j,F,z);const Z=[...L],ae=[...H];X=Array.isArray(X)?[...X]:[X];const Se=[...X],le=K==="reverse"||K==="mirror";let ge=Z,ce=Se;le&&(ge=[...Z].reverse(),K==="reverse"&&(ce=[...Se].reverse().map(ue=>typeof ue=="function"?I1(ue):ue)));for(let ue=0;ue<F;ue++){const Te=le&&ue%2===0,ye=Te?ge:Z,Pe=Te?ce:Se,Ee=(ue+1)*(1+G);G>0&&(L.push(L[L.length-1]),H.push(Ee),X.push("linear")),L.push(...ye);for(let Me=0;Me<ye.length;Me++)H.push(ae[Me]+Ee),X.push(Me===0?"linear":_3(Pe,Me-1))}Cee(H,F,G)}const q=N+j;wee(k,L,X,H,N,q),O=Math.max(Y+j,O),y=Math.max(q,y)};if(Vn(w)){const A=Fk(w,c);T(C,E,Uk("default",A))}else{const A=t_(w,C,i,f),D=A.length;for(let k=0;k<D;k++){C=C,E=E;const M=A[k],I=Fk(M,c);for(const L in C)T(C[L],Mee(E,L),Uk(L,I),k,D)}}m=p,p+=O}return c.forEach((b,x)=>{for(const w in b){const C=b[w];C.sort(Eee);const E=[],O=[],T=[];for(let M=0;M<C.length;M++){const{at:I,value:L,easing:B}=C[M];E.push(L),O.push(_u(0,y,I)),T.push(B||"easeOut")}O[0]!==0&&(O.unshift(0),E.unshift(E[0]),T.unshift(Tee)),O[O.length-1]!==1&&(O.push(1),E.push(null)),a.has(x)||a.set(x,{keyframes:{},transition:{}});const A=a.get(x);A.keyframes[w]=E;const{type:D,...k}=e;A.transition[w]={...k,duration:y,ease:T,times:O,...n}}}),a}function Fk(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Uk(t,e){return e[t]||(e[t]=[]),e[t]}function Oee(t){return Array.isArray(t)?t:[t]}function Mee(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Dee=t=>typeof t=="number",kee=t=>t.every(Dee);function Pee(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ay(t)&&!Tz(t)?new Uz(e):new Vz(e);n.mount(t),Gf.set(t,n)}function Iee(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new CJ(e);n.mount(t),Gf.set(t,n)}function Nee(t,e){return Vn(t)||typeof t=="number"||typeof t=="string"&&!iC(e)}function n_(t,e,n,i){const r=[];if(Nee(t,e))r.push($z(t,iC(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return r;const o=t_(t,e,i),a=o.length;for(let c=0;c<a;c++){const f=o[c],h=f instanceof Element?Pee:Iee;Gf.has(f)||h(f);const m=Gf.get(f),p={...n};"delay"in p&&typeof p.delay=="function"&&(p.delay=p.delay(c,a)),r.push(...W1(m,{...e,transition:p},{}))}}return r}function Lee(t,e,n){const i=[],r=t.map(a=>{if(Array.isArray(a)&&typeof a[0]=="function"){const c=a[0],f=Go(0);return f.on("change",c),a.length===1?[f,[0,1]]:a.length===2?[f,[0,1],a[1]]:[f,a[1],a[2]]}return a});return Aee(r,e,n,{spring:qf}).forEach(({keyframes:a,transition:c},f)=>{i.push(...n_(f,a,c))}),i}function Bee(t){return Array.isArray(t)&&t.some(Array.isArray)}function Vee(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;function r(o,a,c){let f=[],h;const m={};if(n!==void 0&&(m.reduceMotion=n),i!==void 0&&(m.skipAnimations=i),Bee(o)){const{onComplete:y,...b}=a||{};typeof y=="function"&&(h=y),f=Lee(o,{...m,...b},e)}else{const{onComplete:y,...b}=c||{};typeof y=="function"&&(h=y),f=n_(o,a,{...m,...b},e)}const p=new dZ(f);return h&&p.finished.then(h),e&&(e.animations.push(p),p.finished.then(()=>{zu(e.animations,p)})),p}return r}const Lie=Vee(),jk=(t,e)=>Math.abs(t-e);function zee(t,e){const n=jk(t.x,e.x),i=jk(t.y,e.y);return Math.sqrt(n**2+i**2)}const i_=S.createContext({});function r_(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const _ee=typeof window<"u",Hee=_ee?S.useLayoutEffect:S.useEffect,rC=S.createContext(null),sC=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fee(t=!0){const e=S.useContext(rC);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,o=S.useId();S.useEffect(()=>{if(t)return r(o)},[t]);const a=S.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,a]:[!0]}const s_=S.createContext({strict:!1}),Kk={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 Yk=!1;function Uee(){if(Yk)return;const t={};for(const e in Kk)t[e]={isEnabled:n=>Kk[e].some(i=>!!n[i])};Oz(t),Yk=!0}function o_(){return Uee(),dJ()}function jee(t){const e=o_();for(const n in t)e[n]={...e[n],...t[n]};Oz(e)}const Kee=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 Zm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Kee.has(t)}let l_=t=>!Zm(t);function Yee(t){typeof t=="function"&&(l_=e=>e.startsWith("on")?!Zm(e):t(e))}try{Yee(require("@emotion/is-prop-valid").default)}catch{}function qee(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||Vn(t[r])||(l_(r)||n===!0&&Zm(r)||!e&&!Zm(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const fy=S.createContext({});function Gee(t,e){if(cy(t)){const{initial:n,animate:i}=t;return{initial:n===!1||Wf(n)?n:void 0,animate:Wf(i)?i:void 0}}return t.inherit!==!1?e:{}}function Wee(t){const{initial:e,animate:n}=Gee(t,S.useContext(fy));return S.useMemo(()=>({initial:e,animate:n}),[qk(e),qk(n)])}function qk(t){return Array.isArray(t)?t.join(" "):t}const oC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function a_(t,e,n){for(const i in e)!Vn(e[i])&&!Bz(i,n)&&(t[i]=e[i])}function Xee({transformTemplate:t},e){return S.useMemo(()=>{const n=oC();return tC(n,e,t),Object.assign({},n.vars,n.style)},[e])}function $ee(t,e){const n=t.style||{},i={};return a_(i,n,t),Object.assign(i,Xee(t,e)),i}function Qee(t,e){const n={},i=$ee(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const u_=()=>({...oC(),attrs:{}});function Zee(t,e,n,i){const r=S.useMemo(()=>{const o=u_();return zz(o,e,Hz(i),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};a_(o,t.style,t),r.style={...o,...r.style}}return r}const Jee=["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 lC(t){return typeof t!="string"||t.includes("-")?!1:!!(Jee.indexOf(t)>-1||/[A-Z]/u.test(t))}function ete(t,e,n,{latestValues:i},r,o=!1,a){const f=(a??lC(t)?Zee:Qee)(e,i,r,t),h=qee(e,typeof t=="string",o),m=t!==S.Fragment?{...h,...f,ref:n}:{},{children:p}=e,y=S.useMemo(()=>Vn(p)?p.get():p,[p]);return S.createElement(t,{...m,children:y})}function tte({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:nte(n,i,r,t),renderState:e()}}function nte(t,e,n,i){const r={},o=i(t,{});for(const y in o)r[y]=om(o[y]);let{initial:a,animate:c}=t;const f=cy(t),h=Rz(t);e&&h&&!f&&t.inherit!==!1&&(a===void 0&&(a=e.initial),c===void 0&&(c=e.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const p=m?c:a;if(p&&typeof p!="boolean"&&!uy(p)){const y=Array.isArray(p)?p:[p];for(let b=0;b<y.length;b++){const x=q1(t,y[b]);if(x){const{transitionEnd:w,transition:C,...E}=x;for(const O in E){let T=E[O];if(Array.isArray(T)){const A=m?T.length-1:0;T=T[A]}T!==null&&(r[O]=T)}for(const O in w)r[O]=w[O]}}}return r}const c_=t=>(e,n)=>{const i=S.useContext(fy),r=S.useContext(rC),o=()=>tte(t,e,i,r);return n?o():r_(o)},ite=c_({scrapeMotionValuesFromProps:nC,createRenderState:oC}),rte=c_({scrapeMotionValuesFromProps:Fz,createRenderState:u_}),ste=Symbol.for("motionComponentSymbol");function ote(t,e,n){const i=S.useRef(n);S.useInsertionEffect(()=>{i.current=n});const r=S.useRef(null);return S.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const a=i.current;if(typeof a=="function")if(o){const c=a(o);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o)},[e])}const f_=S.createContext({});function ou(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function lte(t,e,n,i,r,o){const{visualElement:a}=S.useContext(fy),c=S.useContext(s_),f=S.useContext(rC),h=S.useContext(sC),m=h.reducedMotion,p=h.skipAnimations,y=S.useRef(null),b=S.useRef(!1);i=i||c.renderer,!y.current&&i&&(y.current=i(t,{visualState:e,parent:a,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:o}),b.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const x=y.current,w=S.useContext(f_);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&ate(y.current,n,r,w);const C=S.useRef(!1);S.useInsertionEffect(()=>{x&&C.current&&x.update(n,f)});const E=n[mz],O=S.useRef(!!E&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return Hee(()=>{b.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),O.current&&x.animationState&&x.animationState.animateChanges())}),S.useEffect(()=>{x&&(!O.current&&x.animationState&&x.animationState.animateChanges(),O.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),O.current=!1),x.enteringChildren=void 0)}),x}function ate(t,e,n,i){const{layoutId:r,layout:o,drag:a,dragConstraints:c,layoutScroll:f,layoutRoot:h,layoutAnchor:m,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:d_(t.parent)),t.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!a||c&&ou(c),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:f,layoutRoot:h,layoutAnchor:m})}function d_(t){if(t)return t.options.allowProjection!==!1?t.projection:d_(t.parent)}function Jb(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&jee(i);const o=n?n==="svg":lC(t),a=o?rte:ite;function c(h,m){let p;const y={...S.useContext(sC),...h,layoutId:ute(h)},{isStatic:b}=y,x=Wee(h),w=a(h,b);if(!b&&typeof window<"u"){cte();const C=fte(y);p=C.MeasureLayout,x.visualElement=lte(t,w,y,r,C.ProjectionNode,o)}return fe.jsxs(fy.Provider,{value:x,children:[p&&x.visualElement?fe.jsx(p,{visualElement:x.visualElement,...y}):null,ete(t,h,ote(w,x.visualElement,m),w,b,e,o)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const f=S.forwardRef(c);return f[ste]=t,f}function ute({layoutId:t}){const e=S.useContext(i_).id;return e&&t!==void 0?e+"-"+t:t}function cte(t,e){S.useContext(s_).strict}function fte(t){const e=o_(),{drag:n,layout:i}=e;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function dte(t,e){if(typeof Proxy>"u")return Jb;const n=new Map,i=(o,a)=>Jb(o,a,t,e),r=(o,a)=>i(o,a);return new Proxy(r,{get:(o,a)=>a==="create"?i:(n.has(a)||n.set(a,Jb(a,void 0,t,e)),n.get(a))})}const hte=(t,e)=>e.isSVG??lC(t)?new Uz(e):new Vz(e,{allowProjection:t!==S.Fragment});class pte extends tl{constructor(e){super(e),e.animationState||(e.animationState=IJ(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();uy(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let mte=0;class gte extends tl{constructor(){super(...arguments),this.id=mte++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=zl(this.node,o,a);if(c){const{transition:f,transitionEnd:h,...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 r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const yte={animation:{Feature:pte},exit:{Feature:gte}};function Rd(t){return{point:{x:t.pageX,y:t.pageY}}}const vte=t=>e=>Z1(e)&&t(e,Rd(e));function Tf(t,e,n,i){return Xf(t,e,vte(n),i)}const h_=({current:t})=>t?t.ownerDocument.defaultView:null,Gk=new Set(["auto","scroll"]);class p_{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:a=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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=eS(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,C=zee(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!C)return;const{point:E}=x,{timestamp:O}=ei;this.history.push({...E,timestamp:O});const{onStart:T,onMove:A}=this.handlers;w||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,x)},this.handlePointerMove=(x,w)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=zp(w,this.transformPagePoint),Zt.update(this.updatePoint,!0)},this.handlePointerUp=(x,w)=>{this.end();const{onEnd:C,onSessionEnd:E,resumeAnimation:O}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&O&&O(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=eS(x.type==="pointercancel"?this.lastMoveEventInfo:zp(w,this.transformPagePoint),this.history);this.startEvent&&C&&C(x,T),E&&E(x,T)},!Z1(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=a,this.contextWindow=r||window;const f=Rd(e),h=zp(f,this.transformPagePoint),{point:m}=h,{timestamp:p}=ei;this.history=[{...m,timestamp:p}];const{onSessionStart:y}=n;y&&y(e,eS(h,this.history));const b={passive:!0,capture:!0};this.removeListeners=Cd(Tf(this.contextWindow,"pointermove",this.handlePointerMove,b),Tf(this.contextWindow,"pointerup",this.handlePointerUp,b),Tf(this.contextWindow,"pointercancel",this.handlePointerUp,b)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(Gk.has(i.overflowX)||Gk.has(i.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(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:r.x-n.x,y:r.y-n.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,r),Zt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qo(this.updatePoint)}}function zp(t,e){return e?{point:e(t.point)}:t}function Wk(t,e){return{x:t.x-e.x,y:t.y-e.y}}function eS({point:t},e){return{point:t,delta:Wk(t,m_(e)),offset:Wk(t,bte(e)),velocity:Ste(e,.1)}}function bte(t){return t[0]}function m_(t){return t[t.length-1]}function Ste(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=m_(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Ii(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&r.timestamp-i.timestamp>Ii(e)*2&&(i=t[1]);const o=cr(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const a={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function xte(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Yt(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Yt(n,t,i.max):Math.min(t,n)),t}function Xk(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function wte(t,{top:e,left:n,bottom:i,right:r}){return{x:Xk(t.x,n,r),y:Xk(t.y,e,i)}}function $k(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function Cte(t,e){return{x:$k(t.x,e.x),y:$k(t.y,e.y)}}function Ete(t,e){let n=.5;const i=gi(t),r=gi(e);return r>i?n=_u(e.min,e.max-i,t.min):i>r&&(n=_u(t.min,t.max-r,e.min)),ys(0,1,n)}function Tte(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const $x=.35;function Rte(t=$x){return t===!1?t=0:t===!0&&(t=$x),{x:Qk(t,"left","right"),y:Qk(t,"top","bottom")}}function Qk(t,e,n){return{min:Zk(t,e),max:Zk(t,n)}}function Zk(t,e){return typeof t=="number"?t:t[e]||0}const Ate=new WeakMap;class Ote{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=On(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=p=>{n&&this.snapToCursor(Rd(p).point),this.stopAnimation()},a=(p,y)=>{const{drag:b,dragPropagation:x,onDragStart:w}=this.getProps();if(b&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=KZ(b),!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),es(E=>{let O=this.getAxisMotionValue(E).get()||0;if(ms.test(O)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[E];A&&(O=gi(A)*(parseFloat(O)/100))}}this.originPoint[E]=O}),w&&Zt.update(()=>w(p,y),!1,!0),Hx(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},c=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:b,dragDirectionLock:x,onDirectionLock:w,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=y;if(x&&this.currentDirection===null){this.currentDirection=Dte(E),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",y.point,E),this.updateAxis("y",y.point,E),this.visualElement.render(),C&&Zt.update(()=>C(p,y),!1,!0)},f=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new p_(e,{onSessionStart:o,onStart:a,onMove:c,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:h_(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!i)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&Zt.postRender(()=>c(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!_p(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(a=xte(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ou(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=wte(i.layoutBox,e):this.constraints=!1,this.elastic=Rte(n),r!==this.constraints&&!ou(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Tte(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ou(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const o=gJ(i,r.root,this.visualElement.getTransformPagePoint());let a=Cte(r.layout.layoutBox,o);if(n){const c=n(hJ(a));this.hasMutatedConstraints=!!c,c&&(a=kz(c))}return a}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},h=es(m=>{if(!_p(m,n,this.currentDirection))return;let p=f&&f[m]||{};(a===!0||a===m)&&(p={min:0,max:0});const y=r?200:1e6,b=r?40:1e7,x={type:"inertia",velocity:i?e[m]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(m,x)});return Promise.all(h).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return Hx(this.visualElement,e),i.start(Y1(e,i,0,n,this.visualElement,!1))}stopAnimation(){es(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps()[n];return r||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){es(n=>{const{drag:i}=this.getProps();if(!_p(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:c}=r.layout.layoutBox[n],f=o.get()||0;o.set(e[n]-Yt(a,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!ou(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};es(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const f=c.get();r[a]=Ete({min:f,max:f},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),es(a=>{if(!_p(a,e,null))return;const c=this.getAxisMotionValue(a),{min:f,max:h}=this.constraints[a];c.set(Yt(f,h,r[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ate.set(this.visualElement,this);const e=this.visualElement.current,n=Tf(e,"pointerdown",h=>{const{drag:m,dragListener:p=!0}=this.getProps(),y=h.target,b=y!==e&&$Z(y);m&&p&&!b&&this.start(h)});let i;const r=()=>{const{dragConstraints:h}=this.getProps();ou(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Mte(e,h.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Zt.read(r);const c=Xf(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(es(p=>{const y=this.getAxisMotionValue(p);y&&(this.originPoint[p]+=h[p].translate,y.set(y.get()+h[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),a(),f&&f(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:a=$x,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:a,dragMomentum:c}}}function Jk(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Mte(t,e,n){const i=sk(t,Jk(n)),r=sk(e,Jk(n));return()=>{i(),r()}}function _p(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Dte(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class kte extends tl{constructor(e){super(e),this.removeGroupControls=fr,this.removeListeners=fr,this.controls=new Ote(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const tS=t=>(e,n)=>{t&&Zt.update(()=>t(e,n),!1,!0)};class Pte extends tl{constructor(){super(...arguments),this.removePointerDownListener=fr}onPointerDown(e){this.session=new p_(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:h_(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:tS(e),onStart:tS(n),onMove:tS(i),onEnd:(o,a)=>{delete this.session,r&&Zt.postRender(()=>r(o,a))}}}mount(){this.removePointerDownListener=Tf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let nS=!1;class Ite extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),i&&i.register&&r&&i.register(o),nS&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:o}=this.props,{projection:a}=i;return a&&(a.isPresent=o,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),nS=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==o?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||Zt.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Q1.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;nS=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function g_(t){const[e,n]=Fee(),i=S.useContext(i_);return fe.jsx(Ite,{...t,layoutGroup:i,switchLayoutGroup:S.useContext(f_),isPresent:e,safeToRemove:n})}const Nte={pan:{Feature:Pte},drag:{Feature:kte,ProjectionNode:e_,MeasureLayout:g_}};function eP(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&Zt.postRender(()=>o(e,Rd(e)))}class Lte extends tl{mount(){const{current:e}=this.node;e&&(this.unmount=qZ(e,(n,i)=>(eP(this.node,i,"Start"),r=>eP(this.node,r,"End"))))}unmount(){}}class Bte extends tl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=Cd(Xf(this.node.current,"focus",()=>this.onFocus()),Xf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tP(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&Zt.postRender(()=>o(e,Rd(e)))}class Vte extends tl{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=ZZ(e,(r,o)=>(tP(this.node,o,"Start"),(a,{success:c})=>tP(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const Qx=new WeakMap,iS=new WeakMap,zte=t=>{const e=Qx.get(t.target);e&&e(t)},_te=t=>{t.forEach(zte)};function Hte({root:t,...e}){const n=t||document;iS.has(n)||iS.set(n,{});const i=iS.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(_te,{root:t,...e})),i[r]}function Fte(t,e,n){const i=Hte(e);return Qx.set(t,n),i.observe(t),()=>{Qx.delete(t),i.unobserve(t)}}const Ute={some:0,all:1};class jte extends tl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=e,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Ute[r]},c=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),y=h?m:p;y&&y(f)};this.stopObserver=Fte(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Kte(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Kte({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Yte={inView:{Feature:jte},tap:{Feature:Vte},focus:{Feature:Bte},hover:{Feature:Lte}},qte={layout:{ProjectionNode:e_,MeasureLayout:g_}},Gte={...yte,...Yte,...Nte,...qte},Wte=dte(Gte,hte);function Bie(t){const e=r_(()=>Go(t)),{isStatic:n}=S.useContext(sC);if(n){const[,i]=S.useState(t);S.useEffect(()=>e.on("change",i),[])}return e}const Vie=Wte;function zie(t){const[e,n]=S.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=S.useRef(null),r=S.useRef(null),o=S.useRef(null),a=S.useRef(null),c=S.useRef(!0),f=S.useRef(null),h=Uu(),m=S.useMemo(()=>({anchor:e,setAnchor:n,actionsRef:o,backdropRef:i,internalBackdropRef:r,positionerRef:a,allowMouseUpTriggerRef:c,initialCursorPointRef:f,rootId:h}),[e,h]);return fe.jsx(CI.Provider,{value:m,children:fe.jsx(Ng.Provider,{value:void 0,children:fe.jsx(Oj,{...t})})})}const nP=500,_ie=S.forwardRef(function(e,n){const{render:i,className:r,style:o,...a}=e,{setAnchor:c,actionsRef:f,internalBackdropRef:h,backdropRef:m,positionerRef:p,allowMouseUpTriggerRef:y,initialCursorPointRef:b,rootId:x}=Lg(!1),{store:w}=Lr(!1),C=w.useState("open"),E=w.useState("disabled"),O=S.useRef(null),T=S.useRef(null),A=wn(),D=wn(),k=S.useRef(!1),M=S.useRef(null);function I(z,V,X){const j=X.type.startsWith("touch");b.current={x:z,y:V},c({getBoundingClientRect(){return DOMRect.fromRect({width:j?10:0,height:j?10:0,x:z,y:V})}}),k.current=!1,f.current?.setOpen(!0,Ze(gs,X)),D.start(nP,()=>{k.current=!0})}function L(z){if(E)return;y.current=!0,Rr(z),I(z.clientX,z.clientY,z.nativeEvent);const V=xt(O.current);M.current?.abort();const X=new AbortController;M.current=X,V.addEventListener("mouseup",j=>{if(y.current=!1,!k.current)return;D.clear(),k.current=!1;const Y=zn(j);Ye(p.current,Y)||x&&Y&&zw(Y)===x||f.current?.setOpen(!1,Ze(sw,j))},{once:!0,signal:X.signal})}function B(){A.clear(),T.current=null}function H(z){if(E){B();return}if(y.current=!1,z.touches.length!==1){B();return}z.stopPropagation();const V=z.touches[0],X={x:V.clientX,y:V.clientY};T.current=X,A.start(nP,()=>{I(X.x,X.y,z.nativeEvent)})}function U(z){if(z.touches.length!==1){B();return}if(A.isStarted()&&T.current){const V=z.touches[0],X=10,j=Math.abs(V.clientX-T.current.x),Y=Math.abs(V.clientY-T.current.y);(j>X||Y>X)&&B()}}return S.useEffect(()=>()=>{M.current?.abort()},[]),S.useEffect(()=>{function z(X){if(E)return;const Y=zn(X);(Ye(O.current,Y)||Ye(h.current,Y)||Ye(m.current,Y))&&X.preventDefault()}const V=xt(O.current);return ft(V,"contextmenu",z)},[m,E,h]),Ot("div",e,{state:{open:C},ref:[O,n],props:[{onContextMenu:L,onTouchStart:H,onTouchMove:U,onTouchEnd:B,onTouchCancel:B,style:{WebkitTouchCallout:"none"}},a],stateAttributesMapping:Rf})}),Hie=gj;export{kX as $,ts as A,RX as B,am as C,aX as D,ze as E,hr as F,Bn as G,kt as H,Vt as I,w1 as J,Zo as K,xe as L,on as M,v1 as N,bs as O,wV as P,nt as Q,zg as R,$t as S,Dr as T,fK as U,ji as V,eg as W,na as X,We as Y,Kl as Z,Sie as _,Hp as a,nB as a$,bx as a0,kV as a1,wie as a2,Cie as a3,xie as a4,jX as a5,Eie as a6,AV as a7,mie as a8,gie as a9,w3 as aA,C3 as aB,_2 as aC,z2 as aD,Die as aE,PX as aF,Nne as aG,an as aH,RV as aI,x$ as aJ,LD as aK,ZV as aL,y2 as aM,XV as aN,Ex as aO,Ln as aP,Vie as aQ,Zte as aR,rne as aS,ine as aT,Jte as aU,nne as aV,sne as aW,tne as aX,ene as aY,Jne as aZ,Zne as a_,o2 as aa,rr as ab,UX as ac,Fg as ad,Yi as ae,Ut as af,kl as ag,MV as ah,Lu as ai,HV as aj,ZS as ak,Hg as al,wK as am,Vne as an,Bne as ao,kr as ap,vu as aq,u9 as ar,c9 as as,Dne as at,Us as au,li as av,Wa as aw,Pne as ax,Tie as ay,uu as az,mg as b,pie as b$,nie as b0,eie as b1,iie as b2,yq as b3,Sq as b4,zie as b5,_ie as b6,cne as b7,Hie as b8,une as b9,wne as bA,Fw as bB,Mne as bC,Cne as bD,Ene as bE,Tne as bF,Rne as bG,Ane as bH,One as bI,b6 as bJ,Hne as bK,Fne as bL,jne as bM,Une as bN,Kne as bO,Yne as bP,qne as bQ,Gne as bR,Wne as bS,Xne as bT,$ne as bU,Qne as bV,aie as bW,uie as bX,cie as bY,fie as bZ,die as b_,ane as ba,gne as bb,oie as bc,sie as bd,KY as be,jY as bf,lie as bg,$l as bh,tie as bi,pne as bj,yne as bk,_ne as bl,one as bm,lne as bn,Oj as bo,mne as bp,gj as bq,fne as br,dne as bs,hne as bt,a6 as bu,bne as bv,Sne as bw,JI as bx,xne as by,Jn as bz,vi as c,uB as c0,Hf as c1,cB as c2,OX as c3,TV as c4,Oie as c5,Ine as c6,E$ as c7,Mie as c8,_g as c9,Lne as ca,Lie as cb,Iie as cc,B$ as cd,rie as ce,Bie as cf,Rie as cg,ty as ch,Aie as ci,yie as cj,TK as ck,zne as cl,Pie as cm,kie as cn,vie as co,Qte as cp,vne as cq,He as d,Ze as e,en as f,Fu as g,Ot as h,Xo as i,fe as j,Ws as k,dn as l,Cw as m,De as n,eo as o,ft as p,Jt as q,$f as r,pP as s,gs as t,bm as u,dr as v,kH as w,Si as x,mt as y,Qt as z};
|